Class SelectionAction

    • Constructor Detail

      • SelectionAction

        public SelectionAction​(IWorkbenchPart part,
                               int style)
        Creates a SelectionAction and associates it with the given editor.
        Parameters:
        part - The workbench part associated with this action
        style - the style for this action
      • SelectionAction

        public SelectionAction​(IWorkbenchPart part)
        Creates a SelectionAction and associates it with the given workbench part.
        Parameters:
        part - the workbench part
    • Method Detail

      • getSelectedObjects

        protected java.util.List getSelectedObjects()
        Returns a List containing the currently selected objects.
        Returns:
        A List containing the currently selected objects.
      • getSelection

        protected ISelection getSelection()
        Gets the current selection.
        Returns:
        The current selection.
      • handleSelectionChanged

        protected void handleSelectionChanged()
        Called when the selection is changed.
      • setSelection

        protected void setSelection​(ISelection selection)
        Sets the current selection and calls on subclasses to handle the selectionChanged event.
        Parameters:
        selection - The new selection.
      • setSelectionProvider

        public void setSelectionProvider​(ISelectionProvider provider)
        May be used to provide an alternative selection source other than the workbench's selection service. Use of this method is optional. The default value is null, in which case the selection is obtained using the partsite's selection service.
        Parameters:
        provider - null or a selection provider