Revision 5c5865f6
Added by Katja Luther almost 3 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportConfiguratorWizardPage.java | ||
---|---|---|
32 | 32 |
import org.eclipse.wb.swt.ResourceManager; |
33 | 33 |
|
34 | 34 |
import eu.etaxonomy.cdm.api.service.IClassificationService; |
35 |
import eu.etaxonomy.cdm.api.service.IReferenceService; |
|
35 | 36 |
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator; |
36 | 37 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
37 | 38 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
39 |
import eu.etaxonomy.cdm.model.reference.Reference; |
|
38 | 40 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
39 | 41 |
import eu.etaxonomy.taxeditor.databaseAdmin.wizard.AbstractPreferenceWizard; |
40 | 42 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
... | ... | |
61 | 63 |
private Button btnBrowseClassification; |
62 | 64 |
private Button btnClear; |
63 | 65 |
|
66 |
private Text textSource; |
|
67 |
private Button btnBrowseSource; |
|
68 |
private Button btnClearSource; |
|
69 |
|
|
64 | 70 |
private Abcd206ImportConfigurator abcdImportConfigurator; |
65 | 71 |
|
66 | 72 |
private List<URI> biocaseProvider = new ArrayList<>(); |
... | ... | |
122 | 128 |
//gridLayout.makeColumnsEqualWidth=true; |
123 | 129 |
composite.setLayout(gridLayout); |
124 | 130 |
|
125 |
Composite classificationComp = new Composite(composite, SWT.NULL); |
|
126 |
classificationComp.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1)); |
|
127 |
classificationComp.setLayout(new GridLayout(4, false)); |
|
131 |
Composite classificationAndSourceComp = new Composite(composite, SWT.NULL);
|
|
132 |
classificationAndSourceComp.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1));
|
|
133 |
classificationAndSourceComp.setLayout(new GridLayout(4, false));
|
|
128 | 134 |
|
129 |
Label labelClassification = new Label(classificationComp, SWT.TOP); |
|
135 |
Label labelClassification = new Label(classificationAndSourceComp, SWT.TOP);
|
|
130 | 136 |
labelClassification.setText("Classification"); |
131 | 137 |
// labelClassification.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1)); |
132 |
textClassification = new Text(classificationComp, SWT.BORDER); |
|
138 |
textClassification = new Text(classificationAndSourceComp, SWT.BORDER);
|
|
133 | 139 |
textClassification.setEnabled(false); |
134 | 140 |
textClassification.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, true)); |
135 | 141 |
if (abcdImportConfigurator.getClassificationUuid() != null){ |
... | ... | |
140 | 146 |
textClassification.setText(classification.getTitleCache()); |
141 | 147 |
} |
142 | 148 |
} |
143 |
btnBrowseClassification = new Button(classificationComp, SWT.NONE); |
|
149 |
btnBrowseClassification = new Button(classificationAndSourceComp, SWT.NONE);
|
|
144 | 150 |
btnBrowseClassification.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/open.gif")); |
145 | 151 |
btnBrowseClassification.addSelectionListener(new SelectionAdapter() { |
146 | 152 |
@Override |
... | ... | |
153 | 159 |
} |
154 | 160 |
} |
155 | 161 |
}); |
156 |
btnClear = new Button(classificationComp, SWT.NONE); |
|
162 |
btnClear = new Button(classificationAndSourceComp, SWT.NONE);
|
|
157 | 163 |
btnClear.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/trash.gif")); |
158 | 164 |
btnClear.addSelectionListener(new SelectionAdapter() { |
159 | 165 |
@Override |
... | ... | |
163 | 169 |
} |
164 | 170 |
}); |
165 | 171 |
|
172 |
|
|
173 |
|
|
166 | 174 |
Button checkBoxMoveToDefaultClassification = new Button(composite, SWT.CHECK); |
167 | 175 |
gridData = new GridData(); |
168 | 176 |
gridData.horizontalAlignment = GridData.FILL_HORIZONTAL; |
... | ... | |
448 | 456 |
checkBoxMediaSpecimen.setLayoutData(gridData); |
449 | 457 |
GridDataFactory.fillDefaults(); |
450 | 458 |
|
459 |
Label labelSource = new Label(composite, SWT.NONE); |
|
460 |
labelSource.setText("Source"); |
|
461 |
labelSource.setFont(font); |
|
462 |
gridData = new GridData(); |
|
463 |
gridData.horizontalAlignment = GridData.FILL; |
|
464 |
gridData.grabExcessHorizontalSpace=true; |
|
465 |
gridData.horizontalSpan = 2; |
|
466 |
labelSource.setLayoutData(gridData); |
|
467 |
|
|
468 |
Composite sourceComp = new Composite(composite, SWT.NULL); |
|
469 |
sourceComp.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 2, 1)); |
|
470 |
sourceComp.setLayout(new GridLayout(4, false)); |
|
471 |
Label labelSourceRef = new Label(sourceComp, SWT.TOP); |
|
472 |
labelSourceRef.setText("Source"); |
|
473 |
// labelClassification.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1)); |
|
474 |
textSource = new Text(sourceComp, SWT.BORDER); |
|
475 |
textSource.setEnabled(false); |
|
476 |
textSource.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, true)); |
|
477 |
if (abcdImportConfigurator.getSourceRefUuid() != null){ |
|
478 |
if (abcdImportConfigurator.getSourceReferenceTitle() != null){ |
|
479 |
textSource.setText(abcdImportConfigurator.getSourceReferenceTitle()); |
|
480 |
}else{ |
|
481 |
Reference sourceRef = CdmStore.getService(IReferenceService.class).load(abcdImportConfigurator.getSourceRefUuid()); |
|
482 |
textClassification.setText(sourceRef.getTitleCache()); |
|
483 |
} |
|
484 |
} |
|
485 |
btnBrowseSource = new Button(sourceComp, SWT.NONE); |
|
486 |
btnBrowseSource.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/open.gif")); |
|
487 |
btnBrowseSource.addSelectionListener(new SelectionAdapter() { |
|
488 |
@Override |
|
489 |
public void widgetSelected(SelectionEvent e) { |
|
490 |
Reference sourceRef = SelectionDialogFactory.getSelectionFromDialog(Reference.class,parent.getShell(), null, null); |
|
491 |
if(sourceRef!=null){ |
|
492 |
textSource.setText(sourceRef.getTitleCache()); |
|
493 |
abcdImportConfigurator.setSourceRefUuid(sourceRef.getUuid()); |
|
494 |
abcdImportConfigurator.setSourceReferenceTitle(sourceRef.getTitleCache()); |
|
495 |
} |
|
496 |
} |
|
497 |
}); |
|
498 |
btnClear = new Button(sourceComp, SWT.NONE); |
|
499 |
btnClear.setImage(ResourceManager.getPluginImage("eu.etaxonomy.taxeditor.store", "icons/trash.gif")); |
|
500 |
btnClear.addSelectionListener(new SelectionAdapter() { |
|
501 |
@Override |
|
502 |
public void widgetSelected(SelectionEvent e) { |
|
503 |
abcdImportConfigurator.setClassificationUuid(null); |
|
504 |
textClassification.setText(""); |
|
505 |
} |
|
506 |
}); |
|
451 | 507 |
|
452 | 508 |
setControl(composite); |
453 | 509 |
} |
Also available in: Unified diff
ref #8769: structure the configuration elements - add source