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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDirectEditManagerEx(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 voidCleanup is done here.protected voidcommit()Commits the current value of the cell editor by getting aCommandfrom the source edit part and executing it via theCommandStack.protected CellEditorcreateCellEditorOn(Composite composite) Creates the cell editor on the given composite.protected org.eclipse.gef.requests.DirectEditRequestCreates and returns the DirectEditRequest.protected voidAsks the source edit part to erase source feedback.protected CellEditorReturns the cell editor.protected org.eclipse.draw2d.IFigureprotected Objectprotected org.eclipse.gef.requests.DirectEditRequestReturns the direct edit request, creating it if needed.protected org.eclipse.gef.GraphicalEditPartReturns the source edit part.protected org.eclipse.gef.tools.CellEditorLocatorprotected voidprotected voidprotected abstract voidInitializes the cell editor.protected booleanisDirty()Returnstrueif the cell editor's value has been changed.protected voidsetCellEditor(CellEditor editor) Sets the cell editor to the given editor.protected voidsetDirty(boolean value) Sets the dirty property.protected voidsetEditPart(org.eclipse.gef.GraphicalEditPart source) Sets the source edit part.voidsetLocator(org.eclipse.gef.tools.CellEditorLocator locator) Sets the CellEditorLocator used to place the cell editor in the correct location.voidshow()Shows the cell editor when direct edit is started.voidAsks the source edit part to show source feedback.protected voidUnhooks 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:
bringDownin classorg.eclipse.gef.tools.DirectEditManager
-
commit
protected void commit()Commits the current value of the cell editor by getting aCommandfrom the source edit part and executing it via theCommandStack. Finally,bringDown()is called to perform and necessary cleanup.- Overrides:
commitin 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:
createCellEditorOnin 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:
createDirectEditRequestin classorg.eclipse.gef.tools.DirectEditManager- Returns:
- the direct edit request
-
eraseFeedback
protected void eraseFeedback()Asks the source edit part to erase source feedback.- Overrides:
eraseFeedbackin classorg.eclipse.gef.tools.DirectEditManager
-
getCellEditor
Returns the cell editor.- Overrides:
getCellEditorin classorg.eclipse.gef.tools.DirectEditManager- Returns:
- the cell editor
-
getCellEditorFrame
protected org.eclipse.draw2d.IFigure getCellEditorFrame()- Overrides:
getCellEditorFramein classorg.eclipse.gef.tools.DirectEditManager
-
getDirectEditFeature
- Overrides:
getDirectEditFeaturein classorg.eclipse.gef.tools.DirectEditManager- Returns:
Objectthat 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:
getDirectEditRequestin classorg.eclipse.gef.tools.DirectEditManager- Returns:
- the direct edit request
-
getEditPart
protected org.eclipse.gef.GraphicalEditPart getEditPart()Returns the source edit part.- Overrides:
getEditPartin classorg.eclipse.gef.tools.DirectEditManager- Returns:
- the source edit part
-
getLocator
protected org.eclipse.gef.tools.CellEditorLocator getLocator()- Overrides:
getLocatorin classorg.eclipse.gef.tools.DirectEditManager
-
handleValueChanged
protected void handleValueChanged()- Overrides:
handleValueChangedin classorg.eclipse.gef.tools.DirectEditManager
-
hookListeners
protected void hookListeners()- Overrides:
hookListenersin 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:
initCellEditorin classorg.eclipse.gef.tools.DirectEditManager
-
isDirty
protected boolean isDirty()Returnstrueif the cell editor's value has been changed.- Overrides:
isDirtyin classorg.eclipse.gef.tools.DirectEditManager- Returns:
trueif the cell editor is dirty
-
setCellEditor
Sets the cell editor to the given editor.- Overrides:
setCellEditorin classorg.eclipse.gef.tools.DirectEditManager- Parameters:
editor- the cell editor
-
setDirty
protected void setDirty(boolean value) Sets the dirty property.- Overrides:
setDirtyin 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:
setEditPartin 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:
setLocatorin 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:
showin classorg.eclipse.gef.tools.DirectEditManager
-
showFeedback
public void showFeedback()Asks the source edit part to show source feedback.- Overrides:
showFeedbackin classorg.eclipse.gef.tools.DirectEditManager
-
unhookListeners
protected void unhookListeners()Unhooks listeners. Called frombringDown().- Overrides:
unhookListenersin classorg.eclipse.gef.tools.DirectEditManager
-