commit 6ac3c9c18cc95fd462d8e2ce82dcb0904cce7c6e
Author: Katja Luther <k.luther@bgbm.org>
Date:   Wed Sep 14 12:03:41 2016 +0200

    fix #6084: check if areas are selected in preferences before open the distribution editor

diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java
index 0b16c16c8..145b81a1a 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java
@@ -2,6 +2,7 @@ package eu.etaxonomy.taxeditor.editor.handler;
 
 import java.util.UUID;
 
+import org.apache.commons.lang.StringUtils;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.ui.PartInitException;
 
@@ -32,25 +33,31 @@ public class OpenChecklistEditorHandler extends DefaultOpenHandlerBase<ITaxonTre
 	@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);
 				}
 			}
 		}		
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java
index 992f9d285..fda70e878 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java
@@ -228,6 +228,7 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
         selectionService.addSelectionListener(this);
         viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
         labelProvider = new ChecklistLabelProvider(this.viewer);
+        
         terms = labelProvider.getNamedAreas();
         if (terms == null){
 			MessagingUtils.informationDialog("No Areas to display", "Please choose the areas you want to display. "
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java
index d9da0c0a2..014ff4fb7 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java
@@ -39,6 +39,7 @@ import eu.etaxonomy.cdm.model.description.Distribution;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.name.NonViralName;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
