Class DirectEditManagerEx
java.lang.Object
org.eclipse.gef.tools.DirectEditManager
org.yakindu.base.xtext.utils.gmf.directedit.DirectEditManagerEx
- Direct Known Subclasses:
XtextDirectEditManager
public abstract class DirectEditManagerEx
extends org.eclipse.gef.tools.DirectEditManager
Full copy of DirectEditManager, changed visibility of BORDER_FRAME and
getCellEditorFrame to protected
TODO: Delete me when https://bugs.eclipse.org/bugs/show_bug.cgi?id=388697 is fixed
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDirectEditManagerEx
(org.eclipse.gef.GraphicalEditPart source, Class editorType, org.eclipse.gef.tools.CellEditorLocator locator) Constructs a new DirectEditManager for the given source edit part.DirectEditManagerEx
(org.eclipse.gef.GraphicalEditPart source, Class editorType, org.eclipse.gef.tools.CellEditorLocator locator, Object feature) Constructs a new DirectEditManager for the given source edit part. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Cleanup is done here.protected void
commit()
Commits the current value of the cell editor by getting aCommand
from the source edit part and executing it via theCommandStack
.protected CellEditor
createCellEditorOn
(Composite composite) Creates the cell editor on the given composite.protected org.eclipse.gef.requests.DirectEditRequest
Creates and returns the DirectEditRequest.protected void
Asks the source edit part to erase source feedback.protected CellEditor
Returns the cell editor.protected org.eclipse.draw2d.IFigure
protected Object
protected org.eclipse.gef.requests.DirectEditRequest
Returns the direct edit request, creating it if needed.protected org.eclipse.gef.GraphicalEditPart
Returns the source edit part.protected org.eclipse.gef.tools.CellEditorLocator
protected void
protected void
protected abstract void
Initializes the cell editor.protected boolean
isDirty()
Returnstrue
if the cell editor's value has been changed.protected void
setCellEditor
(CellEditor editor) Sets the cell editor to the given editor.protected void
setDirty
(boolean value) Sets the dirty property.protected void
setEditPart
(org.eclipse.gef.GraphicalEditPart source) Sets the source edit part.void
setLocator
(org.eclipse.gef.tools.CellEditorLocator locator) Sets the CellEditorLocator used to place the cell editor in the correct location.void
show()
Shows the cell editor when direct edit is started.void
Asks the source edit part to show source feedback.protected void
Unhooks listeners.
-
Field Details
-
BORDER_FRAME
protected static final org.eclipse.draw2d.Border BORDER_FRAME
-
-
Constructor Details
-
DirectEditManagerEx
public DirectEditManagerEx(org.eclipse.gef.GraphicalEditPart source, Class editorType, org.eclipse.gef.tools.CellEditorLocator locator) Constructs a new DirectEditManager for the given source edit part. The cell editor will be created by instantiating the type editorType. The cell editor will be placed using the given CellEditorLocator.- Parameters:
source
- the source edit parteditorType
- the cell editor typelocator
- the locator
-
DirectEditManagerEx
public DirectEditManagerEx(org.eclipse.gef.GraphicalEditPart source, Class editorType, org.eclipse.gef.tools.CellEditorLocator locator, Object feature) Constructs a new DirectEditManager for the given source edit part. The cell editor will be created by instantiating the type editorType. The cell editor will be placed using the given CellEditorLocator.- Parameters:
source
- the source edit parteditorType
- the cell editor typelocator
- the locatorfeature
- If the EditPart supports direct editing of multiple features, this parameter can be used to discriminate among them.- Since:
- 3.2
-
-
Method Details
-
bringDown
protected void bringDown()Cleanup is done here. Any feedback is erased and listeners unhooked. If the cell editor is notnull
, it will bedeativated
,disposed
, and set tonull
.- Overrides:
bringDown
in classorg.eclipse.gef.tools.DirectEditManager
-
commit
protected void commit()Commits the current value of the cell editor by getting aCommand
from the source edit part and executing it via theCommandStack
. Finally,bringDown()
is called to perform and necessary cleanup.- Overrides:
commit
in classorg.eclipse.gef.tools.DirectEditManager
-
createCellEditorOn
Creates the cell editor on the given composite. The cell editor is created by instantiating the cell editor type passed into this DirectEditManager's constuctor.- Overrides:
createCellEditorOn
in classorg.eclipse.gef.tools.DirectEditManager
- Parameters:
composite
- the composite to create the cell editor on- Returns:
- the newly created cell editor
-
createDirectEditRequest
protected org.eclipse.gef.requests.DirectEditRequest createDirectEditRequest()Creates and returns the DirectEditRequest.- Overrides:
createDirectEditRequest
in classorg.eclipse.gef.tools.DirectEditManager
- Returns:
- the direct edit request
-
eraseFeedback
protected void eraseFeedback()Asks the source edit part to erase source feedback.- Overrides:
eraseFeedback
in classorg.eclipse.gef.tools.DirectEditManager
-
getCellEditor
Returns the cell editor.- Overrides:
getCellEditor
in classorg.eclipse.gef.tools.DirectEditManager
- Returns:
- the cell editor
-
getCellEditorFrame
protected org.eclipse.draw2d.IFigure getCellEditorFrame()- Overrides:
getCellEditorFrame
in classorg.eclipse.gef.tools.DirectEditManager
-
getDirectEditFeature
- Overrides:
getDirectEditFeature
in classorg.eclipse.gef.tools.DirectEditManager
- Returns:
Object
that can be used if the EditPart supports direct editing of multiple features, this parameter can be used to discriminate among them.- Since:
- 3.2
-
getDirectEditRequest
protected org.eclipse.gef.requests.DirectEditRequest getDirectEditRequest()Returns the direct edit request, creating it if needed.- Overrides:
getDirectEditRequest
in classorg.eclipse.gef.tools.DirectEditManager
- Returns:
- the direct edit request
-
getEditPart
protected org.eclipse.gef.GraphicalEditPart getEditPart()Returns the source edit part.- Overrides:
getEditPart
in classorg.eclipse.gef.tools.DirectEditManager
- Returns:
- the source edit part
-
getLocator
protected org.eclipse.gef.tools.CellEditorLocator getLocator()- Overrides:
getLocator
in classorg.eclipse.gef.tools.DirectEditManager
-
handleValueChanged
protected void handleValueChanged()- Overrides:
handleValueChanged
in classorg.eclipse.gef.tools.DirectEditManager
-
hookListeners
protected void hookListeners()- Overrides:
hookListeners
in classorg.eclipse.gef.tools.DirectEditManager
-
initCellEditor
protected abstract void initCellEditor()Initializes the cell editor. Subclasses should implement this to set the initial text and add things such asVerifyListeners
, if needed.- Specified by:
initCellEditor
in classorg.eclipse.gef.tools.DirectEditManager
-
isDirty
protected boolean isDirty()Returnstrue
if the cell editor's value has been changed.- Overrides:
isDirty
in classorg.eclipse.gef.tools.DirectEditManager
- Returns:
true
if the cell editor is dirty
-
setCellEditor
Sets the cell editor to the given editor.- Overrides:
setCellEditor
in classorg.eclipse.gef.tools.DirectEditManager
- Parameters:
editor
- the cell editor
-
setDirty
protected void setDirty(boolean value) Sets the dirty property.- Overrides:
setDirty
in classorg.eclipse.gef.tools.DirectEditManager
- Parameters:
value
- the dirty property
-
setEditPart
protected void setEditPart(org.eclipse.gef.GraphicalEditPart source) Sets the source edit part.- Overrides:
setEditPart
in classorg.eclipse.gef.tools.DirectEditManager
- Parameters:
source
- the source edit part
-
setLocator
public void setLocator(org.eclipse.gef.tools.CellEditorLocator locator) Sets the CellEditorLocator used to place the cell editor in the correct location.- Overrides:
setLocator
in classorg.eclipse.gef.tools.DirectEditManager
- Parameters:
locator
- the locator
-
show
public void show()Shows the cell editor when direct edit is started. CallsinitCellEditor()
,CellEditor.activate()
, andshowFeedback()
.- Overrides:
show
in classorg.eclipse.gef.tools.DirectEditManager
-
showFeedback
public void showFeedback()Asks the source edit part to show source feedback.- Overrides:
showFeedback
in classorg.eclipse.gef.tools.DirectEditManager
-
unhookListeners
protected void unhookListeners()Unhooks listeners. Called frombringDown()
.- Overrides:
unhookListeners
in classorg.eclipse.gef.tools.DirectEditManager
-