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
.Shell
;
19 import eu
.etaxonomy
.cdm
.api
.service
.config
.DeleteConfiguratorBase
;
22 * Abstract subclass of MessageDialog providing the functionality to configure
23 * a {@link DeleteConfiguratorBase}
28 public abstract class DeleteConfiguratorDialog
extends MessageDialog
{
30 public DeleteConfiguratorDialog(Shell parentShell
, String dialogTitle
,
31 Image dialogTitleImage
, String dialogMessage
, int dialogImageType
, String
[] dialogButtonLabels
, int defaultIndex
) {
32 super(parentShell
, dialogTitle
, dialogTitleImage
, dialogMessage
, dialogImageType
, dialogButtonLabels
, defaultIndex
);
36 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
39 protected Control
createDialogArea(Composite parent
) {
40 Composite composite
= (Composite
) super.createDialogArea(parent
);
49 static String
[] getButtonLabels(int kind
) {
50 String
[] dialogButtonLabels
;
55 dialogButtonLabels
= new String
[] { IDialogConstants
.OK_LABEL
};
59 dialogButtonLabels
= new String
[] { IDialogConstants
.OK_LABEL
,
60 IDialogConstants
.CANCEL_LABEL
};
64 dialogButtonLabels
= new String
[] { IDialogConstants
.YES_LABEL
,
65 IDialogConstants
.NO_LABEL
};
68 case QUESTION_WITH_CANCEL
: {
69 dialogButtonLabels
= new String
[] { IDialogConstants
.YES_LABEL
,
70 IDialogConstants
.NO_LABEL
,
71 IDialogConstants
.CANCEL_LABEL
};
75 throw new IllegalArgumentException(
76 "Illegal value for kind in MessageDialog.open()"); //$NON-NLS-1$
79 return dialogButtonLabels
;