Package: DecorationgVdmLabelProvider

DecorationgVdmLabelProvider

nameinstructionbranchcomplexitylinemethod
DecorationgVdmLabelProvider(VdmUILabelProvider)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
DecorationgVdmLabelProvider(VdmUILabelProvider, boolean)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
DecorationgVdmLabelProvider(VdmUILabelProvider, boolean, boolean)
M: 19 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
setFlatPackageMode(boolean)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 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.internal.viewsupport;
23:
24:
25: import org.eclipse.jface.viewers.DecorationContext;
26: import org.eclipse.ui.PlatformUI;
27: import org.overture.ide.ui.VdmProblemsLabelDecorator;
28:
29: public class DecorationgVdmLabelProvider extends VdmColoringLabelProvider {
30:
31:         /**
32:          * Decorating label provider for Java. Combines a JavaUILabelProvider
33:          * with problem and override indicator with the workbench decorator (label
34:          * decorator extension point).
35:          * @param labelProvider the label provider to decorate
36:          */
37:         public DecorationgVdmLabelProvider(VdmUILabelProvider labelProvider) {
38:                 this(labelProvider, true);
39:         }
40:
41:         /**
42:          * Decorating label provider for Java. Combines a JavaUILabelProvider
43:          * (if enabled with problem indicator) with the workbench
44:          * decorator (label decorator extension point).
45:          *         @param labelProvider the label provider to decorate
46:          * @param errorTick show error ticks
47:          */
48:         public DecorationgVdmLabelProvider(VdmUILabelProvider labelProvider, boolean errorTick) {
49:                 this(labelProvider, errorTick, true);
50:         }
51:
52:         /**
53:          * Decorating label provider for Java. Combines a JavaUILabelProvider
54:          * (if enabled with problem indicator) with the workbench
55:          * decorator (label decorator extension point).
56:          *         @param labelProvider the label provider to decorate
57:          * @param errorTick show error ticks
58:          * @param flatPackageMode configure flat package mode
59:          */
60:         public DecorationgVdmLabelProvider(VdmUILabelProvider labelProvider, boolean errorTick, boolean flatPackageMode) {
61:                 super(labelProvider, PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator(), DecorationContext.DEFAULT_CONTEXT);
62:•                if (errorTick) {
63:                         labelProvider.addLabelDecorator(new VdmProblemsLabelDecorator(null));
64:                 }
65:                 setFlatPackageMode(flatPackageMode);
66:         }
67:
68:         /**
69:          * Tells the label decorator if the view presents packages flat or hierarchical.
70:          * @param enable If set, packages are presented in flat mode.
71:          */
72:         public void setFlatPackageMode(boolean enable) {
73: //                if (enable) {
74: //                        setDecorationContext(DecorationContext.DEFAULT_CONTEXT);
75: //                } else {
76: //                        setDecorationContext(HierarchicalDecorationContext.getContext());
77: //                }
78:         }
79:
80:         
81: }