01: /*
02: * uDig - User Friendly Desktop Internet GIS client
03: * http://udig.refractions.net
04: * (C) 2004, Refractions Research Inc.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: */
17: package net.refractions.udig.internal.ui;
18:
19: import org.eclipse.ui.IPageLayout;
20: import org.eclipse.ui.IPerspectiveFactory;
21:
22: /**
23: * A perspective factory generates the initial page layout and visible
24: * action set for a page.
25: */
26: public class AlternateMapPerspective implements IPerspectiveFactory {
27:
28: /** <code>ID_PERSPECTIVE</code> field */
29: public static final String ID_PERSPECTIVE = "net.refractions.udig.ui.alternateMapPerspective"; //$NON-NLS-1$
30:
31: /**
32: * Creates the initial layout for a page.
33: * <p>
34: * Implementors of this method may add additional views to a
35: * perspective. The perspective already contains an editor folder
36: * identified by the result of <code>IPageLayout.getEditorArea()</code>.
37: * Additional views should be added to the layout using this value as
38: * the initial point of reference.
39: * </p>
40: *
41: * @param layout the page layout
42: */
43: public void createInitialLayout(IPageLayout layout) {
44: // Get the editor area.
45: String editorArea = layout.getEditorArea();
46:
47: layout
48: .addView(
49: "net.refractions.udig.project.ui.projectExplorer", IPageLayout.RIGHT, 0.65f, editorArea); //$NON-NLS-1$
50: layout
51: .addView(
52: "net.refractions.udig.project.ui.layerManager", IPageLayout.BOTTOM, 0.25f, //$NON-NLS-1$
53: "net.refractions.udig.project.ui.projectExplorer"); //$NON-NLS-1$
54:
55: layout.createPlaceholderFolder(
56: "bottom", IPageLayout.BOTTOM, 0.65f, editorArea); //$NON-NLS-1$
57: layout.addPerspectiveShortcut(MapPerspective.ID_PERSPECTIVE);
58: }
59:
60: }
|