01: package org.drools.eclipse;
02:
03: import org.eclipse.debug.ui.IDebugUIConstants;
04: import org.eclipse.jdt.ui.JavaUI;
05: import org.eclipse.ui.IFolderLayout;
06: import org.eclipse.ui.IPageLayout;
07: import org.eclipse.ui.IPerspectiveFactory;
08: import org.eclipse.ui.console.IConsoleConstants;
09: import org.eclipse.ui.progress.IProgressConstants;
10:
11: public class DroolsPerspective implements IPerspectiveFactory {
12:
13: public void createInitialLayout(IPageLayout layout) {
14: String editorArea = layout.getEditorArea();
15:
16: IFolderLayout folder = layout.createFolder(
17: "left", IPageLayout.LEFT, (float) 0.25, editorArea); //$NON-NLS-1$
18: folder.addView(JavaUI.ID_PACKAGES);
19: folder.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY);
20: folder.addView(IPageLayout.ID_RES_NAV);
21:
22: IFolderLayout rulesfolder = layout.createFolder(
23: "leftbottom", IPageLayout.BOTTOM, (float) 0.5, "left"); //$NON-NLS-1$
24: rulesfolder.addView(IDroolsConstants.RULES_VIEW);
25:
26: IFolderLayout outputfolder = layout.createFolder(
27: "bottom", IPageLayout.BOTTOM, (float) 0.75, editorArea); //$NON-NLS-1$
28: outputfolder.addView(IPageLayout.ID_PROBLEM_VIEW);
29: outputfolder.addView(IPageLayout.ID_PROP_SHEET);
30: outputfolder.addPlaceholder(JavaUI.ID_JAVADOC_VIEW);
31: outputfolder.addPlaceholder(JavaUI.ID_SOURCE_VIEW);
32: outputfolder.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW);
33: outputfolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
34: outputfolder
35: .addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
36:
37: // *** Drools-specific extensions ***
38: outputfolder.addView(IDroolsConstants.AUDIT_VIEW);
39: layout.addShowViewShortcut(IDroolsConstants.AUDIT_VIEW);
40: layout.addNewWizardShortcut("org.drools.eclipse.new.file");
41: layout.addNewWizardShortcut("org.drools.eclipse.new.dsl");
42: layout
43: .addNewWizardShortcut("org.drools.eclipse.wizards.new.project");
44: // **********************************
45:
46: layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT,
47: (float) 0.75, editorArea);
48:
49: layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
50: layout.addActionSet(JavaUI.ID_ACTION_SET);
51: layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET);
52: layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
53:
54: // views - java
55: layout.addShowViewShortcut(JavaUI.ID_PACKAGES);
56: layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY);
57: layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW);
58: layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW);
59:
60: // views - debugging
61: layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
62:
63: // views - standard workbench
64: layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
65: layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
66: layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
67: layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
68: layout.addShowViewShortcut(IProgressConstants.PROGRESS_VIEW_ID);
69:
70: // new actions - Java project creation wizard
71: layout
72: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$
73: layout
74: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$
75: layout
76: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$
77: layout
78: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); //$NON-NLS-1$
79: layout
80: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); //$NON-NLS-1$
81: layout
82: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$
83: layout
84: .addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); //$NON-NLS-1$
85: layout
86: .addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$
87: layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$
88: layout
89: .addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$
90: }
91:
92: }
|