i’m working on a Plug-in that basically iterates over all model elements (and their diagram elements) in a Class Diagram for advanced searching purposes. I’m currently presenting corresponding ‘search results’ in a custom dialog. Now i want to open the Class Specification Dialog of a specific model element and furthermore select a specific view in the active diagram programmatically. I was not able to determine anything in the Open API that could possibly achieve that.
How do i manage to do this?
I’d appreciate any comments. Thanks!
-Christoph Barth
Open Spec (open the Class Specification Dialog)
ViewManager
public void openSpec(IModelElement model, Component component);
component is the parent component for showing spec dialog. If user open spec from his component, pass his component, otherwise, pass null or ViewManager.getRootFrame()
Open Diagram with selecting DiagramElement(s)
DiagramManager
public void openDiagramElement(IDiagramElement diagramElement);
public void openDiagramElements(IDiagramElement[] diagramElements);
Hope these are helpful. If there is anything I can help, please feel free to ask.
this is exactly the functionality i needed. That’s what i call fast support. Big Thanks!
I still have one question/problem:
For the moment, i’m presenting the search results of my custom search in a custom Dialog (IDialogHandler). In this custom Dialog i’m imitating the result presentation from the internal VP Search (the one that pops up when hitting CTRL-F), where you get a result Tree in the Message Pane.
For what i am seeing, the Open API only allows acces to the Message Pane with ViewManager.showMessage(String string), where a programer can print a string into the Message Pane.
Is there a way to gain access to that Message Pane in a way that i can display a JTree (or more commonly a Swing Component / Custom Dialog) in it?
added functions in ViewManager
public void showMessagePaneComponent(String id, String title, Component messageComponent); // add a message pane tab into message pane, if the id already exists, it will be replaced.
public void showMessagePaneComponent(String id); // show the message pane tab which is added in message pane
public void removeMessagePaneComponent(String id);
Attached you can find a sample plugin and the image of result when run the sample plugin. Hope all these are helpful for you. Please feel free to ask if you have any further inquiry.