Revision 6ac3c9c1
Added by Katja Luther over 7 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.util.UUID; |
4 | 4 |
|
5 |
import org.apache.commons.lang.StringUtils; |
|
5 | 6 |
import org.eclipse.core.commands.ExecutionEvent; |
6 | 7 |
import org.eclipse.ui.PartInitException; |
7 | 8 |
|
... | ... | |
32 | 33 |
@Override |
33 | 34 |
protected void open(ExecutionEvent event, ITaxonTreeNode entity) { |
34 | 35 |
if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE)) { |
36 |
if (StringUtils.isBlank(PreferencesUtil.getPreferenceStore().getString(IPreferenceKeys.DISTRIBUTION_AREA_OCCURENCE_STATUS) )){ |
|
37 |
MessagingUtils.informationDialog("No Areas to display", "Please choose the areas you want to display. " |
|
38 |
+ "Therefore go to the preferences, choose the Checklist Editor and choose the areas in the Distribution Selection Wizard."); |
|
39 |
this.dispose(); |
|
40 |
return; |
|
41 |
} |
|
35 | 42 |
if (entity instanceof Classification) { |
36 | 43 |
ChecklistEditorInput input = new ChecklistEditorInput(((Classification) entity)); |
37 | 44 |
try { |
38 | 45 |
EditorUtil.open(input); |
39 | 46 |
} catch (PartInitException e) { |
40 |
MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
|
|
47 |
MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open Distribution Editor", e);
|
|
41 | 48 |
} catch (NullPointerException npe) { |
42 | 49 |
MessagingUtils.messageDialog("Failed to open Editor", OpenChecklistEditorHandler.class, |
43 |
"Could not open ChecklistView. The hierarchy is corrupted!", npe);
|
|
50 |
"Could not open Distribution Editor. The hierarchy is corrupted!", npe);
|
|
44 | 51 |
} |
45 | 52 |
} else if (entity instanceof TaxonNode) { |
46 | 53 |
ChecklistEditorInput input = new ChecklistEditorInput((TaxonNode) entity); |
47 | 54 |
try { |
48 | 55 |
EditorUtil.open(input); |
49 | 56 |
} catch (PartInitException e) { |
50 |
MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
|
|
57 |
MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open Distribution Editor", e);
|
|
51 | 58 |
} catch (NullPointerException npe) { |
52 | 59 |
MessagingUtils.messageDialog("Failed to open Editor", OpenChecklistEditorHandler.class, |
53 |
"Could not open ChecklistView. The hierarchy is corrupted!", npe);
|
|
60 |
"Could not open Distribution Editor. The hierarchy is corrupted!", npe);
|
|
54 | 61 |
} |
55 | 62 |
} |
56 | 63 |
} |
Also available in: Unified diff
fix #6084: check if areas are selected in preferences before open the distribution editor