|
Some tips on Perspective and View Management |
|
- To Change the perspective in the current workbench window, following steps are required:
- The following code hides the current perspective:
IPerspectiveDescriptor persDescription = PlatformUI.getWorkbench().
getActiveWorkbenchWindow().getActivePage().getPerspective();
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().
closePerspective(persDescription,false,false);
|
- The following code shows the new perspective:
IPerspectiveDescriptor persDescription1 = PlatformUI.getWorkbench().
getPerspectiveRegistry(). findPerspectiveWithId(NewPerspective.ID);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().
setPerspective(persDescription1);
|
- To open the perspective in new window, use the following code:
PlatformUI.getWorkbench().openWorkbenchWindow(newPerspectiveI);
|
- To hide the current view, use the following code:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().
getActivePage().hideView(ivref[0]);
|
- To open another view from the plug-in, use the following code:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().
getActivePage().showView(ViewID);
|
- To get the reference of the view:
View view = (View) PlatformUI.getWorkbench().
getActiveWorkbenchWindow().getActivePage().findView(ViewID);
|
Now using this reference the Controls and methods of the view can be accesed.
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.