I am trying to create a new view in Eclipse that - like the Outline view - is sensitive to the current selection, but should analyze elements in a UML class diagram.
I managed to register a new ISelectionListener to catch any SelectionChangeEvent that the UML editor publishes.
I can get the publisher (an instance of org.eclipse.uml2.diagram.clazz.part.UMLDiagramEditor), and the published selection (a StructuredSelection containing instances of org.eclipse.uml2.diagram.clazz.edit.parts.*).
However, I cannot find any way to retrieve the currently-edited package (an instance of org.eclipse.uml2.uml.* ?).