Revision f9b7a561
Added by Katja Luther almost 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/AbcdImportPreference.java | ||
---|---|---|
8 | 8 |
*/ |
9 | 9 |
package eu.etaxonomy.taxeditor.databaseAdmin.preferencePage; |
10 | 10 |
|
11 |
import java.net.URI; |
|
12 |
|
|
11 | 13 |
import org.eclipse.swt.SWT; |
12 | 14 |
import org.eclipse.swt.custom.CLabel; |
13 | 15 |
import org.eclipse.swt.events.SelectionAdapter; |
... | ... | |
19 | 21 |
import org.eclipse.swt.widgets.Combo; |
20 | 22 |
import org.eclipse.swt.widgets.Composite; |
21 | 23 |
import org.eclipse.swt.widgets.Control; |
24 |
import org.eclipse.swt.widgets.Label; |
|
25 |
import org.eclipse.swt.widgets.Text; |
|
22 | 26 |
|
23 | 27 |
import eu.etaxonomy.cdm.api.application.ICdmRepository; |
24 | 28 |
import eu.etaxonomy.cdm.api.service.IPreferenceService; |
... | ... | |
46 | 50 |
|
47 | 51 |
private boolean allowOverride = true; |
48 | 52 |
private CdmPreference preference = null; |
53 |
Text textDNAProviderString; |
|
49 | 54 |
|
50 | 55 |
@Override |
51 | 56 |
protected Control createContents(Composite parent) { |
... | ... | |
115 | 120 |
configurator.setGetSiblings(Boolean.valueOf(valueString)); |
116 | 121 |
}else if (keyString.equals("removeCountryFromLocalityText")){ //$NON-NLS-1$ |
117 | 122 |
configurator.setRemoveCountryFromLocalityText(Boolean.valueOf(valueString)); |
123 |
}else if (keyString.equals("dnaSource")){ //$NON-NLS-1$ |
|
124 |
configurator.setDnaSoure(URI.create(valueString)); |
|
118 | 125 |
} |
119 | 126 |
|
120 | 127 |
} |
... | ... | |
282 | 289 |
} |
283 | 290 |
}); |
284 | 291 |
|
292 |
Label labelRef = new Label(composite, SWT.NONE); |
|
293 |
labelRef.setText("Biocase provider for associated DNA"); |
|
294 |
new Label(composite, SWT.NONE); |
|
295 |
textDNAProviderString = new Text(composite, SWT.NONE); |
|
296 |
textDNAProviderString.setEnabled(true); |
|
297 |
textDNAProviderString.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1)); |
|
298 |
textDNAProviderString.setText(configurator.getDnaSoure().toString()); |
|
285 | 299 |
GridData gridData = new GridData(); |
286 | 300 |
gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false); |
287 | 301 |
gridData.horizontalIndent = 5; |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/abcd/AbcdImportConfiguratorWizardPageE4.java | ||
---|---|---|
15 | 15 |
import org.eclipse.swt.SWT; |
16 | 16 |
import org.eclipse.swt.events.SelectionAdapter; |
17 | 17 |
import org.eclipse.swt.events.SelectionEvent; |
18 |
import org.eclipse.swt.layout.GridData; |
|
18 | 19 |
import org.eclipse.swt.layout.GridLayout; |
19 | 20 |
import org.eclipse.swt.widgets.Button; |
20 | 21 |
import org.eclipse.swt.widgets.Composite; |
22 |
import org.eclipse.swt.widgets.Label; |
|
23 |
import org.eclipse.swt.widgets.Text; |
|
21 | 24 |
|
22 | 25 |
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator; |
23 | 26 |
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys; |
... | ... | |
33 | 36 |
public static final String PAGE_NAME = "AbcdImportConfiguratorWizardPage"; |
34 | 37 |
|
35 | 38 |
private Abcd206ImportConfigurator configurator; |
39 |
Text textDNAProviderString; |
|
36 | 40 |
|
37 | 41 |
@Inject |
38 | 42 |
public AbcdImportConfiguratorWizardPageE4() { |
... | ... | |
218 | 222 |
} |
219 | 223 |
}); |
220 | 224 |
|
225 |
Label labelRef = new Label(composite, SWT.NONE); |
|
226 |
labelRef.setText("Biocase provider for associated DNA"); |
|
227 |
new Label(composite, SWT.NONE); |
|
228 |
textDNAProviderString = new Text(composite, SWT.NONE); |
|
229 |
textDNAProviderString.setEnabled(true); |
|
230 |
textDNAProviderString.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1)); |
|
231 |
|
|
232 |
|
|
221 | 233 |
|
222 | 234 |
setControl(composite); |
223 | 235 |
} |
224 | 236 |
|
225 | 237 |
public void saveConfigToPrefernceStore() { |
226 |
|
|
238 |
//should use PreferencePredicate.AbcdImportConfig |
|
227 | 239 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_INDIVIDUALS_ASSOCIATIONS_SUCH_AS_SPECIMEN_AND_OBSERVATIONS, |
228 | 240 |
configurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations()); |
229 | 241 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_MEDIA_AS_MEDIASPECIMEN, |
... | ... | |
257 | 269 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_TAXA_WHEN_POSSIBLE, |
258 | 270 |
configurator.isReuseExistingTaxaWhenPossible()); |
259 | 271 |
|
272 |
PreferencesUtil.setStringValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DNA_PROVIDER, |
|
273 |
textDNAProviderString.getText()); |
|
260 | 274 |
} |
261 | 275 |
|
262 | 276 |
public String createConfigString(){ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportConfiguratorWizardPage.java | ||
---|---|---|
22 | 22 |
import org.eclipse.swt.widgets.Button; |
23 | 23 |
import org.eclipse.swt.widgets.Combo; |
24 | 24 |
import org.eclipse.swt.widgets.Composite; |
25 |
import org.eclipse.swt.widgets.Label; |
|
26 |
import org.eclipse.swt.widgets.Text; |
|
25 | 27 |
|
26 | 28 |
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator; |
27 | 29 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
... | ... | |
45 | 47 |
private boolean isPreferencePage = false; |
46 | 48 |
|
47 | 49 |
private Combo nomenclaturalCodeSelectionCombo; |
50 |
private Text textDNAProviderString; |
|
48 | 51 |
|
49 | 52 |
protected AbcdImportConfiguratorWizardPage(String title, String description, Abcd206ImportConfigurator configurator) { |
50 | 53 |
super(PAGE_NAME); |
... | ... | |
235 | 238 |
} |
236 | 239 |
}); |
237 | 240 |
|
241 |
Label labelRef = new Label(composite, SWT.NONE); |
|
242 |
labelRef.setText("Biocase provider for associated DNA"); |
|
243 |
new Label(composite, SWT.NONE); |
|
244 |
textDNAProviderString = new Text(composite, SWT.NONE); |
|
245 |
textDNAProviderString.setEnabled(true); |
|
246 |
textDNAProviderString.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1)); |
|
247 |
textDNAProviderString.setText(abcdImportConfigurator.getDnaSoure().toString()); |
|
248 |
|
|
238 | 249 |
GridData gridData = new GridData(); |
239 | 250 |
gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false); |
240 | 251 |
gridData.horizontalIndent = 5; |
... | ... | |
307 | 318 |
if ( abcdImportConfigurator.getNomenclaturalCode() != null){ |
308 | 319 |
PreferencesUtil.setStringValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_NOMENCLATURAL_CODE, abcdImportConfigurator.getNomenclaturalCode().getKey()); |
309 | 320 |
} |
321 |
if ( textDNAProviderString.getText() != null){ |
|
322 |
PreferencesUtil.setStringValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DNA_PROVIDER, textDNAProviderString.getText()); |
|
323 |
} |
|
310 | 324 |
|
311 | 325 |
|
312 | 326 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/PreferencesUtil.java | ||
---|---|---|
1667 | 1667 |
|
1668 | 1668 |
public static List<UUID> createUUIDListFromStringPref(String prefKey) { |
1669 | 1669 |
String prefValue = PreferencesUtil.getStringValue(prefKey); |
1670 |
if (prefValue == null){ |
|
1671 |
return null; |
|
1672 |
} |
|
1670 | 1673 |
String[] stringArray = prefValue.split(";"); |
1671 | 1674 |
List<UUID> uuidList = new ArrayList(); |
1672 | 1675 |
for (String uuid: stringArray){ |
Also available in: Unified diff
add dnaSource in abcd import wizard