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.