RAP常用技巧


    1. 从当前窗口改变透视图需要以下2个步骤:<br><br>
??????? 步骤1 隐藏当前透视图:<br>

IPerspectiveDescriptor persDescription = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
			        .getActivePage().getPerspective();

			PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
			        .closePerspective(persDescription, false, false);

?

<br>
??????? 步骤2 显示新的透视图:

IPerspectiveDescriptor persDescription1 = PlatformUI.getWorkbench().getPerspectiveRegistry()
			        .findPerspectiveWithId(NewPerspective.ID);

			PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(persDescription1);

?
<br><br><br>
??? 2. 在新窗口打开透视图:<br>

 PlatformUI.getWorkbench().openWorkbenchWindow(newPerspectiveI);

?
<br>
??? 3. 隐藏当前视图:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(ivref[0]);

?
<br><br>
??? 4. 从plug-in另外一个视图:

	PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ViewID);

?
<br><br>
??? 5. 获得视图的reference:

 View view = (View) PlatformUI.getWorkbench().
        getActiveWorkbenchWindow().getActivePage().findView(ViewID);

???? Now using this reference the Controls and methods of the view can be accesed.

<br>
说明:RAP隐藏透视图,隐藏视图的功能相当于删除

?

 

你可能感兴趣的:(java,工作,RAP常用技巧)