org.eclipse.gmt.modisco.infra.browser.uicore
Class UnwrappingSelectionProvider
java.lang.Object
org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider
org.eclipse.gmt.modisco.infra.browser.uicore.UnwrappingSelectionProvider
public class UnwrappingSelectionProvider
- extends org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider
Unwraps the a selection's elements, twice:
- First, unwrap the wrapper elements (such as
ModelElementItem
)
- Then, unwrap the Ecore wrappers (see
org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider
, from which this class is
derived).
You can use this selection provider
to register a context menu on a
viewer created using the CustomizableModelContentProvider
, so that the menu actions will
get the Ecore versions of the elements as the selection:
getSite().registerContextMenu(MENU_ID, contextMenu, new UnwrappingSelectionProvider(treeViewer));
Method Summary |
void |
setSelection(ISelection selection)
|
static java.lang.Object |
unwrapElement(java.lang.Object element)
|
static ISelection |
unwrapSelection(ISelection selection)
Replace proxy objects by their underlying Ecore objects in the given selection |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnwrappingSelectionProvider
public UnwrappingSelectionProvider(ISelectionProvider selectionProvider)
setSelection
public void setSelection(ISelection selection)
unwrapSelection
public static ISelection unwrapSelection(ISelection selection)
- Replace proxy objects by their underlying Ecore objects in the given selection
- Returns:
- the unwrapped version of the selection
unwrapElement
public static java.lang.Object unwrapElement(java.lang.Object element)