Class SelectionEditPolicy

  • All Implemented Interfaces:
    EditPolicy, RequestConstants
    Direct Known Subclasses:
    ScrollableSelectionFeedbackEditPolicy, SelectionHandlesEditPolicy

    public abstract class SelectionEditPolicy
    extends GraphicalEditPolicy
    A GraphicalEditPolicy that is sensitive to the host's selection. The overall selection of the host EditPart includes whether or not it has focus. Subclasses will typically decorate the GraphicalEditPart with things like selection handles and/or focus feedback.

    This EditPolicy adds itself as an EditPartListener so that it can observe selection. When selection or focus changes, the EditPolicy will update itself and call the appropriate methods.

    Since:
    2.0
    • Constructor Detail

      • SelectionEditPolicy

        public SelectionEditPolicy()
    • Method Detail

      • addSelectionListener

        protected void addSelectionListener()
        Adds an EditPartListener to the host to observe selection/focus changes.
      • hideFocus

        protected void hideFocus()
        Override to hide focus
        See Also:
        showFocus()
      • hideSelection

        protected abstract void hideSelection()
        Override to hide selection
      • removeSelectionListener

        protected void removeSelectionListener()
        Removes the EditPartListener used to observe selection
      • setFocus

        protected void setFocus​(boolean value)
        Sets the internal focus value. This method is called automatically by the listener. If the focus value is changed, either showFocus() or hideFocus() will be called.
        Parameters:
        value - true if the EditPolicy should show focus
      • setSelectedState

        protected void setSelectedState​(int type)
        Sets the internal selection value. This method is called automatically by the listener. If the selection value is changed, the appropriate method is called to show the specified selection type.
        Parameters:
        type - the type of selection the EditPolicy should display
      • showFocus

        protected void showFocus()
        Override to show focus.
        See Also:
        hideFocus()
      • showPrimarySelection

        protected void showPrimarySelection()
        Calls showSelection() by default. Override to distinguish between primary and normal selection.
      • showSelection

        protected abstract void showSelection()
        Override to show selection