Search in sources :

Example 1 with AggregationFunctionAndRowTableCellRenderer

use of org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer in project knime-core by knime.

the class DBPatternAggregationFunctionPanel method adaptTableColumnModel.

/**
 * {@inheritDoc}
 */
@Override
protected void adaptTableColumnModel(final TableColumnModel columnModel) {
    columnModel.getColumn(0).setCellRenderer(new AggregationFunctionRowTableCellRenderer<>(new ValueRenderer<DBPatternAggregationFunctionRow>() {

        @Override
        public void renderComponent(final DefaultTableCellRenderer c, final DBPatternAggregationFunctionRow row) {
            c.setText(row.getInputPattern());
        }
    }, true, "Double click to remove column. Right mouse click for context menu."));
    columnModel.getColumn(0).setCellEditor(new DBPatternTableCellEditor());
    columnModel.getColumn(1).setCellRenderer(new BooleanCellRenderer("Tick if the pattern is a regular expression"));
    columnModel.getColumn(1).setMinWidth(REGEX_SIZE);
    columnModel.getColumn(1).setMaxWidth(REGEX_SIZE);
    m_aggregationFunctionCellEditor = new DBPatternAggregationFunctionRowTableCellEditor(null);
    columnModel.getColumn(2).setCellEditor(m_aggregationFunctionCellEditor);
    columnModel.getColumn(2).setCellRenderer(new AggregationFunctionAndRowTableCellRenderer());
    columnModel.getColumn(0).setPreferredWidth(250);
    columnModel.getColumn(1).setPreferredWidth(150);
}
Also used : AggregationFunctionAndRowTableCellRenderer(org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer) BooleanCellRenderer(org.knime.base.data.aggregation.dialogutil.BooleanCellRenderer) ValueRenderer(org.knime.base.data.aggregation.dialogutil.AggregationFunctionRowTableCellRenderer.ValueRenderer) DefaultTableCellRenderer(javax.swing.table.DefaultTableCellRenderer)

Example 2 with AggregationFunctionAndRowTableCellRenderer

use of org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer in project knime-core by knime.

the class DBDataTypeAggregationFunctionPanel method adaptTableColumnModel.

/**
 * {@inheritDoc}
 */
@Override
protected void adaptTableColumnModel(final TableColumnModel columnModel) {
    columnModel.getColumn(0).setCellRenderer(new AggregationFunctionRowTableCellRenderer<>(new ValueRenderer<DBDataTypeAggregationFunctionRow>() {

        @Override
        public void renderComponent(final DefaultTableCellRenderer c, final DBDataTypeAggregationFunctionRow row) {
            final DataType dataType = row.getDataType();
            c.setText(dataType.toString());
            c.setIcon(dataType.getIcon());
        }
    }, true, "Double click to remove column. Right mouse click for context menu."));
    m_aggregationFunctionCellEditor = new DBDataTypeAggregationFunctionRowTableCellEditor(null);
    columnModel.getColumn(1).setCellEditor(m_aggregationFunctionCellEditor);
    columnModel.getColumn(1).setCellRenderer(new AggregationFunctionAndRowTableCellRenderer());
    columnModel.getColumn(0).setPreferredWidth(170);
    columnModel.getColumn(1).setPreferredWidth(150);
}
Also used : AggregationFunctionAndRowTableCellRenderer(org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer) DataType(org.knime.core.data.DataType) ValueRenderer(org.knime.base.data.aggregation.dialogutil.AggregationFunctionRowTableCellRenderer.ValueRenderer) DefaultTableCellRenderer(javax.swing.table.DefaultTableCellRenderer)

Example 3 with AggregationFunctionAndRowTableCellRenderer

use of org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer in project knime-core by knime.

the class AggregationColumnPanel method adaptTableColumnModel.

/**
 * {@inheritDoc}
 */
@Override
protected void adaptTableColumnModel(final TableColumnModel columnModel) {
    columnModel.getColumn(0).setCellRenderer(new AggregationFunctionRowTableCellRenderer<>(new ValueRenderer<ColumnAggregator>() {

        @Override
        public void renderComponent(final DefaultTableCellRenderer c, final ColumnAggregator row) {
            final DataColumnSpec spec = row.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 AggregationFunctionAndRowTableCellRenderer());
    columnModel.getColumn(0).setPreferredWidth(170);
    columnModel.getColumn(1).setPreferredWidth(150);
}
Also used : DataColumnSpec(org.knime.core.data.DataColumnSpec) ColumnAggregator(org.knime.base.data.aggregation.ColumnAggregator) AggregationFunctionAndRowTableCellRenderer(org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer) ValueRenderer(org.knime.base.data.aggregation.dialogutil.AggregationFunctionRowTableCellRenderer.ValueRenderer) DefaultTableCellRenderer(javax.swing.table.DefaultTableCellRenderer)

Example 4 with AggregationFunctionAndRowTableCellRenderer

use of org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer in project knime-core by knime.

the class DataTypeAggregationPanel method adaptTableColumnModel.

/**
 * {@inheritDoc}
 */
@Override
protected void adaptTableColumnModel(final TableColumnModel columnModel) {
    columnModel.getColumn(0).setCellRenderer(new AggregationFunctionRowTableCellRenderer<>(new ValueRenderer<DataTypeAggregator>() {

        @Override
        public void renderComponent(final DefaultTableCellRenderer c, final DataTypeAggregator row) {
            final DataType dataType = row.getDataType();
            c.setText(dataType.toString());
            c.setIcon(dataType.getIcon());
        }
    }, true, "Double click to remove data type. Right mouse click for context menu."));
    columnModel.getColumn(1).setCellEditor(new DataTypeAggregatorTableCellEditor());
    columnModel.getColumn(1).setCellRenderer(new AggregationFunctionAndRowTableCellRenderer());
    columnModel.getColumn(0).setPreferredWidth(170);
    columnModel.getColumn(1).setPreferredWidth(150);
}
Also used : AggregationFunctionAndRowTableCellRenderer(org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer) DataType(org.knime.core.data.DataType) ValueRenderer(org.knime.base.data.aggregation.dialogutil.AggregationFunctionRowTableCellRenderer.ValueRenderer) DefaultTableCellRenderer(javax.swing.table.DefaultTableCellRenderer)

Example 5 with AggregationFunctionAndRowTableCellRenderer

use of org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer in project knime-core by knime.

the class PatternAggregationPanel method adaptTableColumnModel.

/**
 * {@inheritDoc}
 */
@Override
protected void adaptTableColumnModel(final TableColumnModel columnModel) {
    columnModel.getColumn(0).setCellRenderer(new AggregationFunctionRowTableCellRenderer<>(new ValueRenderer<PatternAggregator>() {

        @Override
        public void renderComponent(final DefaultTableCellRenderer c, final PatternAggregator row) {
            final String regex = row.getInputPattern();
            c.setText(regex);
        }
    }, true, "Double click to change search pattern. Right mouse click for context menu."));
    columnModel.getColumn(0).setCellEditor(new PatternTableCellEditor());
    columnModel.getColumn(1).setCellRenderer(new BooleanCellRenderer("Tick if the pattern is a regular expression"));
    columnModel.getColumn(1).setMinWidth(REGEX_SIZE);
    columnModel.getColumn(1).setMaxWidth(REGEX_SIZE);
    columnModel.getColumn(2).setCellEditor(new PatternAggregatorTableCellEditor());
    columnModel.getColumn(2).setCellRenderer(new AggregationFunctionAndRowTableCellRenderer());
    columnModel.getColumn(0).setPreferredWidth(250);
    columnModel.getColumn(1).setPreferredWidth(150);
}
Also used : AggregationFunctionAndRowTableCellRenderer(org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer) BooleanCellRenderer(org.knime.base.data.aggregation.dialogutil.BooleanCellRenderer) ValueRenderer(org.knime.base.data.aggregation.dialogutil.AggregationFunctionRowTableCellRenderer.ValueRenderer) DefaultTableCellRenderer(javax.swing.table.DefaultTableCellRenderer)

Aggregations

DefaultTableCellRenderer (javax.swing.table.DefaultTableCellRenderer)6 AggregationFunctionAndRowTableCellRenderer (org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer)6 ValueRenderer (org.knime.base.data.aggregation.dialogutil.AggregationFunctionRowTableCellRenderer.ValueRenderer)6 BooleanCellRenderer (org.knime.base.data.aggregation.dialogutil.BooleanCellRenderer)2 DataColumnSpec (org.knime.core.data.DataColumnSpec)2 DataType (org.knime.core.data.DataType)2 ColumnAggregator (org.knime.base.data.aggregation.ColumnAggregator)1