Merge branch 'release/3.12.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / ui / dialog / FeedbackMessageBox.java
1 // $Id$
2 /**
3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.taxeditor.ui.dialog;
11
12 import java.io.Serializable;
13
14 import org.eclipse.swt.SWT;
15 import org.eclipse.swt.widgets.MessageBox;
16 import org.eclipse.swt.widgets.Shell;
17
18 import eu.etaxonomy.taxeditor.operation.FeedbackGenerator;
19
20 /**
21 * Feedback Generator corresponding to a {@link MessageBox}
22 *
23 * @author cmathew
24 * @date 29 Oct 2015
25 *
26 */
27 public class FeedbackMessageBox extends FeedbackGenerator {
28
29 private Shell shell;
30 /**
31 * @param parent
32 */
33 public FeedbackMessageBox(Shell parent) {
34 this.shell = parent;
35 }
36
37 /**
38 * {@inheritDoc}
39 */
40 @Override
41 public Serializable generateFeedback() {
42
43 // create a dialog with ok and cancel buttons and a question icon
44 MessageBox dialog =
45 new MessageBox(shell, SWT.ICON_QUESTION | SWT.OK| SWT.CANCEL);
46 dialog.setText("Monitor Feedback");
47 dialog.setMessage("Do you really want to continue?");
48
49 // open dialog and await user selection
50 return dialog.open();
51 }
52 }