| org.eclipse.ui.actions.SelectionListenerAction
All known Subclasses: org.eclipse.ui.actions.DeleteResourceAction, org.eclipse.ui.actions.AddTaskAction, org.eclipse.ui.actions.AddBookmarkAction, org.eclipse.ui.views.navigator.CopyAction, org.eclipse.ui.actions.WorkspaceAction, org.eclipse.ui.actions.CopyProjectAction, org.eclipse.ui.actions.OpenSystemEditorAction, org.eclipse.ui.actions.CreateFileAction, org.eclipse.ui.actions.CopyResourceAction, org.eclipse.ui.actions.CreateFolderAction, org.eclipse.ui.views.navigator.PasteAction,
SelectionListenerAction | abstract public class SelectionListenerAction extends BaseSelectionListenerAction (Code) | | The abstract superclass for resource-based actions that listen to selection
change events. This implementation tracks the current selection (see
getStructuredSelection ) and provides a convenient place to
monitor selection changes that could affect the availability of the action.
Subclasses must implement the following IAction method:
run - to do the action's work
Subclasses may extend the updateSelection method to update the
action determine its availability based on the current selection.
The object instantiating the subclass is responsible for registering the
instance with a selection provider. Alternatively, the object can notify the
subclass instance directly of a selection change using the methods:
selectionChanged(IStructuredSelection) - passing the
selection
selectionChanged(ISelectionChangedEvent) - passing the
selection change event
|
Method Summary | |
protected void | clearCache() The SelectionListenerAction implementation of this
BaseSelectionListenerAction method clears the cached
resources and non-resources. | protected List | getSelectedNonResources() Returns the elements in the current selection that are not
IResource s. | protected List | getSelectedResources() Returns the elements in the current selection that are
IResource s. | protected boolean | resourceIsType(IResource resource, int resourceMask) Returns whether the type of the given resource is among those in the
given resource type mask. | protected boolean | selectionIsOfType(int resourceMask) Returns whether the current selection consists entirely of resources
whose types are among those in the given resource type mask. |
SelectionListenerAction | protected SelectionListenerAction(String text)(Code) | | Creates a new action with the given text.
Parameters: text - the string used as the text for the action, ornull if there is no text |
clearCache | protected void clearCache()(Code) | | The SelectionListenerAction implementation of this
BaseSelectionListenerAction method clears the cached
resources and non-resources.
|
getSelectedNonResources | protected List getSelectedNonResources()(Code) | | Returns the elements in the current selection that are not
IResource s.
list of elements (element type: Object ) |
getSelectedResources | protected List getSelectedResources()(Code) | | Returns the elements in the current selection that are
IResource s.
list of resource elements (element type: IResource ) |
resourceIsType | protected boolean resourceIsType(IResource resource, int resourceMask)(Code) | | Returns whether the type of the given resource is among those in the
given resource type mask.
Parameters: resource - the resource Parameters: resourceMask - a bitwise OR of resource types: IResource .{FILE ,FOLDER , PROJECT ,ROOT } true if the resource type matches, andfalse otherwise See Also: IResource |
selectionIsOfType | protected boolean selectionIsOfType(int resourceMask)(Code) | | Returns whether the current selection consists entirely of resources
whose types are among those in the given resource type mask.
Parameters: resourceMask - a bitwise OR of resource types: IResource .{FILE ,FOLDER , PROJECT ,ROOT } true if all resources in the current selection areof the specified types or if the current selection is empty, andfalse if some elements are resources of adifferent type or not resources See Also: IResource |
|
|