Revision 87abc2b1
Added by Patrick Plitzner about 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/matrix/CharacterMatrix.java | ||
---|---|---|
123 | 123 |
import eu.etaxonomy.cdm.model.description.State; |
124 | 124 |
import eu.etaxonomy.cdm.model.description.WorkingSet; |
125 | 125 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
126 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
|
126 | 127 |
import eu.etaxonomy.taxeditor.editor.workingSet.matrix.categorical.CategoricalDataCellEditor; |
127 | 128 |
import eu.etaxonomy.taxeditor.editor.workingSet.matrix.categorical.CategoricalDataDisplayConverter; |
128 | 129 |
import eu.etaxonomy.taxeditor.editor.workingSet.matrix.quantitative.QuantitativeDataCellEditor; |
... | ... | |
151 | 152 |
"descriptions.descriptionElements.feature", //$NON-NLS-1$ |
152 | 153 |
}); |
153 | 154 |
|
154 |
private static final String CHARACTER_MATRIX_STATE_PROPERTIES = "characterMatrixState.properties"; |
|
155 |
private static final String CHARACTER_MATRIX_STATE_PROPERTIES = "characterMatrixState.properties"; //$NON-NLS-1$
|
|
155 | 156 |
|
156 | 157 |
private static final int LEADING_COLUMN_COUNT = 4; |
157 |
private static final String TAXON_COLUMN = "taxon_column"; |
|
158 |
private static final String COLLECTOR_COLUMN = "collector_column"; |
|
159 |
private static final String IDENTIFIER_COLUMN = "identifier_column"; |
|
160 |
private static final String COUNTRY_COLUMN = "country_column"; |
|
158 |
private static final String TAXON_COLUMN = "taxon_column"; //$NON-NLS-1$
|
|
159 |
private static final String COLLECTOR_COLUMN = "collector_column"; //$NON-NLS-1$
|
|
160 |
private static final String IDENTIFIER_COLUMN = "identifier_column"; //$NON-NLS-1$
|
|
161 |
private static final String COUNTRY_COLUMN = "country_column"; //$NON-NLS-1$
|
|
161 | 162 |
|
162 | 163 |
private WorkingSet workingSet; |
163 | 164 |
|
... | ... | |
231 | 232 |
* Toogle tree button |
232 | 233 |
*/ |
233 | 234 |
btnToggleTree.setImage(ImageResources.getImage(ImageResources.HIERARCHICAL)); |
234 |
btnToggleTree.setToolTipText("Show taxon hierarchy");
|
|
235 |
btnToggleTree.setToolTipText(Messages.CharacterMatrix_SHOW_HIERARCHY);
|
|
235 | 236 |
btnToggleTree.setSelection(true); |
236 | 237 |
btnToggleTree.setEnabled(false); |
237 | 238 |
btnToggleTree.addSelectionListener(new SelectionAdapter() { |
... | ... | |
245 | 246 |
* Toogle flat button |
246 | 247 |
*/ |
247 | 248 |
btnToggleFlat.setImage(ImageResources.getImage(ImageResources.FLAT)); |
248 |
btnToggleFlat.setToolTipText("Show flat list");
|
|
249 |
btnToggleFlat.setToolTipText(Messages.CharacterMatrix_SHOW_FLAT_LIST);
|
|
249 | 250 |
btnToggleFlat.addSelectionListener(new SelectionAdapter() { |
250 | 251 |
@Override |
251 | 252 |
public void widgetSelected(SelectionEvent e) { |
... | ... | |
258 | 259 |
* Collapse button |
259 | 260 |
*/ |
260 | 261 |
btnCollapseAll.setImage(ImageResources.getImage(ImageResources.COLLAPSE_ALL)); |
261 |
btnCollapseAll.setToolTipText("Collapse all");
|
|
262 |
btnCollapseAll.setToolTipText(Messages.CharacterMatrix_COLLAPSE);
|
|
262 | 263 |
btnCollapseAll.addSelectionListener(new SelectionAdapter() { |
263 | 264 |
@Override |
264 | 265 |
public void widgetSelected(SelectionEvent e) { |
... | ... | |
270 | 271 |
* Expand button |
271 | 272 |
*/ |
272 | 273 |
btnExpandAll.setImage(ImageResources.getImage(ImageResources.EXPAND_ALL)); |
273 |
btnExpandAll.setToolTipText("Expand all");
|
|
274 |
btnExpandAll.setToolTipText(Messages.CharacterMatrix_EXPAND);
|
|
274 | 275 |
btnExpandAll.addSelectionListener(new SelectionAdapter() { |
275 | 276 |
@Override |
276 | 277 |
public void widgetSelected(SelectionEvent e) { |
... | ... | |
282 | 283 |
* Freeze supplemental info button |
283 | 284 |
*/ |
284 | 285 |
btnFreezeSuppInfo.setImage(ImageResources.getImage(ImageResources.LOCK_ICON)); |
285 |
btnFreezeSuppInfo.setToolTipText("Lock specimen columns");
|
|
286 |
btnFreezeSuppInfo.setToolTipText(Messages.CharacterMatrix_LOCK_COLUMNS);
|
|
286 | 287 |
btnFreezeSuppInfo.setSelection(true); |
287 | 288 |
btnFreezeSuppInfo.addSelectionListener(new SelectionAdapter() { |
288 | 289 |
@Override |
... | ... | |
306 | 307 |
inputStream = new FileInputStream(statePropertiesFile); |
307 | 308 |
natTableState.load(inputStream); |
308 | 309 |
} catch (IOException e) { |
309 |
MessagingUtils.info("No initial state properties file found for character matrix"); |
|
310 |
MessagingUtils.info("No initial state properties file found for character matrix"); //$NON-NLS-1$
|
|
310 | 311 |
} |
311 | 312 |
|
312 | 313 |
// create a combobox for showing the available view states |
... | ... | |
315 | 316 |
@Override |
316 | 317 |
public String getText(Object element) { |
317 | 318 |
if(element instanceof String && ((String) element).isEmpty()){ |
318 |
return "-default-";
|
|
319 |
return Messages.CharacterMatrix_DEFAULT;
|
|
319 | 320 |
} |
320 | 321 |
return super.getText(element); |
321 | 322 |
} |
... | ... | |
348 | 349 |
|
349 | 350 |
// add button to show dialog |
350 | 351 |
btnManageState.setImage(ImageResources.getImage(ImageResources.SETTINGS)); |
351 |
btnManageState.setToolTipText("View configuration");
|
|
352 |
btnManageState.setToolTipText(Messages.CharacterMatrix_VIEW_CONFIG);
|
|
352 | 353 |
btnManageState.addSelectionListener(new SelectionAdapter() { |
353 | 354 |
@Override |
354 | 355 |
public void widgetSelected(SelectionEvent e) { |
... | ... | |
360 | 361 |
/** |
361 | 362 |
* excel export |
362 | 363 |
*/ |
363 |
btnExcelExport.setToolTipText("Export to Excel");
|
|
364 |
btnExcelExport.setToolTipText(Messages.CharacterMatrix_EXPORT);
|
|
364 | 365 |
btnExcelExport.setImage(ImageResources.getImage(ImageResources.EXPORT)); |
365 | 366 |
btnExcelExport.addSelectionListener(new SelectionAdapter() { |
366 | 367 |
@Override |
... | ... | |
444 | 445 |
natTable.addConfiguration(rowHeaderConfig); |
445 | 446 |
DefaultColumnHeaderStyleConfiguration columnHeaderStyle = new DefaultColumnHeaderStyleConfiguration(); |
446 | 447 |
columnHeaderStyle.bgColor = rowColumnColor; |
447 |
columnHeaderStyle.font = GUIHelper.getFont(new FontData("Verdana", 9, SWT.BOLD)); |
|
448 |
columnHeaderStyle.font = GUIHelper.getFont(new FontData("Verdana", 9, SWT.BOLD)); //$NON-NLS-1$
|
|
448 | 449 |
natTable.addConfiguration(columnHeaderStyle); |
449 | 450 |
|
450 | 451 |
} |
... | ... | |
565 | 566 |
//register labels for columns |
566 | 567 |
ColumnOverrideLabelAccumulator bodyColumnLabelAccumulator =new ColumnOverrideLabelAccumulator(bodyDataLayer); |
567 | 568 |
bodyDataLayer.setConfigLabelAccumulator(bodyColumnLabelAccumulator); |
568 |
propertyToLabelMap.put(TAXON_COLUMN, "Taxon");
|
|
569 |
propertyToLabelMap.put(TAXON_COLUMN, Messages.CharacterMatrix_TAXON);
|
|
569 | 570 |
bodyColumnLabelAccumulator.registerColumnOverrides(0, TAXON_COLUMN); |
570 |
propertyToLabelMap.put(COLLECTOR_COLUMN, "Collector + No");
|
|
571 |
propertyToLabelMap.put(COLLECTOR_COLUMN, Messages.CharacterMatrix_COLLECTOR_NO);
|
|
571 | 572 |
bodyColumnLabelAccumulator.registerColumnOverrides(1, COLLECTOR_COLUMN); |
572 |
propertyToLabelMap.put(IDENTIFIER_COLUMN, "Identifier");
|
|
573 |
propertyToLabelMap.put(IDENTIFIER_COLUMN, Messages.CharacterMatrix_IDENTIFIER);
|
|
573 | 574 |
bodyColumnLabelAccumulator.registerColumnOverrides(2, IDENTIFIER_COLUMN); |
574 |
propertyToLabelMap.put(COUNTRY_COLUMN, "Country");
|
|
575 |
propertyToLabelMap.put(COUNTRY_COLUMN, Messages.CharacterMatrix_COUNTRY);
|
|
575 | 576 |
bodyColumnLabelAccumulator.registerColumnOverrides(3, COUNTRY_COLUMN); |
576 | 577 |
for(int i=0;i<features.size();i++){ |
577 | 578 |
Feature feature = features.get(i); |
... | ... | |
609 | 610 |
summaryRowLayer.setHorizontalCompositeDependency(false); |
610 | 611 |
|
611 | 612 |
CompositeLayer composite = new CompositeLayer(1, 2); |
612 |
composite.setChildLayer("SUMMARY", summaryRowLayer, 0, 0); |
|
613 |
composite.setChildLayer("SUMMARY", summaryRowLayer, 0, 0); //$NON-NLS-1$
|
|
613 | 614 |
composite.setChildLayer(GridRegion.BODY, topMostLayer, 0, 1); |
614 | 615 |
|
615 | 616 |
|
... | ... | |
640 | 641 |
DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(rowHeaderDataProvider); |
641 | 642 |
FixedSummaryRowHeaderLayer fixedSummaryRowHeaderLayer = new FixedSummaryRowHeaderLayer(rowHeaderDataLayer, |
642 | 643 |
composite, selectionLayer); |
643 |
fixedSummaryRowHeaderLayer.setSummaryRowLabel("\u2211"); |
|
644 |
fixedSummaryRowHeaderLayer.setSummaryRowLabel("\u2211"); //$NON-NLS-1$
|
|
644 | 645 |
|
645 | 646 |
|
646 | 647 |
/** |
... | ... | |
826 | 827 |
//Create new specimen description if no match was found |
827 | 828 |
setDirty(); |
828 | 829 |
SpecimenDescription newDesription = SpecimenDescription.NewInstance(specimen); |
829 |
newDesription.setTitleCache("WorkingSet "+workingSet.getLabel()+": "+newDesription.generateTitle(), true);
|
|
830 |
newDesription.setTitleCache(Messages.CharacterMatrix_WORKING_SET+workingSet.getLabel()+": "+newDesription.generateTitle(), true); //$NON-NLS-2$
|
|
830 | 831 |
|
831 | 832 |
//check for equals description element (same feature and same values) |
832 | 833 |
Map<Feature, List<DescriptionElementBase>> featureToElementMap = new HashMap<>(); |
... | ... | |
854 | 855 |
} |
855 | 856 |
else if(!new DescriptionElementCompareWrapper(match).equals(new DescriptionElementCompareWrapper(descriptionElementBase))){ |
856 | 857 |
match = null; |
857 |
MessagingUtils.informationDialog("Multiple data found", |
|
858 |
String.format("Multiple description elements with different values " |
|
859 |
+ "found for feature '%s'.\nData will not be copied to new specimen description.", feature.getLabel())); |
|
858 |
MessagingUtils.informationDialog(Messages.CharacterMatrix_MULTIPLE_DATA, |
|
859 |
String.format(Messages.CharacterMatrix_MULTIPLE_DATA_MESSAGE, feature.getLabel())); |
|
860 | 860 |
break; |
861 | 861 |
} |
862 | 862 |
} |
... | ... | |
891 | 891 |
if(feature.isSupportsQuantitativeData()){ |
892 | 892 |
Set<MeasurementUnit> recommendedMeasurementUnits = feature.getRecommendedMeasurementUnits(); |
893 | 893 |
if(recommendedMeasurementUnits.size()!=1){ |
894 |
MessagingUtils.warningDialog("Column initialization problem", CharacterMatrix.class,
|
|
895 |
String.format("Only one unit is allowed for quantitative data: %s", feature.getLabel()));
|
|
894 |
MessagingUtils.warningDialog(Messages.CharacterMatrix_INIT_PROBLEM, CharacterMatrix.class,
|
|
895 |
String.format(Messages.CharacterMatrix_INIT_PROBLEM_MESSAGE, feature.getLabel()));
|
|
896 | 896 |
return; |
897 | 897 |
} |
898 | 898 |
MeasurementUnit unit = recommendedMeasurementUnits.iterator().next(); |
899 |
featureLabel += " ["+unit.getIdInVocabulary()+"]"; |
|
899 |
featureLabel += " ["+unit.getIdInVocabulary()+"]"; //$NON-NLS-1$ //$NON-NLS-2$
|
|
900 | 900 |
} |
901 | 901 |
propertyToLabelMap.put(property, featureLabel); |
902 | 902 |
} |
Also available in: Unified diff
ref #7095, #7086 i18n