org.csstudio.ui.util
Class AbstractAdaptedHandler<T>
java.lang.Object
AbstractHandler
org.csstudio.ui.util.AbstractAdaptedHandler<T>
public abstract class AbstractAdaptedHandler<T>
- extends AbstractHandler
Abstract class for all commands that use AdapterUtil for conversion
and displays the exception in a suitable dialog.
- Author:
- carcassi
Method Summary |
java.lang.Object |
execute(ExecutionEvent event)
|
protected abstract void |
execute(java.util.List<T> data,
ExecutionEvent event)
Implements the command. |
static
|
findView(java.lang.Class<T> clazz,
java.lang.String viewId)
Searches for the view of the given class with the given view id. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractAdaptedHandler
public AbstractAdaptedHandler(java.lang.Class<T> dataType)
findView
public static <T> T findView(java.lang.Class<T> clazz,
java.lang.String viewId)
throws PartInitException
- Searches for the view of the given class with the given view id.
- Parameters:
clazz
- the view classviewId
- the view id
- Returns:
- the view
- Throws:
PartInitException
- if the view was not found
java.lang.ClassCastException
- if the view is of a different type
execute
public java.lang.Object execute(ExecutionEvent event)
throws ExecutionException
- Throws:
ExecutionException
execute
protected abstract void execute(java.util.List<T> data,
ExecutionEvent event)
throws java.lang.Exception
- Implements the command. The selection is already converted to the target class.
- Parameters:
data
- data in the selectionevent
- event of the command
- Throws:
java.lang.Exception