commit 4f25e6422b5f543eda7bfe4f4dd4f7f869277c7a
Author: Katja Luther <k.luther@bgbm.org>
Date:   Thu Sep 27 15:42:41 2018 +0200

    ref #7063: add vocabulary selection for distribution editor and area selection in editor

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 c7234a43a..1a6ee4e5a 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
@@ -27,7 +27,7 @@ import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.TableColumn;
 
 import eu.etaxonomy.cdm.api.service.IDescriptionService;
-import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.common.CdmUtils;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
@@ -170,8 +170,8 @@ public class ChecklistLabelProvider extends LabelProvider implements ITableLabel
     private SortedSet<DefinedTermBase> loadNamedAreas() {
         IPreferenceStore preferenceStore = PreferencesUtil.getPreferenceStore();
 
-        String values = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS);
-
+        String valuesAreas = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS);
+        String values = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_VOCABULARIES);
         if (values != null && values != "") { //$NON-NLS-1$
             String[] split = values.split(","); //$NON-NLS-1$
             List<String> listValue = Arrays.asList(split);
@@ -183,14 +183,27 @@ public class ChecklistLabelProvider extends LabelProvider implements ITableLabel
                 uuidList.add(uuid);
 
             }
-            ITermService service = CdmStore.getService(ITermService.class);
-            termlist = service.find(uuidList);
+            IVocabularyService service =  CdmStore.getService(IVocabularyService.class);
+            List<TermVocabulary> vocs = service.find(uuidList);
+            split = valuesAreas.split(",");
+            listValue = Arrays.asList(split);
+            for (TermVocabulary voc: vocs){
+                termlist.addAll(service.getTerms(voc, null, null, null, null).getRecords());
+            }
+            List<DefinedTermBase> filteredList = new ArrayList();
+            for (DefinedTermBase area: termlist){
+                if (listValue.contains(area.getUuid().toString())) {
+                    filteredList.add(area);
+                }
+
+            }
+
             if (PreferencesUtil.isSortNamedAreaByOrderInVocabulary()){
-                return getTermsOrderedByVocabularyOrder(termlist);
+                return getTermsOrderedByVocabularyOrder(filteredList);
             } else if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
-                return getTermsOrderedByIdInVocabulary(termlist);
+                return getTermsOrderedByIdInVocabulary(filteredList);
             }else{
-                return getTermsOrderedByLabels(termlist, CdmStore.getDefaultLanguage());
+                return getTermsOrderedByLabels(filteredList, CdmStore.getDefaultLanguage());
             }
         }
         return null;
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistDropdownSelectionListenerE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistDropdownSelectionListenerE4.java
index c5bf0fb52..580d81575 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistDropdownSelectionListenerE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistDropdownSelectionListenerE4.java
@@ -42,13 +42,14 @@ public class ChecklistDropdownSelectionListenerE4 extends SelectionAdapter {
         this.editor = editor;
         this.termSet = termSet;
         menu = new Menu(dropdown.getParent().getShell());
+
         initialMenuItem();
     }
 
     // SearchOption option
     public void add(DefinedTermBase<DefinedTermBase> term) {
         MenuItem menuItem = new MenuItem(menu, SWT.CHECK);
-   
+
            menuItem.setText(term.getTitleCache());
 
         if (PreferencesUtil.getPreferenceStore().getBoolean(term.getUuid().toString())) {
@@ -66,43 +67,60 @@ public class ChecklistDropdownSelectionListenerE4 extends SelectionAdapter {
                 // TODO make it selectable according to selection event
                 TableColumn column = null;
                 DefinedTermBase<DefinedTermBase> selectedTerm = null;
-                if (termSet != null) {
-                	TableColumn[] columns = viewer.getTable().getColumns();
-                	for (DefinedTermBase<DefinedTermBase> term : termSet) {
-                		if(selected.getText().equalsIgnoreCase(term.getTitleCache())){
-        					selectedTerm = term;
-        					for(int i=0; i<columns.length; i++){
-        						column = null;
-                        		if(columns[i].getText().equalsIgnoreCase(term.getIdInVocabulary())){
-                        			column = columns[i];
-                        			logger.info("Column no " +i +" Column Header "+ column.getText() ); //$NON-NLS-1$ //$NON-NLS-2$
-                				}else if (columns[i].getText().equalsIgnoreCase(term.getTitleCache())){
-                					column = columns[i];
-                        			logger.info("Column no " +i +" Column Header "+ column.getText() ); //$NON-NLS-1$ //$NON-NLS-2$
-                        			
-                        		}
-                        		if (column != null && column.getWidth() == 0) {
-                                    // save column status if shown or not
-                                    if (selectedTerm != null) {
-                                        PreferencesUtil.getPreferenceStore().setValue(selectedTerm.getUuid().toString(), true);
-                                    }
-                                    column.setWidth(50);
-                                } else if (column != null) {
-                                    if (selectedTerm != null) {
-                                        PreferencesUtil.getPreferenceStore().setValue(selectedTerm.getUuid().toString(), false);
-                                    }
-                                    column.setWidth(0);
-                                }
-                        	}
-        					break;
-        				}
-                		
-        			}
-                	
+
+                Integer position = editor.getAreaPosition().get(term.getUuid());
+                TableColumn[] columns = viewer.getTable().getColumns();
+                column = columns[position];
+
+                if (column != null && column.getWidth() == 0) {
+                    // save column status if shown or not
+                    if (term != null) {
+                        PreferencesUtil.getPreferenceStore().setValue(term.getUuid().toString(), true);
+                    }
+                    column.setWidth(50);
+                } else if (column != null) {
+                    if (term != null) {
+                        PreferencesUtil.getPreferenceStore().setValue(term.getUuid().toString(), false);
+                    }
+                    column.setWidth(0);
                 }
-                
+//                if (termSet != null) {
+//                	TableColumn[] columns = viewer.getTable().getColumns();
+//                	for (DefinedTermBase<DefinedTermBase> term : termSet) {
+//                		if(selected.getText().equalsIgnoreCase(term.getTitleCache())){
+//                		    selectedTerm = term;
+//        					for(int i=0; i<columns.length; i++){
+//        						column = null;
+//                        		if(columns[i].getText().equalsIgnoreCase(term.getIdInVocabulary())){
+//                        			column = columns[i];
+//                        			logger.info("Column no " +i +" Column Header "+ column.getText() ); //$NON-NLS-1$ //$NON-NLS-2$
+//                				}else if (columns[i].getText().equalsIgnoreCase(term.getTitleCache())){
+//                					column = columns[i];
+//                        			logger.info("Column no " +i +" Column Header "+ column.getText() ); //$NON-NLS-1$ //$NON-NLS-2$
+//
+//                        		}
+//                        		if (column != null && column.getWidth() == 0) {
+//                                    // save column status if shown or not
+//                                    if (selectedTerm != null) {
+//                                        PreferencesUtil.getPreferenceStore().setValue(selectedTerm.getUuid().toString(), true);
+//                                    }
+//                                    column.setWidth(50);
+//                                } else if (column != null) {
+//                                    if (selectedTerm != null) {
+//                                        PreferencesUtil.getPreferenceStore().setValue(selectedTerm.getUuid().toString(), false);
+//                                    }
+//                                    column.setWidth(0);
+//                                }
+//                        	}
+//        					break;
+//        				}
+//
+//        			}
+//
+//                }
+
                 editor.refresh();
-                
+
             }
         });
     }
@@ -134,9 +152,11 @@ public class ChecklistDropdownSelectionListenerE4 extends SelectionAdapter {
             Point pt = item.getParent().toDisplay(new Point(rect.x, rect.y));
             menu.setLocation(pt.x, pt.y + rect.height);
             menu.setVisible(true);
+
         } else {
             menu.setVisible(true);
         }
+
     }
 
     public Menu getMenu(){
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java
index 586f201dc..7a1782cb8 100644
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java
+++ b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java
@@ -17,6 +17,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.SortedSet;
+import java.util.UUID;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
@@ -37,6 +38,7 @@ import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.TableViewerColumn;
 import org.eclipse.jface.viewers.TableViewerEditor;
 import org.eclipse.jface.viewers.TableViewerFocusCellManager;
+import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -76,10 +78,11 @@ import eu.etaxonomy.taxeditor.editor.view.checklist.listener.ChecklistModifyList
 import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
 import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.preference.Resources;
+import eu.etaxonomy.taxeditor.preference.wizard.AvailableDistributionWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
 
 /**
@@ -135,12 +138,15 @@ public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversat
 
     private ChecklistLabelProvider labelProvider;
 //TODO: maybe it is better to use a hashMap for better handling of adding and removing terms??
-    private HashMap<String, DefinedTermBase> terms = null;
-	private ToolItem toolItem;
+    private Map<UUID, Integer> areaPosition= new HashMap();
+
+    private ToolItem toolItem;
 	private ChecklistDropdownSelectionListenerE4 dropListener;
 	private Text searchText;
 
-
+	public Map<UUID, Integer> getAreaPosition() {
+        return areaPosition;
+    }
     /**
      * @return the selectedTaxonNodes
      */
@@ -190,16 +196,16 @@ public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversat
 
 
         labelProvider = new ChecklistLabelProvider(this.viewer);
-        SortedSet<DefinedTermBase> termSet = labelProvider.getNamedAreas(false);
-        terms = new HashMap();
-        for (DefinedTermBase term : termSet){
-                terms.put(term.getTitleCache(), term);
-        }
-        if (terms == null){
-			MessagingUtils.informationDialog(Messages.ChecklistEditor_NO_AREAS, Messages.ChecklistEditor_NO_AREAS_MESSAGE);
-			this.dispose();
-			return;
-		}
+       // SortedSet<DefinedTermBase> termSet = labelProvider.getNamedAreas(true);
+//        terms = new HashMap();
+//        for (DefinedTermBase term : termSet){
+//                terms.put(term.getUuid(), term);
+//        }
+//        if (terms == null){
+//			MessagingUtils.informationDialog(Messages.ChecklistEditor_NO_AREAS, Messages.ChecklistEditor_NO_AREAS_MESSAGE);
+//			this.dispose();
+//			return;
+//		}
 
 
         viewer.addFilter(filter);
@@ -267,11 +273,26 @@ public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversat
      */
     private void createToolbar(Composite parent) {
         ToolBar toolBar = new ToolBar(parent, SWT.NONE);
-        toolItem = new ToolItem(toolBar, SWT.DROP_DOWN | SWT.BORDER);
+      //  toolItem = new ToolItem(toolBar, SWT.DROP_DOWN | SWT.BORDER);
+        toolItem = new ToolItem(toolBar, SWT.BUTTON1);
+
         toolItem.setText(Messages.ChecklistEditor_DIST_STATUS);
         toolItem.setToolTipText(Messages.ChecklistEditor_DIST_STATUS_TOOLTIP);
-        createToolbarItems();
-        toolItem.addSelectionListener(dropListener);
+        //createToolbarItems();
+      //  toolItem.addSelectionListener(dropListener);
+        toolItem.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent event) {
+                AvailableDistributionWizard availableDistributionWizard = new AvailableDistributionWizard();
+                WizardDialog dialog = new WizardDialog(StoreUtil.getShell(),
+                        availableDistributionWizard);
+
+                int open = dialog.open();
+                if(open == 0){
+                    reload();
+                }
+            }
+        });
         toolBar.pack();
     }
 
@@ -368,7 +389,7 @@ public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversat
 	private Map<Integer, Boolean> restoreValuesForColumnWidth(List<String> titles,
 			List<Integer> bounds) {
 		Map<Integer, Boolean> restoreColumnWidth = new HashMap<Integer, Boolean>();
-		if (labelProvider.getNamedAreas(false) != null) {
+		if (labelProvider.getNamedAreas(true) != null) {
 		    int columnIndex;
 		    if (PreferencesUtil.isShowRankInChecklistEditor()){
 		        columnIndex = 2;
@@ -378,6 +399,7 @@ public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversat
             for (DefinedTermBase<DefinedTermBase> term : getLabelProvider().getNamedAreas(false)) {
                 if(term != null){
                     restoreColumnWidth.put(columnIndex, PreferencesUtil.getPreferenceStore().getBoolean(term.getUuid().toString()));
+                    areaPosition.put(term.getUuid(), columnIndex);
                     if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
                         if (term.getIdInVocabulary() != null){
                             titles.add(term.getIdInVocabulary());
@@ -403,11 +425,15 @@ public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversat
      * @param colNumber
      * @return
      */
-    private TableViewerColumn addTableViewerColumn(String title, int bound, final int colNumber) {
+    private TableViewerColumn addTableViewerColumn(String title, int bound, final int colNumber, DefinedTermBase term) {
 
         final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE);
         final TableColumn column = viewerColumn.getColumn();
         column.setText(title);
+        String[] UuidAndLable = new String[2];
+        UuidAndLable[0] = term.getUuid().toString();
+        UuidAndLable[1] = title;
+        column.setData(UuidAndLable);
         column.setWidth(200);
         viewerColumn.setEditingSupport(new DistributionEditingSupportE4(viewer, this, colNumber));
         column.setResizable(true);
@@ -533,58 +559,63 @@ public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversat
 //    	}
     	SortedSet<DefinedTermBase> newTerms = labelProvider.getNamedAreas(true);
     	//terms = newTerms;
-    	toolItem.removeSelectionListener(dropListener);
-//    	hideDistributionColumns(oldTerms);
-    	createToolbarItems();
-    	toolItem.addSelectionListener(dropListener);
+//    	toolItem.removeSelectionListener(dropListener);
+////    	hideDistributionColumns(oldTerms);
+//    	createToolbarItems();
+//    	toolItem.addSelectionListener(dropListener);
 
     	//check which terms are deleted and which are new.
     	TableColumn[] columns = viewer.getTable().getColumns() ;
     	int index = 0;
-    	for (TableColumn column: columns){
-    	    if ((!PreferencesUtil.isShowRankInChecklistEditor() && index > 0) || (index > 1)) {
+
+      for (TableColumn column: columns){
+          if ((!PreferencesUtil.isShowRankInChecklistEditor() && index > 0) || (index > 1)) {
                 column.dispose();
             }
-    	    index++;
-    	}
+          index++;
+      }
+    	for (DefinedTermBase oldTerm:oldTerms){
+            boolean delete = true;
+            for (DefinedTermBase term: newTerms){
+                   if(oldTerm.getUuid().equals(term.getUuid())){
+                       delete = false;
+                       break;
+                   }
+
+            }
+            if (delete){
+               // viewer.getTable().remove(areaPosition.get(oldTerm.getUuid()));
+                areaPosition.remove(oldTerm.getUuid());
+
+            }
+        }
+    	updateColumnIndex();
+
+
 
     	for (DefinedTermBase term:newTerms){
     	    boolean isNew = true;
-    	    for (DefinedTermBase oldTerm: oldTerms){
-    	           if(oldTerm.getTitleCache().equals(term.getTitleCache())){
-    	               isNew = false;
-    	               break;
-    	           }
 
-    	    }
-    	    if (isNew){
-    	        terms.put(term.getTitleCache(),term);
+    	    Integer position = areaPosition.get(term.getUuid());
 
-    	    }
     	    String termLable = term.getTitleCache();;
             if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
                 if (term.getIdInVocabulary() != null){
                     termLable = term.getIdInVocabulary();
                 }
             }
-            int count = viewer.getTable().getColumnCount();
-            TableViewerColumn column= addTableViewerColumn(termLable, 200, count);
-            acitivateNewColumnInDropDownMenu(term);
-    	}
-    	for (DefinedTermBase oldTerm:oldTerms){
-    	    boolean delete = true;
-            for (DefinedTermBase term: newTerms){
-                   if(oldTerm.getTitleCache().equals(term.getTitleCache())){
-                       delete = false;
-                       break;
-                   }
 
+            if (position == null){
+                int count = viewer.getTable().getColumnCount();
+                TableViewerColumn column= addTableViewerColumn(termLable, 200, count, term);
+                areaPosition.put(term.getUuid(), Integer.valueOf(count));
+            }else{
+                TableViewerColumn column= addTableViewerColumn(termLable, 200, position, term);
             }
-            if (delete){
-                terms.remove(oldTerm);
 
-            }
-        }
+           // acitivateNewColumnInDropDownMenu(term);
+    	}
+
 
 
 //    	for(DefinedTermBase term:terms.values()){
@@ -613,7 +644,23 @@ public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversat
     	viewer.refresh();
     }
 
-	private void acitivateNewColumnInDropDownMenu(DefinedTermBase term) {
+	/**
+     *
+     */
+    private void updateColumnIndex() {
+        int columnIndex;
+        if (PreferencesUtil.isShowRankInChecklistEditor()){
+            columnIndex = 2;
+        } else{
+            columnIndex = 1;
+        }
+        for (UUID uuid:areaPosition.keySet()){
+            areaPosition.put(uuid, columnIndex);
+            columnIndex++;
+        }
+
+    }
+    private void acitivateNewColumnInDropDownMenu(DefinedTermBase term) {
 		Menu menu = dropListener.getMenu();
 		MenuItem[] items = menu.getItems();
 		for(MenuItem item: items){
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/VocabularyContentProvider.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/VocabularyContentProvider.java
new file mode 100755
index 000000000..7a53ab7f8
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/VocabularyContentProvider.java
@@ -0,0 +1,54 @@
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.definedterm;
+
+import java.util.Collection;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+
+/**
+ * @author l.morris
+ * @date 8 Dec 2011
+ *
+ */
+public class VocabularyContentProvider implements IStructuredContentProvider {
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+	 */
+	@Override
+	public void dispose() {
+		// TODO Auto-generated method stub
+
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+	 */
+	@Override
+	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+		// TODO Auto-generated method stub
+
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+	 */
+	@Override
+	public Object[] getElements(Object inputElement) {
+
+		Collection<TermVocabulary> inputElements = (Collection<TermVocabulary>) inputElement;
+		return inputElements.toArray();
+
+	}
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/VocabularyLabelProvider.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/VocabularyLabelProvider.java
new file mode 100755
index 000000000..650cfb258
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/VocabularyLabelProvider.java
@@ -0,0 +1,114 @@
+/**
+ * Copyright (C) 2009 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.taxeditor.editor.definedterm;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.viewers.StyledCellLabelProvider;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.jface.viewers.StyledString.Styler;
+import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.TextStyle;
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.Representation;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+
+/**
+ * @author l.morris
+ * @date 9 Dec 2011
+ *
+ */
+public class VocabularyLabelProvider extends StyledCellLabelProvider {
+
+    private static Color vocColor = Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);
+    private static Color kindOfColor = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
+    private Styler vocStyler;
+    private Styler kindOfStyler;
+
+    public VocabularyLabelProvider() {
+    }
+
+    public VocabularyLabelProvider(Styler vocStyler){
+        this.vocStyler = vocStyler;
+    }
+
+    @Override
+    public void update(ViewerCell cell) {
+        Object element = cell.getElement();
+
+        String text = getText(element);
+        cell.setText(text);
+
+        Styler styler = null;
+        if (element instanceof TermVocabulary && text != null) {
+            styler = getVocabularyStyler();
+        }
+
+        if(styler!=null){
+            StyledString styledString = new StyledString(text, styler);
+            StyleRange[] styleRanges;
+            styleRanges = styledString.getStyleRanges();
+            cell.setStyleRanges(styleRanges);
+        }
+        super.update(cell);
+    }
+
+//    public StyledString getStyledText(Object element) {
+//        if (element instanceof TermVocabulary) {
+//            new StyledString(getText(element), getVocabularyStyler());
+//        }
+//        else if (element instanceof DefinedTermBase && ((DefinedTermBase) element).getKindOf()!=null) {
+//            new StyledString(getText(element), getKindOfStyler());
+//        }
+//        return new StyledString(getText(element), StyledString.QUALIFIER_STYLER);
+//    }
+
+    public String getText(Object element) {
+        String label = null;
+    	if(element instanceof TermVocabulary){
+    	    TermVocabulary termBase = (TermVocabulary)element;
+    		Representation rep = termBase.getRepresentation(PreferencesUtil.getGlobalLanguage());
+    		if (rep == null){
+    			rep = termBase.getPreferredRepresentation(new ArrayList<Language>());
+    		}
+    		label = rep != null? rep.getLabel() : termBase.getTitleCache();
+    		if (element instanceof DefinedTermBase && label!=null) {
+    			DefinedTermBase<?> dtb = (DefinedTermBase<?>) element;
+    			label = CdmUtils.concat(" : ", dtb.getIdInVocabulary(), label);
+    		}
+    	}
+        // FIXME : must throw an exception here
+    	if(label==null){
+    	    label = element.toString();
+    	}
+        return label;
+    }
+
+    private Styler getVocabularyStyler() {
+        if (vocStyler == null) {
+            vocStyler = new Styler() {
+                @Override
+                public void applyStyles(TextStyle textStyle) {
+                    textStyle.foreground = vocColor;
+                }
+            };
+        }
+        return vocStyler;
+    }
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/e4/OpenDistributionEditorWizardHandlerE4.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/e4/OpenDistributionEditorWizardHandlerE4.java
index cb1424da7..b2e34dca8 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/e4/OpenDistributionEditorWizardHandlerE4.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/e4/OpenDistributionEditorWizardHandlerE4.java
@@ -16,6 +16,7 @@ import org.eclipse.jface.wizard.WizardDialog;
 import org.eclipse.swt.widgets.Shell;
 
 import eu.etaxonomy.taxeditor.preference.wizard.AvailableDistributionWizard;
+import eu.etaxonomy.taxeditor.preference.wizard.AvailableVocabularyWizard;
 
 /**
  *
@@ -29,9 +30,10 @@ public class OpenDistributionEditorWizardHandlerE4 {
 
         @Execute
         public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell) {
+            AvailableVocabularyWizard wizard = new AvailableVocabularyWizard();
             AvailableDistributionWizard availableDistributionWizard = new AvailableDistributionWizard();
             WizardDialog dialog = new WizardDialog(shell,
-                    availableDistributionWizard);
+                    wizard);
 
             dialog.open();
         }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
index 7d725b3f0..85c65e7c8 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
@@ -672,7 +672,7 @@ public abstract class AbstractUtility {
             reportSb.append(((ExportResult)remotingMonitor.getResult()).createReport());
         }else if (remotingMonitor.getResult() instanceof UpdateResult){
             if (((UpdateResult)remotingMonitor.getResult()).isOk()){
-                reportSb.append("Update successfull. \n"+"Updated Objects: " + ((UpdateResult)remotingMonitor.getResult()).getUpdatedObjects().size());
+                reportSb.append("Update successful. \n"+"Updated Objects: " + ((UpdateResult)remotingMonitor.getResult()).getUpdatedObjects().size());
             }
             if (!((UpdateResult)remotingMonitor.getResult()).getExceptions().isEmpty()){
                 reportSb.append(((UpdateResult)remotingMonitor.getResult()).getExceptions().toString());
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractAreaSelectionWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractAreaSelectionWizard.java
new file mode 100755
index 000000000..107a9c514
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractAreaSelectionWizard.java
@@ -0,0 +1,143 @@
+/**
+* Copyright (C) 2018 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.preference.wizard;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.UUID;
+
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
+
+import eu.etaxonomy.cdm.api.service.ITermService;
+import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.model.common.DefinedTermBase;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author k.luther
+ * @since 04.06.2018
+ *
+ */
+public abstract class AbstractAreaSelectionWizard extends WizardPage {
+
+    private ColumnViewer viewer;
+    private List<TermVocabulary<DefinedTermBase>> vocabularies = new ArrayList<>();
+
+    /**
+     * @param pageName
+     */
+    protected AbstractAreaSelectionWizard(String pageName) {
+        super(pageName);
+        // TODO check if configuration exists
+        CdmStore.getCurrentSessionManager().bindNullSession();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public abstract void createControl(Composite parent) ;
+
+    public ColumnViewer getViewer() {
+        return viewer;
+    }
+
+    public void setViewer(ColumnViewer viewer) {
+        this.viewer = viewer;
+    }
+
+    public List<TermVocabulary<DefinedTermBase>> getVocabularies() {
+        return vocabularies;
+    }
+
+    public void addVocabularies(TermVocabulary<DefinedTermBase> vocabulary) {
+        this.vocabularies.add(vocabulary);
+    }
+
+    protected void initialiseVocabularies() {
+        if (getVocabularies() != null) {
+            getVocabularies().clear();
+        }
+        List<TermVocabulary<DefinedTermBase>> vocs = CdmStore.getService(IVocabularyService.class).findByTermType(
+                TermType.NamedArea, null);
+
+        vocabularies = vocs;
+    }
+
+    /**
+     * @param vocs
+     */
+    protected void setVocabularies(List<TermVocabulary> vocs) {
+        for (TermVocabulary voc:vocs){
+            vocabularies.add(voc);
+        }
+
+
+    }
+
+    protected void rememberCheckedValues(String checkedValues, String grayedValues) {
+        initialiseVocabularies();
+        getViewer().setInput(getVocabularies());
+
+        if (grayedValues != null && grayedValues != "") {
+            String[] listGrayed = grayedValues.split(",");
+            ArrayList listGrayedTerms = new ArrayList();
+            getTermsFromStringValues(listGrayed, listGrayedTerms);
+            for(Object element : listGrayedTerms){
+                if(element != null){
+                    if (getViewer() instanceof CheckboxTreeViewer) {
+                        ((CheckboxTreeViewer)getViewer()).setGrayChecked(element, true);
+                    }
+                }
+            }
+        }
+        if (checkedValues != null && checkedValues != "") {
+            String[] listChecked = checkedValues.split(",");
+            ArrayList<DefinedTermBase<?>> listCheckedTerms = new ArrayList<DefinedTermBase<?>>();
+            getTermsFromStringValues(listChecked, listCheckedTerms);
+            for(Object element : listCheckedTerms){
+                if(element != null){
+                    if (getViewer() instanceof CheckboxTreeViewer) {
+                        ((CheckboxTreeViewer)getViewer()).setChecked(element, true);
+                    }else if (getViewer() instanceof CheckboxTableViewer){
+                        ((CheckboxTreeViewer)getViewer()).setChecked(element, true);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * @param split
+     * @param termlist
+     */
+    private void getTermsFromStringValues(String[] split, ArrayList termlist) {
+        List<String> listValue = Arrays.asList(split);
+        for (String s : listValue) {
+            UUID uuid = UUID.fromString(s);
+            ITermService termService = CdmStore.getService(ITermService.class);
+            DefinedTermBase definedTermBase = termService.load(uuid);
+            if(definedTermBase != null){
+                termlist.add(definedTermBase);
+            }else{
+                IVocabularyService vocabularyService = CdmStore.getService(IVocabularyService.class);
+                TermVocabulary termVocabulary = vocabularyService.load(uuid);
+                termlist.add(termVocabulary);
+            }
+        }
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableAreaVocabulariesPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableAreaVocabulariesPage.java
new file mode 100755
index 000000000..574062a47
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableAreaVocabulariesPage.java
@@ -0,0 +1,133 @@
+/**
+* Copyright (C) 2018 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.preference.wizard;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.StyledString.Styler;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.TextStyle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.taxeditor.editor.definedterm.VocabularyContentProvider;
+import eu.etaxonomy.taxeditor.editor.definedterm.VocabularyLabelProvider;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
+
+/**
+ * @author k.luther
+ * @since 04.06.2018
+ *
+ */
+public class AvailableAreaVocabulariesPage  extends AbstractAreaSelectionWizard implements ICdmEntitySessionEnabled{
+
+    /**
+     * @param pageName
+     */
+    public AvailableAreaVocabulariesPage(String pageName) {
+        super(pageName);
+
+    }
+
+     /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void createControl(Composite parent) {
+        IPreferenceStore preferenceStore = PreferencesUtil.getPreferenceStore();
+       // String checkedValues = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS);
+       // String grayedValues = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS_GRAYED);
+        setTitle("Select vocabularies for Distribution Editor");
+        setDescription("In order to be able to modify and see the distribution status of taxa,\n"
+                + "you have to select the areas which you like to see.");
+        Composite composite = new Composite(parent, SWT.NULL);
+        composite.setLayout(new GridLayout());
+        setViewer(CheckboxTableViewer.newCheckList(composite, SWT.NULL));
+        ((CheckboxTableViewer)getViewer()).getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+//        viewer.setContentProvider(new TermContentProvider());
+        Styler styler = new Styler() {
+            @Override
+            public void applyStyles(TextStyle textStyle) {
+                textStyle.foreground = Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
+            }
+        };
+        getViewer().setContentProvider(new VocabularyContentProvider());
+        getViewer().setLabelProvider(new VocabularyLabelProvider(styler));
+        getViewer().setComparator(new ViewerComparator());
+        ((CheckboxTableViewer)getViewer()).addCheckStateListener(new ICheckStateListener() {
+
+            private boolean ignoreCheckEvent = false;
+
+            @Override
+            public void checkStateChanged(CheckStateChangedEvent event) {
+
+
+                if (ignoreCheckEvent ) {
+                    return;
+                }
+
+                ignoreCheckEvent = true;
+
+                try {
+
+
+                }
+                finally {
+                    ignoreCheckEvent = false;
+                }
+
+            }
+        });
+        rememberCheckedValues(null, null);
+        setControl(composite);
+
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ICdmEntitySession getCdmEntitySession() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public <T extends CdmBase> Collection<T> getRootEntities() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java
index 49ade204c..d3d2bb294 100755
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java
@@ -8,10 +8,10 @@
  */
 package eu.etaxonomy.taxeditor.preference.wizard;
 
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -24,7 +24,6 @@ import org.eclipse.jface.viewers.ICheckStateListener;
 import org.eclipse.jface.viewers.StyledString.Styler;
 import org.eclipse.jface.viewers.TreePath;
 import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.TextStyle;
 import org.eclipse.swt.layout.GridData;
@@ -32,11 +31,8 @@ import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 
-import eu.etaxonomy.cdm.api.service.ITermService;
 import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.common.DefinedTermBase;
-import eu.etaxonomy.cdm.model.common.TermType;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermContentProvider;
 import eu.etaxonomy.taxeditor.editor.definedterm.TermLabelProvider;
@@ -50,19 +46,14 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  * @date 21.07.2014
  *
  */
-public class AvailableDistributionPage extends WizardPage implements ICdmEntitySessionEnabled {
-
-    private CheckboxTreeViewer viewer;
-
-    private Set<TermVocabulary<DefinedTermBase>> vocabularies;
+public class AvailableDistributionPage extends AbstractAreaSelectionWizard implements ICdmEntitySessionEnabled {
 
     /**
      * @param pageName
      */
     protected AvailableDistributionPage(String pageName) {
         super(pageName);
-        // TODO check if configuration exists
-        CdmStore.getCurrentSessionManager().bindNullSession();
+
     }
 
     /*
@@ -76,6 +67,7 @@ public class AvailableDistributionPage extends WizardPage implements ICdmEntityS
     @Override
     public void createControl(Composite parent) {
         IPreferenceStore preferenceStore = PreferencesUtil.getPreferenceStore();
+
         String checkedValues = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS);
         String grayedValues = preferenceStore.getString(PreferencesUtil.DISTRIBUTION_AREA_OCCURENCE_STATUS_GRAYED);
         setTitle("Select areas for Distribution Editor");
@@ -83,18 +75,18 @@ public class AvailableDistributionPage extends WizardPage implements ICdmEntityS
                 + "you have to select the areas which you like to see.");
         Composite composite = new Composite(parent, SWT.NULL);
         composite.setLayout(new GridLayout());
-        viewer = new CheckboxTreeViewer(composite, SWT.NULL);
-        viewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-        viewer.setContentProvider(new TermContentProvider());
+        setViewer(new CheckboxTreeViewer(composite, SWT.NULL));
+        ((CheckboxTreeViewer)getViewer()).getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+        getViewer().setContentProvider(new TermContentProvider());
         Styler styler = new Styler() {
             @Override
             public void applyStyles(TextStyle textStyle) {
                 textStyle.foreground = Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
             }
         };
-        viewer.setLabelProvider(new TermLabelProvider(styler));
-        viewer.setComparator(new ViewerComparator());
-        viewer.addCheckStateListener(new ICheckStateListener() {
+        getViewer().setLabelProvider(new TermLabelProvider(styler));
+        getViewer().setComparator(new ViewerComparator());
+        ((CheckboxTreeViewer)getViewer()).addCheckStateListener(new ICheckStateListener() {
 
             private boolean ignoreCheckEvent = false;
 
@@ -127,64 +119,13 @@ public class AvailableDistributionPage extends WizardPage implements ICdmEntityS
     }
 
 
-    protected List<TermVocabulary<DefinedTermBase>> initialiseVocabularies() {
-        if (vocabularies != null) {
-            vocabularies.clear();
-        }
-        List<TermVocabulary<DefinedTermBase>> vocs = CdmStore.getService(IVocabularyService.class).findByTermType(
-                TermType.NamedArea, null);
 
-        return vocs;
-    }
 
-    private void rememberCheckedValues(String checkedValues, String grayedValues) {
-        viewer.setInput(initialiseVocabularies());
 
-        if (grayedValues != null && grayedValues != "") {
-            String[] listGrayed = grayedValues.split(",");
-            ArrayList listGrayedTerms = new ArrayList();
-            getTermsFromStringValues(listGrayed, listGrayedTerms);
-            for(Object element : listGrayedTerms){
-                if(element != null){
-                    viewer.setGrayChecked(element, true);
-                }
-            }
-        }
-        if (checkedValues != null && checkedValues != "") {
-            String[] listChecked = checkedValues.split(",");
-            ArrayList<DefinedTermBase<?>> listCheckedTerms = new ArrayList<DefinedTermBase<?>>();
-            getTermsFromStringValues(listChecked, listCheckedTerms);
-            for(Object element : listCheckedTerms){
-                if(element != null){
-                    viewer.setChecked(element, true);
-                }
-            }
-        }
-    }
-
-    /**
-     * @param split
-     * @param termlist
-     */
-    private void getTermsFromStringValues(String[] split, ArrayList termlist) {
-        List<String> listValue = Arrays.asList(split);
-        for (String s : listValue) {
-            UUID uuid = UUID.fromString(s);
-            ITermService termService = CdmStore.getService(ITermService.class);
-            DefinedTermBase definedTermBase = termService.load(uuid);
-            if(definedTermBase != null){
-                termlist.add(definedTermBase);
-            }else{
-                IVocabularyService vocabularyService = CdmStore.getService(IVocabularyService.class);
-                TermVocabulary termVocabulary = vocabularyService.load(uuid);
-                termlist.add(termVocabulary);
-            }
-        }
-    }
 
     private boolean checkNoneChecked() {
 
-        if (viewer.getCheckedElements().length == 0) {
+        if (((CheckboxTreeViewer)getViewer()).getCheckedElements().length == 0) {
             setMessage("Please check at least one item", WARNING);
             return true;
         } else {
@@ -193,12 +134,6 @@ public class AvailableDistributionPage extends WizardPage implements ICdmEntityS
         }
     }
 
-    /**
-     * @return the viewer
-     */
-    public CheckboxTreeViewer getViewer() {
-        return viewer;
-    }
 
     /**
      *
@@ -215,18 +150,18 @@ public class AvailableDistributionPage extends WizardPage implements ICdmEntityS
             boolean allChecked = true;
             boolean allUnchecked = true;
             for (final Object fieldElement : tcp.getChildren(treeElement)) {
-                allChecked = allChecked && this.viewer.getChecked(fieldElement);
-                allUnchecked = allUnchecked && !this.viewer.getChecked(fieldElement);
+                allChecked = allChecked && ((CheckboxTreeViewer)getViewer()).getChecked(fieldElement);
+                allUnchecked = allUnchecked && !((CheckboxTreeViewer)getViewer()).getChecked(fieldElement);
             }
             if (allUnchecked) {
-                this.viewer.setChecked(treeElement, false);
-                this.viewer.setGrayed(treeElement, false);
+                ((CheckboxTreeViewer)getViewer()).setChecked(treeElement, false);
+                ((CheckboxTreeViewer)getViewer()).setGrayed(treeElement, false);
             } else if (allChecked) {
-                this.viewer.setChecked(treeElement, true);
-                this.viewer.setGrayed(treeElement, false);
+                ((CheckboxTreeViewer)getViewer()).setChecked(treeElement, true);
+                ((CheckboxTreeViewer)getViewer()).setGrayed(treeElement, false);
             } else if (!allUnchecked && !allChecked) {
-                this.viewer.setChecked(treeElement, true);
-                this.viewer.setGrayed(treeElement, true);
+                ((CheckboxTreeViewer)getViewer()).setChecked(treeElement, true);
+                ((CheckboxTreeViewer)getViewer()).setGrayed(treeElement, true);
             }
         }
         checkParents(path.getParentPath());
@@ -268,12 +203,12 @@ public class AvailableDistributionPage extends WizardPage implements ICdmEntityS
        }
     //   final Object element = path.getLastSegment();
        if (element != null) {
-           this.viewer.setChecked(element, checked);
-           this.viewer.setGrayed(element, false);
+           ((CheckboxTreeViewer)getViewer()).setChecked(element, checked);
+           ((CheckboxTreeViewer)getViewer()).setGrayed(element, false);
            int length = tcp.getChildren(element).length;
            if(length>1){
-               this.viewer.expandToLevel(element, CheckboxTreeViewer.ALL_LEVELS);
-               this.viewer.setSubtreeChecked(element, checked);
+               ((CheckboxTreeViewer)getViewer()).expandToLevel(element, CheckboxTreeViewer.ALL_LEVELS);
+               ((CheckboxTreeViewer)getViewer()).setSubtreeChecked(element, checked);
            }
        }
    }
@@ -294,18 +229,18 @@ public class AvailableDistributionPage extends WizardPage implements ICdmEntityS
           boolean allChecked = true;
           boolean allUnchecked = true;
           for (final Object fieldElement : tcp.getChildren(parent)) {
-              allChecked = allChecked && this.viewer.getChecked(fieldElement);
-              allUnchecked = allUnchecked && !this.viewer.getChecked(fieldElement);
+              allChecked = allChecked && ((CheckboxTreeViewer)getViewer()).getChecked(fieldElement);
+              allUnchecked = allUnchecked && !((CheckboxTreeViewer)getViewer()).getChecked(fieldElement);
           }
           if (allUnchecked) {
-              this.viewer.setChecked(parent, false);
-              this.viewer.setGrayed(parent, false);
+              ((CheckboxTreeViewer)getViewer()).setChecked(parent, false);
+              ((CheckboxTreeViewer)getViewer()).setGrayed(parent, false);
           } else if (allChecked) {
-              this.viewer.setChecked(parent, true);
-              this.viewer.setGrayed(parent, false);
+              ((CheckboxTreeViewer)getViewer()).setChecked(parent, true);
+              ((CheckboxTreeViewer)getViewer()).setGrayed(parent, false);
           } else if (!allUnchecked && !allChecked) {
-              this.viewer.setChecked(parent, true);
-              this.viewer.setGrayed(parent, true);
+              ((CheckboxTreeViewer)getViewer()).setChecked(parent, true);
+              ((CheckboxTreeViewer)getViewer()).setGrayed(parent, true);
           }
 
         grayParents(tcp.getParent(parent));
@@ -346,5 +281,24 @@ public class AvailableDistributionPage extends WizardPage implements ICdmEntityS
         propertyPathsMap.put("terms", termsPropertyPaths);
         return propertyPathsMap;
     }
+    @Override
+    protected void initialiseVocabularies() {
+        if (getVocabularies() != null) {
+            getVocabularies().clear();
+        }
+        String vocString = PreferencesUtil.getPreferenceStore().getString(PreferencesUtil.DISTRIBUTION_VOCABULARIES);
+        String[] arrayVocs = vocString.split(",");
+
+        Set<UUID> uuidVocs = new HashSet();
+        for (String voc: arrayVocs){
+            uuidVocs.add(UUID.fromString(voc));
+        }
+
+        List<TermVocabulary> vocs = CdmStore.getService(IVocabularyService.class).find(uuidVocs);
+
+        setVocabularies(vocs);
+    }
+
+
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionWizard.java
index 009909380..5949ae552 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionWizard.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionWizard.java
@@ -15,6 +15,7 @@ import java.util.UUID;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
 import org.eclipse.jface.wizard.Wizard;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
@@ -51,8 +52,8 @@ public class AvailableDistributionWizard extends Wizard implements IConversation
     public boolean performFinish() {
         // TODO: get Selection and save in EditorPreferences
         if (!checkNoneChecked()) {
-            Object[] checkedElements = aPage.getViewer().getCheckedElements();
-            Object[] grayedElements = aPage.getViewer().getGrayedElements();
+            Object[] checkedElements = ((CheckboxTreeViewer)aPage.getViewer()).getCheckedElements();
+            Object[] grayedElements = ((CheckboxTreeViewer)aPage.getViewer()).getGrayedElements();
             ArrayList checkedList = new ArrayList(Arrays.asList(checkedElements));
             ArrayList grayedList = new ArrayList(Arrays.asList(grayedElements));
             checkedList = (ArrayList) CollectionUtils.subtract(checkedList, grayedList);
@@ -99,7 +100,7 @@ public class AvailableDistributionWizard extends Wizard implements IConversation
 
     private boolean checkNoneChecked() {
 
-        if (aPage.getViewer().getCheckedElements().length == 0) {
+        if (((CheckboxTreeViewer)aPage.getViewer()).getCheckedElements().length == 0) {
             aPage.setMessage("Please check at least one item", aPage.WARNING);
             return true;
         } else {
@@ -115,6 +116,8 @@ public class AvailableDistributionWizard extends Wizard implements IConversation
         }
         return conversation;
     }
+    
+    
 
     /*
      * (non-Javadoc)
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableVocabularyWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableVocabularyWizard.java
new file mode 100755
index 000000000..8850d033d
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableVocabularyWizard.java
@@ -0,0 +1,151 @@
+/**
+* Copyright (C) 2018 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.preference.wizard;
+
+import java.util.ArrayList;
+import java.util.UUID;
+
+import org.apache.commons.lang.StringUtils;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;
+import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
+import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author k.luther
+ * @since 04.06.2018
+ *
+ */
+public class AvailableVocabularyWizard extends Wizard implements IConversationEnabled {
+
+    private ConversationHolder conversation;
+    private final AvailableAreaVocabulariesPage aPage;
+
+    public AvailableVocabularyWizard() {
+        setWindowTitle("Vocabulary Selection Wizard");
+        // TODO if preferenceStore has elements checked load elements in wizard
+        aPage = new AvailableAreaVocabulariesPage("AvailableDistributionPage");
+    }
+
+    @Override
+    public void addPages() {
+        addPage(aPage);
+    }
+
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IWizardPage getPage(String pageName) {
+
+        return aPage;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public int getPageCount() {
+       return 1;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public IWizardPage[] getPages() {
+        IWizardPage[] pages = new IWizardPage[1];
+        pages [0] = aPage;
+        return pages;
+    }
+
+
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getWindowTitle() {
+
+        return "Vocabulary Selection Wizard";
+    }
+
+
+
+
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean performCancel() {
+        // TODO Auto-generated method stub
+        return true;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean performFinish() {
+        Object[] checkedElements = ((CheckboxTableViewer)aPage.getViewer()).getCheckedElements();
+
+        ArrayList<UUID> listUIIDChecked = new ArrayList<UUID>();
+        for (Object o : checkedElements) {
+               if(o instanceof OrderedTermVocabulary){
+                    OrderedTermVocabulary otb = (OrderedTermVocabulary) o;
+                    listUIIDChecked.add(otb.getUuid());
+                }
+            }
+           String saveCheckedElements = StringUtils.join(listUIIDChecked, ",");
+           IPreferenceStore preferenceStore = PreferencesUtil.getPreferenceStore();
+           PreferencesUtil.setPreferredVocabulariesForDistributionEditor(saveCheckedElements, false);
+           preferenceStore.setValue(PreferencesUtil.DISTRIBUTION_VOCABULARIES, saveCheckedElements);
+           return true;
+    }
+
+
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void update(CdmDataChangeMap changeEvents) {
+        // TODO Auto-generated method stub
+
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public ConversationHolder getConversationHolder() {
+        if (conversation == null) {
+            conversation = CdmStore.createConversation();
+        }
+        return conversation;
+    }
+
+}
