I create a Plugin with an Extension with a Point on
org.eclipse.ui.popupMenus. The object class on which the popup menu is
displayed is com.tssap.selena.model.ui.IElementWrapper and I add a filter
for metaclass Class20. My problem is that I'm not able to get an handle to
the class currently selected on the diagram. So I'm net able to ask for its
stereotype.
public class PopUpReferentiel implements IObjectActionDelegate {
/**
* @see IActionDelegate#run(IAction)
*/
public void run(IAction action) {
// What should I do there?
}
Can anyone help?
Dave
public void run(IAction action) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
ISelection mySelection =
workbenchWindow.getSelectionService().getSelection();
IStructuredSelection structuredSelection = (IStructuredSelection)
mySelection;
if (structuredSelection.size() == 1) {
Object selectedObject =
structuredSelection.getFirstElement();
EObject selectedEObject = (EObject)
Platform.getAdapterManager()
.getAdapter(selectedObject, EObject.class);
if (selectedEObject instanceof
com.borland.tg.emfapi.uml20.classes.Class) {
com.borland.tg.emfapi.uml20.classes.Class cls =
(com.borland.tg.emfapi.uml20.classes.Class) selectedEObject;
// write your code here
}
}
"Dave Couture" <dave_c...@dmr.ca> wrote in message
news:45bfab6e$1...@newsgroups.borland.com...
"ElenaA" <Elena.A...@borland.com> a écrit dans le message de news:
45c09453$1...@newsgroups.borland.com...