I would like to get a list of selected uml elements from my plug-in.
As an input I have a selection of type IStructuredSelection.
I did not find a way to get the corresponding uml.kernel.Element s
Should I go via com.tssap.selena.model.elements.Reference? com.tssap.selena.model.elements.Element?
Cheers,
Jean-Claude
the following code works for me:
if (selection instanceof IStructuredSelection) {
Object object = ((IStructuredSelection) selection).getFirstElement();
if (object != null) {
EObject selectedEObject = (EObject)
Platform.getAdapterManager().getAdapter(object, EObject.class);
if (selectedEObject instanceof Element) {
Element selectedElement = (Element) selectedEObject;
System.out.println("it is "+
selectedElement.getPropertyValue("$metaclass"));
}
}
where EObject is org.eclipse.emf.ecore.EObject, and Element is
com.borland.tg.emfapi.uml.kernel.Element
Best,
Lena
"Jean-Claude" <jcan...@alineo.com> wrote in message
news:445a4a47$1...@newsgroups.borland.com...