commit 3752053a6bfd93f6e1328a58429189efd0458fd7
Author: Katja Luther <k.luther@bgbm.org>
Date:   Tue Jan 9 10:39:58 2018 +0100

    fix visibility of distribution in distribution editor

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 0891eb8d7..c5bf0fb52 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
@@ -48,9 +48,9 @@ public class ChecklistDropdownSelectionListenerE4 extends SelectionAdapter {
     // SearchOption option
     public void add(DefinedTermBase<DefinedTermBase> term) {
         MenuItem menuItem = new MenuItem(menu, SWT.CHECK);
-//        if (PreferencesUtil) {
-//            menuItem.setText(term.getTitleCache());
-//        }
+   
+           menuItem.setText(term.getTitleCache());
+
         if (PreferencesUtil.getPreferenceStore().getBoolean(term.getUuid().toString())) {
             menuItem.setSelection(true);
         } else {
@@ -68,31 +68,41 @@ public class ChecklistDropdownSelectionListenerE4 extends SelectionAdapter {
                 DefinedTermBase<DefinedTermBase> selectedTerm = null;
                 if (termSet != null) {
                 	TableColumn[] columns = viewer.getTable().getColumns();
-                	for(int i=0; i<columns.length; i++){
-                		if(selected.getText().equalsIgnoreCase(columns[i].getText())){
-                			column = columns[i];
-                			logger.info("Column no " +i +" Column Header "+ column.getText() ); //$NON-NLS-1$ //$NON-NLS-2$
-                			for (DefinedTermBase<DefinedTermBase> term : termSet) {
-                				if(column.getText().equalsIgnoreCase(term.getTitleCache())){
-                					selectedTerm = term;
-                					break;
-                				}
-                			}
-                		}
-                	}
-                }
-                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(100);
-                } else if (column != null) {
-                    if (selectedTerm != null) {
-                        PreferencesUtil.getPreferenceStore().setValue(selectedTerm.getUuid().toString(), false);
-                    }
-                    column.setWidth(0);
+                	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();
+                
             }
         });
     }
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 7a514e1a3..59eeea562 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
@@ -343,7 +343,7 @@ public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversat
                 if(restoreValuesForColumnWidth.get(columnIndex)){
                     column.getColumn().setWidth(50);
                 }else{
-                    column.getColumn().setWidth(50);
+                    column.getColumn().setWidth(0);
                 }
                 column.setEditingSupport(new DistributionEditingSupportE4(viewer, this, columnIndex));
 
@@ -529,9 +529,16 @@ public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversat
     	hideDistributionColumns(oldTerms);
     	createToolbarItems();
     	toolItem.addSelectionListener(dropListener);
+    	
     	for(DefinedTermBase term:newTerms){
     		int count = viewer.getTable().getColumnCount();
-    		addTableViewerColumn(term.getTitleCache(), 200, count);
+    		String termLable = term.getTitleCache();;
+    		if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
+    			if (term.getIdInVocabulary() != null){
+    				termLable = term.getIdInVocabulary();
+    	        } 
+    		}
+    		addTableViewerColumn(termLable, 200, count);
     		acitivateNewColumnInDropDownMenu(term);
     	}
         viewer.setLabelProvider(labelProvider);
