public final class EMFStoreHandlerUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
getSelection(org.eclipse.core.commands.ExecutionEvent event,
Class<T> clazz)
Extracts element from event.
|
static <T> boolean |
hasSelection(org.eclipse.core.commands.ExecutionEvent event,
Class<T> clazz)
Returns whether an object of the given
clazz can be extracted from
the current selection. |
static <T> T |
requireSelection(org.eclipse.core.commands.ExecutionEvent event,
Class<T> clazz)
Returns an object of the given
clazz if it can be extracted from
the current selection. |
public static <T> T getSelection(org.eclipse.core.commands.ExecutionEvent event,
Class<T> clazz)
T - the type of the object to extractevent - the eventclazz - class type of the object to extractpublic static <T> T requireSelection(org.eclipse.core.commands.ExecutionEvent event,
Class<T> clazz)
throws RequiredSelectionException
clazz if it can be extracted from
the current selection.T - the type of the object to be extracted from the current selectionevent - the event from which to extract the 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 static <T> boolean hasSelection(org.eclipse.core.commands.ExecutionEvent event,
Class<T> clazz)
clazz can be extracted from
the current selection.T - the type of the object to be extracted from the current selectionevent - the event from which to extract the 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 otherwiseCopyright © 2017. All rights reserved.