Search in sources :

Example 1 with TableContentModel

use of org.knime.core.node.tableview.TableContentModel in project knime-core by knime.

the class DataTableSpecView method dispose.

/**
 * {@inheritDoc}
 * @since 3.6
 */
@Override
public void dispose() {
    TableContentModel contentModel = m_specView.getContentModel();
    DataTable dataTable = contentModel.getDataTable();
    contentModel.setDataTable(null);
    if (dataTable instanceof ContainerTable) {
        ((ContainerTable) dataTable).clear();
    }
}
Also used : DataTable(org.knime.core.data.DataTable) TableContentModel(org.knime.core.node.tableview.TableContentModel) ContainerTable(org.knime.core.data.container.ContainerTable)

Example 2 with TableContentModel

use of org.knime.core.node.tableview.TableContentModel in project knime-core by knime.

the class PMCCNodeView method modelChanged.

/**
 * {@inheritDoc}
 */
@Override
protected void modelChanged() {
    DataTable table = getNodeModel().getCorrelationTable();
    TableContentModel cntModel = m_tableView.getContentModel();
    cntModel.setDataTable(table);
    changeRenderer(m_currentRendererID);
    // must not call this on cntView as that would not affect the
    // row header column
    m_tableView.setRowHeight(16);
}
Also used : DataTable(org.knime.core.data.DataTable) TableContentModel(org.knime.core.node.tableview.TableContentModel)

Example 3 with TableContentModel

use of org.knime.core.node.tableview.TableContentModel in project knime-core by knime.

the class TableNodeView method updateTitle.

/**
 * Updates the title of the frame. It prints: "Table (#rows[+] x #cols)". It
 * is invoked each time new rows are inserted (user scrolls down).
 */
protected void updateTitle() {
    final TableContentView view = m_tableView.getContentTable();
    TableContentModel model = view.getContentModel();
    StringBuffer title = new StringBuffer();
    if (model.hasData()) {
        String tableName = model.getTableName();
        if (!tableName.equals("default")) {
            title.append(" \"");
            title.append(tableName);
            title.append("\"");
        }
        title.append(" (");
        int rowCount = model.getRowCount();
        boolean isFinal = model.isRowCountFinal();
        title.append(rowCount);
        title.append(isFinal ? " x " : "+ x ");
        title.append(model.getColumnCount());
        title.append(")");
    } else {
        title.append(" <no data>");
    }
    super.setViewTitleSuffix(title.toString());
}
Also used : TableContentView(org.knime.core.node.tableview.TableContentView) TableContentModel(org.knime.core.node.tableview.TableContentModel)

Example 4 with TableContentModel

use of org.knime.core.node.tableview.TableContentModel in project knime-core by knime.

the class DataColumnPropertiesView method dispose.

/**
 * {@inheritDoc}
 * @since 3.6
 */
@Override
public void dispose() {
    TableContentModel contentModel = m_propsView.getContentModel();
    DataTable dataTable = contentModel.getDataTable();
    contentModel.setDataTable(null);
    if (dataTable instanceof ContainerTable) {
        ((ContainerTable) dataTable).clear();
    }
}
Also used : DataTable(org.knime.core.data.DataTable) TableContentModel(org.knime.core.node.tableview.TableContentModel) ContainerTable(org.knime.core.data.container.ContainerTable)

Example 5 with TableContentModel

use of org.knime.core.node.tableview.TableContentModel in project knime-core by knime.

the class AbstractCorrelationComputeNodeView method tableChanged.

/**
 * Call whenever the {@link DataTable} changed e.g. in the modelChanged() method.
 * @param table new {@link DataTable}
 */
protected void tableChanged(final DataTable table) {
    TableContentModel cntModel = getTableViewContentModel();
    cntModel.setDataTable(table);
    changeRenderer(getCurrentRendererID());
    // must not call this on cntView as that would not affect the
    // row header column
    setTableViewRowHeight(16);
}
Also used : TableContentModel(org.knime.core.node.tableview.TableContentModel)

Aggregations

TableContentModel (org.knime.core.node.tableview.TableContentModel)6 DataTable (org.knime.core.data.DataTable)4 ContainerTable (org.knime.core.data.container.ContainerTable)2 TableContentView (org.knime.core.node.tableview.TableContentView)1