Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Plug-in Developer Guide
Previous Page Home Next Page

Adding the perspective

When a rich client application uses the WorkbenchAdvisor as the primary means for customizing the workbench, it must supply a perspective that is shown in the workbench window. This perspective must be identified in the application's workbench advisor class. The following is specified in the BrowserAdvisor class:

	public String getInitialWindowPerspectiveId() {
		return BrowserApp.BROWSER_PERSPECTIVE_ID; 
	}

While BrowserApp defines:

	public static final String PLUGIN_ID = "org.eclipse.ui.examples.rcp.browser";
	public static final String BROWSER_PERSPECTIVE_ID = PLUGIN_ID + ".browserPerspective";

The corresponding perspective is defined in the browser plug-in's manifest:

   <extension
         point="org.eclipse.ui.perspectives">
      <perspective
            id="org.eclipse.ui.examples.rcp.browser.browserPerspective"
            name="%perspectives.browser.name"
            class="org.eclipse.ui.examples.rcp.browser.BrowserPerspectiveFactory"
            fixed="true"/>
   </extension>

The BrowserPerspectiveFactory is responsible for laying out the views appropriately.

	public void createInitialLayout(IPageLayout layout) {
		layout.addView(BrowserApp.BROWSER_VIEW_ID, IPageLayout.RIGHT, .25f, IPageLayout.ID_EDITOR_AREA);
		layout.addPlaceholder(BrowserApp.HISTORY_VIEW_ID, IPageLayout.LEFT, .3f, IPageLayout.ID_EDITOR_AREA); 
		IViewLayout historyLayout = layout.getViewLayout(BrowserApp.HISTORY_VIEW_ID);
		historyLayout.setCloseable(true);
		layout.setEditorAreaVisible(false);
	}

The browser perspective defines two views (one visible, with a placeholder for the other), and makes the editor area invisible. For a complete discussion of perspectives and their corresponding layout, see Perspectives.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire