Revision 148679e6
Added by Patrick Plitzner about 9 years ago
- added option to toggle the delete configurator parameters in taxon deletion dialog (#4656)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/DeleteTaxonConfiguratorDialog.java | ||
---|---|---|
10 | 10 |
package eu.etaxonomy.taxeditor.ui.dialog; |
11 | 11 |
|
12 | 12 |
import org.apache.log4j.Logger; |
13 |
import org.eclipse.swt.SWT; |
|
14 | 13 |
import org.eclipse.swt.graphics.Image; |
15 |
import org.eclipse.swt.widgets.Button; |
|
16 | 14 |
import org.eclipse.swt.widgets.Composite; |
17 |
import org.eclipse.swt.widgets.Event;
|
|
15 |
import org.eclipse.swt.widgets.Control;
|
|
18 | 16 |
import org.eclipse.swt.widgets.Shell; |
19 | 17 |
|
20 | 18 |
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator; |
... | ... | |
30 | 28 |
private final Logger logger = Logger.getLogger(DeleteTaxonConfiguratorDialog.class); |
31 | 29 |
|
32 | 30 |
private final TaxonDeletionConfigurator configurator; |
33 |
private Button btnDeleteName; |
|
34 | 31 |
|
35 | 32 |
/** |
36 | 33 |
* @param configurator |
... | ... | |
49 | 46 |
} |
50 | 47 |
|
51 | 48 |
/* (non-Javadoc) |
52 |
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
|
|
49 |
* @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
|
|
53 | 50 |
*/ |
54 | 51 |
@Override |
55 |
public void handleEvent(Event event) { |
|
56 |
if(event.widget==btnDeleteName){ |
|
57 |
configurator.setDeleteNameIfPossible(btnDeleteName.getSelection()); |
|
58 |
} |
|
59 |
} |
|
60 |
|
|
61 |
/* (non-Javadoc) |
|
62 |
* @see eu.etaxonomy.taxeditor.ui.dialog.DeleteConfiguratorDialog#createCheckBoxes() |
|
63 |
*/ |
|
64 |
@Override |
|
65 |
protected void createCheckBoxes(Composite parent) { |
|
66 |
btnDeleteName = new Button(parent, SWT.CHECK); |
|
67 |
btnDeleteName.setText("Delete taxon name if possible"); |
|
68 |
btnDeleteName.addListener(SWT.Selection, this); |
|
69 |
btnDeleteName.setSelection(configurator.isDeleteNameIfPossible()); |
|
52 |
protected Control createCustomArea(Composite parent) { |
|
53 |
DeleteConfiguratorComposite composite = new DeleteConfiguratorComposite(configurator, parent, NONE); |
|
54 |
return composite; |
|
70 | 55 |
} |
71 | 56 |
|
72 | 57 |
public static boolean openConfirmWithConfigurator(TaxonDeletionConfigurator configurator, Shell parent, String title, String message) { |
... | ... | |
74 | 59 |
return dialog.open() == 0; |
75 | 60 |
} |
76 | 61 |
|
62 |
/* (non-Javadoc) |
|
63 |
* @see org.eclipse.jface.dialogs.Dialog#isResizable() |
|
64 |
*/ |
|
65 |
@Override |
|
66 |
protected boolean isResizable() { |
|
67 |
return true; |
|
68 |
} |
|
69 |
|
|
77 | 70 |
} |
Also available in: Unified diff