Package org.eclipse.gef.tools
Class DirectEditManager
java.lang.Object
org.eclipse.gef.tools.DirectEditManager
Manages the direct edit operation by creating and maintaining the
 
CellEditor and executing the resulting
 command if the cell editor value has changed.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static classThe border used to 'frame' the cell editor.
- 
Constructor SummaryConstructorsConstructorDescriptionDirectEditManager(GraphicalEditPart source, Class<? extends CellEditor> editorType, CellEditorLocator locator) Constructs a new DirectEditManager for the given source edit part.DirectEditManager(GraphicalEditPart source, Class<? extends CellEditor> editorType, CellEditorLocator locator, Object feature) Constructs a new DirectEditManager for the given source edit part.
- 
Method SummaryModifier 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 DirectEditRequestCreates and returns the DirectEditRequest.protected voidAsks the source edit part to erase source feedback.protected CellEditorReturns the cell editor.protected IFigureReturns the IFigure, which is used to 'embed' the cell editor control.protected Objectprotected DirectEditRequestReturns the direct edit request, creating it if needed.protected GraphicalEditPartReturns the source edit part.protected 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(GraphicalEditPart source) Sets the source edit part.voidsetLocator(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.
- 
Constructor Details- 
DirectEditManagerpublic DirectEditManager(GraphicalEditPart source, Class<? extends CellEditor> editorType, 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 part
- editorType- the cell editor type
- locator- the locator
 
- 
DirectEditManagerpublic DirectEditManager(GraphicalEditPart source, Class<? extends CellEditor> editorType, 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 part
- editorType- the cell editor type
- locator- the locator
- feature- If the EditPart supports direct editing of multiple features, this parameter can be used to discriminate among them.
- Since:
- 3.2
 
 
- 
- 
Method Details- 
bringDownprotected 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.
- 
commitprotected 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.
- 
createCellEditorOnCreates the cell editor on the given composite. The cell editor is created by instantiating the cell editor type passed into this DirectEditManager's constructor. This method assumes that editorType is not null. Subclasses may on purpose set it to null but then need to override this method to correctly create a CellEditor.- Parameters:
- composite- the composite to create the cell editor on
- Returns:
- the newly created cell editor
 
- 
createDirectEditRequestCreates and returns the DirectEditRequest.- Returns:
- the direct edit request
 
- 
eraseFeedbackprotected void eraseFeedback()Asks the source edit part to erase source feedback.
- 
getCellEditorReturns the cell editor.- Returns:
- the cell editor
 
- 
getCellEditorFrameReturns the IFigure, which is used to 'embed' the cell editor control.- Returns:
- An IFigureto be used as frame around the cell editor control.
- Since:
- 3.9
 
- 
getDirectEditFeature- 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
 
- 
getDirectEditRequestReturns the direct edit request, creating it if needed.- Returns:
- the direct edit request
 
- 
getEditPartReturns the source edit part.- Returns:
- the source edit part
 
- 
getLocator
- 
handleValueChangedprotected void handleValueChanged()
- 
hookListenersprotected void hookListeners()
- 
initCellEditorprotected abstract void initCellEditor()Initializes the cell editor. Subclasses should implement this to set the initial text and add things such asVerifyListeners, if needed.
- 
isDirtyprotected boolean isDirty()Returnstrueif the cell editor's value has been changed.- Returns:
- trueif the cell editor is dirty
 
- 
setCellEditorSets the cell editor to the given editor.- Parameters:
- editor- the cell editor
 
- 
setDirtyprotected void setDirty(boolean value) Sets the dirty property.- Parameters:
- value- the dirty property
 
- 
setEditPartSets the source edit part.- Parameters:
- source- the source edit part
 
- 
setLocatorSets the CellEditorLocator used to place the cell editor in the correct location.- Parameters:
- locator- the locator
 
- 
showpublic void show()Shows the cell editor when direct edit is started. CallsinitCellEditor(),CellEditor.activate(), andshowFeedback().
- 
showFeedbackpublic void showFeedback()Asks the source edit part to show source feedback.
- 
unhookListenersprotected void unhookListeners()Unhooks listeners. Called frombringDown().
 
-