Project

General

Profile

Download (2.38 KB) Statistics
| Branch: | Tag: | Revision:
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 org.apache.log4j.Logger;
13
import org.eclipse.swt.graphics.Image;
14
import org.eclipse.swt.widgets.Composite;
15
import org.eclipse.swt.widgets.Control;
16
import org.eclipse.swt.widgets.Shell;
17

    
18
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
19

    
20
/**
21
 * @author pplitzner
22
 * @date Jan 28, 2015
23
 *
24
 */
25
public class DeleteTaxonConfiguratorDialog extends DeleteConfiguratorDialog {
26

    
27
    @SuppressWarnings("unused")
28
    private final Logger logger = Logger.getLogger(DeleteTaxonConfiguratorDialog.class);
29

    
30
    private final TaxonDeletionConfigurator configurator;
31

    
32
    /**
33
     * @param configurator
34
     * @param parentShell
35
     * @param dialogTitle
36
     * @param dialogTitleImage
37
     * @param dialogMessage
38
     * @param dialogImageType
39
     * @param dialogButtonLabels
40
     * @param defaultIndex
41
     */
42
    public DeleteTaxonConfiguratorDialog(TaxonDeletionConfigurator configurator, Shell parentShell, String dialogTitle,
43
            Image dialogTitleImage, String dialogMessage,int dialogImageType, String[] dialogButtonLabels, int defaultIndex) {
44
        super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
45
        this.configurator = configurator;
46
    }
47

    
48
    /* (non-Javadoc)
49
     * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
50
     */
51
    @Override
52
    protected Control createCustomArea(Composite parent) {
53
        DeleteConfiguratorComposite composite = new DeleteConfiguratorComposite(configurator, parent, NONE);
54
        return composite;
55
    }
56

    
57
    public static boolean openConfirmWithConfigurator(TaxonDeletionConfigurator configurator, Shell parent, String title, String message) {
58
        DeleteTaxonConfiguratorDialog dialog = new DeleteTaxonConfiguratorDialog(configurator, parent, title, getDefaultImage(), message, QUESTION, getButtonLabels(QUESTION), 0);
59
        return dialog.open() == 0;
60
    }
61

    
62
    /* (non-Javadoc)
63
     * @see org.eclipse.jface.dialogs.Dialog#isResizable()
64
     */
65
    @Override
66
    protected boolean isResizable() {
67
        return true;
68
    }
69

    
70
}
(4-4/7)