@Override public Object getValue(Object element, String property) { if (element != null && COLUMN_QUANTITY.equals(property)) { if (element instanceof OrderEntry) { OrderEntry entry = (OrderEntry) element; return "" + entry.getQuantity(); } } return ""; }
@Override public void modify(Object element, String property, Object value) { if (!(element != null && COLUMN_QUANTITY.equals(property))) { return; } if (!(element instanceof TableItem)) { return; } if (((TableItem) element).getData() instanceof OrderEntry) { OrderEntry entry = (OrderEntry) ((TableItem) element).getData(); entry.setQuantity(NumberUtils.toInt("" + value)); this.orderEditor.tableViewer.refresh(); } }