Skip to content

Package: ECPTreeViewAction

ECPTreeViewAction

nameinstructionbranchcomplexitylinemethod
ECPTreeViewAction()
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%
getTreeEditor()
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%
getTreeSelection()
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%
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%
init(TreeViewer, TreeSelection, TreeEditor)
M: 10 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 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: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.spi.categorization.swt;
15:
16: import org.eclipse.emf.ecp.view.spi.categorization.model.ECPAction;
17: import org.eclipse.jface.viewers.TreeSelection;
18: import org.eclipse.jface.viewers.TreeViewer;
19: import org.eclipse.swt.custom.TreeEditor;
20:
21: /**
22: * This {@link ECPAction} implementation is specific for a TreeViewer. The action will be initialized with the
23: * {@link TreeViewer}, the current {@link TreeEditor} and the current {@link TreeSelection}.
24: *
25: * @author Eugen Neufeld
26: *
27: */
28: public abstract class ECPTreeViewAction implements ECPAction {
29:
30:         private TreeViewer treeViewer;
31:         private TreeSelection treeSelection;
32:         private TreeEditor treeEditor;
33:
34:         /**
35:          * Initialize the tree action.
36:          *
37:          * @param treeViewer the {@link TreeViewer} showing this action
38:          * @param treeSelection the current {@link TreeSelection}
39:          * @param treeEditor the current {@link TreeEditor}
40:          */
41:         public final void init(TreeViewer treeViewer,
42:                 TreeSelection treeSelection, TreeEditor treeEditor) {
43:                 this.treeViewer = treeViewer;
44:                 this.treeSelection = treeSelection;
45:                 this.treeEditor = treeEditor;
46:         }
47:
48:         /**
49:          * The {@link TreeViewer} showing this action.
50:          *
51:          * @return the {@link TreeViewer}
52:          */
53:         protected TreeViewer getTreeViewer() {
54:                 return treeViewer;
55:         }
56:
57:         /**
58:          * Current {@link TreeSelection}.
59:          *
60:          * @return the {@link TreeSelection}
61:          */
62:         protected TreeSelection getTreeSelection() {
63:                 return treeSelection;
64:         }
65:
66:         /**
67:          * Current {@link TreeEditor}.
68:          *
69:          * @return the {@link TreeEditor}
70:          */
71:         protected TreeEditor getTreeEditor() {
72:                 return treeEditor;
73:         }
74:
75: }