Removed Reference Tab from checklist editor....
authorAlexander Oppermann <a.oppermann@bgbm.org>
Wed, 18 Mar 2015 14:37:22 +0000 (14:37 +0000)
committerAlexander Oppermann <a.oppermann@bgbm.org>
Wed, 18 Mar 2015 14:37:22 +0000 (14:37 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistLabelProvider.java

index 4b6afb1a12f7a7f8570e1890491b743d95551d3a..b3506ee1403f83e9fdde80ccc0f257f7ef9d05be 100644 (file)
@@ -314,9 +314,9 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
     private void createTable() {
         Table table = viewer.getTable();//new Table(parent, viewer.getTable().getStyle());
         List<String> titles = new ArrayList<String>();
-        Collections.addAll(titles, "Taxon", "Author", "Reference", "Rank");
+        Collections.addAll(titles, "Taxon", "Author", "Rank");
         List<Integer> bounds = new ArrayList<Integer>();
-        Collections.addAll(bounds, 300, 200, 200, 200);
+        Collections.addAll(bounds, 300, 200, 200);
         Map<Integer, Boolean> restoreValuesForColumnWidth = restoreValuesForColumnWidth(titles, bounds);
         createInitalDistributionColumns(table, titles, bounds, restoreValuesForColumnWidth);
         table.setSortDirection(SWT.DOWN);
@@ -325,7 +325,7 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
        }
     /**
      * This method creates initially the distribution columns for a table. It should only be called for creation.<br>
-     *<p> 
+     *<p>
      *
      *<b>Notice:</b> If you want to add additional columns later please use <b>addTableViewerColumn()</b>
      *
@@ -365,9 +365,9 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
 
     /**
      * This methods loads the last opened distribution columns for the table viewer from the prefrence store.<br>
-     *<p> 
+     *<p>
      * <b>Notice:</b> It adds also the TitleCache to the titles list for the header of each column.<p>
-     * 
+     *
      * @param titles
      * @param bounds
      * @return Map<Integer, Boolean>
@@ -390,8 +390,8 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
        }
 
     /**
-     * This method adds new DistributionColumns to an existing table. 
-     * 
+     * This method adds new DistributionColumns to an existing table.
+     *
      * @param title
      * @param bound
      * @param colNumber
@@ -407,9 +407,9 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
         column.setMoveable(true);
         return viewerColumn;
       }
-    
-    
-    
+
+
+
     /**
      *
      * pull data from database and set input for view
@@ -488,7 +488,7 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
      * It will hide the old distribution column and load the newly added columns.<br>
      * <p>
      * <b>Notice:</b> for data update please use <b>refresh()</b>
-     * 
+     *
      */
     @SuppressWarnings({ "unchecked", "rawtypes" })
        public void reload(){
@@ -541,7 +541,7 @@ public class ChecklistEditor extends EditorPart implements ISelectionListener, I
                }
        }
        }
-    
+
     /**
      * <p>
      * Getter for the field <code>service</code>.
index 56af4186aa5a57b11bbacc59372bb4763820188b..0ae5336b38e01875faa6eaa9678eb600bfc49587 100644 (file)
@@ -34,8 +34,6 @@ import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 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.reference.INomenclaturalReference;
-import eu.etaxonomy.cdm.model.reference.Reference;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
@@ -64,7 +62,7 @@ public class ChecklistLabelProvider extends LabelProvider implements ITableLabel
         namedAreas = loadNamedAreas();
         this.viewer = viewer;
     }
-    
+
     /*
      * (non-Javadoc)
      *
@@ -106,15 +104,15 @@ public class ChecklistLabelProvider extends LabelProvider implements ITableLabel
             String authorship = null;
             authorship = (nonVirlaName != null) ? nonVirlaName.getAuthorshipCache() : null;
             return (authorship != null) ? authorship : DEFAULT_ENTRY;
+//        case 2:
+//            String ref = null;
+//            if (taxon.getName() != null) {
+//                INomenclaturalReference nomenclaturalReference = HibernateProxyHelper.deproxy(
+//                        nonVirlaName.getNomenclaturalReference(), Reference.class);
+//                ref = (nomenclaturalReference != null) ? nomenclaturalReference.getAbbrevTitleCache() : null;
+//            }
+//            return (ref != null) ? ref : DEFAULT_ENTRY;
         case 2:
-            String ref = null;
-            if (taxon.getName() != null) {
-                INomenclaturalReference nomenclaturalReference = HibernateProxyHelper.deproxy(
-                        nonVirlaName.getNomenclaturalReference(), Reference.class);
-                ref = (nomenclaturalReference != null) ? nomenclaturalReference.getAbbrevTitleCache() : null;
-            }
-            return (ref != null) ? ref : DEFAULT_ENTRY;
-        case 3:
             String rank = null;
             if (taxon.getName().getRank() != null) {
                 rank = taxon.getName().getRank().toString();
@@ -122,7 +120,7 @@ public class ChecklistLabelProvider extends LabelProvider implements ITableLabel
             return (rank != null) ? rank : DEFAULT_ENTRY;
         }
 
-        if(columnIndex >3){
+        if(columnIndex >2){
 
             for (TaxonDescription td : listTaxonDescriptions) {
                 for (DescriptionElementBase deb : td.getElements()) {