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);
}
/**
* 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>
*
/**
* 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>
}
/**
- * This method adds new DistributionColumns to an existing table.
- *
+ * This method adds new DistributionColumns to an existing table.
+ *
* @param title
* @param bound
* @param colNumber
column.setMoveable(true);
return viewerColumn;
}
-
-
-
+
+
+
/**
*
* pull data from database and set input for view
* 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(){
}
}
}
-
+
/**
* <p>
* Getter for the field <code>service</code>.
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;
namedAreas = loadNamedAreas();
this.viewer = viewer;
}
-
+
/*
* (non-Javadoc)
*
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();
return (rank != null) ? rank : DEFAULT_ENTRY;
}
- if(columnIndex >3){
+ if(columnIndex >2){
for (TaxonDescription td : listTaxonDescriptions) {
for (DescriptionElementBase deb : td.getElements()) {