blob: 22112fbe52148045a97f461f506d350b6ace5506 [file] [log] [blame]
Brian Fitzpatrick66ec5152010-02-10 22:53:53 +00001/*******************************************************************************
2 * Copyright (c) 2009 Sybase, Inc. and others
3 *
4 * All rights reserved. This program and the accompanying materials are made
5 * available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors: Ingres - initial API and implementation
10 * brianf - a few tweaks
11 ******************************************************************************/
12package org.eclipse.datatools.enablement.rcp;
13
14import org.eclipse.ui.IFolderLayout;
15import org.eclipse.ui.IPageLayout;
16import org.eclipse.ui.IPerspectiveFactory;
17
18public class Perspective implements IPerspectiveFactory {
19
20 private static String DSE_VIEW_ID = "org.eclipse.datatools.connectivity.DataSourceExplorerNavigator"; //$NON-NLS-1$
21 private static String PROJECT_EXPLORER_VIEW_ID = "org.eclipse.ui.navigator.ProjectExplorer"; //$NON-NLS-1$
22 private static String RESULT_VIEW_ID = "org.eclipse.datatools.sqltools.result.resultView"; //$NON-NLS-1$
23 private static String PLAN_VIEW_ID = "org.eclipse.datatools.sqltools.plan.planView"; //$NON-NLS-1$
24
25 public void createInitialLayout(IPageLayout layout) {
26
27 // Get the editor area.
28 String editorArea = layout.getEditorArea();
29 layout.setEditorAreaVisible(true);
30
31 //Left
32 IFolderLayout left = layout.createFolder("topleft", IPageLayout.LEFT, 0.25f, editorArea); //$NON-NLS-1$
33 left.addView(DSE_VIEW_ID);
34
35 left = layout.createFolder("bottomleft", IPageLayout.BOTTOM, 0.5f, //$NON-NLS-1$
36 "topleft"); //$NON-NLS-1$
37 left.addView(PROJECT_EXPLORER_VIEW_ID);
38
39 // Bottom
40 IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM, 0.75f, editorArea); //$NON-NLS-1$
41 bottom.addView(RESULT_VIEW_ID);
42 bottom.addView(PLAN_VIEW_ID);
43 }
44}