Class SelectEditPartTracker

    • Field Detail

      • FLAG_SELECTION_PERFORMED

        protected static final int FLAG_SELECTION_PERFORMED
        Flag to indicate selection has been performed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SelectEditPartTracker

        public SelectEditPartTracker​(EditPart owner)
        Constructs a new SelectEditPartTracker with the given edit part as the source.
        Parameters:
        owner - the source edit part
    • Method Detail

      • calculateCursor

        protected Cursor calculateCursor()
        Description copied from class: AbstractTool
        Returns the appropriate cursor for the tools current state. If the tool is in its terminal state, null is returned. Otherwise, either the default or disabled cursor is returned, based on the existence of a current command, and whether that current command is executable.

        Subclasses may override or extend this method to calculate the appropriate cursor based on other conditions.

        Overrides:
        calculateCursor in class AbstractTool
        Returns:
        null or a cursor to be displayed.
        See Also:
        AbstractTool.calculateCursor()
      • getCommandName

        protected java.lang.String getCommandName()
        Description copied from class: AbstractTool
        Returns the identifier of the command that is being sought. This name is also the named that will be logged in the debug view.
        Specified by:
        getCommandName in class AbstractTool
        Returns:
        the identifier for the command
        See Also:
        AbstractTool.getCommandName()
      • getSourceEditPart

        protected EditPart getSourceEditPart()
        Returns the source edit part.
        Returns:
        the source edit part
      • handleButtonDown

        protected boolean handleButtonDown​(int button)
        Performs a conditional selection if needed (if right or left mouse button have been pressed) and goes into the drag state. If any other button has been pressed, the tool goes into the invalid state.
        Overrides:
        handleButtonDown in class AbstractTool
        Parameters:
        button - which button went down
        Returns:
        true if the buttonDown was handled
        See Also:
        AbstractTool.handleButtonDown(int)
      • handleDragStarted

        protected boolean handleDragStarted()
        Description copied from class: AbstractTool
        Called only one time during a drag when the drag threshold has been exceeded. By default, nothing happens and false is returned. Subclasses may override to interpret the drag starting. Returning true indicates that the event was handled.
        Overrides:
        handleDragStarted in class AbstractTool
        Returns:
        true if the drag starting was handled
        See Also:
        AbstractTool.handleDragStarted()
      • hasSelectionOccurred

        protected boolean hasSelectionOccurred()
        Returns true if selection has already occured.
        Returns:
        true if selection has occured
      • performConditionalSelection

        protected void performConditionalSelection()
        Calls performSelection() if the source is not selected. If the source is selected and there are no modifier keys pressed (i.e. the user isn't selecting multiple edit parts or deselecting edit parts), sets the direct edit flag so that when the mouse is released, a direct edit will be performed.
      • performDirectEdit

        protected void performDirectEdit()
        Creates a DirectEditRequest and sends it to a DelayedDirectEditHelper to allow the user to directly edit the edit part.
      • performOpen

        protected void performOpen()
        Creates a SelectionRequest and sends it to the source edit part via EditPart.performRequest(Request). Possible uses are to open the selected item in another editor or replace the current editor's contents based on the selected item.
      • performSelection

        protected void performSelection()
        Performs the appropriate selection action based on the selection state of the source and the modifiers (CTRL and SHIFT). If no modifier key is pressed, the source will be set as the only selection. If the CTRL key is pressed and the edit part is already selected, it will be deselected. If the CTRL key is pressed and the edit part is not selected, it will be appended to the selection set. If the SHIFT key is pressed, the source will be appended to the selection.
      • setSourceEditPart

        protected void setSourceEditPart​(EditPart part)
        Sets the source edit part.
        Parameters:
        part - the source edit part