Package: VdmUIPlugin

VdmUIPlugin

nameinstructionbranchcomplexitylinemethod
VdmUIPlugin()
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%
getDefault()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getImageDescriptorRegistry()
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%
getPartitionScanner()
M: 11 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getProblemMarkerManager()
M: 11 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getWorkspace()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
internalGetImageDescriptorRegistry()
M: 11 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
log(Exception)
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
log(String, Exception)
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
logErrorMessage(String)
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
printe(Exception)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
println(String)
M: 6 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
start(BundleContext)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
stop(BundleContext)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * #%~
3: * org.overture.ide.ui
4: * %%
5: * Copyright (C) 2008 - 2014 Overture
6: * %%
7: * This program is free software: you can redistribute it and/or modify
8: * it under the terms of the GNU General Public License as
9: * published by the Free Software Foundation, either version 3 of the
10: * License, or (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public
18: * License along with this program. If not, see
19: * <http://www.gnu.org/licenses/gpl-3.0.html>.
20: * #~%
21: */
22: package org.overture.ide.ui;
23:
24: import org.eclipse.core.resources.IWorkspace;
25: import org.eclipse.core.resources.ResourcesPlugin;
26: import org.eclipse.core.runtime.IStatus;
27: import org.eclipse.core.runtime.Status;
28: import org.eclipse.ui.plugin.AbstractUIPlugin;
29: import org.osgi.framework.BundleContext;
30: import org.overture.ide.ui.editor.partitioning.VdmPartitionScanner;
31: import org.overture.ide.ui.internal.viewsupport.ImageDescriptorRegistry;
32: import org.overture.ide.ui.internal.viewsupport.ProblemMarkerManager;
33:
34: public class VdmUIPlugin extends AbstractUIPlugin {
35:         public static boolean DEBUG = true;
36:         private static VdmUIPlugin plugin;
37:         
38:
39:         private VdmPartitionScanner fPartitionScanner;
40:         private ImageDescriptorRegistry fImageDescriptorRegistry;
41:         private ProblemMarkerManager fProblemMarkerManager;
42: //        private Object fTemplateStore;
43: //        private Object fContextTypeRegistry;
44:
45:         @Override
46:         public void start(BundleContext context) throws Exception {
47:                 super.start(context);
48:                 plugin = this;
49:         }
50:
51:         /*
52:          * (non-Javadoc)
53:          *
54:          * @see
55:          * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
56:          * )
57:          */
58:         @Override
59:         public void stop(BundleContext context) throws Exception {
60:                 plugin = null;
61:                 super.stop(context);
62:         }
63:
64:         /**
65:          * Returns the shared instance
66:          *
67:          * @return the shared instance
68:          */
69:         public static VdmUIPlugin getDefault() {
70:                 return plugin;
71:         }
72:
73:         public VdmPartitionScanner getPartitionScanner() {
74:•                if (fPartitionScanner == null)
75:                         fPartitionScanner = new VdmPartitionScanner();
76:
77:                 return fPartitionScanner;
78:         }
79:
80:         public static void log(Exception exception) {
81:                 getDefault().getLog().log(new Status(IStatus.ERROR,IVdmUiConstants.PLUGIN_ID,"VdmUIPlugin",exception));
82:         }
83:         public static void log(String message,Exception exception) {
84:                 getDefault().getLog().log(new Status(IStatus.ERROR,IVdmUiConstants.PLUGIN_ID,message,exception));
85:         }
86:
87:         public static void println(String s) {
88:•                if (DEBUG)
89:                         System.out.println(s);
90:         }
91:
92:         public static void printe(Exception e) {
93:                 println(e.getStackTrace().toString());
94:                 println(e.getMessage());
95:
96:         }
97:
98:         public static void logErrorMessage(String message) {
99:                 getDefault().getLog().log(new Status(IStatus.ERROR,IVdmUiConstants.PLUGIN_ID,message));
100:
101:         }
102:
103:         public static ImageDescriptorRegistry getImageDescriptorRegistry() {
104:                 return getDefault().internalGetImageDescriptorRegistry();
105:         }
106:
107:         private synchronized ImageDescriptorRegistry internalGetImageDescriptorRegistry() {
108:•                if (fImageDescriptorRegistry == null)
109:                         fImageDescriptorRegistry = new ImageDescriptorRegistry();
110:                 return fImageDescriptorRegistry;
111:         }
112:
113:         public synchronized ProblemMarkerManager getProblemMarkerManager() {
114:•                if (fProblemMarkerManager == null)
115:                         fProblemMarkerManager = new ProblemMarkerManager();
116:                 return fProblemMarkerManager;
117:         }
118:
119:         public static IWorkspace getWorkspace() {
120:                 return ResourcesPlugin.getWorkspace();
121:         }
122:
123:         
124: }