org.eclipse.gmf.tooling.runtime.directedit
Class DirectEditManagerBase

java.lang.Object
  extended by org.eclipse.gef.tools.DirectEditManager
      extended by org.eclipse.gmf.tooling.runtime.directedit.DirectEditManagerBase
Direct Known Subclasses:
ComboDirectEditManager, TextDirectEditManager2

public abstract class DirectEditManagerBase
extends org.eclipse.gef.tools.DirectEditManager

Since:
1.6
Author:
melaasar

Constructor Summary
DirectEditManagerBase(org.eclipse.gef.GraphicalEditPart source, Class editorType, org.eclipse.gef.tools.CellEditorLocator locator)
           
DirectEditManagerBase(org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart source)
           
 
Method Summary
protected  void bringDown()
           
protected  void commit()
           
protected  org.eclipse.jface.viewers.CellEditor createCellEditorOn(org.eclipse.swt.widgets.Composite composite)
          This method is overridden so that the editor class can have a style as the style needs to be passed into the editor class when it is created.
protected abstract  void createContentAssistant(org.eclipse.swt.widgets.Control control, org.eclipse.swt.graphics.Color proposalPopupForegroundColor, org.eclipse.swt.graphics.Color proposalPopupBackgroundColor, org.eclipse.jface.text.contentassist.IContentAssistProcessor processor)
           
protected abstract  org.eclipse.jface.viewers.CellEditor doCreateCellEditorOn(org.eclipse.swt.widgets.Composite composite)
           
static org.eclipse.gef.tools.CellEditorLocator getCellEditorLocator(org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart source)
           
protected  org.eclipse.jface.resource.ResourceManager getResourceManager()
          Gets the resource manager to remember the resources allocated for this graphical viewer.
protected  org.eclipse.swt.graphics.Font getScaledFont(org.eclipse.draw2d.IFigure label)
          Given a label figure object, this will calculate the correct Font needed to display into screen coordinates, taking into account the current mapmode.
protected  void hookListeners()
           
protected  void initCellEditor()
           
protected  void setCellEditor(org.eclipse.jface.viewers.CellEditor editor)
           
 void setEditText(String toEdit)
          This method is used to set the cell editors text
 void show()
           
 void show(char initialChar)
          Performs show and sets the edit string to be the initial character or string
 void show(org.eclipse.swt.graphics.Point location)
          Performs show and sends an extra mouse click to the point location so that cursor appears at the mouse click point The Text control does not allow for the cursor to appear at point location but at a character location
 void showFeedback()
           
protected  void unhookListeners()
           
 
Methods inherited from class org.eclipse.gef.tools.DirectEditManager
createDirectEditRequest, eraseFeedback, getCellEditor, getDirectEditFeature, getDirectEditRequest, getEditPart, getLocator, handleValueChanged, isDirty, setDirty, setEditPart, setLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectEditManagerBase

public DirectEditManagerBase(org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart source)

DirectEditManagerBase

public DirectEditManagerBase(org.eclipse.gef.GraphicalEditPart source,
                             Class editorType,
                             org.eclipse.gef.tools.CellEditorLocator locator)
Method Detail

createCellEditorOn

protected org.eclipse.jface.viewers.CellEditor createCellEditorOn(org.eclipse.swt.widgets.Composite composite)
This method is overridden so that the editor class can have a style as the style needs to be passed into the editor class when it is created. It will default to the super behavior if an editorType was passed into the constructor.

Overrides:
createCellEditorOn in class org.eclipse.gef.tools.DirectEditManager
Since:
2.1

getCellEditorLocator

public static org.eclipse.gef.tools.CellEditorLocator getCellEditorLocator(org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart source)
Parameters:
source - the ITextAwareEditPart to determine the cell editor for
Returns:
the CellEditorLocator that is appropriate for the source EditPart

getScaledFont

protected org.eclipse.swt.graphics.Font getScaledFont(org.eclipse.draw2d.IFigure label)
Given a label figure object, this will calculate the correct Font needed to display into screen coordinates, taking into account the current mapmode. This will typically be used by direct edit cell editors that need to display independent of the zoom or any coordinate mapping that is taking place on the drawing surface.

Parameters:
label - the label to use for the font calculation
Returns:
the Font that is scaled to the screen coordinates. Note: the returned Font should not be disposed since it is cached by a common resource manager.

initCellEditor

protected void initCellEditor()
Specified by:
initCellEditor in class org.eclipse.gef.tools.DirectEditManager

commit

protected void commit()
Overrides:
commit in class org.eclipse.gef.tools.DirectEditManager
See Also:
DirectEditManager.commit()

bringDown

protected void bringDown()
Overrides:
bringDown in class org.eclipse.gef.tools.DirectEditManager
See Also:
DirectEditManager.bringDown()

setEditText

public void setEditText(String toEdit)
This method is used to set the cell editors text

Parameters:
toEdit - String to be set in the cell editor

show

public void show(char initialChar)
Performs show and sets the edit string to be the initial character or string

Parameters:
initialChar -

show

public void show()
Overrides:
show in class org.eclipse.gef.tools.DirectEditManager

show

public void show(org.eclipse.swt.graphics.Point location)
Performs show and sends an extra mouse click to the point location so that cursor appears at the mouse click point The Text control does not allow for the cursor to appear at point location but at a character location

Parameters:
location -

hookListeners

protected void hookListeners()
Overrides:
hookListeners in class org.eclipse.gef.tools.DirectEditManager

unhookListeners

protected void unhookListeners()
Overrides:
unhookListeners in class org.eclipse.gef.tools.DirectEditManager

setCellEditor

protected void setCellEditor(org.eclipse.jface.viewers.CellEditor editor)
Overrides:
setCellEditor in class org.eclipse.gef.tools.DirectEditManager

showFeedback

public void showFeedback()
Overrides:
showFeedback in class org.eclipse.gef.tools.DirectEditManager

getResourceManager

protected org.eclipse.jface.resource.ResourceManager getResourceManager()
Gets the resource manager to remember the resources allocated for this graphical viewer. All resources will be disposed when the graphical viewer is closed if they have not already been disposed.

Returns:

doCreateCellEditorOn

protected abstract org.eclipse.jface.viewers.CellEditor doCreateCellEditorOn(org.eclipse.swt.widgets.Composite composite)

createContentAssistant

protected abstract void createContentAssistant(org.eclipse.swt.widgets.Control control,
                                               org.eclipse.swt.graphics.Color proposalPopupForegroundColor,
                                               org.eclipse.swt.graphics.Color proposalPopupBackgroundColor,
                                               org.eclipse.jface.text.contentassist.IContentAssistProcessor processor)


Copyright © 2012. All Rights Reserved.