Skip to content

Package: RAPWrapper

RAPWrapper

nameinstructionbranchcomplexitylinemethod
RAPWrapper()
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%
openDialog(Dialog, ECPDialogExecutor)
M: 16 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-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: * Eugen Neufeld - initial API and implementation
13: *******************************************************************************/
14: package org.eclipse.emf.ecp.rap.spi.util;
15:
16: import org.eclipse.emf.ecp.edit.internal.swt.util.DialogWrapper;
17: import org.eclipse.emf.ecp.edit.spi.swt.util.ECPDialogExecutor;
18: import org.eclipse.jface.dialogs.Dialog;
19: import org.eclipse.swt.events.DisposeEvent;
20: import org.eclipse.swt.events.DisposeListener;
21:
22: /**
23: * The RAP Wrapper for JFace Dialog class.
24: *
25: * @author Eugen Neufeld
26: *
27: */
28: @SuppressWarnings("restriction")
29: public class RAPWrapper implements DialogWrapper {
30:
31:         /**
32:          * {@inheritDoc}
33:          *
34:          * @see org.eclipse.emf.ecp.edit.internal.swt.util.DialogWrapper#openDialog(org.eclipse.jface.dialogs.Dialog,
35:          * org.eclipse.emf.ecp.edit.spi.swt.util.ECPDialogExecutor)
36:          * @since 1.5
37:          */
38:         @Override
39:         public void openDialog(final Dialog dialog, final ECPDialogExecutor callBack) {
40:                 dialog.setBlockOnOpen(false);
41:                 dialog.open();
42:                 dialog.getShell().addDisposeListener(new DisposeListener() {
43:
44:                         @Override
45:                         public void widgetDisposed(DisposeEvent event) {
46:                                 callBack.handleResult(dialog.getReturnCode());
47:                         }
48:                 });
49:         }
50:
51: }