package org.eclipse.iee.ui;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
import org.eclipse.ui.console.IConsoleConstants;
import org.eclipse.jdt.ui.JavaUI;
/**
* Defines IEE Perspective layout.
*/
public class IeePerspective implements IPerspectiveFactory {
private IPageLayout factory;
public IeePerspective() {
super();
}
public void createInitialLayout(IPageLayout factory) {
this.factory = factory;
addViews();
addActionSets();
addNewWizardShortcuts();
addPerspectiveShortcuts();
addViewShortcuts();
}
private void addViews() {
IFolderLayout bottom =
factory.createFolder(
"bottomRight", //NON-NLS-1
IPageLayout.BOTTOM,
0.75f,
factory.getEditorArea());
bottom.addView(IPageLayout.ID_PROBLEM_VIEW);
bottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
IFolderLayout topLeft =
factory.createFolder(
"topLeft", //NON-NLS-1
IPageLayout.LEFT,
0.25f,
factory.getEditorArea());
topLeft.addView(IPageLayout.ID_RES_NAV);
}
private void addActionSets() {
factory.addActionSet(JavaUI.ID_ACTION_SET);
factory.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); //NON-NLS-1
}
private void addPerspectiveShortcuts() {
factory.addPerspectiveShortcut("org.eclipse.team.ui.TeamSynchronizingPerspective"); //NON-NLS-1
factory.addPerspectiveShortcut("org.eclipse.team.cvs.ui.cvsPerspective"); //NON-NLS-1
factory.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); //NON-NLS-1
}
private void addNewWizardShortcuts() {
factory.addNewWizardShortcut("org.eclipse.iee.ui.wizards.IEEProjectWizard");//NON-NLS-1
factory.addNewWizardShortcut("org.eclipse.iee.ui.wizards.GeneralIEEWizard");//NON-NLS-1
factory.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//NON-NLS-1
factory.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//NON-NLS-1
}
private void addViewShortcuts() {
factory.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
factory.addShowViewShortcut(JavaUI.ID_PACKAGES);
factory.addShowViewShortcut(IPageLayout.ID_RES_NAV);
factory.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
factory.addShowViewShortcut(IPageLayout.ID_OUTLINE);
}
}