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.DirectEditManagerFull 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 Modifier and Type Field Description protected static org.eclipse.draw2d.BorderBORDER_FRAME
-
Constructor Summary
Constructors Constructor Description DirectEditManagerEx(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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidbringDown()Cleanup 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.DirectEditRequestcreateDirectEditRequest()Creates and returns the DirectEditRequest.protected voideraseFeedback()Asks the source edit part to erase source feedback.protected CellEditorgetCellEditor()Returns the cell editor.protected org.eclipse.draw2d.IFiguregetCellEditorFrame()protected ObjectgetDirectEditFeature()protected org.eclipse.gef.requests.DirectEditRequestgetDirectEditRequest()Returns the direct edit request, creating it if needed.protected org.eclipse.gef.GraphicalEditPartgetEditPart()Returns the source edit part.protected org.eclipse.gef.tools.CellEditorLocatorgetLocator()protected voidhandleValueChanged()protected voidhookListeners()protected abstract voidinitCellEditor()Initializes 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.voidshowFeedback()Asks the source edit part to show source feedback.protected voidunhookListeners()Unhooks listeners.
-
-
-
Constructor Detail
-
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 Detail
-
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
protected CellEditor createCellEditorOn(Composite composite)
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
protected CellEditor 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
protected Object 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
protected void setCellEditor(CellEditor editor)
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
-
-