org.eclipse.wst.jsdt.chromium.debug.ui.actions

## Class SelectionBasedAction<S>

- java.lang.Object
- - org.eclipse.wst.jsdt.chromium.debug.ui.actions.SelectionBasedAction<S>

Type Parameters:
  `S` - user type for data that is read from selection

Direct Known Subclasses:
  SelectionBasedAction.Single, TemporarilyFormatSourceAction

    public abstract class SelectionBasedAction<S>
    extends java.lang.Object

A base class for actions. User implementation is responsible for getting elements from context (i.e. selection) and for performing the action itself. This class implements all methods of `IObjectActionDelegate` and `IActionDelegate2`.

### Nested Class Summary

Nested Classes
`static interface` `SelectionBasedAction.ActionRunnable`
`static class` `SelectionBasedAction.Single<T>` Base class for actions that are enabled only for a single element in selection.

### Constructor Summary

Constructors
Constructor and Description
`SelectionBasedAction()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected abstract SelectionBasedAction.ActionRunnable` `createRunnable(S selectedElements)`
`void` `dispose()`
`protected IAction` `getAction()`
`void` `init(IAction action)`
`protected void` `modifyActionText(java.lang.String newText)`
`protected abstract S` `readSelection(IStructuredSelection selection)`
`protected void` `restoreActionText()`
`void` `run(IAction action)`
`void` `runWithEvent(IAction action, Event event)`
`void` `selectionChanged(IAction actionParam, ISelection selection)`
`void` `setActivePart(IAction action, IWorkbenchPart targetPart)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SelectionBasedAction

    public SelectionBasedAction()

### Method Detail

#### readSelection

    protected abstract S readSelection(IStructuredSelection selection)

#### setActivePart

    public void setActivePart(IAction action,
                              IWorkbenchPart targetPart)

#### run

    public void run(IAction action)

#### selectionChanged

    public void selectionChanged(IAction actionParam,
                                 ISelection selection)

#### createRunnable

    protected abstract SelectionBasedAction.ActionRunnable createRunnable(S selectedElements)

#### modifyActionText

    protected void modifyActionText(java.lang.String newText)

#### restoreActionText

    protected void restoreActionText()

#### getAction

    protected IAction getAction()

#### dispose

    public void dispose()

#### init

    public void init(IAction action)

#### runWithEvent

    public void runWithEvent(IAction action,
                             Event event)