Revision f53701cb
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/e4/OpenDistributionEditorWizardHandlerE4.java | ||
---|---|---|
15 | 15 |
import org.eclipse.jface.wizard.WizardDialog; |
16 | 16 |
import org.eclipse.swt.widgets.Shell; |
17 | 17 |
|
18 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference; |
|
19 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
|
18 | 20 |
import eu.etaxonomy.taxeditor.preference.wizard.AvailableVocabularyWizard; |
19 | 21 |
|
20 | 22 |
/** |
... | ... | |
29 | 31 |
|
30 | 32 |
@Execute |
31 | 33 |
public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell) { |
32 |
|
|
33 |
AvailableVocabularyWizard wizard = new AvailableVocabularyWizard(true, null, "Distribution");
|
|
34 |
CdmPreference pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.AvailableDistributionAreaVocabularies, null); |
|
35 |
AvailableVocabularyWizard wizard = new AvailableVocabularyWizard(true, pref, "Distribution");
|
|
34 | 36 |
|
35 | 37 |
WizardDialog dialog = new WizardDialog(shell, |
36 | 38 |
wizard); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableVocabularyWizard.java | ||
---|---|---|
124 | 124 |
} |
125 | 125 |
} |
126 | 126 |
String saveCheckedElements = StringUtils.join(listUIIDChecked, ";"); |
127 |
// |
|
127 |
String predicate = null; |
|
128 |
if (pref != null){ |
|
129 |
predicate = pref.getPredicate(); |
|
130 |
} |
|
128 | 131 |
CdmPreference savePref = CdmPreference.NewInstance(PreferenceSubject.NewDatabaseInstance(), PreferencePredicate.getByKey(pref.getPredicate()), saveCheckedElements); |
129 | 132 |
PreferencesUtil.setPreferenceToDB(savePref); |
130 | 133 |
|
Also available in: Unified diff
ref #7063: fix NPE in local preferences