Skip to content

Package: ECPDialogExecutor

ECPDialogExecutor

nameinstructionbranchcomplexitylinemethod
ECPDialogExecutor(Dialog)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
execute()
M: 0 C: 5
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-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: *******************************************************************************/
15: package org.eclipse.emf.ecp.edit.spi.swt.util;
16:
17: import org.eclipse.emf.ecp.edit.internal.swt.util.DialogOpener;
18: import org.eclipse.jface.dialogs.Dialog;
19:
20: /**
21: * @author Eugen Neufeld
22: * @since 1.5
23: *
24: */
25: public abstract class ECPDialogExecutor {
26:
27:         private final Dialog dialog;
28:
29:         /**
30:          * Constructor.
31:          *
32:          * @param dialog the Dialog to show
33:          */
34:         public ECPDialogExecutor(Dialog dialog) {
35:                 this.dialog = dialog;
36:         }
37:
38:         /**
39:          * Callback method which will get notified when the user presses a button leading to a close of the dialog. (e.g Ok
40:          * or Cancel)
41:          *
42:          * @param codeResult the result code of the dialog. Constants are defined in {@link org.eclipse.jface.window.Window
43:          * Window}
44:          */
45:         public abstract void handleResult(int codeResult);
46:
47:         /**
48:          * This is the method to run the {@link ECPDialogExecutor}.
49:          */
50:         public void execute() {
51:                 DialogOpener.openDialog(dialog, this);
52:         }
53: }