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

## Class SelectionBasedAction.Single<T>

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

Direct Known Subclasses:
  PinPointValueAction, V8ScriptAction

Enclosing class:
  SelectionBasedAction<S>

    public abstract static class SelectionBasedAction.Single<T>
    extends SelectionBasedAction<T>

Base class for actions that are enabled only for a single element in selection. User implements `castElement(Object)` method that map raw selection object to a custom type T. Action optionally may allow selections with more than 1 object, but it is required that only a single object is filtered out.

### Nested Class Summary

### Nested classes/interfaces inherited from class org.eclipse.wst.jsdt.chromium.debug.ui.actions.SelectionBasedAction

`SelectionBasedAction.ActionRunnable, SelectionBasedAction.Single<T>`

### Constructor Summary

Constructors
`protected` `Single(boolean allowMutipleSelection)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected abstract T` `castElement(java.lang.Object element)` User-provided method that casts raw selection element to user type T.
`protected T` `readSelection(IStructuredSelection selection)`

### Methods inherited from class org.eclipse.wst.jsdt.chromium.debug.ui.actions.SelectionBasedAction

`createRunnable, dispose, getAction, init, modifyActionText, restoreActionText, run, runWithEvent, selectionChanged, setActivePart`

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

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

### Constructor Detail

#### Single

    protected Single(boolean allowMutipleSelection)

Parameters:
  `allowMutipleSelection` - if false requires that selection contains exactly 1 element; if true only requires that selection contains exactly 1 element that gets cast by `castElement(Object)` method

### Method Detail

#### readSelection

    protected T readSelection(IStructuredSelection selection)

Specified by:
  `readSelection` in class `SelectionBasedAction<T>`

#### castElement

    protected abstract T castElement(java.lang.Object element)

User-provided method that casts raw selection element to user type T. Method may return null which means that this raw object should be ignored.