private ConfigRegistry configRegistry;
+ private DefaultBodyLayerStack bodyLayer;
+
public CharacterMatrix(Composite parent, CharacterMatrixPart part) {
super(parent, SWT.NONE);
* Add description button
*/
Button btnAddDescription = new Button(buttonPanel, SWT.PUSH);
- btnAddDescription.setImage(ImageResources.getImage(ImageResources.ADD_ICON));
+ btnAddDescription.setImage(ImageResources.getImage(ImageResources.ADD_ICON_GREEN));
btnAddDescription.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
}
}
});
+ /**
+ * Remove description button
+ */
+ Button btnRemoveDescription = new Button(buttonPanel, SWT.PUSH);
+ btnRemoveDescription.setImage(ImageResources.getImage(ImageResources.ACTIVE_DELETE_ICON));
+ btnRemoveDescription.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ int[] fullySelectedRowPositions = bodyLayer.getSelectionLayer().getFullySelectedRowPositions();
+ for (int i : fullySelectedRowPositions) {
+ Object rowObject = bodyDataProvider.getRowObject(i);
+ if(rowObject instanceof RowWrapper){
+ CharacterMatrix.this.descriptions.remove(rowObject);
+ workingSet.removeDescription(((RowWrapper) rowObject).getSpecimenDescription());
+ setDirty();
+ }
+ }
+ }
+ });
}
private void applyStyles(){
GlazedListTreeData treeData = new GlazedListTreeData<>(treeList);
ITreeRowModel treeRowModel = new GlazedListTreeRowModel<>(treeData);
- final DefaultBodyLayerStack bodyLayer = new DefaultBodyLayerStack(
- bodyDataLayer);
+ bodyLayer = new DefaultBodyLayerStack(
+ eventLayer);
viewportLayer = bodyLayer.getViewportLayer();
final SelectionLayer selectionLayer = bodyLayer.getSelectionLayer();
freezeLayer = new FreezeLayer(selectionLayer);
************************************************************************************** */
/** Constant <code>ADD_ICON="add_icon"</code> */
public static final String ADD_ICON = "add_icon";
+ public static final String ADD_ICON_GREEN = "add_icon_green";
+ public static final String MIN_ICON = "min_icon";
public static final String ADD_EDIT = "add_edit";
/** Constant <code>TRASH_ICON="trash_icon"</code> */
public static final String TRASH_ICON = "trash_icon";
protected void initializeImageRegistry(ImageRegistry registry) {
registerImage(registry, ADD_ICON,
"add_no_bg.gif");
+ registerImage(registry, ADD_ICON_GREEN,
+ "add.gif");
+ registerImage(registry, MIN_ICON,
+ "min.gif");
registerImage(registry, ADD_EDIT,
"add_edit.gif");
registerImage(registry, TRASH_ICON,