import java.util.UUID;
+import org.apache.commons.lang.StringUtils;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.ui.PartInitException;
@Override
protected void open(ExecutionEvent event, ITaxonTreeNode entity) {
if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.DISTRIBUTION_AREA_PREFRENCES_ACTIVE)) {
+ if (StringUtils.isBlank(PreferencesUtil.getPreferenceStore().getString(IPreferenceKeys.DISTRIBUTION_AREA_OCCURENCE_STATUS) )){
+ MessagingUtils.informationDialog("No Areas to display", "Please choose the areas you want to display. "
+ + "Therefore go to the preferences, choose the Checklist Editor and choose the areas in the Distribution Selection Wizard.");
+ this.dispose();
+ return;
+ }
if (entity instanceof Classification) {
ChecklistEditorInput input = new ChecklistEditorInput(((Classification) entity));
try {
EditorUtil.open(input);
} catch (PartInitException e) {
- MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
+ MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open Distribution Editor", e);
} catch (NullPointerException npe) {
MessagingUtils.messageDialog("Failed to open Editor", OpenChecklistEditorHandler.class,
- "Could not open ChecklistView. The hierarchy is corrupted!", npe);
+ "Could not open Distribution Editor. The hierarchy is corrupted!", npe);
}
} else if (entity instanceof TaxonNode) {
ChecklistEditorInput input = new ChecklistEditorInput((TaxonNode) entity);
try {
EditorUtil.open(input);
} catch (PartInitException e) {
- MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open ChecklistView", e);
+ MessagingUtils.error(OpenChecklistEditorHandler.class, "Could not open Distribution Editor", e);
} catch (NullPointerException npe) {
MessagingUtils.messageDialog("Failed to open Editor", OpenChecklistEditorHandler.class,
- "Could not open ChecklistView. The hierarchy is corrupted!", npe);
+ "Could not open Distribution Editor. The hierarchy is corrupted!", npe);
}
}
}