Revision a63e71bd
Added by Katja Luther about 3 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportConfiguratorWizardPage.java | ||
---|---|---|
19 | 19 |
import org.eclipse.swt.events.SelectionAdapter; |
20 | 20 |
import org.eclipse.swt.events.SelectionEvent; |
21 | 21 |
import org.eclipse.swt.events.SelectionListener; |
22 |
import org.eclipse.swt.graphics.Font; |
|
23 |
import org.eclipse.swt.graphics.FontData; |
|
22 | 24 |
import org.eclipse.swt.layout.GridData; |
23 | 25 |
import org.eclipse.swt.layout.GridLayout; |
24 | 26 |
import org.eclipse.swt.widgets.Button; |
25 | 27 |
import org.eclipse.swt.widgets.Combo; |
26 | 28 |
import org.eclipse.swt.widgets.Composite; |
29 |
import org.eclipse.swt.widgets.Display; |
|
27 | 30 |
import org.eclipse.swt.widgets.Label; |
28 | 31 |
import org.eclipse.swt.widgets.Text; |
29 | 32 |
import org.eclipse.wb.swt.ResourceManager; |
... | ... | |
104 | 107 |
Composite composite = new Composite(parent, SWT.NULL); |
105 | 108 |
GridLayout gridLayout = new GridLayout(); |
106 | 109 |
gridLayout.numColumns=2; |
107 |
//gridLayout.makeColumnsEqualWidth=true; |
|
108 |
composite.setLayout(gridLayout); |
|
110 |
Label labelnewlyCreatedTaxa = new Label(composite, SWT.NONE); |
|
111 |
labelnewlyCreatedTaxa.setText("Newly Created Taxa"); |
|
112 |
Display display = Display.getDefault(); |
|
113 |
FontData data = display .getSystemFont().getFontData()[0]; |
|
114 |
Font font = new Font(display, data.getName(), data.getHeight(), SWT.BOLD); |
|
115 |
labelnewlyCreatedTaxa.setFont(font); |
|
109 | 116 |
GridData gridData = new GridData(); |
110 | 117 |
gridData.horizontalAlignment = GridData.FILL; |
111 | 118 |
gridData.grabExcessHorizontalSpace=true; |
112 | 119 |
gridData.horizontalSpan = 2; |
120 |
labelnewlyCreatedTaxa.setLayoutData(gridData); |
|
121 |
|
|
122 |
//gridLayout.makeColumnsEqualWidth=true; |
|
123 |
composite.setLayout(gridLayout); |
|
124 |
|
|
113 | 125 |
Composite classificationComp = new Composite(composite, SWT.NULL); |
114 | 126 |
classificationComp.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1)); |
115 | 127 |
classificationComp.setLayout(new GridLayout(4, false)); |
... | ... | |
151 | 163 |
} |
152 | 164 |
}); |
153 | 165 |
|
154 |
// Composite composite = new Composite(parent, SWT.NULL); |
|
155 |
// GridLayout gridLayout = new GridLayout(); |
|
156 |
// gridLayout.numColumns=2; |
|
157 |
// //gridLayout.makeColumnsEqualWidth=true; |
|
158 |
// composite.setLayout(gridLayout); |
|
159 |
// GridData gridData = new GridData(); |
|
160 |
// gridData.horizontalAlignment = GridData.FILL; |
|
161 |
// gridData.grabExcessHorizontalSpace=true; |
|
162 |
// gridData.horizontalSpan = 2; |
|
163 |
|
|
164 |
Button checkBoxMediaSpecimen = new Button(composite, SWT.CHECK); |
|
165 |
|
|
166 |
checkBoxMediaSpecimen.setSelection(abcdImportConfigurator.isAddMediaAsMediaSpecimen()); |
|
167 |
checkBoxMediaSpecimen.setText("Import media as media specimen"); |
|
168 |
checkBoxMediaSpecimen |
|
169 |
.setToolTipText("Any media attached to a ABCD unit will be imported as a sub derivative of the specimen created from this unit"); |
|
170 |
checkBoxMediaSpecimen.addSelectionListener(new SelectionAdapter() { |
|
171 |
@Override |
|
172 |
public void widgetSelected(SelectionEvent e) { |
|
173 |
abcdImportConfigurator.setAddMediaAsMediaSpecimen(!abcdImportConfigurator.isAddMediaAsMediaSpecimen()); |
|
174 |
} |
|
175 |
}); |
|
176 |
checkBoxMediaSpecimen.setLayoutData(gridData); |
|
166 |
Button checkBoxMoveToDefaultClassification = new Button(composite, SWT.CHECK); |
|
167 |
gridData = new GridData(); |
|
168 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
|
169 |
gridData.horizontalSpan = 2; |
|
170 |
checkBoxMoveToDefaultClassification.setLayoutData(gridData); |
|
171 |
GridDataFactory.fillDefaults(); |
|
172 |
checkBoxMoveToDefaultClassification.setSelection(abcdImportConfigurator.isMoveNewTaxaToDefaultClassification()); |
|
173 |
checkBoxMoveToDefaultClassification.setText("Create new classification for new taxa"); |
|
174 |
checkBoxMoveToDefaultClassification |
|
175 |
.setToolTipText("For taxa that do not exist in the data base " |
|
176 |
+ "a new classification will be created"); |
|
177 |
checkBoxMoveToDefaultClassification.addSelectionListener(new SelectionAdapter() { |
|
178 |
@Override |
|
179 |
public void widgetSelected(SelectionEvent e) { |
|
180 |
abcdImportConfigurator.setMoveNewTaxaToDefaultClassification(!abcdImportConfigurator.isMoveNewTaxaToDefaultClassification()); |
|
181 |
} |
|
182 |
}); |
|
183 |
|
|
184 |
Button checkBoxReuseExistingTaxa = new Button(composite, SWT.CHECK); |
|
185 |
gridData = new GridData(); |
|
186 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
|
187 |
gridData.horizontalSpan = 2; |
|
188 |
checkBoxReuseExistingTaxa.setLayoutData(gridData); |
|
189 |
GridDataFactory.fillDefaults(); |
|
190 |
checkBoxReuseExistingTaxa.setSelection(abcdImportConfigurator.isReuseExistingTaxaWhenPossible()); |
|
191 |
checkBoxReuseExistingTaxa.setText("Reuse existing taxa when possible"); |
|
192 |
checkBoxReuseExistingTaxa |
|
193 |
.setToolTipText("Reuse existing taxa when the name matches the identified name of the specimen"); |
|
194 |
checkBoxReuseExistingTaxa.addSelectionListener(new SelectionAdapter() { |
|
195 |
@Override |
|
196 |
public void widgetSelected(SelectionEvent e) { |
|
197 |
abcdImportConfigurator.setReuseExistingDescriptiveGroups(!abcdImportConfigurator.isReuseExistingDescriptiveGroups()); |
|
198 |
} |
|
199 |
}); |
|
200 |
|
|
201 |
Button checkBoxIgnoreAuthorship = new Button(composite, SWT.CHECK); |
|
202 |
gridData = new GridData(); |
|
203 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
|
204 |
gridData.horizontalSpan = 2; |
|
205 |
checkBoxIgnoreAuthorship.setLayoutData(gridData); |
|
206 |
GridDataFactory.fillDefaults(); |
|
207 |
checkBoxIgnoreAuthorship.setSelection(abcdImportConfigurator.isIgnoreAuthorship()); |
|
208 |
checkBoxIgnoreAuthorship.setText("Ignore Authorship for name matching"); |
|
209 |
checkBoxIgnoreAuthorship |
|
210 |
.setToolTipText("Name matching with existing names will be done without " |
|
211 |
+ "the authorship part of the name"); |
|
212 |
checkBoxIgnoreAuthorship.addSelectionListener(new SelectionAdapter() { |
|
213 |
@Override |
|
214 |
public void widgetSelected(SelectionEvent e) { |
|
215 |
abcdImportConfigurator.setIgnoreAuthorship(!abcdImportConfigurator.isIgnoreAuthorship()); |
|
216 |
} |
|
217 |
}); |
|
218 |
|
|
219 |
Label labelCode = new Label(composite, SWT.NONE); |
|
220 |
labelCode.setText("Nomenclatural Code"); |
|
221 |
gridData = new GridData(); |
|
222 |
gridData.horizontalAlignment=SWT.BEGINNING; |
|
223 |
|
|
224 |
labelCode.setLayoutData(gridData); |
|
177 | 225 |
GridDataFactory.fillDefaults(); |
226 |
nomenclaturalCodeSelectionCombo = new Combo(composite, SWT.BORDER| SWT.READ_ONLY); |
|
227 |
gridData = new GridData(); |
|
228 |
gridData.horizontalAlignment=SWT.BEGINNING; |
|
229 |
nomenclaturalCodeSelectionCombo.setLayoutData(gridData); |
|
230 |
GridDataFactory.fillDefaults(); |
|
231 |
for(NomenclaturalCode code: NomenclaturalCode.values()){ |
|
232 |
nomenclaturalCodeSelectionCombo.add(code.getKey()); |
|
233 |
} |
|
234 |
|
|
235 |
nomenclaturalCodeSelectionCombo.addSelectionListener(this); |
|
236 |
int index = 0; |
|
237 |
if (abcdImportConfigurator.getNomenclaturalCode() != null){ |
|
238 |
for (String label : nomenclaturalCodeSelectionCombo.getItems()){ |
|
239 |
if (label.equals(abcdImportConfigurator.getNomenclaturalCode().getKey())){ |
|
240 |
nomenclaturalCodeSelectionCombo.select(index); |
|
241 |
} |
|
242 |
index++; |
|
243 |
} |
|
244 |
} |
|
245 |
|
|
246 |
Label labelLinkToTaxon = new Label(composite, SWT.NONE); |
|
247 |
labelLinkToTaxon.setText("Link to Taxon"); |
|
248 |
labelLinkToTaxon.setFont(font); |
|
249 |
|
|
250 |
Button checkBoxAddIndividualsAssociations = new Button(composite, SWT.CHECK); |
|
251 |
gridData = new GridData(); |
|
252 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
|
253 |
gridData.horizontalSpan = 2; |
|
254 |
checkBoxAddIndividualsAssociations.setLayoutData(gridData); |
|
255 |
GridDataFactory.fillDefaults(); |
|
256 |
checkBoxAddIndividualsAssociations.setSelection(abcdImportConfigurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations()); |
|
257 |
checkBoxAddIndividualsAssociations.setText("Create an Individual Association for each Specimen"); |
|
258 |
checkBoxAddIndividualsAssociations |
|
259 |
.setToolTipText("For each specimen associated to a taxon an indiviadual association to this taxon is created"); |
|
260 |
checkBoxAddIndividualsAssociations.addSelectionListener(new SelectionAdapter() { |
|
261 |
@Override |
|
262 |
public void widgetSelected(SelectionEvent e) { |
|
263 |
abcdImportConfigurator.setAddIndividualsAssociationsSuchAsSpecimenAndObservations(!abcdImportConfigurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations()); |
|
264 |
} |
|
265 |
}); |
|
266 |
|
|
267 |
Button checkBoxReuseDescriptiveGroups = new Button(composite, SWT.CHECK); |
|
268 |
gridData = new GridData(); |
|
269 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
|
270 |
gridData.horizontalSpan = 2; |
|
271 |
checkBoxReuseDescriptiveGroups.setLayoutData(gridData); |
|
272 |
GridDataFactory.fillDefaults(); |
|
273 |
checkBoxReuseDescriptiveGroups.setSelection(abcdImportConfigurator.isReuseExistingDescriptiveGroups()); |
|
274 |
checkBoxReuseDescriptiveGroups.setText("Reuse existing descriptive group"); |
|
275 |
checkBoxReuseDescriptiveGroups |
|
276 |
.setToolTipText("Reuse one of the existing descriptive groups or create a new one for every import"); |
|
277 |
checkBoxReuseDescriptiveGroups.addSelectionListener(new SelectionAdapter() { |
|
278 |
@Override |
|
279 |
public void widgetSelected(SelectionEvent e) { |
|
280 |
abcdImportConfigurator.setReuseExistingDescriptiveGroups(!abcdImportConfigurator.isReuseExistingDescriptiveGroups()); |
|
281 |
} |
|
282 |
}); |
|
283 |
|
|
178 | 284 |
|
285 |
Label labelSpecimen = new Label(composite, SWT.NONE); |
|
286 |
labelSpecimen.setText("Specimen"); |
|
287 |
labelSpecimen.setFont(font); |
|
288 |
gridData = new GridData(); |
|
289 |
gridData.horizontalAlignment = GridData.FILL; |
|
290 |
gridData.grabExcessHorizontalSpace=true; |
|
291 |
gridData.horizontalSpan = 2; |
|
292 |
labelSpecimen.setLayoutData(gridData); |
|
293 |
GridDataFactory.fillDefaults(); |
|
179 | 294 |
Button checkBoxIgnoreExisting = new Button(composite, SWT.CHECK); |
180 | 295 |
gridData = new GridData(); |
181 | 296 |
gridData.horizontalAlignment = GridData.FILL; |
... | ... | |
196 | 311 |
checkBoxIgnoreExisting.setLayoutData(gridData); |
197 | 312 |
GridDataFactory.fillDefaults(); |
198 | 313 |
|
199 |
Button checkBoxIgnoreAuthorship = new Button(composite, SWT.CHECK); |
|
200 |
gridData = new GridData(); |
|
201 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
|
202 |
gridData.horizontalSpan = 2; |
|
203 |
checkBoxIgnoreAuthorship.setLayoutData(gridData); |
|
204 |
GridDataFactory.fillDefaults(); |
|
205 |
checkBoxIgnoreAuthorship.setSelection(abcdImportConfigurator.isIgnoreAuthorship()); |
|
206 |
checkBoxIgnoreAuthorship.setText("Ignore Authorship for name matching"); |
|
207 |
checkBoxIgnoreAuthorship |
|
208 |
.setToolTipText("Name matching with existing names will be done without " |
|
209 |
+ "the authorship part of the name"); |
|
210 |
checkBoxIgnoreAuthorship.addSelectionListener(new SelectionAdapter() { |
|
211 |
@Override |
|
212 |
public void widgetSelected(SelectionEvent e) { |
|
213 |
abcdImportConfigurator.setIgnoreAuthorship(!abcdImportConfigurator.isIgnoreAuthorship()); |
|
214 |
} |
|
215 |
}); |
|
216 |
|
|
217 |
|
|
218 | 314 |
Label unitIdLabel = new Label(composite, SWT.NONE); |
219 | 315 |
unitIdLabel.setText(Messages.AbcdImportPreference_map_unit_nr_catalog_number); |
220 | 316 |
|
... | ... | |
264 | 360 |
} |
265 | 361 |
}); |
266 | 362 |
|
267 |
Button checkBoxMoveToDefaultClassification = new Button(composite, SWT.CHECK); |
|
268 |
gridData = new GridData(); |
|
269 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
|
270 |
gridData.horizontalSpan = 2; |
|
271 |
checkBoxMoveToDefaultClassification.setLayoutData(gridData); |
|
272 |
GridDataFactory.fillDefaults(); |
|
273 |
checkBoxMoveToDefaultClassification.setSelection(abcdImportConfigurator.isMoveNewTaxaToDefaultClassification()); |
|
274 |
checkBoxMoveToDefaultClassification.setText("Create new classification for new taxa"); |
|
275 |
checkBoxMoveToDefaultClassification |
|
276 |
.setToolTipText("For taxa that do not exist in the data base " |
|
277 |
+ "a new classification will be created"); |
|
278 |
checkBoxMoveToDefaultClassification.addSelectionListener(new SelectionAdapter() { |
|
279 |
@Override |
|
280 |
public void widgetSelected(SelectionEvent e) { |
|
281 |
abcdImportConfigurator.setMoveNewTaxaToDefaultClassification(!abcdImportConfigurator.isMoveNewTaxaToDefaultClassification()); |
|
282 |
} |
|
283 |
}); |
|
363 |
|
|
284 | 364 |
|
285 | 365 |
Button checkBoxImportSiblings = new Button(composite, SWT.CHECK); |
286 | 366 |
gridData = new GridData(); |
... | ... | |
299 | 379 |
} |
300 | 380 |
}); |
301 | 381 |
|
302 |
Button checkBoxAddIndividualsAssociations = new Button(composite, SWT.CHECK); |
|
303 |
gridData = new GridData(); |
|
304 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
|
305 |
gridData.horizontalSpan = 2; |
|
306 |
checkBoxAddIndividualsAssociations.setLayoutData(gridData); |
|
307 |
GridDataFactory.fillDefaults(); |
|
308 |
checkBoxAddIndividualsAssociations.setSelection(abcdImportConfigurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations()); |
|
309 |
checkBoxAddIndividualsAssociations.setText("Create an Individual Association for each Specimen"); |
|
310 |
checkBoxAddIndividualsAssociations |
|
311 |
.setToolTipText("For each specimen associated to a taxon an indiviadual association to this taxon is created"); |
|
312 |
checkBoxAddIndividualsAssociations.addSelectionListener(new SelectionAdapter() { |
|
313 |
@Override |
|
314 |
public void widgetSelected(SelectionEvent e) { |
|
315 |
abcdImportConfigurator.setAddIndividualsAssociationsSuchAsSpecimenAndObservations(!abcdImportConfigurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations()); |
|
316 |
} |
|
317 |
}); |
|
318 | 382 |
|
319 |
Button checkBoxReuseDescriptiveGroups = new Button(composite, SWT.CHECK); |
|
320 |
gridData = new GridData(); |
|
321 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
|
322 |
gridData.horizontalSpan = 2; |
|
323 |
checkBoxReuseDescriptiveGroups.setLayoutData(gridData); |
|
324 |
GridDataFactory.fillDefaults(); |
|
325 |
checkBoxReuseDescriptiveGroups.setSelection(abcdImportConfigurator.isReuseExistingDescriptiveGroups()); |
|
326 |
checkBoxReuseDescriptiveGroups.setText("Reuse existing descriptive group"); |
|
327 |
checkBoxReuseDescriptiveGroups |
|
328 |
.setToolTipText("Reuse one of the existing descriptive groups or create a new one for every import"); |
|
329 |
checkBoxReuseDescriptiveGroups.addSelectionListener(new SelectionAdapter() { |
|
330 |
@Override |
|
331 |
public void widgetSelected(SelectionEvent e) { |
|
332 |
abcdImportConfigurator.setReuseExistingDescriptiveGroups(!abcdImportConfigurator.isReuseExistingDescriptiveGroups()); |
|
333 |
} |
|
334 |
}); |
|
335 | 383 |
|
336 |
Button checkBoxReuseExistingTaxa = new Button(composite, SWT.CHECK); |
|
337 |
gridData = new GridData(); |
|
338 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
|
339 |
gridData.horizontalSpan = 2; |
|
340 |
checkBoxReuseExistingTaxa.setLayoutData(gridData); |
|
341 |
GridDataFactory.fillDefaults(); |
|
342 |
checkBoxReuseExistingTaxa.setSelection(abcdImportConfigurator.isReuseExistingTaxaWhenPossible()); |
|
343 |
checkBoxReuseExistingTaxa.setText("Reuse existing taxa when possible"); |
|
344 |
checkBoxReuseExistingTaxa |
|
345 |
.setToolTipText("Reuse existing taxa when the name matches the identified name of the specimen"); |
|
346 |
checkBoxReuseExistingTaxa.addSelectionListener(new SelectionAdapter() { |
|
347 |
@Override |
|
348 |
public void widgetSelected(SelectionEvent e) { |
|
349 |
abcdImportConfigurator.setReuseExistingDescriptiveGroups(!abcdImportConfigurator.isReuseExistingDescriptiveGroups()); |
|
350 |
} |
|
351 |
}); |
|
352 | 384 |
|
353 | 385 |
|
354 | 386 |
if (!isFileImport){ |
... | ... | |
388 | 420 |
abcdImportConfigurator.setDnaSoure(null); |
389 | 421 |
} |
390 | 422 |
|
391 |
|
|
392 |
Label labelCode = new Label(composite, SWT.NONE);
|
|
393 |
labelCode.setText("Nomenclatural Code");
|
|
423 |
Label labelMedia = new Label(composite, SWT.NONE); |
|
424 |
labelMedia.setText("Media");
|
|
425 |
labelMedia.setFont(font);
|
|
394 | 426 |
gridData = new GridData(); |
395 |
gridData.horizontalAlignment=SWT.BEGINNING; |
|
427 |
gridData.horizontalAlignment = GridData.FILL; |
|
428 |
gridData.grabExcessHorizontalSpace=true; |
|
429 |
gridData.horizontalSpan = 2; |
|
430 |
labelMedia.setLayoutData(gridData); |
|
396 | 431 |
|
397 |
labelCode.setLayoutData(gridData); |
|
398 |
GridDataFactory.fillDefaults(); |
|
399 |
nomenclaturalCodeSelectionCombo = new Combo(composite, SWT.BORDER| SWT.READ_ONLY); |
|
432 |
|
|
433 |
Button checkBoxMediaSpecimen = new Button(composite, SWT.CHECK); |
|
434 |
|
|
435 |
checkBoxMediaSpecimen.setSelection(abcdImportConfigurator.isAddMediaAsMediaSpecimen()); |
|
436 |
checkBoxMediaSpecimen.setText("Import media as media specimen"); |
|
437 |
checkBoxMediaSpecimen |
|
438 |
.setToolTipText("Any media attached to a ABCD unit will be imported as a sub derivative of the specimen created from this unit"); |
|
439 |
checkBoxMediaSpecimen.addSelectionListener(new SelectionAdapter() { |
|
440 |
@Override |
|
441 |
public void widgetSelected(SelectionEvent e) { |
|
442 |
abcdImportConfigurator.setAddMediaAsMediaSpecimen(!abcdImportConfigurator.isAddMediaAsMediaSpecimen()); |
|
443 |
} |
|
444 |
}); |
|
400 | 445 |
gridData = new GridData(); |
401 |
gridData.horizontalAlignment=SWT.BEGINNING; |
|
402 |
nomenclaturalCodeSelectionCombo.setLayoutData(gridData); |
|
446 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
|
447 |
gridData.horizontalSpan = 2; |
|
448 |
checkBoxMediaSpecimen.setLayoutData(gridData); |
|
403 | 449 |
GridDataFactory.fillDefaults(); |
404 |
for(NomenclaturalCode code: NomenclaturalCode.values()){ |
|
405 |
nomenclaturalCodeSelectionCombo.add(code.getKey()); |
|
406 |
} |
|
407 | 450 |
|
408 |
nomenclaturalCodeSelectionCombo.addSelectionListener(this); |
|
409 |
int index = 0; |
|
410 |
if (abcdImportConfigurator.getNomenclaturalCode() != null){ |
|
411 |
for (String label : nomenclaturalCodeSelectionCombo.getItems()){ |
|
412 |
if (label.equals(abcdImportConfigurator.getNomenclaturalCode().getKey())){ |
|
413 |
nomenclaturalCodeSelectionCombo.select(index); |
|
414 |
} |
|
415 |
index++; |
|
416 |
} |
|
417 |
} |
|
418 | 451 |
|
419 | 452 |
setControl(composite); |
420 | 453 |
} |
Also available in: Unified diff
ref #8769: structure the configuration elements