Package org.eclipse.emf.edapt.common.ui
Class HandlerUtils
- java.lang.Object
-
- org.eclipse.emf.edapt.common.ui.HandlerUtils
-
public final class HandlerUtils extends Object
Helper methods to support command handlers.- Version:
- $Rev$
- Author:
- herrmama, $Author$
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.ui.IWorkbenchPage
getActivePage(org.eclipse.core.commands.ExecutionEvent event)
Get the active page from within a handler.static <V> V
getSelectedElement(org.eclipse.core.commands.ExecutionEvent event, Class<V> type)
Get the selected element of type V.static <V> List<V>
getSelectedElements(org.eclipse.core.commands.ExecutionEvent event, Class<V> type)
Get a list of selected elements of type V.static <E extends org.eclipse.ui.IEditorPart>
EopenEditor(org.eclipse.core.commands.ExecutionEvent event, String editorId, org.eclipse.ui.IEditorInput editorInput)
Open an editor from within a handler.static <V extends org.eclipse.ui.IViewPart>
VshowView(org.eclipse.core.commands.ExecutionEvent event, String viewId)
Show a view from within a handler.
-
-
-
Method Detail
-
getSelectedElement
public static <V> V getSelectedElement(org.eclipse.core.commands.ExecutionEvent event, Class<V> type)
Get the selected element of type V.
-
getSelectedElements
public static <V> List<V> getSelectedElements(org.eclipse.core.commands.ExecutionEvent event, Class<V> type)
Get a list of selected elements of type V.
-
getActivePage
public static org.eclipse.ui.IWorkbenchPage getActivePage(org.eclipse.core.commands.ExecutionEvent event)
Get the active page from within a handler.
-
openEditor
public static <E extends org.eclipse.ui.IEditorPart> E openEditor(org.eclipse.core.commands.ExecutionEvent event, String editorId, org.eclipse.ui.IEditorInput editorInput) throws org.eclipse.ui.PartInitException
Open an editor from within a handler.- Throws:
org.eclipse.ui.PartInitException
-
showView
public static <V extends org.eclipse.ui.IViewPart> V showView(org.eclipse.core.commands.ExecutionEvent event, String viewId) throws org.eclipse.ui.PartInitException
Show a view from within a handler.- Throws:
org.eclipse.ui.PartInitException
-
-