Search in sources :

Example 1 with DataTypeListCellRenderer

use of org.knime.core.node.util.DataTypeListCellRenderer in project knime-core by knime.

the class AddOutFieldDialog method initKnimeTypeComboBox.

/**
 * Initialize the selection list for the knime type.
 */
private void initKnimeTypeComboBox() {
    m_knimeType.removeAllItems();
    if (m_fieldType.getSelectedItem().equals(FieldType.Column)) {
        TypeProvider typeProvider = TypeProvider.getDefault();
        for (DataType type : typeProvider.getColumnTypes()) {
            m_knimeType.addItem(type);
        }
        m_knimeType.setRenderer(new DataTypeListCellRenderer());
    } else {
        TypeProvider typeProvider = TypeProvider.getDefault();
        for (FlowVariable.Type type : typeProvider.getFlowVarTypes().keySet()) {
            m_knimeType.addItem(type);
        }
        m_knimeType.setRenderer(new TypeListCellRender());
    }
    // string is the default value
    m_knimeType.setSelectedItem(StringCell.TYPE);
}
Also used : DataType(org.knime.core.data.DataType) DataTypeListCellRenderer(org.knime.core.node.util.DataTypeListCellRenderer) FlowVariable(org.knime.core.node.workflow.FlowVariable)

Example 2 with DataTypeListCellRenderer

use of org.knime.core.node.util.DataTypeListCellRenderer in project knime-core by knime.

the class AddOutFieldDialog method initKnimeTypeComboBox.

/**
 * Initialize the selection list for the knime type.
 */
private void initKnimeTypeComboBox() {
    m_knimeType.removeAllItems();
    if (m_fieldType.getSelectedItem().equals(FieldType.Column)) {
        for (final DataType type : ConverterUtil.getAllDestinationDataTypes()) {
            m_knimeType.addItem(type);
        }
        m_knimeType.setRenderer(new DataTypeListCellRenderer());
    } else {
        TypeProvider typeProvider = TypeProvider.getDefault();
        for (FlowVariable.Type type : typeProvider.getTypes()) {
            m_knimeType.addItem(type);
        }
        m_knimeType.setRenderer(new TypeListCellRender());
    }
    // string is the default value
    m_knimeType.setSelectedItem(StringCell.TYPE);
}
Also used : DataType(org.knime.core.data.DataType) TypeProvider(org.knime.base.node.jsnippet.type.TypeProvider) DataTypeListCellRenderer(org.knime.core.node.util.DataTypeListCellRenderer) FlowVariable(org.knime.core.node.workflow.FlowVariable)

Aggregations

DataType (org.knime.core.data.DataType)2 DataTypeListCellRenderer (org.knime.core.node.util.DataTypeListCellRenderer)2 FlowVariable (org.knime.core.node.workflow.FlowVariable)2 TypeProvider (org.knime.base.node.jsnippet.type.TypeProvider)1