T - the return type of the handlerpublic abstract class AbstractEMFStoreHandlerWithResult<T>
extends org.eclipse.core.commands.AbstractHandler
AbstractEMFStoreHandler| Constructor and Description |
|---|
AbstractEMFStoreHandlerWithResult() |
| Modifier and Type | Method and Description |
|---|---|
T |
execute(org.eclipse.core.commands.ExecutionEvent event) |
org.eclipse.swt.widgets.Shell |
getShell()
Returns the currently active shell.
|
abstract T |
handleWithResult()
Executes the handler and returns a result.
|
<U> boolean |
hasSelection(Class<U> clazz)
Returns whether an object of the given
clazz
can be extracted from the current selection. |
<U> U |
requireSelection(Class<U> clazz)
Returns an object of the given
clazz if it can be extracted from
the current selection. |
public T execute(org.eclipse.core.commands.ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException
org.eclipse.core.commands.ExecutionExceptionIHandler.execute(org.eclipse.core.commands.ExecutionEvent)public abstract T handleWithResult()
public <U> U requireSelection(Class<U> clazz) throws RequiredSelectionException
clazz if it can be extracted from
the current selection.U - the type of the object to be extracted from the current selectionclazz - the type of the object that is requested to be extracted from the current selectionRequiredSelectionException - if the selection is invalid, i.e. if no object of the given type is contained in the selection
or if the selection is nullpublic <U> boolean hasSelection(Class<U> clazz)
clazz
can be extracted from the current selection.U - the type of the object to be extracted from the current selectionclazz - the type of the object that is requested to be extracted from the current selectiontrue, if an object of type T is contained within the current selection,
false otherwisepublic org.eclipse.swt.widgets.Shell getShell()
Copyright © 2017. All rights reserved.