org.eclipse.gmt.modisco.infra.browser.uicore
Class UnwrappingSelectionProvider

java.lang.Object
  extended by org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider
      extended by 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:

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));
 


Constructor Summary
UnwrappingSelectionProvider(ISelectionProvider selectionProvider)
           
 
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
 

Constructor Detail

UnwrappingSelectionProvider

public UnwrappingSelectionProvider(ISelectionProvider selectionProvider)
Method Detail

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)