Skip to content

Package: MasterDetailAction

MasterDetailAction

nameinstructionbranchcomplexitylinemethod
MasterDetailAction()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getImagePath()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getLabel()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getTreeViewer()
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%
setImagePath(String)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setLabel(String)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setTreeViewer(TreeViewer)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Alexandra Buzila - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.spi.treemasterdetail.ui.swt;
15:
16: import org.eclipse.core.commands.AbstractHandler;
17: import org.eclipse.emf.ecore.EObject;
18: import org.eclipse.jface.viewers.TreeViewer;
19:
20: /**
21: * @author Alexandra Buzila
22: * @since 1.5
23: *
24: */
25: public abstract class MasterDetailAction extends AbstractHandler {
26:         private String label, imagePath;
27:         private TreeViewer treeviewer;
28:
29:         /**
30:          * @param eObject the {@link EObject} on which to test if the action can be executed
31:          * @return <b>true</b> if the action can be executed on the parameter {@code eObject}
32:          */
33:         public abstract boolean shouldShow(EObject eObject);
34:
35:         /**
36:          * @param object The {@link EObject} on which the action is executed
37:          **/
38:         public abstract void execute(EObject object);
39:
40:         /**
41:          * @return the label of the action
42:          */
43:         String getLabel() {
44:                 return label;
45:         }
46:
47:         /**
48:          * @param label the label of the action
49:          */
50:         void setLabel(String label) {
51:                 this.label = label;
52:         }
53:
54:         /**
55:          * @return the imagePath
56:          */
57:         String getImagePath() {
58:                 return imagePath;
59:         }
60:
61:         /**
62:          * @param imagePath the path to the image
63:          */
64:         void setImagePath(String imagePath) {
65:                 this.imagePath = imagePath;
66:         }
67:
68:         /**
69:          * Sets the treeviewer of the tree master detail renderer.
70:          *
71:          * @param treeviewer the tree
72:          */
73:         void setTreeViewer(TreeViewer treeviewer) {
74:                 this.treeviewer = treeviewer;
75:         }
76:
77:         /**
78:          * Returns the treeviewer renderered by the tree master detail renderer.
79:          *
80:          * @return the tree
81:          * @since 1.6
82:          */
83:         protected TreeViewer getTreeViewer() {
84:                 return treeviewer;
85:         }
86: }