Revision fc9c0563
Added by Katja Luther over 4 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java | ||
---|---|---|
331 | 331 |
} |
332 | 332 |
|
333 | 333 |
|
334 |
Map<Integer, Boolean> restoreValuesForColumnWidth = restoreValuesForColumnWidth(titles, bounds); |
|
335 |
createInitalDistributionColumns(table, titles, bounds, restoreValuesForColumnWidth); |
|
334 |
// Map<Integer, Boolean> restoreValuesForColumnWidth = |
|
335 |
restoreValuesForColumnWidth(titles, bounds); |
|
336 |
createInitalDistributionColumns(table, titles, bounds); |
|
336 | 337 |
table.setSortDirection(SWT.DOWN); |
337 | 338 |
table.setHeaderVisible(true); |
338 | 339 |
table.setLinesVisible(true); |
... | ... | |
349 | 350 |
* @param restoreValuesForColumnWidth |
350 | 351 |
*/ |
351 | 352 |
private void createInitalDistributionColumns(Table table, |
352 |
List<String> titles, List<Integer> bounds, Map<Integer, Boolean> restoreValuesForColumnWidth) {
|
|
353 |
List<String> titles, List<Integer> bounds) { |
|
353 | 354 |
for (int columnIndex = 0; columnIndex < titles.size(); columnIndex++) { |
354 | 355 |
TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE); |
355 | 356 |
column.getColumn().setText(titles.get(columnIndex)); |
... | ... | |
366 | 367 |
} |
367 | 368 |
if ((columnIndex == 1 && !PreferencesUtil.isShowRankInChecklistEditor()) || columnIndex >= 2 ) { |
368 | 369 |
//read PrefrenceStore to setWidth according to last saved state |
369 |
if(restoreValuesForColumnWidth.get(columnIndex)){ |
|
370 |
// if(restoreValuesForColumnWidth.get(columnIndex)){
|
|
370 | 371 |
column.getColumn().setWidth(50); |
371 |
}else{ |
|
372 |
column.getColumn().setWidth(0); |
|
373 |
} |
|
372 |
// }else{
|
|
373 |
// column.getColumn().setWidth(0);
|
|
374 |
// }
|
|
374 | 375 |
column.setEditingSupport(new DistributionEditingSupportE4(viewer, this, columnIndex)); |
375 | 376 |
|
376 | 377 |
} |
... | ... | |
386 | 387 |
* @param bounds |
387 | 388 |
* @return Map<Integer, Boolean> |
388 | 389 |
*/ |
389 |
private Map<Integer, Boolean> restoreValuesForColumnWidth(List<String> titles,
|
|
390 |
private void restoreValuesForColumnWidth(List<String> titles,
|
|
390 | 391 |
List<Integer> bounds) { |
391 |
Map<Integer, Boolean> restoreColumnWidth = new HashMap<Integer, Boolean>(); |
|
392 |
// Map<Integer, Boolean> restoreColumnWidth = new HashMap<Integer, Boolean>();
|
|
392 | 393 |
if (labelProvider.getNamedAreas(true) != null) { |
393 | 394 |
int columnIndex; |
394 | 395 |
if (PreferencesUtil.isShowRankInChecklistEditor()){ |
... | ... | |
398 | 399 |
} |
399 | 400 |
for (DefinedTermBase<DefinedTermBase> term : getLabelProvider().getNamedAreas(false)) { |
400 | 401 |
if(term != null){ |
401 |
restoreColumnWidth.put(columnIndex, PreferencesUtil.getPreferenceStore().getBoolean(term.getUuid().toString())); |
|
402 |
// restoreColumnWidth.put(columnIndex, PreferencesUtil.getPreferenceStore().getBoolean(term.getUuid().toString()));
|
|
402 | 403 |
areaPosition.put(term.getUuid(), columnIndex); |
403 | 404 |
if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){ |
404 | 405 |
if (term.getIdInVocabulary() != null){ |
... | ... | |
414 | 415 |
} |
415 | 416 |
} |
416 | 417 |
} |
417 |
return restoreColumnWidth; |
|
418 |
// return restoreColumnWidth;
|
|
418 | 419 |
} |
419 | 420 |
|
420 | 421 |
/** |
Also available in: Unified diff
ref #7063:handle orderedTerms without orderindex and order by lable