Package: ImportCompleteOCLResourceAction

ImportCompleteOCLResourceAction

nameinstructionbranchcomplexitylinemethod
ImportCompleteOCLResourceAction(TextViewer)
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
run()
M: 11 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: * Copyright (c) 2010, 2012 Obeo.
3: * All rights reserved. This program and the accompanying materials
4: * are made available under the terms of the Eclipse Public License v1.0
5: * which accompanies this distribution, and is available at
6: * http://www.eclipse.org/legal/epl-v10.html
7: *
8: * Contributors:
9: * Obeo - initial API and implementation
10: *******************************************************************************/
11: package org.eclipse.acceleo.ui.interpreter.completeocl.internal.action;
12:
13: import org.eclipse.jface.action.Action;
14: import org.eclipse.jface.action.IAction;
15: import org.eclipse.jface.text.TextViewer;
16: import org.eclipse.ui.PlatformUI;
17:
18: /**
19: * This action will be used to import the content of a CompleteOCL document within the expression section of
20: * the interpreter view.
21: *
22: * @author <a href="mailto:marwa.rostren@obeo.fr">Marwa Rostren</a>
23: */
24: public final class ImportCompleteOCLResourceAction extends Action {
25:         /** The viewer in which to import a resource's content. */
26:         private TextViewer viewer;
27:
28:         /**
29:          * Instantiates the load resource action.
30:          */
31:         public ImportCompleteOCLResourceAction(TextViewer viewer) {
32:                 super("Import Complete OCL Resource", IAction.AS_PUSH_BUTTON);
33:                 setToolTipText("Import the content of a CompleteOCL Resource into the expression area.");
34:                 this.viewer = viewer;
35:         }
36:
37:         /**
38:          * {@inheritDoc}
39:          *
40:          * @see org.eclipse.jface.action.Action#run()
41:          */
42:         @Override
43:         public void run() {
44:                 new ImportCompleteOCLResourceDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), viewer)
45:                                 .open();
46:         }
47: }