Package: DebugPerspectiveFactory

DebugPerspectiveFactory

nameinstructionbranchcomplexitylinemethod
DebugPerspectiveFactory()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
createInitialLayout(IPageLayout)
M: 67 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 19 C: 0
0%
M: 1 C: 0
0%
setContentsOfShowViewMenu(IPageLayout)
M: 25 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 9 C: 0
0%
M: 1 C: 0
0%

Coverage

1: package org.overture.ide.debug.ui;
2:
3:
4: import org.eclipse.debug.ui.IDebugUIConstants;
5: import org.eclipse.ui.IFolderLayout;
6: import org.eclipse.ui.IPageLayout;
7: import org.eclipse.ui.IPerspectiveFactory;
8: import org.eclipse.ui.console.IConsoleConstants;
9: import org.eclipse.ui.progress.IProgressConstants;
10:
11: /**
12: * The debug perspective factory as adapted from the Debug UI.
13: */
14: public class DebugPerspectiveFactory implements IPerspectiveFactory {
15:
16:         private class IInternalDebugUIConstants {
17:
18:                 public static final String ID_NAVIGATOR_FOLDER_VIEW = "org.overture.ide.debug.ui.NavigatorFolderView";
19:                 public static final String ID_TOOLS_FOLDER_VIEW = "org.overture.ide.debug.ui.ToolsFolderView";
20:                 public static final String ID_OUTLINE_FOLDER_VIEW = "org.overture.ide.debug.ui.OutlineFolderView";
21:
22:         }
23:
24:         /**
25:          * @see IPerspectiveFactory#createInitialLayout(IPageLayout)
26:          */
27:         @Override
28:         public void createInitialLayout(IPageLayout layout) {
29:
30:                 String editorArea = layout.getEditorArea();
31:
32:                 IFolderLayout navFolder = layout.createFolder(IInternalDebugUIConstants.ID_NAVIGATOR_FOLDER_VIEW, IPageLayout.TOP, (float) 0.25, editorArea);
33:                 navFolder.addView(IDebugUIConstants.ID_DEBUG_VIEW);
34:
35:                 IFolderLayout toolsFolder = layout.createFolder(IInternalDebugUIConstants.ID_TOOLS_FOLDER_VIEW, IPageLayout.BOTTOM, (float) 0.75, editorArea);
36:                 toolsFolder.addView(IConsoleConstants.ID_CONSOLE_VIEW);
37:                 toolsFolder.addView(IPageLayout.ID_PROBLEM_VIEW);
38:                 toolsFolder.addPlaceholder(IDebugUIConstants.ID_REGISTER_VIEW);
39:                 toolsFolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
40:                 toolsFolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
41:
42:                 IFolderLayout outlineFolder = layout.createFolder(IInternalDebugUIConstants.ID_OUTLINE_FOLDER_VIEW, IPageLayout.RIGHT, (float) 0.33,IInternalDebugUIConstants.ID_NAVIGATOR_FOLDER_VIEW);
43:                 outlineFolder.addView(IDebugUIConstants.ID_VARIABLE_VIEW);
44:                 outlineFolder.addView(IDebugUIConstants.ID_BREAKPOINT_VIEW);
45:                 outlineFolder.addView(IDebugUIConstants.ID_EXPRESSION_VIEW);
46:
47:                 layout.addShowViewShortcut(IProgressConstants.PROGRESS_VIEW_ID);
48:
49:                 layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET);
50:                 layout.addActionSet(IDebugUIConstants.DEBUG_ACTION_SET);
51:                 layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET);
52:
53:                 setContentsOfShowViewMenu(layout);
54:         }
55:         
56:         /**
57:          * Sets the initial contents of the "Show View" menu.
58:          */
59:         protected void setContentsOfShowViewMenu(IPageLayout layout) {
60:                 layout.addShowViewShortcut(IDebugUIConstants.ID_DEBUG_VIEW);
61:                 layout.addShowViewShortcut(IDebugUIConstants.ID_VARIABLE_VIEW);
62:                 layout.addShowViewShortcut(IDebugUIConstants.ID_BREAKPOINT_VIEW);
63:                 layout.addShowViewShortcut(IDebugUIConstants.ID_EXPRESSION_VIEW);
64:                 layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
65:                 layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
66:                 layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW);
67:                 layout.addShowViewShortcut(IPageLayout.ID_PROJECT_EXPLORER);
68:         }
69: }