Class 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 
      Modifier and Type Field Description
      protected static org.eclipse.draw2d.Border BORDER_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.
    • Field Detail

      • BORDER_FRAME

        protected static final org.eclipse.draw2d.Border BORDER_FRAME
    • 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 part
        editorType - the cell editor type
        locator - 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 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 Detail

      • bringDown

        protected void bringDown()
        Cleanup is done here. Any feedback is erased and listeners unhooked. If the cell editor is not null, it will be deativated, disposed, and set to null.
        Overrides:
        bringDown in class org.eclipse.gef.tools.DirectEditManager
      • commit

        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. Finally, bringDown() is called to perform and necessary cleanup.
        Overrides:
        commit in class org.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:
        createCellEditorOn in class org.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 class org.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 class org.eclipse.gef.tools.DirectEditManager
      • getCellEditor

        protected CellEditor getCellEditor()
        Returns the cell editor.
        Overrides:
        getCellEditor in class org.eclipse.gef.tools.DirectEditManager
        Returns:
        the cell editor
      • getCellEditorFrame

        protected org.eclipse.draw2d.IFigure getCellEditorFrame()
        Overrides:
        getCellEditorFrame in class org.eclipse.gef.tools.DirectEditManager
      • getDirectEditFeature

        protected Object getDirectEditFeature()
        Overrides:
        getDirectEditFeature in class org.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 class org.eclipse.gef.tools.DirectEditManager
        Returns:
        the direct edit request
      • getEditPart

        protected org.eclipse.gef.GraphicalEditPart getEditPart()
        Returns the source edit part.
        Overrides:
        getEditPart in class org.eclipse.gef.tools.DirectEditManager
        Returns:
        the source edit part
      • getLocator

        protected org.eclipse.gef.tools.CellEditorLocator getLocator()
        Overrides:
        getLocator in class org.eclipse.gef.tools.DirectEditManager
      • handleValueChanged

        protected void handleValueChanged()
        Overrides:
        handleValueChanged in class org.eclipse.gef.tools.DirectEditManager
      • hookListeners

        protected void hookListeners()
        Overrides:
        hookListeners in class org.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 as VerifyListeners, if needed.
        Specified by:
        initCellEditor in class org.eclipse.gef.tools.DirectEditManager
      • isDirty

        protected boolean isDirty()
        Returns true if the cell editor's value has been changed.
        Overrides:
        isDirty in class org.eclipse.gef.tools.DirectEditManager
        Returns:
        true if the cell editor is dirty
      • setCellEditor

        protected void setCellEditor​(CellEditor editor)
        Sets the cell editor to the given editor.
        Overrides:
        setCellEditor in class org.eclipse.gef.tools.DirectEditManager
        Parameters:
        editor - the cell editor
      • setDirty

        protected void setDirty​(boolean value)
        Sets the dirty property.
        Overrides:
        setDirty in class org.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 class org.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 class org.eclipse.gef.tools.DirectEditManager
        Parameters:
        locator - the locator
      • showFeedback

        public void showFeedback()
        Asks the source edit part to show source feedback.
        Overrides:
        showFeedback in class org.eclipse.gef.tools.DirectEditManager
      • unhookListeners

        protected void unhookListeners()
        Unhooks listeners. Called from bringDown().
        Overrides:
        unhookListeners in class org.eclipse.gef.tools.DirectEditManager