use of org.knime.base.data.aggregation.dialogutil.AggregationMethodDecoratorTableCellRenderer.ValueRenderer in project knime-core by knime.
the class AggregationColumnPanel method adaptTableColumnModel.
/**
* {@inheritDoc}
*/
@Override
protected void adaptTableColumnModel(final TableColumnModel columnModel) {
columnModel.getColumn(0).setCellRenderer(new AggregationMethodDecoratorTableCellRenderer(new ValueRenderer() {
@Override
public void renderComponent(final DefaultTableCellRenderer c, final AggregationMethodDecorator method) {
if (method instanceof ColumnAggregator) {
final ColumnAggregator aggregator = (ColumnAggregator) method;
final DataColumnSpec spec = aggregator.getOriginalColSpec();
c.setText(spec.getName());
c.setIcon(spec.getType().getIcon());
}
}
}, true, "Double click to remove column. Right mouse click for context menu."));
columnModel.getColumn(1).setCellEditor(new ColumnAggregatorTableCellEditor());
columnModel.getColumn(1).setCellRenderer(new AggregationMethodDecoratorTableCellRenderer(new ValueRenderer() {
@Override
public void renderComponent(final DefaultTableCellRenderer c, final AggregationMethodDecorator method) {
c.setText(method.getLabel());
}
}, false));
columnModel.getColumn(0).setPreferredWidth(170);
columnModel.getColumn(1).setPreferredWidth(150);
}
Aggregations