리치 클라이언트 응용프로그램이 Workbench를 사용자 정의하기 위한 기본 수단으로WorkbenchAdvisor를 사용하는 경우 Workbench 창에 표시되는 Perspective를 제공해야 합니다. 이 Perspective는 응용프로그램의 Workbench 어드바이저 클래스에서 식별되어야 합니다. 다음 항목이 BrowserAdvisor 클래스에 지정됩니다.
public String getInitialWindowPerspectiveId() { return BrowserApp.BROWSER_PERSPECTIVE_ID; }
BrowserApp는 다음을 정의합니다.
public static final String PLUGIN_ID = "org.eclipse.ui.examples.rcp.browser"; public static final String BROWSER_PERSPECTIVE_ID = PLUGIN_ID + ".browserPerspective";
해당 Perspective는 다음과 같이 브라우저 플러그인의 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>
BrowserPerspectiveFactory는 보기를 적절히 레이아웃해야 합니다.
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); }
브라우저 Perspective는 두 개의 보기(하나는 가시적인 보기이고 다른 하나에 대한 위치 표시기가 있음)를 정의하고 편집기 영역을 숨깁니다. Perspective 및 해당 레이아웃에 대한 전체 설명은 Perspectives를 참조하십시오.