Revision 3698034e
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/deleteConfigurator/DeleteTaxonBaseConfiguratorComposite.java | ||
---|---|---|
26 | 26 |
import org.eclipse.swt.widgets.Composite; |
27 | 27 |
import org.eclipse.swt.widgets.Display; |
28 | 28 |
import org.eclipse.swt.widgets.Event; |
29 |
import org.eclipse.swt.widgets.Label; |
|
29 | 30 |
import org.eclipse.swt.widgets.Listener; |
30 | 31 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
32 |
import org.eclipse.wb.swt.SWTResourceManager; |
|
31 | 33 |
|
32 | 34 |
import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator; |
33 | 35 |
import eu.etaxonomy.cdm.api.service.config.TaxonBaseDeletionConfigurator; |
... | ... | |
61 | 63 |
|
62 | 64 |
Classification selectedClassification; |
63 | 65 |
private List<Classification> classifications; |
66 |
private Composite composite; |
|
64 | 67 |
|
65 | 68 |
|
66 | 69 |
/** |
... | ... | |
82 | 85 |
setBackground(getBackground()); |
83 | 86 |
|
84 | 87 |
btnDeleteTaxonName = new Button(this, SWT.CHECK); |
88 |
btnDeleteTaxonName.setLayoutData(new GridData(SWT.LEFT, SWT.BOTTOM, false, false, 1, 1)); |
|
85 | 89 |
btnDeleteTaxonName.setText("Delete name if possible"); |
86 | 90 |
btnDeleteTaxonName.setSelection(true); |
87 | 91 |
btnDeleteTaxonName.addListener(SWT.Selection, new Listener() { |
88 | 92 |
@Override |
89 | 93 |
public void handleEvent(Event e) { |
90 | 94 |
Button b = (Button) e.widget; |
91 |
GridData data = (GridData) btnRemoveAllNameRelationships.getLayoutData();
|
|
95 |
GridData data = (GridData) btnDeleteTaxonName.getLayoutData();
|
|
92 | 96 |
data.exclude = b.getSelection(); |
93 |
btnRemoveAllNameRelationships.setVisible(data.exclude); |
|
94 |
btnIgnoreIsBasionym.setVisible(data.exclude); |
|
95 |
btnIgnoreIsReplacedSynonymFor.setVisible(data.exclude); |
|
96 |
btnIgnoreHasBasionym.setVisible(data.exclude); |
|
97 |
btnIgnoreHasReplacedSynonym.setVisible(data.exclude); |
|
98 |
btnRemoveAllTypeDesignations.setVisible(data.exclude); |
|
97 |
composite.setEnabled(data.exclude); |
|
98 |
btnRemoveAllNameRelationships.setSelection(data.exclude); |
|
99 |
btnIgnoreIsBasionym.setSelection(data.exclude); |
|
100 |
btnIgnoreIsReplacedSynonymFor.setSelection(data.exclude); |
|
101 |
btnIgnoreHasBasionym.setSelection(data.exclude); |
|
102 |
btnIgnoreHasReplacedSynonym.setSelection(data.exclude); |
|
103 |
btnRemoveAllTypeDesignations.setSelection(data.exclude); |
|
99 | 104 |
} |
100 | 105 |
}); |
101 | 106 |
|
107 |
composite = new Composite(this, SWT.NO_BACKGROUND); |
|
108 |
GridLayout gl_composite = new GridLayout(1, false); |
|
109 |
gl_composite.horizontalSpacing = 1; |
|
110 |
gl_composite.marginHeight = 1; |
|
111 |
composite.setLayout(gl_composite); |
|
112 |
GridData gd_composite = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
113 |
gd_composite.heightHint = 166; |
|
114 |
gd_composite.widthHint = 294; |
|
115 |
composite.setLayoutData(gd_composite); |
|
116 |
composite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); |
|
117 |
toolkit.adapt(composite); |
|
118 |
toolkit.paintBordersFor(composite); |
|
119 |
|
|
102 | 120 |
|
103 | 121 |
//DeleteConfigurator for the name |
104 | 122 |
|
105 | 123 |
|
106 |
btnRemoveAllNameRelationships = new Button(this, SWT.CHECK); |
|
124 |
btnRemoveAllNameRelationships = new Button(composite, SWT.CHECK); |
|
125 |
GridData gd_btnRemoveAllNameRelationships = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
126 |
gd_btnRemoveAllNameRelationships.horizontalIndent = 5; |
|
127 |
btnRemoveAllNameRelationships.setLayoutData(gd_btnRemoveAllNameRelationships); |
|
107 | 128 |
btnRemoveAllNameRelationships.setText("Remove all name relations"); |
108 | 129 |
btnRemoveAllNameRelationships.setSelection(true); |
109 | 130 |
|
110 |
btnIgnoreIsBasionym = new Button(this, SWT.CHECK); |
|
111 |
btnIgnoreIsBasionym.setText("Ignore if it is basionym"); |
|
131 |
btnRemoveAllTypeDesignations = new Button(composite, SWT.CHECK); |
|
132 |
GridData gd_btnRemoveAllTypeDesignations = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
133 |
gd_btnRemoveAllTypeDesignations.horizontalIndent = 5; |
|
134 |
btnRemoveAllTypeDesignations.setLayoutData(gd_btnRemoveAllTypeDesignations); |
|
135 |
btnRemoveAllTypeDesignations.setText("Remove all type designations"); |
|
136 |
btnRemoveAllTypeDesignations.setSelection(true); |
|
137 |
|
|
138 |
Label lblDelete = new Label(composite, SWT.NONE); |
|
139 |
GridData gd_lblDelete = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
140 |
gd_lblDelete.horizontalIndent = 5; |
|
141 |
lblDelete.setLayoutData(gd_lblDelete); |
|
142 |
toolkit.adapt(lblDelete, true, true); |
|
143 |
lblDelete.setText("delete even if "); |
|
144 |
|
|
145 |
btnIgnoreHasReplacedSynonym = new Button(composite, SWT.CHECK); |
|
146 |
GridData gd_btnIgnoreHasReplacedSynonym = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
147 |
gd_btnIgnoreHasReplacedSynonym.horizontalIndent = 10; |
|
148 |
btnIgnoreHasReplacedSynonym.setLayoutData(gd_btnIgnoreHasReplacedSynonym); |
|
149 |
btnIgnoreHasReplacedSynonym.setText("it has replaced synonym"); |
|
150 |
btnIgnoreHasReplacedSynonym.setSelection(true); |
|
151 |
|
|
152 |
btnIgnoreHasBasionym = new Button(composite, SWT.CHECK); |
|
153 |
GridData gd_btnIgnoreHasBasionym = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
154 |
gd_btnIgnoreHasBasionym.horizontalIndent = 10; |
|
155 |
btnIgnoreHasBasionym.setLayoutData(gd_btnIgnoreHasBasionym); |
|
156 |
btnIgnoreHasBasionym.setText("it has basionym"); |
|
157 |
btnIgnoreHasBasionym.setSelection(true); |
|
158 |
|
|
159 |
btnIgnoreIsReplacedSynonymFor = new Button(composite, SWT.CHECK); |
|
160 |
GridData gd_btnIgnoreIsReplacedSynonymFor = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
161 |
gd_btnIgnoreIsReplacedSynonymFor.horizontalIndent = 10; |
|
162 |
btnIgnoreIsReplacedSynonymFor.setLayoutData(gd_btnIgnoreIsReplacedSynonymFor); |
|
163 |
btnIgnoreIsReplacedSynonymFor.setSelection(true); |
|
164 |
btnIgnoreIsReplacedSynonymFor.setText("it is replaced synonym"); |
|
165 |
|
|
166 |
btnIgnoreIsBasionym = new Button(composite, SWT.CHECK); |
|
167 |
GridData gd_btnIgnoreIsBasionym = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); |
|
168 |
gd_btnIgnoreIsBasionym.horizontalIndent = 10; |
|
169 |
btnIgnoreIsBasionym.setLayoutData(gd_btnIgnoreIsBasionym); |
|
170 |
btnIgnoreIsBasionym.setText("it is basionym"); |
|
112 | 171 |
btnIgnoreIsBasionym.setSelection(true); |
113 | 172 |
|
114 |
btnIgnoreIsReplacedSynonymFor = new Button(this, SWT.CHECK); |
|
115 |
btnIgnoreIsReplacedSynonymFor.setText("Ignore if it is replaced synonym"); |
|
116 |
btnIgnoreIsReplacedSynonymFor.setSelection(true); |
|
117 |
|
|
118 |
btnIgnoreHasBasionym = new Button(this, SWT.CHECK); |
|
119 |
btnIgnoreHasBasionym.setText("Ignore if it has basionym"); |
|
120 |
btnIgnoreHasBasionym.setSelection(true); |
|
121 |
|
|
122 |
btnIgnoreHasReplacedSynonym = new Button(this, SWT.CHECK); |
|
123 |
btnIgnoreHasReplacedSynonym.setText("Ignore if it has replaced synonym"); |
|
124 |
btnIgnoreHasReplacedSynonym.setSelection(true); |
|
125 |
|
|
126 |
btnRemoveAllTypeDesignations = new Button(this, SWT.CHECK); |
|
127 |
btnRemoveAllTypeDesignations.setText("Remove all type designations"); |
|
128 |
btnRemoveAllTypeDesignations.setSelection(true); |
|
129 |
|
|
130 | 173 |
|
131 | 174 |
|
132 | 175 |
// createClassificationSelectionCombo(this); |
Also available in: Unified diff
smaller changes