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