Class ScrollableSelectionFeedbackEditPolicy

All Implemented Interfaces:
EditPolicy, RequestConstants

public class ScrollableSelectionFeedbackEditPolicy extends SelectionEditPolicy
A SelectionEditPolicy, which may be registered to an IScrollableEditPart to provide primary selection feedback by rendering the hidden contents of the host figure's ScrollPane's nested Viewport by means of GhostImageFigures.
Since:
3.6
  • Constructor Details

    • ScrollableSelectionFeedbackEditPolicy

      public ScrollableSelectionFeedbackEditPolicy()
  • Method Details

    • activate

      public void activate()
      Description copied from class: SelectionEditPolicy
      Extends activate to hook the appropriate listener and to initialize the visual changes for representing selection/focus.
      Specified by:
      activate in interface EditPolicy
      Overrides:
      activate in class SelectionEditPolicy
      See Also:
    • addFeedbackFigure

      protected void addFeedbackFigure(org.eclipse.draw2d.IFigure feedbackFigure, org.eclipse.draw2d.geometry.Rectangle feedbackFigureAbsoluteBounds)
      Adds a given feedback figure to the feedback layer (using the provided bounds to layout it) and registers it in the local feedbackFigures list.
      Parameters:
      feedbackFigure - the feedback figure to add to the feedback layer
      feedbackFigureAbsoluteBounds - the absolute bounds used to layout the feedback figure
    • createConnectionFeedbackFigure

      protected void createConnectionFeedbackFigure(ConnectionEditPart connectionEditPart)
      Creates a ghost image feedback figure for the given ConnectionEditPart's figure and adds it to the feedback layer.
      Parameters:
      connectionEditPart -
    • createConnectionFeedbackFigures

      protected void createConnectionFeedbackFigures()
      Creates the connection layer feedback figures.
    • createNodeFeedbackFigure

      protected void createNodeFeedbackFigure(GraphicalEditPart childEditPart)
      Creates a ghost image feedback figure for the given GraphicalEditPart's figure and adds it to the feedback layer.
      Parameters:
      childEditPart -
    • createNodeFeedbackFigures

      protected void createNodeFeedbackFigures()
      Creates the primary layer feedback figures.
    • deactivate

      public void deactivate()
      Description copied from class: SelectionEditPolicy
      Extends deactivate to unhook the seleciton listener and to remove the visual changes for representing selection/focus.
      Specified by:
      deactivate in interface EditPolicy
      Overrides:
      deactivate in class SelectionEditPolicy
      See Also:
    • getAlpha

      protected int getAlpha()
      Used to obtain the alpha value used for all feedback figures. The valid range is the one documented for Graphics.setAlpha(int).
      Returns:
      the alpha
    • getFeedbackLayer

      protected org.eclipse.draw2d.IFigure getFeedbackLayer()
      Description copied from class: GraphicalEditPolicy
      Returns the layer used for displaying feedback.
      Overrides:
      getFeedbackLayer in class GraphicalEditPolicy
      Returns:
      the feedback layer
      See Also:
    • getHostFigureViewport

      protected org.eclipse.draw2d.Viewport getHostFigureViewport()
      Provides access to the host figure's Viewport.
      Returns:
      the nested Viewport of the host figure's ScrollPane
    • hideFeedback

      protected void hideFeedback()
      Removes all feedback figures from the feedback layer as well as from the feedbackFigures list.
    • hideSelection

      protected void hideSelection()
      Description copied from class: SelectionEditPolicy
      Override to hide selection
      Specified by:
      hideSelection in class SelectionEditPolicy
      See Also:
    • setAlpha

      public void setAlpha(int alpha)
      Used to specify the alpha value used for all feedback figures. The valid range is the one documented for Graphics.setAlpha(int).
      Parameters:
      alpha -
    • setHost

      public void setHost(EditPart host)
      Description copied from interface: EditPolicy
      Sets the host in which this EditPolicy is installed.
      Specified by:
      setHost in interface EditPolicy
      Overrides:
      setHost in class AbstractEditPolicy
      Parameters:
      host - the host EditPart
      See Also:
    • showFeedback

      protected void showFeedback()
      Creates feedback figures for all node figures nested within the host figure's viewport, as well as for all incoming and outgoing connections of these nodes. Feedback figures are only created in case there are children or connections, which are not fully visible.
    • showSelection

      protected void showSelection()
      Description copied from class: SelectionEditPolicy
      Override to show selection
      Specified by:
      showSelection in class SelectionEditPolicy
      See Also:
    • updateFeedback

      protected void updateFeedback()
      Removes any existing feedback figures by delegating to hideFeedback(). In case the host edit part is the primary selection, recreates feedback figures via showFeedback().