Revision 9c128421
Added by Katja Luther over 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/AbcdImportProvider.java | ||
---|---|---|
19 | 19 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference; |
20 | 20 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
21 | 21 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
22 |
import eu.etaxonomy.taxeditor.preference.ListComponent; |
|
22 | 23 |
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage; |
23 | 24 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
24 | 25 |
|
... | ... | |
44 | 45 |
//gridLayout.makeColumnsEqualWidth = true; |
45 | 46 |
|
46 | 47 |
composite.setLayout(gridLayout); |
47 |
biocaseProviderList = new ListComponent(composite, SWT.SCROLL_LINE); |
|
48 |
biocaseProviderList = new ListComponent(composite, SWT.SCROLL_LINE, isAdminPreference);
|
|
48 | 49 |
setApply(true); |
49 | 50 |
return composite; |
50 | 51 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/GeneralAdminPreferencePage.java | ||
---|---|---|
57 | 57 |
service.set(pref); |
58 | 58 |
} |
59 | 59 |
|
60 |
if(isShowCheckListPerspective == null){
|
|
60 |
if(isShowTaxonNodeWizard == null){
|
|
61 | 61 |
service.remove(CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.ShowTaxonNodeWizard)); |
62 | 62 |
}else{ |
63 | 63 |
pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowTaxonNodeWizard, Boolean.toString(this.isShowTaxonNodeWizard)); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/ListComponent.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2017 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.taxeditor.databaseAdmin.preferencePage; |
|
10 |
|
|
11 |
|
|
12 |
import java.awt.Toolkit; |
|
13 |
|
|
14 |
import javax.swing.event.DocumentEvent; |
|
15 |
|
|
16 |
import org.apache.commons.lang.StringUtils; |
|
17 |
import org.eclipse.swt.SWT; |
|
18 |
import org.eclipse.swt.events.MouseEvent; |
|
19 |
import org.eclipse.swt.events.MouseListener; |
|
20 |
import org.eclipse.swt.graphics.Rectangle; |
|
21 |
import org.eclipse.swt.layout.GridData; |
|
22 |
import org.eclipse.swt.widgets.Button; |
|
23 |
import org.eclipse.swt.widgets.Composite; |
|
24 |
import org.eclipse.swt.widgets.List; |
|
25 |
import org.eclipse.swt.widgets.Text; |
|
26 |
|
|
27 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference; |
|
28 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
|
29 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
|
30 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
|
31 |
|
|
32 |
|
|
33 |
/** |
|
34 |
* @author k.luther |
|
35 |
* @date 20.04.2017 |
|
36 |
* |
|
37 |
*/ |
|
38 |
public class ListComponent |
|
39 |
{ |
|
40 |
private List list; |
|
41 |
|
|
42 |
private static final String addString = Messages.ListComponent_ADD_PROVIDER; |
|
43 |
private static final String removeString = Messages.ListComponent_REMOVE_PROVIDER; |
|
44 |
private static final String noProvider = Messages.ListComponent_NO_PROVIDER_AVAILABLE; |
|
45 |
private Button removeButton; |
|
46 |
private Text providerURI; |
|
47 |
|
|
48 |
public ListComponent(Composite parent, int style) { |
|
49 |
|
|
50 |
list = new List(parent, SWT.BORDER | SWT.V_SCROLL); |
|
51 |
GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, true, 2, 3); |
|
52 |
gridData.grabExcessHorizontalSpace = true; |
|
53 |
list.setLayoutData(gridData); |
|
54 |
|
|
55 |
Rectangle clientArea = parent.getShell().getClientArea (); |
|
56 |
list.setBounds (clientArea.x, clientArea.y, 50, 500); |
|
57 |
|
|
58 |
CdmPreference providerListPreference = PreferencesUtil.getPreferenceFromDB(PreferencePredicate.BioCaseProvider); |
|
59 |
String allProviderString = ""; //$NON-NLS-1$ |
|
60 |
if (providerListPreference != null){ |
|
61 |
allProviderString = providerListPreference.getValue(); |
|
62 |
} |
|
63 |
// = PreferencesUtil.getPreferenceStore().getString(IPreferenceKeys.BIOCASE_PROVIDER_LIST); |
|
64 |
//the string is structured like this: http://ww3.bgbm.org/biocase/pywrapper.cgi?dsa=DNA_Bank;http:...; |
|
65 |
String[] providerArray = allProviderString.split(";"); //$NON-NLS-1$ |
|
66 |
for (String providerString : providerArray){ |
|
67 |
if (!StringUtils.isBlank(providerString)){ |
|
68 |
list.add(providerString); |
|
69 |
} |
|
70 |
} |
|
71 |
if (list.getItemCount() == 0){ |
|
72 |
list.add(noProvider); |
|
73 |
} |
|
74 |
list.add(""); //$NON-NLS-1$ |
|
75 |
|
|
76 |
// list.setSelection(0); |
|
77 |
GridData dataList = new GridData(); |
|
78 |
dataList.horizontalAlignment = GridData.FILL; |
|
79 |
dataList.horizontalSpan = 3; |
|
80 |
|
|
81 |
|
|
82 |
// dataList.grabExcessVerticalSpace = true; |
|
83 |
|
|
84 |
list.setLayoutData(dataList); |
|
85 |
|
|
86 |
|
|
87 |
providerURI = new Text(parent, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION); |
|
88 |
GridData dataProviderUri = new GridData(); |
|
89 |
dataProviderUri.horizontalAlignment = GridData.FILL; |
|
90 |
dataProviderUri.horizontalSpan = 3; |
|
91 |
providerURI.setLayoutData(dataProviderUri); |
|
92 |
|
|
93 |
Button addButton = new Button(parent, SWT.NULL); |
|
94 |
AddListener addListener = new AddListener(addButton); |
|
95 |
addButton.setText(addString); |
|
96 |
addButton.addMouseListener(addListener); |
|
97 |
|
|
98 |
removeButton = new Button(parent, SWT.NULL); |
|
99 |
removeButton.setText(removeString); |
|
100 |
removeButton.addMouseListener(new RemoveListener()); |
|
101 |
} |
|
102 |
|
|
103 |
class RemoveListener implements MouseListener { |
|
104 |
@Override |
|
105 |
public void mouseUp(MouseEvent e) { |
|
106 |
//This method can be called only if |
|
107 |
//there's a valid selection |
|
108 |
//so go ahead and remove whatever's selected. |
|
109 |
int index = list.getSelectionIndex(); |
|
110 |
list.remove(index); |
|
111 |
|
|
112 |
int size = list.getItemCount(); |
|
113 |
|
|
114 |
if (size == 0) { //Nothing's left, disable removing. |
|
115 |
removeButton.setEnabled(false); |
|
116 |
|
|
117 |
} else { //Select an index. |
|
118 |
if (index == size) { |
|
119 |
//removed item in last position |
|
120 |
index--; |
|
121 |
} |
|
122 |
|
|
123 |
list.setSelection(index-1); |
|
124 |
|
|
125 |
|
|
126 |
} |
|
127 |
} |
|
128 |
/** |
|
129 |
* {@inheritDoc} |
|
130 |
*/ |
|
131 |
@Override |
|
132 |
public void mouseDoubleClick(MouseEvent e) { |
|
133 |
// TODO Auto-generated method stub |
|
134 |
|
|
135 |
} |
|
136 |
|
|
137 |
|
|
138 |
/** |
|
139 |
* {@inheritDoc} |
|
140 |
*/ |
|
141 |
@Override |
|
142 |
public void mouseDown(MouseEvent e) { |
|
143 |
// TODO Auto-generated method stub |
|
144 |
|
|
145 |
} |
|
146 |
} |
|
147 |
|
|
148 |
//This listener is shared by the text field and the add button. |
|
149 |
class AddListener implements MouseListener { |
|
150 |
private boolean alreadyEnabled = false; |
|
151 |
private Button button; |
|
152 |
|
|
153 |
public AddListener(Button button) { |
|
154 |
this.button = button; |
|
155 |
} |
|
156 |
|
|
157 |
|
|
158 |
protected boolean alreadyInList(String name) { |
|
159 |
return list.getData(name) != null; |
|
160 |
} |
|
161 |
|
|
162 |
|
|
163 |
private void enableButton() { |
|
164 |
if (!alreadyEnabled) { |
|
165 |
button.setEnabled(true); |
|
166 |
} |
|
167 |
} |
|
168 |
|
|
169 |
private boolean handleEmptyTextField(DocumentEvent e) { |
|
170 |
if (e.getDocument().getLength() <= 0) { |
|
171 |
button.setEnabled(false); |
|
172 |
alreadyEnabled = false; |
|
173 |
return true; |
|
174 |
} |
|
175 |
return false; |
|
176 |
} |
|
177 |
|
|
178 |
|
|
179 |
|
|
180 |
/** |
|
181 |
* {@inheritDoc} |
|
182 |
*/ |
|
183 |
@Override |
|
184 |
public void mouseDoubleClick(MouseEvent e) { |
|
185 |
// TODO Auto-generated method stub |
|
186 |
|
|
187 |
} |
|
188 |
|
|
189 |
/** |
|
190 |
* {@inheritDoc} |
|
191 |
*/ |
|
192 |
@Override |
|
193 |
public void mouseDown(MouseEvent e) { |
|
194 |
// TODO Auto-generated method stub |
|
195 |
|
|
196 |
} |
|
197 |
|
|
198 |
/** |
|
199 |
* {@inheritDoc} |
|
200 |
*/ |
|
201 |
@Override |
|
202 |
public void mouseUp(MouseEvent event) { |
|
203 |
String name = providerURI.getText(); |
|
204 |
|
|
205 |
//User didn't type in a unique name... |
|
206 |
if (name.equals("") || alreadyInList(name)) { //$NON-NLS-1$ |
|
207 |
Toolkit.getDefaultToolkit().beep(); |
|
208 |
providerURI.selectAll(); |
|
209 |
return; |
|
210 |
} |
|
211 |
|
|
212 |
int index = list.getSelectionIndex(); //get selected index |
|
213 |
if (index == -1) { //no selection, so insert at beginning |
|
214 |
index = 0; |
|
215 |
} else { //add after the selected item |
|
216 |
index++; |
|
217 |
} |
|
218 |
if(list.getItemCount() == 0){ |
|
219 |
index = 0; |
|
220 |
}else if (list.getItem(0).equals(noProvider)){ |
|
221 |
list.remove(noProvider); |
|
222 |
} |
|
223 |
int itemCount = list.getItemCount(); |
|
224 |
|
|
225 |
|
|
226 |
list.add(providerURI.getText(), index); |
|
227 |
list.setSelection(index); |
|
228 |
list.update(); |
|
229 |
list.redraw(); |
|
230 |
|
|
231 |
//Select the new item |
|
232 |
|
|
233 |
providerURI.setText(""); //$NON-NLS-1$ |
|
234 |
|
|
235 |
} |
|
236 |
} |
|
237 |
|
|
238 |
public String createAllProviderString(){ |
|
239 |
String allProviderString = null; |
|
240 |
boolean first = true; |
|
241 |
for (String item: list.getItems()){ |
|
242 |
if (first || allProviderString == null || allProviderString == ""){ //$NON-NLS-1$ |
|
243 |
allProviderString = item.trim(); |
|
244 |
first = false; |
|
245 |
}else{ |
|
246 |
allProviderString +=";"+ item.trim(); //$NON-NLS-1$ |
|
247 |
} |
|
248 |
} |
|
249 |
|
|
250 |
return allProviderString; |
|
251 |
|
|
252 |
} |
|
253 |
|
|
254 |
|
|
255 |
|
|
256 |
} |
|
257 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/RankAdminPreference.java | ||
---|---|---|
44 | 44 |
if (!isApply()){ |
45 | 45 |
return true; |
46 | 46 |
} |
47 |
if (pref == null){ |
|
47 |
int index = useLocalOrAdmin.getSelectionIndex(); |
|
48 |
if (pref == null && index == 0){ |
|
48 | 49 |
PreferencesUtil.setPreferenceToDB(CdmPreference.NewTaxEditorInstance(PreferencePredicate.AvailableRanks, null)); |
49 | 50 |
PreferencesUtil.updateDBPreferences(); |
50 | 51 |
PreferencesUtil.firePreferencesChanged(this.getClass()); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/SearchDialogAdminPreferences.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2019 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.taxeditor.databaseAdmin.preferencePage; |
|
10 |
|
|
11 |
import eu.etaxonomy.cdm.api.application.ICdmRepository; |
|
12 |
import eu.etaxonomy.cdm.api.service.IPreferenceService; |
|
13 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference; |
|
14 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
|
15 |
import eu.etaxonomy.taxeditor.preference.SearchDialogPreferences; |
|
16 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
17 |
|
|
18 |
/** |
|
19 |
* @author k.luther |
|
20 |
* @since 08.08.2019 |
|
21 |
*/ |
|
22 |
public class SearchDialogAdminPreferences extends SearchDialogPreferences implements IE4AdminPreferencePage { |
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
@Override |
|
28 |
public void getValues(){ |
|
29 |
super.getValues(); |
|
30 |
if(showIdInSelectionDialogPref != null){ |
|
31 |
showIdInSelectionDialog = Boolean.parseBoolean(showIdInSelectionDialogPref.getValue()); |
|
32 |
}else{ |
|
33 |
showIdInSelectionDialog = null; |
|
34 |
showIdInSelectionDialogPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowIdInSelectionDialog, null); |
|
35 |
} |
|
36 |
if (searchForIdentifierAsDefaultPref != null){ |
|
37 |
searchForIdentifierAsDefault = Boolean.parseBoolean(searchForIdentifierAsDefaultPref.getValue()); |
|
38 |
}else{ |
|
39 |
searchForIdentifierAsDefault = null; |
|
40 |
searchForIdentifierAsDefaultPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.SearchForIdentifierAsDefault, null); |
|
41 |
} |
|
42 |
if (searchForIdentifierAndTitleCachePref != null){ |
|
43 |
searchForIdentifierAndTitleCache = Boolean.parseBoolean(searchForIdentifierAndTitleCachePref.getValue()); |
|
44 |
}else{ |
|
45 |
searchForIdentifierAndTitleCache = null; |
|
46 |
searchForIdentifierAndTitleCachePref =CdmPreference.NewTaxEditorInstance(PreferencePredicate.SearchForIdentifierAndTitleCache, null); |
|
47 |
} |
|
48 |
if (sortTaxaByRankAndNamePref != null){ |
|
49 |
sortTaxaByRankAndName = Boolean.parseBoolean(sortTaxaByRankAndNamePref.getValue()); |
|
50 |
}else{ |
|
51 |
sortTaxaByRankAndName = null; |
|
52 |
sortTaxaByRankAndNamePref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.SortTaxaByRankAndName, null); |
|
53 |
} |
|
54 |
if (filterCommonNameReferencesPref != null){ |
|
55 |
filterCommonNameReferences = Boolean.parseBoolean(filterCommonNameReferencesPref.getValue()); |
|
56 |
}else{ |
|
57 |
filterCommonNameReferences = null; |
|
58 |
filterCommonNameReferencesPref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.CommonNameReferencesWithMarker, null); |
|
59 |
} |
|
60 |
} |
|
61 |
|
|
62 |
@Override |
|
63 |
public boolean performOk(){ |
|
64 |
if (!isApply()){ |
|
65 |
return true; |
|
66 |
} |
|
67 |
ICdmRepository controller = CdmStore.getCurrentApplicationConfiguration(); |
|
68 |
if (controller != null){ |
|
69 |
IPreferenceService service = controller.getPreferenceService(); |
|
70 |
CdmPreference pref; |
|
71 |
if (showIdInSelectionDialog != null || !showIdInSelectionDialogPref.isAllowOverride()) { |
|
72 |
pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.ShowIdInSelectionDialog, showIdInSelectionDialog != null? showIdInSelectionDialog.toString():null); |
|
73 |
pref.setAllowOverride(showIdInSelectionDialogPref.isAllowOverride()); |
|
74 |
service.set(pref); |
|
75 |
}else{ |
|
76 |
service.remove(showIdInSelectionDialogPref.getKey()); |
|
77 |
} |
|
78 |
|
|
79 |
|
|
80 |
if(searchForIdentifierAsDefault != null || !searchForIdentifierAsDefaultPref.isAllowOverride()){ |
|
81 |
pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.SearchForIdentifierAsDefault, searchForIdentifierAsDefault!= null? searchForIdentifierAsDefault.toString():null); |
|
82 |
pref.setAllowOverride(searchForIdentifierAsDefaultPref.isAllowOverride()); |
|
83 |
service.set(pref); |
|
84 |
}else{ |
|
85 |
service.remove(searchForIdentifierAsDefaultPref.getKey()); |
|
86 |
} |
|
87 |
|
|
88 |
|
|
89 |
if(searchForIdentifierAndTitleCache != null){ |
|
90 |
pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.SearchForIdentifierAndTitleCache, searchForIdentifierAndTitleCache!= null? searchForIdentifierAndTitleCache.toString():null); |
|
91 |
pref.setAllowOverride(searchForIdentifierAndTitleCachePref.isAllowOverride()); |
|
92 |
service.set(pref); |
|
93 |
}else{ |
|
94 |
service.remove(searchForIdentifierAndTitleCachePref.getKey()); |
|
95 |
} |
|
96 |
|
|
97 |
if(sortTaxaByRankAndName != null){ |
|
98 |
|
|
99 |
pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.SortTaxaByRankAndName, sortTaxaByRankAndName!= null? sortTaxaByRankAndName.toString():null); |
|
100 |
pref.setAllowOverride(sortTaxaByRankAndNamePref.isAllowOverride()); |
|
101 |
service.set(pref); |
|
102 |
}else{ |
|
103 |
service.remove(sortTaxaByRankAndNamePref.getKey()); |
|
104 |
} |
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
if(filterCommonNameReferences != null){ |
|
109 |
pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.CommonNameReferencesWithMarker, filterCommonNameReferences!= null? filterCommonNameReferences.toString():null); |
|
110 |
pref.setAllowOverride(filterCommonNameReferencesPref.isAllowOverride()); |
|
111 |
service.set(pref); |
|
112 |
}else{ |
|
113 |
service.remove(filterCommonNameReferencesPref.getKey()); |
|
114 |
} |
|
115 |
} |
|
116 |
|
|
117 |
return true; |
|
118 |
} |
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java | ||
---|---|---|
433 | 433 |
if (configurator instanceof CdmLightExportConfigurator){ |
434 | 434 |
isZip = ((CdmLightExportConfigurator)configurator).isCreateZipFile(); |
435 | 435 |
} |
436 |
AbstractUtility.executeMoniteredExport("Export: " + configurator.getClass().getSimpleName(),
|
|
436 |
AbstractUtility.executeMoniteredExport(configurator.getUserFriendlyIOName(),
|
|
437 | 437 |
uuid, |
438 | 438 |
1000, |
439 | 439 |
true, |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/abcd/AbcdImportConfiguratorWizardPageE4.java | ||
---|---|---|
23 | 23 |
import org.eclipse.swt.widgets.Text; |
24 | 24 |
|
25 | 25 |
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator; |
26 |
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
|
|
26 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate;
|
|
27 | 27 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
28 | 28 |
|
29 | 29 |
/** |
... | ... | |
235 | 235 |
} |
236 | 236 |
|
237 | 237 |
public void saveConfigToPrefernceStore() { |
238 |
//should use PreferencePredicate.AbcdImportConfig |
|
239 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_INDIVIDUALS_ASSOCIATIONS_SUCH_AS_SPECIMEN_AND_OBSERVATIONS, |
|
240 |
configurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations()); |
|
241 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_MEDIA_AS_MEDIASPECIMEN, |
|
242 |
configurator.isAddMediaAsMediaSpecimen()); |
|
243 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ALLOW_REUSE_OTHER_CLASSIFICATIONS, |
|
244 |
configurator.isAllowReuseOtherClassifications()); |
|
245 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_CLASSIFICATIONS, |
|
246 |
configurator.isDeduplicateClassifications()); |
|
247 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_REFERENCES, |
|
248 |
configurator.isDeduplicateReferences()); |
|
249 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DO_SIBLINGS, |
|
250 |
configurator.isGetSiblings()); |
|
251 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_IGNORE_AUTHORSHIP, |
|
252 |
configurator.isIgnoreAuthorship()); |
|
253 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_IGNORE_IMPORT_OF_EXISTING_SPECIMEN, |
|
254 |
configurator.isIgnoreImportOfExistingSpecimen()); |
|
255 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_ACCESSION_NUMBER, |
|
256 |
configurator.isMapUnitIdToAccessionNumber()); |
|
257 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_BARCODE, |
|
258 |
configurator.isMapUnitIdToBarcode()); |
|
259 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TOCATALOG_NUMBER, |
|
260 |
configurator.isMapUnitIdToCatalogNumber()); |
|
261 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MOVE_NEW_TAXA_TO_DEFAULT_CLASSIFICATION, |
|
262 |
configurator.isMoveNewTaxaToDefaultClassification()); |
|
263 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_OVERWRITE_EXISTING_SPECIMEN, |
|
264 |
configurator.isOverwriteExistingSpecimens()); |
|
265 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_DESCRIPTIVE_GROUPS, |
|
266 |
configurator.isReuseExistingDescriptiveGroups()); |
|
267 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_META_DATA, |
|
268 |
configurator.isReuseExistingMetaData()); |
|
269 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_TAXA_WHEN_POSSIBLE, |
|
270 |
configurator.isReuseExistingTaxaWhenPossible()); |
|
271 |
|
|
272 |
PreferencesUtil.setStringValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DNA_PROVIDER, |
|
273 |
textDNAProviderString.getText()); |
|
238 |
PreferencesUtil.setStringValue(PreferencePredicate.AbcdImportConfig.getKey(), configurator.toString()); |
|
239 |
|
|
274 | 240 |
} |
275 | 241 |
|
276 | 242 |
public String createConfigString(){ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportConfiguratorWizardPage.java | ||
---|---|---|
26 | 26 |
import org.eclipse.swt.widgets.Text; |
27 | 27 |
|
28 | 28 |
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator; |
29 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
|
29 | 30 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
30 | 31 |
import eu.etaxonomy.taxeditor.databaseAdmin.wizard.AbstractPreferenceWizard; |
31 |
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys; |
|
32 | 32 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
33 | 33 |
|
34 | 34 |
/** |
... | ... | |
283 | 283 |
} |
284 | 284 |
|
285 | 285 |
public void saveConfigToPrefernceStore() { |
286 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_INDIVIDUALS_ASSOCIATIONS_SUCH_AS_SPECIMEN_AND_OBSERVATIONS, |
|
287 |
abcdImportConfigurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations()); |
|
288 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_MEDIA_AS_MEDIASPECIMEN, |
|
289 |
abcdImportConfigurator.isAddMediaAsMediaSpecimen()); |
|
290 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ALLOW_REUSE_OTHER_CLASSIFICATIONS, |
|
291 |
abcdImportConfigurator.isAllowReuseOtherClassifications()); |
|
292 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_CLASSIFICATIONS, |
|
293 |
abcdImportConfigurator.isDeduplicateClassifications()); |
|
294 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REMOVE_COUNTRY_FROM_LOCALITY_TEXT, |
|
295 |
abcdImportConfigurator.isRemoveCountryFromLocalityText()); |
|
296 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_REFERENCES, |
|
297 |
abcdImportConfigurator.isDeduplicateReferences()); |
|
298 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DO_SIBLINGS, |
|
299 |
abcdImportConfigurator.isGetSiblings()); |
|
300 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_IGNORE_AUTHORSHIP, |
|
301 |
abcdImportConfigurator.isIgnoreAuthorship()); |
|
302 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_IGNORE_IMPORT_OF_EXISTING_SPECIMEN, |
|
303 |
abcdImportConfigurator.isIgnoreImportOfExistingSpecimen()); |
|
304 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_ACCESSION_NUMBER, |
|
305 |
abcdImportConfigurator.isMapUnitIdToAccessionNumber()); |
|
306 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_BARCODE, |
|
307 |
abcdImportConfigurator.isMapUnitIdToBarcode()); |
|
308 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TOCATALOG_NUMBER, |
|
309 |
abcdImportConfigurator.isMapUnitIdToCatalogNumber()); |
|
310 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MOVE_NEW_TAXA_TO_DEFAULT_CLASSIFICATION, |
|
311 |
abcdImportConfigurator.isMoveNewTaxaToDefaultClassification()); |
|
312 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_OVERWRITE_EXISTING_SPECIMEN, |
|
313 |
abcdImportConfigurator.isOverwriteExistingSpecimens()); |
|
314 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_DESCRIPTIVE_GROUPS, |
|
315 |
abcdImportConfigurator.isReuseExistingDescriptiveGroups()); |
|
316 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_META_DATA, |
|
317 |
abcdImportConfigurator.isReuseExistingMetaData()); |
|
318 |
PreferencesUtil.setBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_TAXA_WHEN_POSSIBLE, |
|
319 |
abcdImportConfigurator.isReuseExistingTaxaWhenPossible()); |
|
320 |
if ( abcdImportConfigurator.getNomenclaturalCode() != null){ |
|
321 |
PreferencesUtil.setStringValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_NOMENCLATURAL_CODE, abcdImportConfigurator.getNomenclaturalCode().getKey()); |
|
322 |
} |
|
323 |
if ( textDNAProviderString.getText() != null){ |
|
324 |
PreferencesUtil.setStringValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DNA_PROVIDER, textDNAProviderString.getText()); |
|
325 |
} |
|
286 |
PreferencesUtil.setStringValue(PreferencePredicate.AbcdImportConfig.getKey(), abcdImportConfigurator.toString()); |
|
326 | 287 |
|
327 | 288 |
|
328 | 289 |
} |
... | ... | |
344 | 305 |
} |
345 | 306 |
|
346 | 307 |
public void createAbcdImportConfig() { |
347 |
this.abcdImportConfigurator.setAddIndividualsAssociationsSuchAsSpecimenAndObservations(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_INDIVIDUALS_ASSOCIATIONS_SUCH_AS_SPECIMEN_AND_OBSERVATIONS)); |
|
348 |
this.abcdImportConfigurator.setAddMediaAsMediaSpecimen(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ADD_MEDIA_AS_MEDIASPECIMEN)); |
|
349 |
this.abcdImportConfigurator.setAllowReuseOtherClassifications(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_ALLOW_REUSE_OTHER_CLASSIFICATIONS)); |
|
350 |
//this.abcdImportConfigurator.setClassificationUuid(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_CLASSIFICATION_UUID)); |
|
351 |
this.abcdImportConfigurator.setDeduplicateClassifications(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_CLASSIFICATIONS)); |
|
352 |
this.abcdImportConfigurator.setDeduplicateReferences(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_REFERENCES)); |
|
353 |
// this.abcdImportConfigurator.setDefaultAuthor(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DEFAULT_AUTHOR)); |
|
354 |
this.abcdImportConfigurator.setGetSiblings(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_DO_SIBLINGS)); |
|
355 |
this.abcdImportConfigurator.setIgnoreAuthorship(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_IGNORE_AUTHORSHIP)); |
|
356 |
this.abcdImportConfigurator.setIgnoreImportOfExistingSpecimen(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_IGNORE_IMPORT_OF_EXISTING_SPECIMEN)); |
|
357 |
this.abcdImportConfigurator.setMapUnitIdToAccessionNumber(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_ACCESSION_NUMBER)); |
|
358 |
this.abcdImportConfigurator.setMapUnitIdToBarcode(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_BARCODE)); |
|
359 |
this.abcdImportConfigurator.setMapUnitIdToCatalogNumber(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TOCATALOG_NUMBER)); |
|
360 |
this.abcdImportConfigurator.setMoveNewTaxaToDefaultClassification(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_MOVE_NEW_TAXA_TO_DEFAULT_CLASSIFICATION)); |
|
361 |
this.abcdImportConfigurator.setReuseExistingDescriptiveGroups(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_DESCRIPTIVE_GROUPS)); |
|
362 |
this.abcdImportConfigurator.setReuseExistingTaxaWhenPossible(PreferencesUtil.getBooleanValue(IPreferenceKeys.ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_TAXA_WHEN_POSSIBLE)); |
|
308 |
this.abcdImportConfigurator = PreferencesUtil.getLocalAbcdImportConfigurator(); |
|
363 | 309 |
|
364 | 310 |
} |
365 | 311 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java | ||
---|---|---|
322 | 322 |
public static String DatabasePreferencesPage_Specimen_Or_Observation; |
323 | 323 |
public static String DatabasePreferencesPage_SetPublishFlag; |
324 | 324 |
|
325 |
public static String DatabasePreferncesPage_Show_Id_In_SelectionDialog; |
|
326 |
public static String DatabasePreferncesPage_Search_for_identifier_as_default; |
|
327 |
public static String DatabasePreferncesPage_search_for_identifier_and_titleCache; |
|
328 |
public static String DatabasePreferncesPage_Sort_Taxa_By_Name_And_Rank; |
|
329 |
public static String DatabasePreferncesPage_CommonNameFilter; |
|
330 |
|
|
325 | 331 |
public static String ImportFromFileAndChooseVocIdWizardPage_AreaVoc; |
326 | 332 |
public static String ImportFromFileAndChooseVocIdWizardOage_AreaVoc_toolTip; |
327 | 333 |
|
... | ... | |
661 | 667 |
public static String Preference_Use_Default; |
662 | 668 |
|
663 | 669 |
|
670 |
|
|
671 |
|
|
672 |
|
|
664 | 673 |
static { |
665 | 674 |
// initialize resource bundle |
666 | 675 |
NLS.initializeMessages(BUNDLE_NAME, Messages.class); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties | ||
---|---|---|
460 | 460 |
DatabasePreferncesPage_Show_ChecklistPerspective=Show Checklist Perspective as default Perspective |
461 | 461 |
DatabasePreferncesPage_Show_TaxonNodeWizard=Taxon Nodes can be edited in Wizard |
462 | 462 |
|
463 |
DatabasePreferncesPage_Show_Id_In_SelectionDialog=Show ID in selection dialogs |
|
464 |
DatabasePreferncesPage_Search_for_identifier_as_default=Use identifier search as default |
|
465 |
DatabasePreferncesPage_search_for_identifier_and_titleCache=Search also for titlecache if identifier search is activated |
|
466 |
DatabasePreferncesPage_Sort_Taxa_By_Name_And_Rank=Sort taxa by rank and name |
|
467 |
DatabasePreferncesPage_CommonNameFilter=Filter common name references |
|
468 |
|
|
463 | 469 |
Distribution_status_selection=Status Selection |
464 | 470 |
DistributionAdminPreferences_SELECT_STATUS=List of available distribution status |
465 | 471 |
DistributionAdminPreferences_PER_AREA_STATUS=List of preferences defining available status per area.\nIn this list you can define whether the preference can be overwritten or delete it. |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties | ||
---|---|---|
460 | 460 |
DatabasePreferncesPage_Show_ChecklistPerspective=Checklist Perspektive als Default Perspektive anzeigen |
461 | 461 |
DatabasePreferncesPage_Show_TaxonNodeWizard=Wizard zum Editieren der Taxon Knoten anzeigen |
462 | 462 |
|
463 |
DatabasePreferncesPage_Show_Id_In_SelectionDialog=Zeige ID in Selection Dialogen |
|
464 |
DatabasePreferncesPage_Search_for_identifier_as_default=Nutze Identifier Suche als Default |
|
465 |
DatabasePreferncesPage_search_for_identifier_and_titleCache=Suche nach Identifier und TitleCache, wenn Identifier Suche aktiviert ist |
|
466 |
DatabasePreferncesPage_Sort_Taxa_By_Name_And_Rank=Sortiere Taxa nach Rang und Namen |
|
467 |
DatabasePreferncesPage_CommonNameFilter=Filtere Referenzen, die als Referenzen f?r Trivialnamen markiert sind |
|
468 |
|
|
463 | 469 |
Distribution_status_selection=Status Auswahl |
464 | 470 |
DistributionAdminPreferences_SELECT_STATUS=Liste der verf?gbaren Verbreitungs-Status |
465 | 471 |
DistributionAdminPreferences_PER_AREA_STATUS=Liste der pro Area definierten Status Preferenzen\nSie k?nnen in der Liste definieren, ob das lokale ?berschreiben erlaubt sein soll und die Preferenz l?schen |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/AbcdImportPreference.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2018 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.taxeditor.preference; |
|
10 |
|
|
11 |
import java.net.URI; |
|
12 |
|
|
13 |
import org.eclipse.swt.SWT; |
|
14 |
import org.eclipse.swt.custom.CLabel; |
|
15 |
import org.eclipse.swt.events.SelectionAdapter; |
|
16 |
import org.eclipse.swt.events.SelectionEvent; |
|
17 |
import org.eclipse.swt.events.SelectionListener; |
|
18 |
import org.eclipse.swt.layout.GridData; |
|
19 |
import org.eclipse.swt.layout.GridLayout; |
|
20 |
import org.eclipse.swt.widgets.Button; |
|
21 |
import org.eclipse.swt.widgets.Combo; |
|
22 |
import org.eclipse.swt.widgets.Composite; |
|
23 |
import org.eclipse.swt.widgets.Control; |
|
24 |
import org.eclipse.swt.widgets.Label; |
|
25 |
import org.eclipse.swt.widgets.Text; |
|
26 |
|
|
27 |
import eu.etaxonomy.cdm.api.application.ICdmRepository; |
|
28 |
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator; |
|
29 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference; |
|
30 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey; |
|
31 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
|
32 |
import eu.etaxonomy.cdm.model.metadata.PreferenceSubject; |
|
33 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
|
34 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
|
35 |
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage; |
|
36 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
37 |
|
|
38 |
/** |
|
39 |
* @author k.luther |
|
40 |
* @since 23.03.2018 |
|
41 |
* |
|
42 |
*/ |
|
43 |
public class AbcdImportPreference extends CdmPreferencePage implements IE4PreferencePage, SelectionListener { |
|
44 |
|
|
45 |
private Abcd206ImportConfigurator configurator; |
|
46 |
|
|
47 |
private Combo nomenclaturalCodeSelectionCombo; |
|
48 |
|
|
49 |
private boolean allowOverride = true; |
|
50 |
private boolean override = true; |
|
51 |
private CdmPreference preference = null; |
|
52 |
Text textDNAProviderString; |
|
53 |
private Composite composite; |
|
54 |
Combo overrideCombo; |
|
55 |
|
|
56 |
@Override |
|
57 |
protected Control createContents(Composite parent) { |
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
getValues(); |
|
63 |
|
|
64 |
|
|
65 |
//configurator = PreferencesUtil.getAbcdImportConfigurationPreference(); |
|
66 |
final CLabel description = new CLabel(parent, SWT.NULL); |
|
67 |
description.setText(Messages.AbcdImportPreference_description); |
|
68 |
// final CLabel overrideDescription = new CLabel(parent, SWT.NULL); |
|
69 |
// overrideDescription.setText(""); |
|
70 |
// GridData textGrid = createTextGridData(); |
|
71 |
// textGrid.verticalSpan = 2; |
|
72 |
// overrideDescription.setLayoutData(textGrid); |
|
73 |
|
|
74 |
overrideCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY); |
|
75 |
|
|
76 |
overrideCombo.add(LocalOrDefaultEnum.Default.getLabel(), 0); |
|
77 |
overrideCombo.add(LocalOrDefaultEnum.Local.getLabel(), 1); |
|
78 |
overrideCombo.addSelectionListener(this); |
|
79 |
if (override){ |
|
80 |
overrideCombo.select(1); |
|
81 |
}else{ |
|
82 |
overrideCombo.select(0); |
|
83 |
} |
|
84 |
|
|
85 |
composite = new Composite(parent, SWT.NULL); |
|
86 |
|
|
87 |
GridLayout gridLayout = new GridLayout(); |
|
88 |
composite.setLayout(gridLayout); |
|
89 |
Button checkBoxMediaSpecimen = new Button(composite, SWT.CHECK); |
|
90 |
checkBoxMediaSpecimen.setSelection(configurator.isAddMediaAsMediaSpecimen()); |
|
91 |
checkBoxMediaSpecimen.setText(Messages.AbcdImportPreference_media_as_mediaSpecimen); |
|
92 |
checkBoxMediaSpecimen |
|
93 |
.setToolTipText(Messages.AbcdImportPreference_media_as_subUnit); |
|
94 |
checkBoxMediaSpecimen.addSelectionListener(new SelectionAdapter() { |
|
95 |
@Override |
|
96 |
public void widgetSelected(SelectionEvent e) { |
|
97 |
configurator.setAddMediaAsMediaSpecimen(!configurator.isAddMediaAsMediaSpecimen()); |
|
98 |
setApply(true); |
|
99 |
} |
|
100 |
}); |
|
101 |
|
|
102 |
Button checkBoxIgnoreExisting = new Button(composite, SWT.CHECK); |
|
103 |
checkBoxIgnoreExisting.setSelection(configurator.isIgnoreImportOfExistingSpecimen()); |
|
104 |
checkBoxIgnoreExisting.setText(Messages.AbcdImportPreference_not_import_existing_specimen); |
|
105 |
checkBoxIgnoreExisting |
|
106 |
.setToolTipText(Messages.AbcdImportPreference_not_import_existing_specimen_tooltip); |
|
107 |
checkBoxIgnoreExisting.addSelectionListener(new SelectionAdapter() { |
|
108 |
@Override |
|
109 |
public void widgetSelected(SelectionEvent e) { |
|
110 |
configurator.setIgnoreImportOfExistingSpecimen(!configurator.isIgnoreImportOfExistingSpecimen()); |
|
111 |
setApply(true); |
|
112 |
} |
|
113 |
}); |
|
114 |
|
|
115 |
Button checkBoxIgnoreAuthorship = new Button(composite, SWT.CHECK); |
|
116 |
checkBoxIgnoreAuthorship.setSelection(configurator.isIgnoreAuthorship()); |
|
117 |
checkBoxIgnoreAuthorship.setText(Messages.AbcdImportPreference_ignore_author); |
|
118 |
checkBoxIgnoreAuthorship |
|
119 |
.setToolTipText(Messages.AbcdImportPreference_ignore_author_tooltip); |
|
120 |
checkBoxIgnoreAuthorship.addSelectionListener(new SelectionAdapter() { |
|
121 |
@Override |
|
122 |
public void widgetSelected(SelectionEvent e) { |
|
123 |
configurator.setIgnoreAuthorship(!configurator.isIgnoreAuthorship()); |
|
124 |
setApply(true); |
|
125 |
} |
|
126 |
}); |
|
127 |
|
|
128 |
Button checkBoxMapUnitIdToCatalogNumber = new Button(composite, SWT.CHECK); |
|
129 |
checkBoxMapUnitIdToCatalogNumber.setSelection(configurator.isMapUnitIdToCatalogNumber()); |
|
130 |
checkBoxMapUnitIdToCatalogNumber.setText(Messages.AbcdImportPreference_map_unit_nr_catalog_number); |
|
131 |
checkBoxMapUnitIdToCatalogNumber |
|
132 |
.setToolTipText(Messages.AbcdImportPreference_map_unit_number_catalog_number_tooltip); |
|
133 |
checkBoxMapUnitIdToCatalogNumber.addSelectionListener(new SelectionAdapter() { |
|
134 |
@Override |
|
135 |
public void widgetSelected(SelectionEvent e) { |
|
136 |
configurator.setMapUnitIdToCatalogNumber(!configurator.isMapUnitIdToCatalogNumber()); |
|
137 |
setApply(true); |
|
138 |
} |
|
139 |
}); |
|
140 |
//TODO: only one of the mappings can be checked! |
|
141 |
Button checkBoxMapUnitIdToAccessionNumber = new Button(composite, SWT.CHECK); |
|
142 |
checkBoxMapUnitIdToAccessionNumber.setSelection(configurator.isMapUnitIdToAccessionNumber()); |
|
143 |
checkBoxMapUnitIdToAccessionNumber.setText(Messages.AbcdImportPreference_map_unit_number_to_accession_number); |
|
144 |
checkBoxMapUnitIdToAccessionNumber |
|
145 |
.setToolTipText(Messages.AbcdImportPreference_map_unit_number_accession_number_tooltip); |
|
146 |
checkBoxMapUnitIdToAccessionNumber.addSelectionListener(new SelectionAdapter() { |
|
147 |
@Override |
|
148 |
public void widgetSelected(SelectionEvent e) { |
|
149 |
configurator.setMapUnitIdToAccessionNumber(!configurator.isMapUnitIdToAccessionNumber()); |
|
150 |
setApply(true); |
|
151 |
} |
|
152 |
}); |
|
153 |
|
|
154 |
Button checkBoxMapUnitIdToBarcode = new Button(composite, SWT.CHECK); |
|
155 |
checkBoxMapUnitIdToBarcode.setSelection(configurator.isMapUnitIdToBarcode()); |
|
156 |
checkBoxMapUnitIdToBarcode.setText(Messages.AbcdImportPreference_map_unit_number_barcode); |
|
157 |
checkBoxMapUnitIdToBarcode |
|
158 |
.setToolTipText(Messages.AbcdImportPreference_map_unit_number_barcode_tooltip); |
|
159 |
checkBoxMapUnitIdToBarcode.addSelectionListener(new SelectionAdapter() { |
|
160 |
@Override |
|
161 |
public void widgetSelected(SelectionEvent e) { |
|
162 |
configurator.setMapUnitIdToBarcode(!configurator.isMapUnitIdToBarcode()); |
|
163 |
setApply(true); |
|
164 |
} |
|
165 |
}); |
|
166 |
|
|
167 |
Button checkBoxRemoveCountry = new Button(composite, SWT.CHECK); |
|
168 |
checkBoxRemoveCountry.setSelection(configurator.isRemoveCountryFromLocalityText()); |
|
169 |
checkBoxRemoveCountry.setText(Messages.AbcdImportPreference_remove_country_from_locality); |
|
170 |
checkBoxRemoveCountry |
|
171 |
.setToolTipText(Messages.AbcdImportPreference_remove_country_from_locality_tooltip); |
|
172 |
checkBoxRemoveCountry.addSelectionListener(new SelectionAdapter() { |
|
173 |
@Override |
|
174 |
public void widgetSelected(SelectionEvent e) { |
|
175 |
configurator.setRemoveCountryFromLocalityText(!configurator.isRemoveCountryFromLocalityText()); |
|
176 |
setApply(true); |
|
177 |
} |
|
178 |
}); |
|
179 |
|
|
180 |
Button checkBoxMoveToDefaultClassification = new Button(composite, SWT.CHECK); |
|
181 |
checkBoxMoveToDefaultClassification.setSelection(configurator.isMoveNewTaxaToDefaultClassification()); |
|
182 |
checkBoxMoveToDefaultClassification.setText(Messages.AbcdImportPreference_create_new_classification_new_taxa); |
|
183 |
checkBoxMoveToDefaultClassification |
|
184 |
.setToolTipText(Messages.AbcdImportPreference_create_new_classification_new_taxa_tooltip); |
|
185 |
checkBoxMoveToDefaultClassification.addSelectionListener(new SelectionAdapter() { |
|
186 |
@Override |
|
187 |
public void widgetSelected(SelectionEvent e) { |
|
188 |
configurator.setMoveNewTaxaToDefaultClassification(!configurator.isMoveNewTaxaToDefaultClassification()); |
|
189 |
setApply(true); |
|
190 |
} |
|
191 |
}); |
|
192 |
|
|
193 |
Button checkBoxImportSiblings = new Button(composite, SWT.CHECK); |
|
194 |
checkBoxImportSiblings.setSelection(configurator.isGetSiblings()); |
|
195 |
checkBoxImportSiblings.setText(Messages.AbcdImportPreference_import_all_children_for_cultures_or_tissues); |
|
196 |
checkBoxImportSiblings |
|
197 |
.setToolTipText(Messages.AbcdImportPreference_import_all_children_for_cultures_or_tissues_tooltip); |
|
198 |
checkBoxImportSiblings.addSelectionListener(new SelectionAdapter() { |
|
199 |
@Override |
|
200 |
public void widgetSelected(SelectionEvent e) { |
|
201 |
configurator.setGetSiblings(!configurator.isGetSiblings()); |
|
202 |
setApply(true); |
|
203 |
} |
|
204 |
}); |
|
205 |
|
|
206 |
Button checkBoxAddIndividualsAssociations = new Button(composite, SWT.CHECK); |
|
207 |
checkBoxAddIndividualsAssociations.setSelection(configurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations()); |
|
208 |
checkBoxAddIndividualsAssociations.setText(Messages.AbcdImportPreference_create_Individual_Association); |
|
209 |
checkBoxAddIndividualsAssociations |
|
210 |
.setToolTipText(Messages.AbcdImportPreference_create_Individual_Association_tooltip); |
|
211 |
checkBoxAddIndividualsAssociations.addSelectionListener(new SelectionAdapter() { |
|
212 |
@Override |
|
213 |
public void widgetSelected(SelectionEvent e) { |
|
214 |
configurator.setAddIndividualsAssociationsSuchAsSpecimenAndObservations(!configurator.isAddIndividualsAssociationsSuchAsSpecimenAndObservations()); |
|
215 |
setApply(true); |
|
216 |
} |
|
217 |
}); |
|
218 |
|
|
219 |
Button checkBoxReuseDescriptiveGroups = new Button(composite, SWT.CHECK); |
|
220 |
checkBoxReuseDescriptiveGroups.setSelection(configurator.isReuseExistingDescriptiveGroups()); |
|
221 |
checkBoxReuseDescriptiveGroups.setText(Messages.AbcdImportPreference_reuse_descriptive_group); |
|
222 |
checkBoxReuseDescriptiveGroups |
|
223 |
.setToolTipText(Messages.AbcdImportPreference_reuse_descriptive_group_tooltip); |
|
224 |
checkBoxReuseDescriptiveGroups.addSelectionListener(new SelectionAdapter() { |
|
225 |
@Override |
|
226 |
public void widgetSelected(SelectionEvent e) { |
|
227 |
configurator.setReuseExistingDescriptiveGroups(!configurator.isReuseExistingDescriptiveGroups()); |
|
228 |
setApply(true); |
|
229 |
} |
|
230 |
}); |
|
231 |
|
|
232 |
Button checkBoxReuseExistingTaxa = new Button(composite, SWT.CHECK); |
|
233 |
checkBoxReuseExistingTaxa.setSelection(configurator.isReuseExistingTaxaWhenPossible()); |
|
234 |
checkBoxReuseExistingTaxa.setText(Messages.AbcdImportPreference_reuse_existing_taxa); |
|
235 |
checkBoxReuseExistingTaxa |
|
236 |
.setToolTipText(Messages.AbcdImportPreference_reuse_existing_taxa_tooltip); |
|
237 |
checkBoxReuseExistingTaxa.addSelectionListener(new SelectionAdapter() { |
|
238 |
@Override |
|
239 |
public void widgetSelected(SelectionEvent e) { |
|
240 |
configurator.setReuseExistingTaxaWhenPossible(!configurator.isReuseExistingTaxaWhenPossible()); |
|
241 |
setApply(true); |
|
242 |
} |
|
243 |
}); |
|
244 |
|
|
245 |
Label labelRef = new Label(composite, SWT.NONE); |
|
246 |
labelRef.setText("Biocase provider for associated DNA"); |
|
247 |
new Label(composite, SWT.NONE); |
|
248 |
textDNAProviderString = new Text(composite, SWT.NONE); |
|
249 |
textDNAProviderString.setEnabled(true); |
|
250 |
textDNAProviderString.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1)); |
|
251 |
textDNAProviderString.setText(configurator.getDnaSoure().toString()); |
|
252 |
GridData gridData = new GridData(); |
|
253 |
gridData = new GridData(GridData.BEGINNING, GridData.CENTER, true, false); |
|
254 |
gridData.horizontalIndent = 5; |
|
255 |
// classificationSelection.setLayoutData(gridData); |
|
256 |
|
|
257 |
nomenclaturalCodeSelectionCombo = new Combo(composite, SWT.BORDER| SWT.READ_ONLY); |
|
258 |
nomenclaturalCodeSelectionCombo.setLayoutData(gridData); |
|
259 |
for(NomenclaturalCode code: NomenclaturalCode.values()){ |
|
260 |
nomenclaturalCodeSelectionCombo.add(code.getKey()); |
|
261 |
} |
|
262 |
int index = 0; |
|
263 |
if (configurator.getNomenclaturalCode() != null){ |
|
264 |
for (String label : nomenclaturalCodeSelectionCombo.getItems()){ |
|
265 |
if (label.equals(configurator.getNomenclaturalCode().getKey())){ |
|
266 |
nomenclaturalCodeSelectionCombo.select(index); |
|
267 |
|
|
268 |
} |
|
269 |
index++; |
|
270 |
} |
|
271 |
} |
|
272 |
|
|
273 |
// TODO remember last selection |
|
274 |
nomenclaturalCodeSelectionCombo.addSelectionListener(this); |
|
275 |
if (preference != null){ |
|
276 |
allowOverride = preference.isAllowOverride(); |
|
277 |
} |
|
278 |
|
|
279 |
if (!override){ |
|
280 |
//composite.setEnabled(false); |
|
281 |
PreferencesUtil.recursiveSetEnabled(composite, override); |
|
282 |
} |
|
283 |
|
|
284 |
return composite; |
|
285 |
} |
|
286 |
|
|
287 |
@Override |
|
288 |
public void widgetSelected(SelectionEvent e) { |
|
289 |
if (e.getSource().equals(nomenclaturalCodeSelectionCombo)){ |
|
290 |
this.configurator.setNomenclaturalCode(NomenclaturalCode.getByKey(nomenclaturalCodeSelectionCombo.getText())); |
|
291 |
} |
|
292 |
if (e.getSource().equals(overrideCombo)) { |
|
293 |
override = overrideCombo.getText().equals(LocalOrDefaultEnum.Local.getLabel())?true:false; |
|
294 |
} |
|
295 |
PreferencesUtil.recursiveSetEnabled(composite, override); |
|
296 |
setApply(true); |
|
297 |
|
|
298 |
} |
|
299 |
|
|
300 |
@Override |
|
301 |
public boolean performOk() { |
|
302 |
if (!isApply()){ |
|
303 |
return true; |
|
304 |
} |
|
305 |
if (configurator != null){ |
|
306 |
String configString = configurator.toString(); |
|
307 |
|
|
308 |
|
|
309 |
if (override){ |
|
310 |
PreferencesUtil.setStringValue(PreferencePredicate.AbcdImportConfig.getKey(), configString); |
|
311 |
PreferencesUtil.setBooleanValue( PreferencesUtil.prefOverrideKey(PreferencePredicate.AbcdImportConfig.getKey()), override); |
|
312 |
|
|
313 |
}else{ |
|
314 |
PreferencesUtil.setBooleanValue( PreferencesUtil.prefOverrideKey(PreferencePredicate.AbcdImportConfig.getKey()), override); |
|
315 |
} |
|
316 |
|
|
317 |
|
|
318 |
} |
|
319 |
return true; |
|
320 |
} |
|
321 |
|
|
322 |
/** |
|
323 |
* {@inheritDoc} |
|
324 |
*/ |
|
325 |
@Override |
|
326 |
public void widgetDefaultSelected(SelectionEvent e) { |
|
327 |
// TODO Auto-generated method stub |
|
328 |
|
|
329 |
} |
|
330 |
|
|
331 |
@Override |
|
332 |
protected void performDefaults() { |
|
333 |
configurator = Abcd206ImportConfigurator.NewInstance(null,null); |
|
334 |
preference = CdmPreference.NewTaxEditorInstance(PreferencePredicate.AbcdImportConfig, configurator.toString()); |
|
335 |
preference.setAllowOverride(true); |
|
336 |
super.performDefaults(); |
|
337 |
} |
|
338 |
|
|
339 |
@Override |
|
340 |
public void getValues() { |
|
341 |
isAdminPreference = false; |
|
342 |
configurator = Abcd206ImportConfigurator.NewInstance(null,null); |
|
343 |
ICdmRepository controller; |
|
344 |
controller = CdmStore.getCurrentApplicationConfiguration(); |
|
345 |
PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.AbcdImportConfig); |
|
346 |
preference = controller.getPreferenceService().find(key); |
|
347 |
|
|
348 |
if (preference != null ){ |
|
349 |
allowOverride = preference.isAllowOverride(); |
|
350 |
}else{ |
|
351 |
preference = CdmPreference.NewTaxEditorInstance(PreferencePredicate.AbcdImportConfig, configurator.toString()); |
|
352 |
} |
|
353 |
|
|
354 |
override = PreferencesUtil.getBooleanValue( |
|
355 |
PreferencesUtil.prefOverrideKey(PreferencePredicate.AbcdImportConfig.getKey()), true) != null? PreferencesUtil.getBooleanValue( |
|
356 |
PreferencesUtil.prefOverrideKey(PreferencePredicate.AbcdImportConfig.getKey()), true):false; |
|
357 |
|
|
358 |
String configString; |
|
359 |
if (!override){ |
|
360 |
configString = preference.getValue(); |
|
361 |
}else{ |
|
362 |
configString = PreferencesUtil.getStringValue(PreferencePredicate.AbcdImportConfig.getKey(), true); |
|
363 |
} |
|
364 |
if(configString!=null){ |
|
365 |
String[] configArray = configString.split(";"); //$NON-NLS-1$ |
|
366 |
|
|
367 |
for (String configItem: configArray){ |
|
368 |
String[] keyValue = configItem.split(":"); //$NON-NLS-1$ |
|
369 |
if(keyValue.length==2){ |
|
370 |
String keyString = keyValue[0]; |
|
371 |
String valueString = keyValue[1]; |
|
372 |
if (keyString.equals("ignoreImportOfExistingSpecimen")){ //$NON-NLS-1$ |
|
373 |
configurator.setIgnoreImportOfExistingSpecimen(Boolean.valueOf(valueString)); |
|
374 |
}else if (keyString.equals("addIndividualsAssociationsSuchAsSpecimenAndObservations")){ //$NON-NLS-1$ |
|
375 |
configurator.setAddIndividualsAssociationsSuchAsSpecimenAndObservations(Boolean.valueOf(valueString)); |
|
376 |
}else if (keyString.equals("reuseExistingTaxaWhenPossible")){ //$NON-NLS-1$ |
|
377 |
configurator.setReuseExistingTaxaWhenPossible(Boolean.valueOf(valueString)); |
|
378 |
}else if (keyString.equals("ignoreAuthorship")){ //$NON-NLS-1$ |
|
379 |
configurator.setIgnoreAuthorship(Boolean.valueOf(valueString)); |
|
380 |
}else if (keyString.equals("addMediaAsMediaSpecimen")){ //$NON-NLS-1$ |
|
381 |
configurator.setAddMediaAsMediaSpecimen(Boolean.valueOf(valueString)); |
|
382 |
}else if (keyString.equals("reuseExistingMetaData")){ //$NON-NLS-1$ |
|
383 |
configurator.setReuseExistingMetaData(Boolean.valueOf(valueString)); |
|
384 |
}else if (keyString.equals("reuseExistingDescriptiveGroups")){ //$NON-NLS-1$ |
|
385 |
configurator.setReuseExistingDescriptiveGroups(Boolean.valueOf(valueString)); |
|
386 |
}else if (keyString.equals("allowReuseOtherClassifications")){ //$NON-NLS-1$ |
|
387 |
configurator.setAllowReuseOtherClassifications(Boolean.valueOf(valueString)); |
|
388 |
}else if (keyString.equals("deduplicateReferences")){ //$NON-NLS-1$ |
|
389 |
configurator.setDeduplicateReferences(Boolean.valueOf(valueString)); |
|
390 |
}else if (keyString.equals("deduplicateClassifications")){ //$NON-NLS-1$ |
|
391 |
configurator.setDeduplicateClassifications(Boolean.valueOf(valueString)); |
|
392 |
}else if (keyString.equals("moveNewTaxaToDefaultClassification")){ //$NON-NLS-1$ |
|
393 |
configurator.setMoveNewTaxaToDefaultClassification(Boolean.valueOf(valueString)); |
|
394 |
}else if (keyString.equals("mapUnitIdToCatalogNumber")){ //$NON-NLS-1$ |
|
395 |
configurator.setMapUnitIdToCatalogNumber(Boolean.valueOf(valueString)); |
|
396 |
}else if (keyString.equals("mapUnitIdToAccessionNumber")){ //$NON-NLS-1$ |
|
397 |
configurator.setMapUnitIdToAccessionNumber(Boolean.valueOf(valueString)); |
|
398 |
}else if (keyString.equals("mapUnitIdToBarcode")){ //$NON-NLS-1$ |
|
399 |
configurator.setMapUnitIdToBarcode(Boolean.valueOf(valueString)); |
|
400 |
}else if (keyString.equals("overwriteExistingSpecimens")){ //$NON-NLS-1$ |
|
401 |
configurator.setOverwriteExistingSpecimens(Boolean.valueOf(valueString)); |
|
402 |
}else if (keyString.equals("nomenclaturalCode")){ //$NON-NLS-1$ |
|
403 |
configurator.setNomenclaturalCode(NomenclaturalCode.fromString(valueString)); |
|
404 |
}else if (keyString.equals("getSiblings")){ //$NON-NLS-1$ |
|
405 |
configurator.setGetSiblings(Boolean.valueOf(valueString)); |
|
406 |
}else if (keyString.equals("removeCountryFromLocalityText")){ //$NON-NLS-1$ |
|
407 |
configurator.setRemoveCountryFromLocalityText(Boolean.valueOf(valueString)); |
|
408 |
}else if (keyString.equals("dnaSource")){ //$NON-NLS-1$ |
|
409 |
configurator.setDnaSoure(URI.create(valueString)); |
|
410 |
} |
|
411 |
|
|
412 |
} |
|
413 |
} |
|
414 |
} |
|
415 |
} |
|
416 |
|
|
417 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/AbcdImportProvider.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2018 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.taxeditor.preference; |
|
10 |
|
|
11 |
import org.eclipse.swt.SWT; |
|
12 |
import org.eclipse.swt.custom.CLabel; |
|
13 |
import org.eclipse.swt.layout.GridLayout; |
|
14 |
import org.eclipse.swt.widgets.Composite; |
|
15 |
import org.eclipse.swt.widgets.Control; |
|
16 |
|
|
17 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
|
18 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
|
19 |
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage; |
|
20 |
|
|
21 |
/** |
|
22 |
* @author k.luther |
|
23 |
* @since 23.03.2018 |
|
24 |
* |
|
25 |
*/ |
|
26 |
public class AbcdImportProvider extends CdmPreferencePage implements IE4PreferencePage{ |
|
27 |
|
|
28 |
private ListComponent biocaseProviderList; |
|
29 |
|
|
30 |
@Override |
|
31 |
protected Control createContents(Composite parent) { |
|
32 |
final Composite composite = new Composite(parent, SWT.NULL); |
|
33 |
final CLabel description = new CLabel(composite, SWT.NULL); |
|
34 |
description.setText(Messages.AbcdImportProvider_description); |
|
35 |
GridLayout gridLayout = new GridLayout(); |
|
36 |
composite.setLayout(gridLayout); |
|
37 |
|
|
38 |
gridLayout.numColumns = 3; |
|
39 |
//gridLayout.horizontalSpacing= 5; |
|
40 |
//gridLayout.makeColumnsEqualWidth = true; |
|
41 |
|
|
42 |
composite.setLayout(gridLayout); |
|
43 |
biocaseProviderList = new ListComponent(composite, SWT.SCROLL_LINE,false); |
|
44 |
setApply(true); |
|
45 |
return composite; |
|
46 |
} |
|
47 |
|
|
48 |
@Override |
|
49 |
public boolean performOk() { |
|
50 |
String providerList = null; |
|
51 |
if (biocaseProviderList != null){ |
|
52 |
providerList = biocaseProviderList.createAllProviderString(); |
|
53 |
PreferencesUtil.setStringValue(PreferencePredicate.BioCaseProvider.getKey(), providerList); |
|
54 |
|
|
55 |
|
|
56 |
} |
|
57 |
|
|
58 |
return true; |
|
59 |
} |
|
60 |
|
|
61 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/ChecklistEditorGeneralPreference.java | ||
---|---|---|
195 | 195 |
areaOrderSelectionCombo = createCombo(child, TermOrder.values(), PreferencePredicate.AreasSortedInDistributionEditor, Messages.ChecklistEditorGeneralPreference_Configure_area_order, isAdminPreference); |
196 | 196 |
|
197 | 197 |
index = 0; |
198 |
TermOrder areaOrder; |
|
199 |
try { |
|
200 |
if (orderAreas != null) { |
|
201 |
areaOrder = TermOrder.valueOf(orderAreas); |
|
202 |
} else { |
|
203 |
areaOrder = TermOrder.IdInVoc; |
|
204 |
} |
|
205 |
} catch (IllegalArgumentException e) { |
|
206 |
areaOrder = TermOrder.IdInVoc; |
|
207 |
} |
|
198 |
|
|
208 | 199 |
for (String itemLabel : areaOrderSelectionCombo.getItems()) { |
209 | 200 |
if (itemLabel.startsWith(Messages.Preference_Use_Default) && orderAreas == null){ |
210 | 201 |
areaOrderSelectionCombo.select(index); |
211 | 202 |
break; |
212 | 203 |
} |
213 |
if (itemLabel.startsWith(areaOrder.getLabel())) {
|
|
204 |
if (itemLabel.startsWith(orderAreas)) {
|
|
214 | 205 |
areaOrderSelectionCombo.select(index); |
215 | 206 |
break; |
216 | 207 |
} |
... | ... | |
241 | 232 |
|
242 | 233 |
|
243 | 234 |
index = 0; |
244 |
TermDisplayEnum areaDisplay; |
|
245 |
try { |
|
246 |
if (displayArea != null) { |
|
247 |
areaDisplay = TermDisplayEnum.valueOf(displayArea); |
|
248 |
} else { |
|
249 |
areaDisplay = TermDisplayEnum.Title; |
|
250 |
} |
|
251 |
} catch (IllegalArgumentException e) { |
|
252 |
areaDisplay = TermDisplayEnum.Title; |
|
253 |
} |
|
235 |
|
|
254 | 236 |
for (String itemLabel : areaDisplaySelectionCombo.getItems()) { |
255 | 237 |
if (itemLabel.startsWith(Messages.Preference_Use_Default) && displayArea == null){ |
256 | 238 |
areaDisplaySelectionCombo.select(index); |
257 | 239 |
break; |
258 |
} |
|
259 |
if (itemLabel.startsWith(areaDisplay.getLabel())) { |
|
240 |
}else if (itemLabel.startsWith(displayArea)) { |
|
260 | 241 |
areaDisplaySelectionCombo.select(index); |
261 | 242 |
break; |
262 | 243 |
} |
... | ... | |
283 | 264 |
statusDisplaySelectionCombo = createCombo(child, TermDisplayEnum.values(), PreferencePredicate.DisplayOfStatus, Messages.ChecklistEditorGeneralPreference_Configure_display_of_Status, isAdminPreference); |
284 | 265 |
|
285 | 266 |
index = 0; |
286 |
TermDisplayEnum statusDisplay; |
|
287 |
try { |
|
288 |
if (displayStatus != null) { |
|
289 |
statusDisplay = TermDisplayEnum.valueOf(displayStatus); |
|
290 |
} else { |
|
291 |
statusDisplay = TermDisplayEnum.Title; |
|
292 |
} |
|
293 |
} catch (IllegalArgumentException e) { |
|
294 |
statusDisplay = TermDisplayEnum.Title; |
|
295 |
} |
|
267 |
|
|
296 | 268 |
for (String itemLabel : statusDisplaySelectionCombo.getItems()) { |
297 | 269 |
if (itemLabel.startsWith(Messages.Preference_Use_Default) && displayStatus == null){ |
298 | 270 |
statusDisplaySelectionCombo.select(index); |
299 | 271 |
break; |
300 | 272 |
} |
301 |
if (itemLabel.startsWith(statusDisplay.getLabel())) {
|
|
273 |
if (itemLabel.startsWith(displayStatus)) {
|
|
302 | 274 |
statusDisplaySelectionCombo.select(index); |
303 | 275 |
break; |
304 | 276 |
} |
... | ... | |
326 | 298 |
statusDisplayInComboSelectionCombo = createCombo(child, TermComboEnum.values(), PreferencePredicate.DisplayOfStatusInCombo, Messages.ChecklistEditorGeneralPreference_Configure_display_of_Status_in_Combo, isAdminPreference); |
327 | 299 |
|
328 | 300 |
index = 0; |
329 |
TermComboEnum statusComboDisplay; |
|
330 |
try { |
|
331 |
if (displayStatusCombo != null) { |
|
332 |
statusComboDisplay = TermComboEnum.byKey(displayStatusCombo); |
|
333 |
} else { |
|
334 |
statusComboDisplay = TermComboEnum.Title; |
|
335 |
} |
|
336 |
} catch (IllegalArgumentException e) { |
|
337 |
statusComboDisplay = TermComboEnum.Title; |
|
338 |
} |
|
301 |
|
|
339 | 302 |
for (String itemLabel : statusDisplayInComboSelectionCombo.getItems()) { |
340 | 303 |
if (itemLabel.startsWith(Messages.Preference_Use_Default) && displayStatusCombo == null){ |
341 | 304 |
statusDisplayInComboSelectionCombo.select(index); |
342 | 305 |
break; |
343 | 306 |
} |
344 |
if (itemLabel.startsWith(statusComboDisplay.getLabel())) {
|
|
307 |
if (itemLabel.startsWith(displayStatus)) {
|
|
345 | 308 |
statusDisplayInComboSelectionCombo.select(index); |
346 | 309 |
break; |
347 | 310 |
} |
... | ... | |
416 | 379 |
|
417 | 380 |
|
418 | 381 |
override = false; |
419 |
if (!orderAreas.startsWith(Messages.Preference_Use_Default) ) {
|
|
382 |
if (orderAreas != null ) {
|
|
420 | 383 |
override = true; |
421 | 384 |
PreferencesUtil.setSortNamedAreasInDistributionEditor(orderAreas); |
422 | 385 |
} |
... | ... | |
439 | 402 |
|
440 | 403 |
|
441 | 404 |
override = false; |
442 |
if (!displayStatus.startsWith(Messages.Preference_Use_Default)) {
|
|
405 |
if (displayStatus != null) {
|
|
443 | 406 |
override = true; |
444 | 407 |
PreferencesUtil.setDisplayStatusInChecklistEditor(displayStatus); |
445 | 408 |
} |
... | ... | |
448 | 411 |
override); |
449 | 412 |
|
450 | 413 |
override = false; |
451 |
if (!displayStatusCombo.startsWith(Messages.Preference_Use_Default)) {
|
|
414 |
if (displayStatusCombo != null) {
|
|
452 | 415 |
override = true; |
453 | 416 |
PreferencesUtil.setStringValue(PreferencePredicate.DisplayOfStatusInCombo.getKey(), displayStatusCombo); |
454 | 417 |
} |
... | ... | |
459 | 422 |
|
460 | 423 |
|
461 | 424 |
override = false; |
462 |
if (!displayArea.startsWith(Messages.Preference_Use_Default) ) {
|
|
425 |
if (displayArea != null) {
|
|
463 | 426 |
override = true; |
464 | 427 |
PreferencesUtil.setAreaDisplayInChecklistEditor(displayArea); |
465 | 428 |
} |
... | ... | |
469 | 432 |
|
470 | 433 |
|
471 | 434 |
|
472 |
PreferencesUtil.setOwnDescriptionForChecklistEditor(ownDescriptionForDistributionEditor); |
|
473 |
PreferencesUtil.setBooleanValue( |
|
474 |
PreferencesUtil.prefOverrideKey(PreferencePredicate.OwnDescriptionForDistributionEditor.getKey()), |
|
475 |
true); |
|
435 |
// PreferencesUtil.setOwnDescriptionForChecklistEditor(ownDescriptionForDistributionEditor);
|
|
436 |
// PreferencesUtil.setBooleanValue(
|
|
437 |
// PreferencesUtil.prefOverrideKey(PreferencePredicate.OwnDescriptionForDistributionEditor.getKey()),
|
|
438 |
// true);
|
|
476 | 439 |
|
477 | 440 |
PreferencesUtil.firePreferencesChanged(this.getClass()); |
478 | 441 |
|
... | ... | |
851 | 814 |
|
852 | 815 |
ownDescriptionForDistributionEditor = null; |
853 | 816 |
|
854 |
allowOverrideActivatedButton.setSelection(true); |
|
817 |
if (isAdminPreference){ |
|
818 |
allowOverrideActivatedButton.setSelection(true); |
|
819 |
allowOverrideAreaDisplayButton.setSelection(true); |
|
820 |
allowOverrideStatusDisplayButton.setSelection(true); |
|
821 |
allowOverrideOrderAreasButton.setSelection(true); |
|
822 |
allowOverrideRankButton.setSelection(true); |
|
823 |
} |
|
855 | 824 |
overrideActivated = true; |
856 |
|
|
857 | 825 |
overrideAreaDisplay = true; |
858 |
allowOverrideAreaDisplayButton.setSelection(true); |
|
859 |
|
|
860 | 826 |
overrideStatusDisplay = true; |
861 |
allowOverrideStatusDisplayButton.setSelection(true); |
|
862 |
|
|
863 | 827 |
overrideOrderAreas = true; |
864 |
allowOverrideOrderAreasButton.setSelection(true); |
|
865 |
|
|
866 | 828 |
overrideRank = true; |
867 |
allowOverrideRankButton.setSelection(true); |
|
868 |
|
|
869 | 829 |
overrideOwnDescriptionForDistributionEditor = true; |
870 | 830 |
|
871 | 831 |
|
872 | 832 |
if (!isAdminPreference) { |
873 |
PreferencesUtil.recursiveSetEnabled(child, isEditorActivated); |
|
874 |
|
|
875 |
|
|
876 |
if (!prefRank.isAllowOverride()) { |
|
877 |
activateRankCombo.setEnabled(false); |
|
878 |
|
|
879 |
if (!prefAreaSort.isAllowOverride()) { |
|
880 |
areaOrderSelectionCombo.setEnabled(false); |
|
881 |
allowOverrideOrderAreasButton.setEnabled(false); |
|
882 |
} |
|
883 |
if (!prefAreaDisplay.isAllowOverride()) { |
|
884 |
allowOverrideAreaDisplayButton.setEnabled(false); |
|
885 |
} |
|
886 |
if (!prefStatusDisplay.isAllowOverride()) { |
|
887 |
allowOverrideStatusDisplayButton.setEnabled(false); |
|
888 |
} |
|
889 |
} |
|
833 |
PreferencesUtil.recursiveSetEnabled(child, Boolean.parseBoolean(distributionEditorPref.getValue())); |
|
834 |
// if (!prefRank.isAllowOverride()) { |
|
835 |
// activateRankCombo.setEnabled(false); |
|
836 |
// |
|
837 |
// if (!prefAreaSort.isAllowOverride()) { |
|
838 |
// areaOrderSelectionCombo.setEnabled(false); |
|
839 |
// } |
|
840 |
// if (!prefAreaDisplay.isAllowOverride()) { |
|
841 |
// allowOverrideAreaDisplayButton.setEnabled(false); |
|
842 |
// } |
|
843 |
// if (!prefStatusDisplay.isAllowOverride()) { |
|
844 |
// allowOverrideStatusDisplayButton.setEnabled(false); |
|
845 |
// } |
|
846 |
// } |
|
890 | 847 |
super.performDefaults(); |
891 | 848 |
} |
892 | 849 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/GeneralPreferencePage.java | ||
---|---|---|
169 | 169 |
|
170 | 170 |
@Override |
171 | 171 |
public boolean performOk() { |
172 |
if (!isApply()){ |
|
173 |
return true; |
|
174 |
} |
|
172 | 175 |
if (isAllowOverrideShowCheckListPerspective){ |
173 | 176 |
PreferencesUtil.setBooleanValue(PreferencesUtil.prefOverrideKey(PreferencePredicate.ShowChecklistPerspective.getKey()), isOverrideShowCheckListPerspective); |
174 | 177 |
PreferencesUtil.setBooleanValue(PreferencePredicate.ShowChecklistPerspective.getKey(), isShowCheckListPerspective); |
178 |
|
|
175 | 179 |
} |
176 | 180 |
if (isAllowOverrideShowIOMenu){ |
177 | 181 |
PreferencesUtil.setBooleanValue(PreferencePredicate.ShowImportExportMenu.getKey(), isShowIOMenu); |
... | ... | |
234 | 238 |
if (e.getSource().equals(this.showIOMenuButton)) { |
235 | 239 |
String text = showIOMenuButton.getText(); |
236 | 240 |
if (text.startsWith(Messages.Preference_Use_Default)){ |
237 |
isOverrideShowIOMenu = true;
|
|
241 |
isOverrideShowIOMenu = false;
|
|
238 | 242 |
isShowIOMenu = null; |
239 |
} |
|
240 |
if (text.equals(SHOW)){ |
|
243 |
}else if (text.equals(SHOW)){ |
|
241 | 244 |
isShowIOMenu = true; |
242 | 245 |
}else{ |
243 | 246 |
isShowIOMenu = false; |
... | ... | |
246 | 249 |
if (e.getSource().equals(this.showChecklistPerspectiveButton)) { |
247 | 250 |
String text = showChecklistPerspectiveButton.getText(); |
248 | 251 |
if (text.startsWith(Messages.Preference_Use_Default)){ |
249 |
isOverrideShowCheckListPerspective = true;
|
|
252 |
isOverrideShowCheckListPerspective = false;
|
|
250 | 253 |
isShowCheckListPerspective = null; |
251 |
} |
|
252 |
if (text.equals(SHOW)){ |
|
254 |
}else if (text.equals(SHOW)){ |
|
253 | 255 |
isShowCheckListPerspective = true; |
254 | 256 |
}else{ |
255 | 257 |
isShowCheckListPerspective = false; |
... | ... | |
258 | 260 |
if (e.getSource().equals(this.showTaxonNodeWizardButton)) { |
259 | 261 |
String text = showTaxonNodeWizardButton.getText(); |
260 | 262 |
if (text.startsWith(Messages.Preference_Use_Default)){ |
261 |
isOverrideShowTaxonNodeWizard = true;
|
|
263 |
isOverrideShowTaxonNodeWizard = false;
|
|
262 | 264 |
isShowTaxonNodeWizard = null; |
263 |
} |
|
264 |
if (text.equals(SHOW)){ |
|
265 |
}else if (text.equals(SHOW)){ |
|
265 | 266 |
isShowTaxonNodeWizard = true; |
266 | 267 |
}else{ |
267 | 268 |
isShowTaxonNodeWizard = false; |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/GeneralTermPreference.java | ||
---|---|---|
113 | 113 |
parent.setLayout(new GridLayout()); |
114 | 114 |
useLocalOrAdmin = new Combo(parent, SWT.BORDER | SWT.READ_ONLY); |
115 | 115 |
if (localPref){ |
116 |
useLocalOrAdmin.add(LocalOrDefaultEnum.Default.getLabel()); |
|
117 |
useLocalOrAdmin.add(LocalOrDefaultEnum.Local.getLabel()); |
|
116 |
useLocalOrAdmin.add(LocalOrDefaultEnum.Default.getLabel(), 0);
|
|
117 |
useLocalOrAdmin.add(LocalOrDefaultEnum.Local.getLabel(), 1);
|
|
118 | 118 |
|
119 | 119 |
}else{ |
120 |
useLocalOrAdmin.add(LocalOrDefaultEnum.Database.getLabel());
|
|
121 |
useLocalOrAdmin.add(LocalOrDefaultEnum.AllowOverride.getLabel());
|
|
120 |
useLocalOrAdmin.add(LocalOrDefaultEnum.AllowOverride.getLabel(), 0);
|
|
121 |
useLocalOrAdmin.add(LocalOrDefaultEnum.Database.getLabel(), 1);
|
|
122 | 122 |
} |
123 | 123 |
|
124 | 124 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/IPreferenceKeys.java | ||
---|---|---|
166 | 166 |
|
167 | 167 |
public static final String ALLOW_OVERRIDE_RL = "eu.etaxonomy.taxeditor.isRL.allow_override"; |
168 | 168 |
|
169 |
/* |
|
170 |
* Keys for the Abcd Import Configurator |
|
171 |
* |
|
172 |
*/ |
|
173 |
public static final String ABCD_IMPORT_CONFIGURATOR_SOURCE_URI = "eu.etaxonomy.taxeditor.abcd_import_configurator.sourceUri"; |
|
174 |
public static final String ABCD_IMPORT_CONFIGURATOR_DO_SIBLINGS = "eu.etaxonomy.taxeditor.abcd_import_configurator.doSiblings"; |
|
175 |
public static final String ABCD_IMPORT_CONFIGURATOR_IGNORE_IMPORT_OF_EXISTING_SPECIMEN= "eu.etaxonomy.taxeditor.abcd_import_configurator.ignoreImportOfExistingSpecimen"; |
|
176 |
public static final String ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_TAXA_WHEN_POSSIBLE= "eu.etaxonomy.taxeditor.abcd_import_configurator.reuseExistingTaxaWhenPossible"; |
|
177 |
public static final String ABCD_IMPORT_CONFIGURATOR_IGNORE_AUTHORSHIP= "eu.etaxonomy.taxeditor.abcd_import_configurator.ignoreAuthorship"; |
|
178 |
public static final String ABCD_IMPORT_CONFIGURATOR_REMOVE_COUNTRY_FROM_LOCALITY_TEXT= "eu.etaxonomy.taxeditor.abcd_import_configurator.removeCountryFromLocalityText"; |
|
179 |
public static final String ABCD_IMPORT_CONFIGURATOR_ADD_MEDIA_AS_MEDIASPECIMEN= "eu.etaxonomy.taxeditor.abcd_import_configurator.addMediaAsMediaSpecimen"; |
|
180 |
public static final String ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_META_DATA= "eu.etaxonomy.taxeditor.abcd_import_configurator.reuseExistingMetaData"; |
|
181 |
public static final String ABCD_IMPORT_CONFIGURATOR_ADD_INDIVIDUALS_ASSOCIATIONS_SUCH_AS_SPECIMEN_AND_OBSERVATIONS= "eu.etaxonomy.taxeditor.abcd_import_configurator.addIndividualsAssociationsSuchAsSpecimenAndObservations"; |
|
182 |
public static final String ABCD_IMPORT_CONFIGURATOR_REUSE_EXISTING_DESCRIPTIVE_GROUPS= "eu.etaxonomy.taxeditor.abcd_import_configurator.reuseExistingDescriptiveGroups"; |
|
183 |
public static final String ABCD_IMPORT_CONFIGURATOR_ALLOW_REUSE_OTHER_CLASSIFICATIONS= "eu.etaxonomy.taxeditor.abcd_import_configurator.allowReuseOtherClassifications"; |
|
184 |
public static final String ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_REFERENCES= "eu.etaxonomy.taxeditor.abcd_import_configurator.deduplicateReferences"; |
|
185 |
public static final String ABCD_IMPORT_CONFIGURATOR_DEDUPLICATE_CLASSIFICATIONS= "eu.etaxonomy.taxeditor.abcd_import_configurator.deduplicateClassifications"; |
|
186 |
public static final String ABCD_IMPORT_CONFIGURATOR_MOVE_NEW_TAXA_TO_DEFAULT_CLASSIFICATION= "eu.etaxonomy.taxeditor.abcd_import_configurator.moveNewTaxaToDefaultClassification"; |
|
187 |
public static final String ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TOCATALOG_NUMBER= "eu.etaxonomy.taxeditor.abcd_import_configurator.mapUnitIdToCatalogNumber"; |
|
188 |
public static final String ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_ACCESSION_NUMBER= "eu.etaxonomy.taxeditor.abcd_import_configurator.mapUnitIdToAccessionNumber"; |
|
189 |
public static final String ABCD_IMPORT_CONFIGURATOR_MAP_UNIT_ID_TO_BARCODE= "eu.etaxonomy.taxeditor.abcd_import_configurator.mapUnitIdToBarcode"; |
|
190 |
public static final String ABCD_IMPORT_CONFIGURATOR_OVERWRITE_EXISTING_SPECIMEN= "eu.etaxonomy.taxeditor.abcd_import_configurator.overwriteExistingSpecimens"; |
|
191 |
public static final String ABCD_IMPORT_CONFIGURATOR_DEFAULT_AUTHOR = "eu.etaxonomy.taxeditor.abcd_import_configurator.defaultAuthor"; |
|
192 |
public static final String ABCD_IMPORT_CONFIGURATOR_CLASSIFICATION_UUID = "eu.etaxonomy.taxeditor.abcd_import_configurator.classificationUuid"; |
|
193 |
public static final String ABCD_IMPORT_CONFIGURATOR_NOMENCLATURAL_CODE = "eu.etaxonomy.taxeditor.abcd_import_configurator.nomenclaturalCode"; |
|
194 |
public static final String ABCD_IMPORT_CONFIGURATOR_DNA_PROVIDER = "eu.etaxonomy.taxeditor.abcd_import_configurator.dnaProvider"; |
|
195 |
|
|
196 |
|
|
197 |
|
|
198 |
/* |
|
199 |
* Keys for the biocase providers |
|
200 |
*/ |
|
201 |
|
|
202 |
public static final String BIOCASE_PROVIDER_LIST = "eu.etaxonomy.taxeditor.abcd_import.biocaseProviderList" ; |
|
203 | 169 |
|
204 | 170 |
public static final String SHOW_ADVANCED_MEDIA_SECTION = "eu.etaxonomy.taxeditor.media.showAdvancedMedia" + CdmStore.getActiveCdmSource().getName(); |
205 | 171 |
public static final String SHOW_MEDIA_PREVIEW = "eu.etaxonomy.taxeditor.media.showMediaPreview"+ CdmStore.getActiveCdmSource().getName(); |
Also available in: Unified diff
ref #8385: adapt local and db preference pages