Revision 05030527
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties | ||
---|---|---|
22 | 22 |
DatabaseRepairPage_toolTip_polytomousKeyNode=The sort indexes of all polytomous keys are recalculated. |
23 | 23 |
DatabaseRepairPage_featureNodes=Feature Tree |
24 | 24 |
DatabaseRepairPage_toolTipFeatureNodes=The sort indexes of the feature tree will be recalculated. |
25 |
DatabaseRepairPage_updateTaxonName=Scientific Names |
|
26 |
DatabaseRepairPage_toolTip_TaxonName=Caches of all scientific names are recalculated. |
|
27 |
DatabaseRepairPage_TaxonBase=Taxa and Synonyms |
|
28 |
DatabaseRepairPage_toolTip_taxonBase=Caches of all taxa and synonyms are recalculated. |
|
29 |
DatabaseRepairPage_Reference=References |
|
30 |
DatabaseRepairPage_toolTip_reference=Caches of all references are recalculated. |
|
31 |
|
|
32 |
|
|
33 |
|
|
25 | 34 |
UriWithLabelElement_URL_NOT_SAVED=URI won't be saved\! |
26 | 35 |
UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URI is invalid. |
27 | 36 |
UriWithLabelElement_INVALID_URL=Invalid URI |
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages_de.properties | ||
---|---|---|
22 | 22 |
DatabaseRepairPage_toolTip_polytomousKeyNode=Die Sortier Indizes aller Polytomen Schl?ssel werden aktualisiert. |
23 | 23 |
DatabaseRepairPage_featureNodes=Merkmalsbaum |
24 | 24 |
DatabaseRepairPage_toolTipFeatureNodes=Die Sortier Indizes des Merkmalsbaumes werden aktualisiert. |
25 |
DatabaseRepairPage_updateTaxonName=Wissenschaftliche Namen |
|
26 |
DatabaseRepairPage_toolTip_TaxonName=Die Caches aller wissenschaftlichen Namen werden aktualisiert. |
|
27 |
DatabaseRepairPage_TaxonBase=Taxa und Synonyme |
|
28 |
DatabaseRepairPage_toolTip_taxonBase=Die Caches aller Taxa und Synonyme werden aktualisiert. |
|
29 |
DatabaseRepairPage_Reference=Referenzen |
|
30 |
DatabaseRepairPage_toolTip_reference=Die Caches aller Referenzen werden aktualisiert. |
|
25 | 31 |
|
26 | 32 |
UriWithLabelElement_URL_NOT_SAVED=URI wird nicht gespeichert\! |
27 | 33 |
UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Externer Browser konnte nicht ge?ffnet werden. URI ist ung\u00FCtlig. |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/Messages.java | ||
---|---|---|
19 | 19 |
public class Messages extends NLS { |
20 | 20 |
private static final String BUNDLE_NAME = "OSGI-INF/l10n/messages"; //$NON-NLS-1$ |
21 | 21 |
|
22 |
|
|
22 | 23 |
public static String AuthenticatedUserBar_LOGGED_IN_AS; |
23 | 24 |
public static String AuthenticatedUserBar_NOT_LOGGED_IN; |
24 | 25 |
public static String LanguageEditorPreferencePage_ChooseDefaultLanguage; |
... | ... | |
32 | 33 |
public static String DatabaseRepairPage_toolTip_polytomousKeyNode; |
33 | 34 |
public static String DatabaseRepairPage_featureNodes; |
34 | 35 |
public static String DatabaseRepairPage_toolTipFeatureNodes; |
36 |
public static String DatabaseRepairPage_updateTaxonName; |
|
37 |
public static String DatabaseRepairPage_toolTip_TaxonName; |
|
38 |
public static String DatabaseRepairPage_TaxonBase; |
|
39 |
public static String DatabaseRepairPage_toolTip_taxonBase; |
|
40 |
public static String DatabaseRepairPage_Reference; |
|
41 |
public static String DatabaseRepairPage_toolTip_reference; |
|
42 |
|
|
35 | 43 |
public static String LoginDialog_CANCEL_MESSAGE; |
36 | 44 |
public static String LoginDialog_LOGIN; |
37 | 45 |
public static String LoginDialog_PASSWORD; |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databasePreferences/wizard/DatabasePreferencesPage.java | ||
---|---|---|
1 |
// $Id$ |
|
2 |
/** |
|
3 |
* Copyright (C) 2016 EDIT |
|
4 |
* European Distributed Institute of Taxonomy |
|
5 |
* http://www.e-taxonomy.eu |
|
6 |
* |
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
9 |
*/ |
|
10 |
package eu.etaxonomy.taxeditor.databasePreferences.wizard; |
|
11 |
|
|
12 |
import java.util.List; |
|
13 |
|
|
14 |
import org.eclipse.jface.preference.BooleanFieldEditor; |
|
15 |
import org.eclipse.jface.preference.ComboFieldEditor; |
|
16 |
import org.eclipse.jface.preference.FieldEditorPreferencePage; |
|
17 |
import org.eclipse.jface.preference.IPreferenceStore; |
|
18 |
import org.eclipse.jface.wizard.IWizard; |
|
19 |
import org.eclipse.jface.wizard.IWizardPage; |
|
20 |
import org.eclipse.ui.IWorkbench; |
|
21 |
import org.eclipse.ui.IWorkbenchPreferencePage; |
|
22 |
|
|
23 |
import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration; |
|
24 |
import eu.etaxonomy.cdm.api.service.IPreferenceService; |
|
25 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference; |
|
26 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
|
27 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
|
28 |
import eu.etaxonomy.taxeditor.model.NomenclaturalCodeHelper; |
|
29 |
import eu.etaxonomy.taxeditor.preference.IPreferenceKeys; |
|
30 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
|
31 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
32 |
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin; |
|
33 |
|
|
34 |
/** |
|
35 |
* @author k.luther |
|
36 |
* @date 01.11.2016 |
|
37 |
* |
|
38 |
*/ |
|
39 |
public class DatabasePreferencesPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IWizardPage { |
|
40 |
|
|
41 |
/** |
|
42 |
* The wizard to which this page belongs; <code>null</code> |
|
43 |
* if this page has yet to be added to a wizard. |
|
44 |
*/ |
|
45 |
private IWizard wizard = null; |
|
46 |
|
|
47 |
/** |
|
48 |
* Indicates whether this page is complete. |
|
49 |
*/ |
|
50 |
private boolean isPageComplete = true; |
|
51 |
|
|
52 |
/** |
|
53 |
* The page that was shown right before this page became visible; |
|
54 |
* <code>null</code> if none. |
|
55 |
*/ |
|
56 |
private IWizardPage previousPage = null; |
|
57 |
|
|
58 |
CdmPreference preferedNomenclaturalCode; |
|
59 |
|
|
60 |
/* |
|
61 |
* |
|
62 |
*/ |
|
63 |
public DatabasePreferencesPage() { |
|
64 |
this.noDefaultAndApplyButton(); |
|
65 |
} |
|
66 |
|
|
67 |
/* (non-Javadoc) |
|
68 |
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) |
|
69 |
*/ |
|
70 |
@Override |
|
71 |
public void init(IWorkbench workbench) { |
|
72 |
|
|
73 |
setPreferenceStore(TaxeditorStorePlugin.getDefault() |
|
74 |
.getPreferenceStore()); |
|
75 |
|
|
76 |
preferedNomenclaturalCode = PreferencesUtil.setPreferredNomenclaturalCode(null, false); |
|
77 |
if (super.getPreferenceStore()== null){ |
|
78 |
setPreferenceStore(PreferencesUtil.getPreferenceStore()); |
|
79 |
} |
|
80 |
|
|
81 |
|
|
82 |
} |
|
83 |
|
|
84 |
/* (non-Javadoc) |
|
85 |
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() |
|
86 |
*/ |
|
87 |
@Override |
|
88 |
protected void createFieldEditors() { |
|
89 |
setMessage("Choose which nomenclatural code you would like to use for scientific names unless otherwise specified."); |
|
90 |
ComboFieldEditor nomenclaturalCode = new ComboFieldEditor( |
|
91 |
IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY, |
|
92 |
"Available Codes", getLabelAndValues(), |
|
93 |
getFieldEditorParent()); |
|
94 |
nomenclaturalCode.setPreferenceStore(PreferencesUtil.getPreferenceStore()); |
|
95 |
addField(nomenclaturalCode); |
|
96 |
BooleanFieldEditor allowOverride = new BooleanFieldEditor( |
|
97 |
IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY, |
|
98 |
"allow to use local preference", |
|
99 |
getFieldEditorParent()); |
|
100 |
allowOverride.setPreferenceStore(PreferencesUtil.getPreferenceStore()); |
|
101 |
addField(allowOverride); |
|
102 |
|
|
103 |
|
|
104 |
} |
|
105 |
|
|
106 |
/** |
|
107 |
* Returns the preference store of this preference page. |
|
108 |
* <p> |
|
109 |
* This is a framework hook method for subclasses to return a |
|
110 |
* page-specific preference store. The default implementation |
|
111 |
* returns <code>null</code>. |
|
112 |
* </p> |
|
113 |
* |
|
114 |
* @return the preference store, or <code>null</code> if none |
|
115 |
*/ |
|
116 |
@Override |
|
117 |
protected IPreferenceStore doGetPreferenceStore() { |
|
118 |
return PreferencesUtil.getPreferenceStore(); |
|
119 |
} |
|
120 |
|
|
121 |
/** |
|
122 |
* @return |
|
123 |
*/ |
|
124 |
private String[][] getLabelAndValues() { |
|
125 |
List<NomenclaturalCode> supportedCodes = NomenclaturalCodeHelper |
|
126 |
.getSupportedCodes(); |
|
127 |
String[][] labelAndValues = new String[supportedCodes.size()][2]; |
|
128 |
for (int i = 0; i < supportedCodes.size(); i++) { |
|
129 |
labelAndValues[i][0] = NomenclaturalCodeHelper |
|
130 |
.getDescription(supportedCodes.get(i)); |
|
131 |
labelAndValues[i][1] = PreferencesUtil |
|
132 |
.getPreferenceKey(supportedCodes.get(i)); |
|
133 |
} |
|
134 |
return labelAndValues; |
|
135 |
} |
|
136 |
@Override |
|
137 |
public boolean performOk() { |
|
138 |
if (super.getPreferenceStore()== null){ |
|
139 |
setPreferenceStore(PreferencesUtil.getPreferenceStore()); |
|
140 |
} |
|
141 |
boolean result = super.performOk(); |
|
142 |
if (result){ |
|
143 |
String value =getPreferenceStore().getString(IPreferenceKeys.CDM_NOMENCLATURAL_CODE_KEY); |
|
144 |
boolean allowOverride = getPreferenceStore().getBoolean(IPreferenceKeys.ALLOW_OVERRIDE_NOMENCLATURAL_CODE_KEY); |
|
145 |
CdmPreference pref = CdmPreference.NewDatabaseInstance( PreferencePredicate.NomenclaturalCode, value); |
|
146 |
pref.setAllowOverride(allowOverride); |
|
147 |
ICdmApplicationConfiguration controller = CdmStore.getCurrentApplicationConfiguration(); |
|
148 |
if (controller == null){ |
|
149 |
return false; |
|
150 |
} |
|
151 |
IPreferenceService service = controller.getPreferenceService(); |
|
152 |
service.set(pref); |
|
153 |
} |
|
154 |
return result; |
|
155 |
} |
|
156 |
|
|
157 |
/** |
|
158 |
* {@inheritDoc} |
|
159 |
*/ |
|
160 |
@Override |
|
161 |
public boolean canFlipToNextPage() { |
|
162 |
// TODO Auto-generated method stub |
|
163 |
return true; |
|
164 |
} |
|
165 |
|
|
166 |
/** |
|
167 |
* {@inheritDoc} |
|
168 |
*/ |
|
169 |
@Override |
|
170 |
public String getName() { |
|
171 |
|
|
172 |
return "Database Preferences"; |
|
173 |
} |
|
174 |
|
|
175 |
/** |
|
176 |
* {@inheritDoc} |
|
177 |
*/ |
|
178 |
@Override |
|
179 |
public IWizardPage getNextPage() { |
|
180 |
// TODO Auto-generated method stub |
|
181 |
return null; |
|
182 |
} |
|
183 |
|
|
184 |
/** |
|
185 |
* {@inheritDoc} |
|
186 |
*/ |
|
187 |
@Override |
|
188 |
public IWizardPage getPreviousPage() { |
|
189 |
|
|
190 |
return previousPage; |
|
191 |
} |
|
192 |
|
|
193 |
/** |
|
194 |
* {@inheritDoc} |
|
195 |
*/ |
|
196 |
@Override |
|
197 |
public IWizard getWizard() { |
|
198 |
|
|
199 |
return wizard; |
|
200 |
} |
|
201 |
|
|
202 |
/** |
|
203 |
* {@inheritDoc} |
|
204 |
*/ |
|
205 |
@Override |
|
206 |
public boolean isPageComplete() { |
|
207 |
|
|
208 |
return isPageComplete; |
|
209 |
} |
|
210 |
|
|
211 |
/** |
|
212 |
* {@inheritDoc} |
|
213 |
*/ |
|
214 |
@Override |
|
215 |
public void setPreviousPage(IWizardPage page) { |
|
216 |
this.previousPage = page; |
|
217 |
|
|
218 |
} |
|
219 |
|
|
220 |
/** |
|
221 |
* {@inheritDoc} |
|
222 |
*/ |
|
223 |
@Override |
|
224 |
public void setWizard(IWizard newWizard) { |
|
225 |
this.wizard = newWizard; |
|
226 |
|
|
227 |
} |
|
228 |
|
|
229 |
|
|
230 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databasePreferences/wizard/DatabasePreferencesWizard.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2016 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.databasePreferences.wizard; |
|
10 |
|
|
11 |
import org.eclipse.jface.wizard.Wizard; |
|
12 |
|
|
13 |
/** |
|
14 |
* @author k.luther |
|
15 |
* @date 18.11.2016 |
|
16 |
* |
|
17 |
*/ |
|
18 |
public class DatabasePreferencesWizard extends Wizard { |
|
19 |
|
|
20 |
|
|
21 |
private final DatabasePreferencesPage preferencePage; |
|
22 |
|
|
23 |
|
|
24 |
public DatabasePreferencesWizard() { |
|
25 |
setWindowTitle("Database Preferences Wizard"); |
|
26 |
|
|
27 |
preferencePage = new DatabasePreferencesPage(); |
|
28 |
// preferencePage.setDescription("Choose which nomenclatural code you would like to use for scientific names unless otherwise specified."); |
|
29 |
// preferencePage.init(PlatformUI.getWorkbench()); |
|
30 |
} |
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
/** |
|
35 |
* {@inheritDoc} |
|
36 |
*/ |
|
37 |
@Override |
|
38 |
public boolean performFinish() { |
|
39 |
if (preferencePage.performOk()){ |
|
40 |
return true; |
|
41 |
} |
|
42 |
return false; |
|
43 |
} |
|
44 |
|
|
45 |
/** |
|
46 |
* @return the preferencePage |
|
47 |
*/ |
|
48 |
public DatabasePreferencesPage getPreferencePage() { |
|
49 |
return preferencePage; |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
public void addPages() { |
|
54 |
addPage(preferencePage); |
|
55 |
} |
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databasePreferences/wizard/DatabaseRepairPage.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2016 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.databasePreferences.wizard; |
|
10 |
|
|
11 |
import org.eclipse.jface.wizard.WizardPage; |
|
12 |
import org.eclipse.swt.SWT; |
|
13 |
import org.eclipse.swt.events.SelectionAdapter; |
|
14 |
import org.eclipse.swt.events.SelectionEvent; |
|
15 |
import org.eclipse.swt.layout.GridLayout; |
|
16 |
import org.eclipse.swt.widgets.Button; |
|
17 |
import org.eclipse.swt.widgets.Composite; |
|
18 |
|
|
19 |
import eu.etaxonomy.cdm.io.common.SortIndexUpdaterConfigurator; |
|
20 |
import eu.etaxonomy.taxeditor.Messages; |
|
21 |
|
|
22 |
/** |
|
23 |
* @author k.luther |
|
24 |
* @date 06.12.2016 |
|
25 |
* |
|
26 |
*/ |
|
27 |
public class DatabaseRepairPage extends WizardPage { |
|
28 |
|
|
29 |
SortIndexUpdaterConfigurator config = null; |
|
30 |
/** |
|
31 |
* @param pageName |
|
32 |
*/ |
|
33 |
protected DatabaseRepairPage(String pageName, SortIndexUpdaterConfigurator config){ |
|
34 |
super(pageName); |
|
35 |
this.config = config; |
|
36 |
setMessage(Messages.DatabaseRepairPage_chooseParameter); |
|
37 |
} |
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
/** |
|
47 |
* {@inheritDoc} |
|
48 |
*/ |
|
49 |
@Override |
|
50 |
public void createControl(Composite parent) { |
|
51 |
final Composite composite = new Composite(parent, SWT.NULL); |
|
52 |
|
|
53 |
GridLayout gridLayout = new GridLayout(); |
|
54 |
composite.setLayout(gridLayout); |
|
55 |
|
|
56 |
Button checkBoxTaxonNode = new Button(composite, SWT.CHECK); |
|
57 |
checkBoxTaxonNode.setSelection(config.isDoTaxonNode()); |
|
58 |
checkBoxTaxonNode.setText(Messages.DatabaseRepairPage_updateTaxonNodes); |
|
59 |
checkBoxTaxonNode |
|
60 |
.setToolTipText(Messages.DatabaseRepairPage_toolTip_taxonNode); |
|
61 |
checkBoxTaxonNode.addSelectionListener(new SelectionAdapter() { |
|
62 |
@Override |
|
63 |
public void widgetSelected(SelectionEvent e) { |
|
64 |
config.setDoTaxonNode(!config.isDoTaxonNode()); |
|
65 |
} |
|
66 |
}); |
|
67 |
|
|
68 |
Button checkBoxPolytomousKeyNode = new Button(composite, SWT.CHECK); |
|
69 |
checkBoxPolytomousKeyNode.setSelection(config.isDoPolytomousKeyNode()); |
|
70 |
checkBoxPolytomousKeyNode.setText(Messages.DatabaseRepairPage_PolytomousKeyNode); |
|
71 |
checkBoxPolytomousKeyNode |
|
72 |
.setToolTipText(Messages.DatabaseRepairPage_toolTip_polytomousKeyNode); |
|
73 |
checkBoxPolytomousKeyNode.addSelectionListener(new SelectionAdapter() { |
|
74 |
@Override |
|
75 |
public void widgetSelected(SelectionEvent e) { |
|
76 |
config.setDoPolytomousKeyNode(!config.isDoPolytomousKeyNode()); |
|
77 |
} |
|
78 |
}); |
|
79 |
|
|
80 |
Button checkBoxFeatureNode = new Button(composite, SWT.CHECK); |
|
81 |
checkBoxFeatureNode.setSelection(config.isDoFeatureNode()); |
|
82 |
checkBoxFeatureNode.setText(Messages.DatabaseRepairPage_featureNodes); |
|
83 |
checkBoxFeatureNode |
|
84 |
.setToolTipText(Messages.DatabaseRepairPage_toolTipFeatureNodes); |
|
85 |
checkBoxFeatureNode.addSelectionListener(new SelectionAdapter() { |
|
86 |
@Override |
|
87 |
public void widgetSelected(SelectionEvent e) { |
|
88 |
config.setDoFeatureNode(!config.isDoFeatureNode()); |
|
89 |
} |
|
90 |
}); |
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
setControl(composite); |
|
95 |
|
|
96 |
} |
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databasePreferences/wizard/DatabaseRepairWizard.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2016 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.databasePreferences.wizard; |
|
10 |
|
|
11 |
import org.eclipse.core.runtime.jobs.Job; |
|
12 |
import org.eclipse.jface.wizard.Wizard; |
|
13 |
|
|
14 |
import eu.etaxonomy.cdm.config.ICdmSource; |
|
15 |
import eu.etaxonomy.cdm.io.common.SortIndexUpdaterConfigurator; |
|
16 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
17 |
|
|
18 |
/** |
|
19 |
* @author k.luther |
|
20 |
* @date 06.12.2016 |
|
21 |
* |
|
22 |
*/ |
|
23 |
public class DatabaseRepairWizard extends Wizard { |
|
24 |
private final DatabaseRepairPage repairPage; |
|
25 |
SortIndexUpdaterConfigurator config; |
|
26 |
|
|
27 |
public DatabaseRepairWizard() { |
|
28 |
setWindowTitle("Database Repair Wizard"); |
|
29 |
config = SortIndexUpdaterConfigurator.NewInstance(null); |
|
30 |
repairPage = new DatabaseRepairPage("Database Repair",config); |
|
31 |
|
|
32 |
} |
|
33 |
|
|
34 |
/** |
|
35 |
* {@inheritDoc} |
|
36 |
*/ |
|
37 |
@Override |
|
38 |
public boolean performFinish() { |
|
39 |
if (repairPage.isPageComplete()){ |
|
40 |
if (config == null){ |
|
41 |
ICdmSource source= CdmStore.getActiveCdmSource(); |
|
42 |
config = SortIndexUpdaterConfigurator.NewInstance(null); |
|
43 |
config.setDoFeatureNode(false); |
|
44 |
config.setDoPolytomousKeyNode(false); |
|
45 |
|
|
46 |
} |
|
47 |
Job updateJob = CdmStore.getImportManager().createIOServiceJob(config); |
|
48 |
|
|
49 |
CdmStore.getImportManager().run(updateJob); |
|
50 |
} |
|
51 |
return true; |
|
52 |
} |
|
53 |
|
|
54 |
@Override |
|
55 |
public void addPages() { |
|
56 |
addPage(repairPage); |
|
57 |
} |
|
58 |
|
|
59 |
|
|
60 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/NameDetailsConfigurator.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2016 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 |
/** |
|
12 |
* @author k.luther |
|
13 |
* @date 16.12.2016 |
|
14 |
* |
|
15 |
*/ |
|
16 |
public class NameDetailsConfigurator { |
|
17 |
|
|
18 |
private boolean isSimpleDetailsViewActivated = true; |
|
19 |
|
|
20 |
private boolean isTaxonSectionActivated = true; |
|
21 |
private boolean isLSIDActivated = true; |
|
22 |
private boolean isNomenclaturalCodeActived = true; |
|
23 |
private boolean isNameCacheActivated = true; |
|
24 |
private boolean isAppendedPhraseActivated = true; |
|
25 |
private boolean isRankActivated = true; |
|
26 |
private boolean isAtomisedEpithetsActivated = true; |
|
27 |
private boolean isAuthorshipSectionActivated = true; |
|
28 |
private boolean isNomenclaturalReferenceSectionActivated = true; |
|
29 |
private boolean isNomenclaturalStatusSectionActivated = true; |
|
30 |
private boolean isTypeDesignationSectionActivated = true; |
|
31 |
private boolean isNameRelationsSectionActivated = true; |
|
32 |
private boolean isProtologueActivated = true; |
|
33 |
|
|
34 |
public NameDetailsConfigurator(boolean isSimpleDetailsViewActivated){ |
|
35 |
this.isSimpleDetailsViewActivated = isSimpleDetailsViewActivated; |
|
36 |
} |
|
37 |
|
|
38 |
public boolean isSimpleDetailsViewActivated() { |
|
39 |
return isSimpleDetailsViewActivated; |
|
40 |
} |
|
41 |
|
|
42 |
public void setSimpleDetailsViewActivated(boolean isSimpleDetailsViewActivated) { |
|
43 |
this.isSimpleDetailsViewActivated = isSimpleDetailsViewActivated; |
|
44 |
} |
|
45 |
|
|
46 |
public boolean isTaxonSectionActivated() { |
|
47 |
return isTaxonSectionActivated; |
|
48 |
} |
|
49 |
|
|
50 |
public void setTaxonSectionActivated(boolean isTaxonSectionActivated) { |
|
51 |
this.isTaxonSectionActivated = isTaxonSectionActivated; |
|
52 |
} |
|
53 |
|
|
54 |
public boolean isLSIDActivated() { |
|
55 |
return isLSIDActivated; |
|
56 |
} |
|
57 |
|
|
58 |
public void setLSIDActivated(boolean isLSIDActivated) { |
|
59 |
this.isLSIDActivated = isLSIDActivated; |
|
60 |
} |
|
61 |
|
|
62 |
public boolean isNomenclaturalCodeActived() { |
|
63 |
return isNomenclaturalCodeActived; |
|
64 |
} |
|
65 |
|
|
66 |
public void setNomenclaturalCodeActived(boolean isNomenclaturalCodeActived) { |
|
67 |
this.isNomenclaturalCodeActived = isNomenclaturalCodeActived; |
|
68 |
} |
|
69 |
|
|
70 |
public boolean isNameCacheActivated() { |
|
71 |
return isNameCacheActivated; |
|
72 |
} |
|
73 |
|
|
74 |
public void setNameCacheActivated(boolean isNameCacheActivated) { |
|
75 |
this.isNameCacheActivated = isNameCacheActivated; |
|
76 |
} |
|
77 |
|
|
78 |
public boolean isAppendedPhraseActivated() { |
|
79 |
return isAppendedPhraseActivated; |
|
80 |
} |
|
81 |
|
|
82 |
public void setAppendedPhraseActivated(boolean isAppendedPhraseActivated) { |
|
83 |
this.isAppendedPhraseActivated = isAppendedPhraseActivated; |
|
84 |
} |
|
85 |
|
|
86 |
public boolean isRankActivated() { |
|
87 |
return isRankActivated; |
|
88 |
} |
|
89 |
|
|
90 |
public void setRankActivated(boolean isRankActivated) { |
|
91 |
this.isRankActivated = isRankActivated; |
|
92 |
} |
|
93 |
|
|
94 |
public boolean isAtomisedEpithetsActivated() { |
|
95 |
return isAtomisedEpithetsActivated; |
|
96 |
} |
|
97 |
|
|
98 |
public void setAtomisedEpithetsActivated(boolean isAtomisedEpithetsActivated) { |
|
99 |
this.isAtomisedEpithetsActivated = isAtomisedEpithetsActivated; |
|
100 |
} |
|
101 |
|
|
102 |
public boolean isAuthorshipSectionActivated() { |
|
103 |
return isAuthorshipSectionActivated; |
|
104 |
} |
|
105 |
|
|
106 |
public void setAuthorshipSectionActivated(boolean isAuthorshipSectionActivated) { |
|
107 |
this.isAuthorshipSectionActivated = isAuthorshipSectionActivated; |
|
108 |
} |
|
109 |
|
|
110 |
public boolean isNomenclaturalReferenceSectionActivated() { |
|
111 |
return isNomenclaturalReferenceSectionActivated; |
|
112 |
} |
|
113 |
|
|
114 |
public void setNomenclaturalReferenceSectionActivated(boolean isNomenclaturalReferenceSectionActivated) { |
|
115 |
this.isNomenclaturalReferenceSectionActivated = isNomenclaturalReferenceSectionActivated; |
|
116 |
} |
|
117 |
|
|
118 |
public boolean isNomenclaturalStatusSectionActivated() { |
|
119 |
return isNomenclaturalStatusSectionActivated; |
|
120 |
} |
|
121 |
|
|
122 |
public void setNomenclaturalStatusSectionActivated(boolean isNomenclaturalStatusSectionActivated) { |
|
123 |
this.isNomenclaturalStatusSectionActivated = isNomenclaturalStatusSectionActivated; |
|
124 |
} |
|
125 |
|
|
126 |
public boolean isTypeDesignationSectionActivated() { |
|
127 |
return isTypeDesignationSectionActivated; |
|
128 |
} |
|
129 |
|
|
130 |
public void setTypeDesignationSectionActivated(boolean isTypeDesignationSectionActivated) { |
|
131 |
this.isTypeDesignationSectionActivated = isTypeDesignationSectionActivated; |
|
132 |
} |
|
133 |
|
|
134 |
public boolean isNameRelationsSectionActivated() { |
|
135 |
return isNameRelationsSectionActivated; |
|
136 |
} |
|
137 |
|
|
138 |
public void setNameRelationsSectionActivated(boolean isNameRelationsSectionActivated) { |
|
139 |
this.isNameRelationsSectionActivated = isNameRelationsSectionActivated; |
|
140 |
} |
|
141 |
|
|
142 |
/** |
|
143 |
* @return the isProtologueActivated |
|
144 |
*/ |
|
145 |
public boolean isProtologueActivated() { |
|
146 |
return isProtologueActivated; |
|
147 |
} |
|
148 |
|
|
149 |
/** |
|
150 |
* @param isProtologueActivated the isProtologueActivated to set |
|
151 |
*/ |
|
152 |
public void setProtologueActivated(boolean isProtologueActivated) { |
|
153 |
this.isProtologueActivated = isProtologueActivated; |
|
154 |
} |
|
155 |
|
|
156 |
@Override |
|
157 |
public String toString(){ |
|
158 |
StringBuffer result = new StringBuffer(); |
|
159 |
//the preference value is build like this: |
|
160 |
//<section1>:true;<section2>:false.... |
|
161 |
result.append("taxon"); |
|
162 |
result.append(":"); |
|
163 |
result.append(this.isTaxonSectionActivated); |
|
164 |
result.append(";"); |
|
165 |
|
|
166 |
result.append("lsid"); |
|
167 |
result.append(":"); |
|
168 |
result.append(this.isLSIDActivated()); |
|
169 |
result.append(";"); |
|
170 |
result.append("nc"); |
|
171 |
result.append(":"); |
|
172 |
result.append(this.isNomenclaturalCodeActived()); |
|
173 |
result.append(";"); |
|
174 |
result.append("ap"); |
|
175 |
result.append(":"); |
|
176 |
result.append(this.isAppendedPhraseActivated()); |
|
177 |
result.append(";"); |
|
178 |
result.append("rank"); |
|
179 |
result.append(":"); |
|
180 |
result.append(this.isRankActivated()); |
|
181 |
result.append(";"); |
|
182 |
result.append("author"); |
|
183 |
result.append(":"); |
|
184 |
result.append(this.isAuthorshipSectionActivated()); |
|
185 |
result.append(";"); |
|
186 |
result.append("atomisedEpithets"); |
|
187 |
result.append(":"); |
|
188 |
result.append(this.isAtomisedEpithetsActivated()); |
|
189 |
result.append(";"); |
|
190 |
result.append("nomRef"); |
|
191 |
result.append(":"); |
|
192 |
result.append(this.isNomenclaturalReferenceSectionActivated()); |
|
193 |
result.append(";"); |
|
194 |
result.append("nomStat"); |
|
195 |
result.append(":"); |
|
196 |
result.append(this.isNomenclaturalStatusSectionActivated()); |
|
197 |
result.append(";"); |
|
198 |
result.append("protologue"); |
|
199 |
result.append(":"); |
|
200 |
result.append(this.isProtologueActivated()); |
|
201 |
result.append(";"); |
|
202 |
result.append("typeDes"); |
|
203 |
result.append(":"); |
|
204 |
result.append(this.isTypeDesignationSectionActivated()); |
|
205 |
result.append(";"); |
|
206 |
result.append("nameRelation"); |
|
207 |
result.append(":"); |
|
208 |
result.append(this.isNameRelationsSectionActivated()); |
|
209 |
|
|
210 |
return result.toString(); |
|
211 |
} |
|
212 |
|
|
213 |
|
|
214 |
} |
Also available in: Unified diff
ref #6105: add name details view configuration to the cdm preferences view