Eclipse GEF
2.1

org.eclipse.gef.ui.actions
Class SelectionAction

java.lang.Object
  |
  +--org.eclipse.jface.action.Action
        |
        +--org.eclipse.gef.ui.actions.EditorPartAction
              |
              +--org.eclipse.gef.ui.actions.SelectionAction
All Implemented Interfaces:
Disposable, IAction, UpdateAction
Direct Known Subclasses:
AlignmentAction, DeleteAction, DirectEditAction

public abstract class SelectionAction
extends EditorPartAction

Superclass for an action needing the current selection.


Field Summary
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, IMAGE, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
SelectionAction(IEditorPart editor)
          Creates a SelectionAction and associates it with the given editor.
 
Method Summary
 void dispose()
          Called when the action is about to be disposed.
protected  List getSelectedObjects()
          Returns a List containing the currently selected objects.
protected  ISelection getSelection()
          Gets the current selection.
protected  void handleSelectionChanged()
           
protected  void setSelection(ISelection selection)
          Sets the current selection and calls on subclasses to handle the selectionChanged event.
 void update()
           
 
Methods inherited from class org.eclipse.gef.ui.actions.EditorPartAction
calculateEnabled, execute, getCommandStack, getEditorPart, init, isEnabled, refresh, setEditorPart
 
Methods inherited from class org.eclipse.jface.action.Action
addPropertyChangeListener, convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, firePropertyChange, firePropertyChange, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, removeAcceleratorText, removePropertyChangeListener, run, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionAction

public SelectionAction(IEditorPart editor)
Creates a SelectionAction and associates it with the given editor.

Parameters:
editor - The editor that this action is associated with.
Method Detail

dispose

public void dispose()
Description copied from class: EditorPartAction
Called when the action is about to be disposed.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class EditorPartAction

getSelection

protected ISelection getSelection()
Gets the current selection.

Returns:
The current selection.

getSelectedObjects

protected List getSelectedObjects()
Returns a List containing the currently selected objects.

Returns:
A List containing the currently selected objects.

handleSelectionChanged

protected void handleSelectionChanged()

setSelection

protected void setSelection(ISelection selection)
Sets the current selection and calls on subclasses to handle the selectionChanged event.

Parameters:
selection - The new selection.

update

public void update()
Specified by:
update in interface UpdateAction
Overrides:
update in class EditorPartAction
See Also:
EditorPartAction.update()

Eclipse GEF
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.