|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.core.commands.common.EventManager org.eclipse.core.commands.AbstractHandler org.eclipse.emf.emfstore.internal.client.ui.handlers.AbstractEMFStoreHandlerWithResult<T>
T
- the return type of the handlerpublic abstract class AbstractEMFStoreHandlerWithResult<T>
Handlers are the top level abstraction that clients should use execute actions within the EMFStore workspace. They are responsible for calling the UI controllers and therefore provide helper methods that can determine the currently selected element, if needed. This handler is capable of returning a result.
AbstractEMFStoreHandler
Constructor Summary | |
---|---|
AbstractEMFStoreHandlerWithResult()
|
Method Summary | ||
---|---|---|
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. |
|
|
requireSelection(Class<U> clazz)
Returns an object of the given clazz if it can be extracted from
the current selection. |
Methods inherited from class org.eclipse.core.commands.AbstractHandler |
---|
addHandlerListener, dispose, isEnabled, isHandled, removeHandlerListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractEMFStoreHandlerWithResult()
Method Detail |
---|
public T execute(org.eclipse.core.commands.ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException
org.eclipse.core.commands.ExecutionException
IHandler.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 selection
RequiredSelectionException
- if the selection is invalid, i.e. if no object of the given type is contained in the selection
or if the selection is null
public org.eclipse.swt.widgets.Shell getShell()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |