Revision 248d15d9
Added by Patrick Plitzner about 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/matrix/CharacterMatrix.java | ||
---|---|---|
196 | 196 |
|
197 | 197 |
private ConfigRegistry configRegistry; |
198 | 198 |
|
199 |
private DefaultBodyLayerStack bodyLayer; |
|
200 |
|
|
199 | 201 |
|
200 | 202 |
public CharacterMatrix(Composite parent, CharacterMatrixPart part) { |
201 | 203 |
super(parent, SWT.NONE); |
... | ... | |
384 | 386 |
* Add description button |
385 | 387 |
*/ |
386 | 388 |
Button btnAddDescription = new Button(buttonPanel, SWT.PUSH); |
387 |
btnAddDescription.setImage(ImageResources.getImage(ImageResources.ADD_ICON)); |
|
389 |
btnAddDescription.setImage(ImageResources.getImage(ImageResources.ADD_ICON_GREEN));
|
|
388 | 390 |
btnAddDescription.addSelectionListener(new SelectionAdapter() { |
389 | 391 |
@Override |
390 | 392 |
public void widgetSelected(SelectionEvent e) { |
... | ... | |
406 | 408 |
} |
407 | 409 |
} |
408 | 410 |
}); |
411 |
/** |
|
412 |
* Remove description button |
|
413 |
*/ |
|
414 |
Button btnRemoveDescription = new Button(buttonPanel, SWT.PUSH); |
|
415 |
btnRemoveDescription.setImage(ImageResources.getImage(ImageResources.ACTIVE_DELETE_ICON)); |
|
416 |
btnRemoveDescription.addSelectionListener(new SelectionAdapter() { |
|
417 |
@Override |
|
418 |
public void widgetSelected(SelectionEvent e) { |
|
419 |
int[] fullySelectedRowPositions = bodyLayer.getSelectionLayer().getFullySelectedRowPositions(); |
|
420 |
for (int i : fullySelectedRowPositions) { |
|
421 |
Object rowObject = bodyDataProvider.getRowObject(i); |
|
422 |
if(rowObject instanceof RowWrapper){ |
|
423 |
CharacterMatrix.this.descriptions.remove(rowObject); |
|
424 |
workingSet.removeDescription(((RowWrapper) rowObject).getSpecimenDescription()); |
|
425 |
setDirty(); |
|
426 |
} |
|
427 |
} |
|
428 |
} |
|
429 |
}); |
|
409 | 430 |
} |
410 | 431 |
|
411 | 432 |
private void applyStyles(){ |
... | ... | |
584 | 605 |
GlazedListTreeData treeData = new GlazedListTreeData<>(treeList); |
585 | 606 |
ITreeRowModel treeRowModel = new GlazedListTreeRowModel<>(treeData); |
586 | 607 |
|
587 |
final DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(
|
|
588 |
bodyDataLayer);
|
|
608 |
bodyLayer = new DefaultBodyLayerStack( |
|
609 |
eventLayer);
|
|
589 | 610 |
viewportLayer = bodyLayer.getViewportLayer(); |
590 | 611 |
final SelectionLayer selectionLayer = bodyLayer.getSelectionLayer(); |
591 | 612 |
freezeLayer = new FreezeLayer(selectionLayer); |
Also available in: Unified diff
ref #7095 Add remove description button