| /******************************************************************************* |
| * Copyright (c) 2007, 2008 Oracle. All rights reserved. This |
| * program and the accompanying materials are made available under the terms of |
| * the Eclipse Public License v1.0 which accompanies this distribution, and is |
| * available at http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: Oracle. - initial API and implementation |
| ******************************************************************************/ |
| package org.eclipse.jpt.ui.internal.perspective; |
| |
| import org.eclipse.jdt.ui.JavaUI; |
| import org.eclipse.ui.IFolderLayout; |
| import org.eclipse.ui.IPageLayout; |
| import org.eclipse.ui.IPerspectiveFactory; |
| import org.eclipse.ui.navigator.resources.ProjectExplorer; |
| import org.eclipse.ui.progress.IProgressConstants; |
| |
| public class JpaPerspectiveFactory implements IPerspectiveFactory { |
| |
| public void createInitialLayout(IPageLayout layout) { |
| String editorArea = layout.getEditorArea(); |
| |
| //Package area |
| IFolderLayout folder = layout.createFolder( |
| "left", IPageLayout.LEFT, (float) 0.25, editorArea); //$NON-NLS-1$ |
| folder.addView(ProjectExplorer.VIEW_ID); |
| folder.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY); |
| folder.addPlaceholder(IPageLayout.ID_RES_NAV); |
| |
| //Database Explorer area |
| layout.addView("org.eclipse.datatools.connectivity.DataSourceExplorerNavigator", //$NON-NLS-1$ |
| IPageLayout.BOTTOM, (float) 0.60, ProjectExplorer.VIEW_ID); |
| |
| //Problems/Console area |
| IFolderLayout outputFolder = layout.createFolder( |
| "bottom", IPageLayout.BOTTOM, (float) 0.60, editorArea); //$NON-NLS-1$ |
| outputFolder.addView(IPageLayout.ID_PROBLEM_VIEW); |
| outputFolder.addPlaceholder(IPageLayout.ID_BOOKMARKS); |
| outputFolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); |
| |
| //JPA Details (Split with Problems/Console area) |
| layout.addView("org.eclipse.jpt.ui.jpaDetailsView", |
| IPageLayout.RIGHT, (float) .60, "bottom"); |
| |
| //JPA Structure area |
| IFolderLayout outlineFolder = layout.createFolder( |
| "right", IPageLayout.RIGHT, (float) 0.75, editorArea); //$NON-NLS-1$ |
| outlineFolder.addView("org.eclipse.jpt.ui.jpaStructureView"); |
| outlineFolder.addView(IPageLayout.ID_OUTLINE); |
| |
| layout.addActionSet(JavaUI.ID_ACTION_SET); |
| layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET); |
| layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); |
| |
| // views - java |
| layout.addShowViewShortcut(JavaUI.ID_PACKAGES); |
| layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY); |
| layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW); |
| layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW); |
| |
| // views - standard workbench |
| layout.addShowViewShortcut(ProjectExplorer.VIEW_ID); |
| layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); |
| layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); |
| layout.addShowViewShortcut(IPageLayout.ID_RES_NAV); |
| |
| // new actions - Java project creation wizard |
| layout.addNewWizardShortcut("org.eclipse.jpt.ui.wizard.newJpaProject"); //$NON-NLS-1$ |
| layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$ |
| layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$ |
| layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$ |
| layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); //$NON-NLS-1$ |
| layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); //$NON-NLS-1$ |
| layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$ |
| layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); //$NON-NLS-1$ |
| layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$ |
| layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$ |
| layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$ |
| } |
| } |