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

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 views

The browser example defines two views in its workbench. One view shows the browser content and the other displays the history of visited links. We first saw these views when they were added to the browser's perspective:

	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 corresponding views are also defined in the browser plug-in's manifest:

   <extension
         point="org.eclipse.ui.views">
      <category
            id="org.eclipse.ui.examples.rcp.browser"
            name="%views.category.name"/>
      <view
            id="org.eclipse.ui.examples.rcp.browser.browserView"
            name="%views.browser.name"
            icon="icons/eclipse.png"
            class="org.eclipse.ui.examples.rcp.browser.BrowserView"
            category="org.eclipse.ui.examples.rcp.browser"
            allowMultiple="true"/>
      <view
            id="org.eclipse.ui.examples.rcp.browser.historyView"
            name="%views.history.name"
            icon="icons/eclipse.png"
            class="org.eclipse.ui.examples.rcp.browser.HistoryView"
            category="org.eclipse.ui.examples.rcp.browser"/>
   </extension>

The BrowserView and HistoryView create the necessary SWT controls for showing the browser content and history. The implementation of these views is no different for rich client plug-ins, so we won't review them here. See the example classes and org.eclipse.ui.views for more information.


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