Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-ui-dev] How to get the specified view

hi, I customize one view with unique id in my plugin. I can open it from the menu
Window->show view.Now I want to check whether it is opened in run-time,How to
implement this, I use the following code to do this, but the variable window is
null, any suggestions to solve this problem would be appreciated, thx in advance


IWorkbench workbench = PlatformUI.getWorkbench();	
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();

IWorkbenchPage page = window.getActivePage();
ActionView actionView = (ActionView)page.findView("MyViewID");

Note:ActionView is my defined view,The variable window assigned from 
workbench.getActiveWorkbenchWindow() is null;




Back to the top