Open Class Specification Dialog programmatically

Hi,

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

Hi Christoph Barth,

Thanks for your post. I’ve passed the details to our engineers to follow-up, and I’ll come back to you once there is any feedback.

Best regards,
Lilian Wong

Hi Christoph Barth,

I would like to let you know that we enhanced to support what you want to do. Please download and install the patch at the following link first:

http://files2.visual-paradigm.com/200906/Patch/20090610m/VP_Suite_Windows_4_0_20090610m.exe

Then you can call the followings:

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.

Best regards,
Lilian Wong

Hello Lilian Wong,

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?

Thanks in advance,
-Christoph Barth

Hi

Thanks for replying, I’ve forwarded the details to our engineers to follow-up, , and will come back to you once there is any feedback.

Best regards,
Lilian Wong

Hi Christoph Barth,

Our engineers enhanced to access tree in Message pane to display custom dialog, please download the latest patch from the link below:

http://files2.visual-paradigm.com/200906/Patch/20090617b/VP_Suite_Windows_4_0_20090617b.exe

What we added are:

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.

Best regards,
Lilian Wong


sample_message_pane.png
com.vp.plugin.sample.showmessage.zip

Hello Lilian Wong,

thank you for your fast response. Integration was no problem with the example you gave and it solved my problem, so that meets the needs!

Thanks again to you and your engineers!
-Christoph Barth

Hi Christoph Barth,

You are welcome.

Best regards,
Lilian Wong