Search in sources :

Example 1 with BooleanCellRenderer

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

the class NameBasedKeysPanel method adaptTableColumnModel.

/**
 * {@inheritDoc}
 */
@Override
protected void adaptTableColumnModel(final TableColumnModel columnModel) {
    // Adapts column "Regex"
    int colIdx = NameBasedKeysElement.REGEX_IDX;
    columnModel.getColumn(colIdx).setCellRenderer(new BooleanCellRenderer("Tick if the pattern is a regular expression"));
    columnModel.getColumn(colIdx).setMinWidth(REGEX_SIZE);
    columnModel.getColumn(colIdx).setMaxWidth(REGEX_SIZE);
    // Adapts column "Key Name"
    colIdx = NameBasedKeysElement.KEY_NAME_IDX;
    columnModel.getColumn(colIdx).setCellEditor(new NameCellEditor());
    // Adapts column "Primary Key"
    colIdx = NameBasedKeysElement.PRIMARY_KEY_IDX;
    columnModel.getColumn(colIdx).setCellEditor(new RadioButtonCellEditor());
    columnModel.getColumn(colIdx).setCellRenderer(new RadioButtonCellRenderer());
    columnModel.getColumn(colIdx).setMinWidth(PRIMARY_KEY_SIZE);
    columnModel.getColumn(colIdx).setMaxWidth(PRIMARY_KEY_SIZE);
}
Also used : BooleanCellRenderer(org.knime.base.data.aggregation.dialogutil.BooleanCellRenderer)

Example 2 with BooleanCellRenderer

use of org.knime.base.data.aggregation.dialogutil.BooleanCellRenderer 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 3 with BooleanCellRenderer

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

the class KNIMEBasedMappingPanel method adaptTableColumnModel.

/**
 * {@inheritDoc}
 */
@Override
protected void adaptTableColumnModel(final TableColumnModel columnModel) {
    // Adapts column "Not Null"
    int colIdx = KNIMEBasedMappingElement.NOT_NULL_IDX;
    columnModel.getColumn(colIdx).setCellRenderer(new BooleanCellRenderer("Tick if the columns that have the selected knime type should be not null"));
    columnModel.getColumn(colIdx).setMinWidth(NOT_NULL_SIZE);
    columnModel.getColumn(colIdx).setMaxWidth(NOT_NULL_SIZE);
}
Also used : BooleanCellRenderer(org.knime.base.data.aggregation.dialogutil.BooleanCellRenderer)

Example 4 with BooleanCellRenderer

use of org.knime.base.data.aggregation.dialogutil.BooleanCellRenderer 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)

Example 5 with BooleanCellRenderer

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

the class NameBasedMappingPanel method adaptTableColumnModel.

/**
 * {@inheritDoc}
 */
@Override
protected void adaptTableColumnModel(final TableColumnModel columnModel) {
    // Adapts column "Regex"
    int colIdx = NameBasedMappingElement.REGEX_IDX;
    columnModel.getColumn(colIdx).setCellRenderer(new BooleanCellRenderer("Tick if the pattern is a regular expression"));
    columnModel.getColumn(colIdx).setMinWidth(REGEX_SIZE);
    columnModel.getColumn(colIdx).setMaxWidth(REGEX_SIZE);
    // Adapts column "Not Null"
    colIdx = NameBasedMappingElement.NOT_NULL_IDX;
    columnModel.getColumn(colIdx).setCellRenderer(new BooleanCellRenderer("Tick if the columns that match the pattern should be not null"));
    columnModel.getColumn(colIdx).setMinWidth(NOT_NULL_SIZE);
    columnModel.getColumn(colIdx).setMaxWidth(NOT_NULL_SIZE);
}
Also used : BooleanCellRenderer(org.knime.base.data.aggregation.dialogutil.BooleanCellRenderer)

Aggregations

BooleanCellRenderer (org.knime.base.data.aggregation.dialogutil.BooleanCellRenderer)5 DefaultTableCellRenderer (javax.swing.table.DefaultTableCellRenderer)2 AggregationFunctionAndRowTableCellRenderer (org.knime.base.data.aggregation.dialogutil.AggregationFunctionAndRowTableCellRenderer)2 ValueRenderer (org.knime.base.data.aggregation.dialogutil.AggregationFunctionRowTableCellRenderer.ValueRenderer)2