Creating a New PerspectiveThis tutorial creates a new perspective that is based on combining Declare new PerspectiveAdd the following XML snippet to your plugin.xml: <extension point="org.eclipse.ui.perspectives"> <perspective class="tutorial.PerspectiveFactory1" id="tutorial.perspective1" name="tutorial.perspective1"/> </extension> The plugin.xml editor's extension tab should now be similar to the following (provided you did the last two tutorials): ![]() Create a Perspective Factory classPerspectiveFactory1 package tutorial; import org.eclipse.ui.IPageLayout; import org.eclipse.ui.IPerspectiveFactory; public class PerspectiveFactory1 implements IPerspectiveFactory { public void createInitialLayout(IPageLayout layout) { layout.createFolder("left", IPageLayout.LEFT, 0.2f, IPageLayout.ID_EDITOR_AREA);; layout.createFolder("right", IPageLayout.RIGHT, 0.6f, IPageLayout.ID_EDITOR_AREA);; layout.createFolder("bottom", IPageLayout.BOTTOM, 0.8f, IPageLayout.ID_EDITOR_AREA);; layout.createFolder("top", IPageLayout.TOP, 0.6f, IPageLayout.ID_EDITOR_AREA);; } } Create the Perspective ExtensionsSee the 4 Example of extending an existing perspective tutorial on how to create Perspective extensions. <extension point="org.eclipse.ui.perspectiveExtensions"> <perspectiveExtension targetID="tutorial.perspective1"> <view id="org.eclipse.ui.views.ResourceNavigator" relationship="stack" relative="right"/> <view id="org.eclipse.ui.views.TaskList" relationship="stack" relative="top"/> <view id="org.eclipse.ui.views.BookmarkView" relationship="stack" relative="left"/> <view id="org.eclipse.ui.views.ProblemView" relationship="stack" relative="bottom"/> </perspectiveExtension> </extension> Run the application.Create a new Application Launcher by doing the following:
The workbench should now look similar to the following image: ![]() |
(c) Copyright (c) 2004,2005 Refractions Research Inc. and others. |