public class XtextDirectEditManager extends DirectEditManagerEx
BORDER_FRAME| Constructor and Description |
|---|
XtextDirectEditManager(org.eclipse.gef.GraphicalEditPart source,
java.lang.Class<?> editorType,
org.eclipse.gef.tools.CellEditorLocator locator,
com.google.inject.Injector injector,
int style) |
XtextDirectEditManager(IXtextAwareEditPart source,
com.google.inject.Injector injector,
int style)
constructor
|
XtextDirectEditManager(IXtextAwareEditPart source,
com.google.inject.Injector injector,
int style,
IXtextFakeContextResourcesProvider provider) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bringDown()
Cleanup is done here.
|
protected void |
commit()
Commits the current value of the cell editor by getting a
Command
from the source edit part and executing it via the CommandStack. |
protected CellEditor |
createCellEditorOn(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 org.eclipse.draw2d.IFigure |
getCellEditorFrame()
Overridden to enlarge the cell editor frame for a control decorator
|
protected IXtextAwareEditPart |
getEditPart()
Returns the source edit part.
|
protected ResourceManager |
getResourceManager()
Gets the resource manager to remember the resources allocated for this
graphical viewer.
|
protected 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.
|
static org.eclipse.gef.tools.CellEditorLocator |
getTextCellEditorLocator(IXtextAwareEditPart source) |
protected void |
hookListeners() |
protected void |
initCellEditor()
Initializes the cell editor.
|
protected void |
setCellEditor(CellEditor editor)
Sets the cell editor to the given editor.
|
void |
setEditText(java.lang.String toEdit)
This method is used to set the cell editors text
|
void |
show()
Shows the cell editor when direct edit is started.
|
void |
show(char initialChar)
Performs show and sets the edit string to be the initial character or
string
|
void |
show(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()
Asks the source edit part to show source feedback.
|
protected void |
unhookListeners()
Unhooks listeners.
|
createDirectEditRequest, eraseFeedback, getCellEditor, getDirectEditFeature, getDirectEditRequest, getLocator, handleValueChanged, isDirty, setDirty, setEditPart, setLocatorpublic XtextDirectEditManager(IXtextAwareEditPart source, com.google.inject.Injector injector, int style)
source - GraphicalEditPart to support direct edit of. The
figure of the source edit part must be of type
WrapLabel.public XtextDirectEditManager(IXtextAwareEditPart source, com.google.inject.Injector injector, int style, IXtextFakeContextResourcesProvider provider)
public XtextDirectEditManager(org.eclipse.gef.GraphicalEditPart source,
java.lang.Class<?> editorType,
org.eclipse.gef.tools.CellEditorLocator locator,
com.google.inject.Injector injector,
int style)
source - editorType - locator - public static org.eclipse.gef.tools.CellEditorLocator getTextCellEditorLocator(IXtextAwareEditPart source)
source - the ITextAwareEditPart to determine the cell
editor forCellEditorLocator that is appropriate for the
source EditPartprotected CellEditor createCellEditorOn(Composite composite)
editorType was
passed into the constructor.createCellEditorOn in class DirectEditManagerExcomposite - the composite to create the cell editor onprotected Font getScaledFont(org.eclipse.draw2d.IFigure label)
label - the label to use for the font calculationFont that is scaled to the screen coordinates.
Note: the returned Font should not be disposed since
it is cached by a common resource manager.protected void initCellEditor()
DirectEditManagerExVerifyListeners, if needed.initCellEditor in class DirectEditManagerExprotected void commit()
DirectEditManagerExCommand
from the source edit part and executing it via the CommandStack.
Finally, DirectEditManagerEx.bringDown() is called to perform and necessary cleanup.commit in class DirectEditManagerExDirectEditManager.commit()protected void bringDown()
DirectEditManagerExnull, it will be
deativated, disposed, and set to null.bringDown in class DirectEditManagerExDirectEditManager.bringDown()public void setEditText(java.lang.String toEdit)
toEdit - String to be set in the cell editorpublic void show(char initialChar)
initialChar - public void show()
DirectEditManagerExDirectEditManagerEx.initCellEditor(), CellEditor.activate(), and
DirectEditManagerEx.showFeedback().show in class DirectEditManagerExpublic void show(Point location)
location - protected void hookListeners()
hookListeners in class DirectEditManagerExprotected void unhookListeners()
DirectEditManagerExDirectEditManagerEx.bringDown().unhookListeners in class DirectEditManagerExprotected void setCellEditor(CellEditor editor)
DirectEditManagerExsetCellEditor in class DirectEditManagerExeditor - the cell editorpublic void showFeedback()
DirectEditManagerExshowFeedback in class DirectEditManagerExprotected org.eclipse.draw2d.IFigure getCellEditorFrame()
getCellEditorFrame in class DirectEditManagerExprotected IXtextAwareEditPart getEditPart()
DirectEditManagerExgetEditPart in class DirectEditManagerExprotected ResourceManager getResourceManager()