Hi,

Workbench.getInstance().getPerspectives() will give you all the 
perspectives. To switch the current one you have to set the 
ModelMapConstants.CURRENT_PERSPECTIVE in the ModelMap to your desired 
perspective.

Here is a little method that shows how to switch to DesignPerspective:

     private void switchToDesignPerspective() {
         if (designPerspective == null) {
             for (PerspectiveSPI perspective : Workbench.getInstance()
                     .getPerspectives().getPerspectives()) {
                 if (perspective.getText().equalsIgnoreCase("design")) {
                     designPerspective = perspective;
                     break;
                 }
             }
         }

         if (designPerspective != null) {
             ModelMap.getInstance().setModel(
                     ModelMapConstants.CURRENT_PERSPECTIVE, 
designPerspective);
         }
     }

Regards,
Alex


On 05/02/2014 10:26, Dmitry wrote:
> Hello,
>
> My plugin allows to import an operation into a workflow via
> WorkflowView.importServiceDescription(...).
> After that I would like to switch into the design perspective, but can't
> figure out how to do this.
> There is a setSelectedPerspective(...) method in the SelectionManager,
> but how can I get the DesignPerspective?
> It looks like the Workbench interface lacks getPerspectives() method.
> Is there a method to do this?
>
> Thank you in advance,
>
> Dmitry
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> taverna-hackers mailing list
> [email protected]
> Web site: http://www.taverna.org.uk
> Mailing lists: http://www.taverna.org.uk/about/contact-us/
> Developers Guide: http://www.taverna.org.uk/developers/



------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
taverna-hackers mailing list
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/about/contact-us/
Developers Guide: http://www.taverna.org.uk/developers/

Reply via email to