| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> |
| <HEAD> |
| |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
| |
| <LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> |
| <TITLE> |
| Adding views |
| </TITLE> |
| |
| <link rel="stylesheet" type="text/css" HREF="../book.css"> |
| </HEAD> |
| <BODY BGCOLOR="#ffffff"> |
| <H3> |
| Adding views</H3> |
| <P> |
| 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:</p> |
| <pre> public void createInitialLayout(IPageLayout layout) { |
| <b>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); </b> |
| IViewLayout historyLayout = layout.getViewLayout(BrowserApp.HISTORY_VIEW_ID); |
| historyLayout.setCloseable(true); |
| layout.setEditorAreaVisible(false); |
| } |
| </pre> |
| <p> The corresponding views are also defined in the browser plug-in's manifest:</p> |
| <pre> <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" |
| <b>class="org.eclipse.ui.examples.rcp.browser.BrowserView"</b> |
| 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" |
| <b>class="org.eclipse.ui.examples.rcp.browser.HistoryView"</b> |
| category="org.eclipse.ui.examples.rcp.browser"/> |
| </extension> |
| </pre> |
| <p>The <b>BrowserView</b> and <b>HistoryView</b> 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 <a href="workbench_basicext_views.htm"> |
| org.eclipse.ui.views</a> for more information.</p> |
| |
| </BODY> |
| </HTML> |