use of org.knime.base.node.jsnippet.ui.FieldsTableModel in project knime-core by knime.
the class JavaEditVarNodeDialog method createOutFieldsTable.
/**
* {@inheritDoc}
*/
@Override
protected OutFieldsTable createOutFieldsTable() {
OutFieldsTable table = new OutFieldsTable(true);
FieldsTableModel model = (FieldsTableModel) table.getTable().getModel();
model.setColumnName(model.getIndex(Column.COLUMN), "Flow Variable");
table.getTable().getColumnModel().getColumn(model.getIndex(Column.REPLACE_EXISTING)).setPreferredWidth(15);
return table;
}
use of org.knime.base.node.jsnippet.ui.FieldsTableModel in project knime-core by knime.
the class JavaEditVarNodeDialog method createInFieldsTable.
/**
* {@inheritDoc}
*/
@Override
protected InFieldsTable createInFieldsTable() {
InFieldsTable table = new InFieldsTable();
FieldsTableModel model = (FieldsTableModel) table.getTable().getModel();
model.setColumnName(model.getIndex(Column.COLUMN), "Flow Variable");
return table;
}
use of org.knime.base.node.jsnippet.ui.FieldsTableModel in project knime-core by knime.
the class JavaSnippetNodeDialog method saveSettingsTo.
@Override
protected void saveSettingsTo(final NodeSettingsWO settings) throws InvalidSettingsException {
ViewUtils.invokeAndWaitInEDT(() -> {
// pressed.
if (null != m_inFieldsTable.getTable().getCellEditor()) {
m_inFieldsTable.getTable().getCellEditor().stopCellEditing();
}
if (null != m_outFieldsTable.getTable().getCellEditor()) {
m_outFieldsTable.getTable().getCellEditor().stopCellEditing();
}
});
final JavaSnippetSettings s = m_snippet.getSettings();
// if settings have less fields than defined in the table it means
// that the tables contain errors
final FieldsTableModel inFieldsModel = (FieldsTableModel) m_inFieldsTable.getTable().getModel();
if (!inFieldsModel.validateValues()) {
throw new IllegalArgumentException("The input fields table has errors.");
}
final FieldsTableModel outFieldsModel = (FieldsTableModel) m_outFieldsTable.getTable().getModel();
if (!outFieldsModel.validateValues()) {
throw new IllegalArgumentException("The output fields table has errors.");
}
s.setBundles(m_bundleListPanel.getBundles());
// give subclasses the chance to modify settings
preSaveSettings(s);
s.saveSettings(settings);
}
use of org.knime.base.node.jsnippet.ui.FieldsTableModel in project knime-core by knime.
the class JavaSnippetNodeDialog method createOutFieldsTable.
/**
* Create table do display the output fields.
*
* @return the table
*/
protected OutFieldsTable createOutFieldsTable() {
final OutFieldsTable table = new OutFieldsTable(false);
final FieldsTableModel model = (FieldsTableModel) table.getTable().getModel();
final TableColumnModel columnModel = table.getTable().getColumnModel();
columnModel.getColumn(model.getIndex(Column.FIELD_TYPE)).setPreferredWidth(30);
columnModel.getColumn(model.getIndex(Column.REPLACE_EXISTING)).setPreferredWidth(15);
columnModel.getColumn(model.getIndex(Column.IS_COLLECTION)).setPreferredWidth(15);
return table;
}
Aggregations