Thursday, January 26, 2012

Programmatically Changing Eclipse Perspectives

Use the code below to change perspectives in a Eclipse plug-in or RCP application.

try 
{
   PlatformUI.getWorkbench().showPerspective("perspective.id",       
         PlatformUI.getWorkbench().getActiveWorkbenchWindow());
} 
catch (WorkbenchException e) 
{
   e.printStackTrace();
}

1 comment:

  1. Thanks a lot for such useful information. It helped me!!

    ReplyDelete