843ff14fbe8ddc9a69cc850e454dc833f7e28e19
3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.ui
.dialog
;
12 import org
.eclipse
.jface
.dialogs
.IDialogConstants
;
13 import org
.eclipse
.jface
.dialogs
.MessageDialog
;
14 import org
.eclipse
.swt
.graphics
.Image
;
15 import org
.eclipse
.swt
.widgets
.Composite
;
16 import org
.eclipse
.swt
.widgets
.Control
;
17 import org
.eclipse
.swt
.widgets
.Listener
;
18 import org
.eclipse
.swt
.widgets
.Shell
;
20 import eu
.etaxonomy
.cdm
.api
.service
.config
.DeleteConfiguratorBase
;
23 * Abstract subclass of MessageDialog providing the functionality to configure
24 * a {@link DeleteConfiguratorBase}
29 public abstract class DeleteConfiguratorDialog
extends MessageDialog
implements Listener
{
31 public DeleteConfiguratorDialog(Shell parentShell
, String dialogTitle
,
32 Image dialogTitleImage
, String dialogMessage
, int dialogImageType
, String
[] dialogButtonLabels
, int defaultIndex
) {
33 super(parentShell
, dialogTitle
, dialogTitleImage
, dialogMessage
, dialogImageType
, dialogButtonLabels
, defaultIndex
);
37 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
40 protected Control
createDialogArea(Composite parent
) {
41 Composite composite
= (Composite
) super.createDialogArea(parent
);
43 createCheckBoxes(composite
);
48 protected abstract void createCheckBoxes(Composite parent
);
54 static String
[] getButtonLabels(int kind
) {
55 String
[] dialogButtonLabels
;
60 dialogButtonLabels
= new String
[] { IDialogConstants
.OK_LABEL
};
64 dialogButtonLabels
= new String
[] { IDialogConstants
.OK_LABEL
,
65 IDialogConstants
.CANCEL_LABEL
};
69 dialogButtonLabels
= new String
[] { IDialogConstants
.YES_LABEL
,
70 IDialogConstants
.NO_LABEL
};
73 case QUESTION_WITH_CANCEL
: {
74 dialogButtonLabels
= new String
[] { IDialogConstants
.YES_LABEL
,
75 IDialogConstants
.NO_LABEL
,
76 IDialogConstants
.CANCEL_LABEL
};
80 throw new IllegalArgumentException(
81 "Illegal value for kind in MessageDialog.open()"); //$NON-NLS-1$
84 return dialogButtonLabels
;