Search in sources :

Example 1 with DialogComponentButtonGroup

use of org.knime.core.node.defaultnodesettings.DialogComponentButtonGroup in project knime-core by knime.

the class CorrelationOperator method getDialogComponent.

private DialogComponentButtonGroup getDialogComponent() {
    if (m_correlationComponent == null) {
        final SettingsModelString correlationModel = m_settings.getCorrelationMethodModel();
        m_correlationComponent = new DialogComponentButtonGroup(correlationModel, "Correlation method", false, CorrelationMethods.values());
    }
    return m_correlationComponent;
}
Also used : DialogComponentButtonGroup(org.knime.core.node.defaultnodesettings.DialogComponentButtonGroup) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 2 with DialogComponentButtonGroup

use of org.knime.core.node.defaultnodesettings.DialogComponentButtonGroup in project knime-core by knime.

the class AbstractFieldExtractorNodeDialog method createUIComponentWithFormatSelection.

/**
 * Creates the necessary {@link SettingsModel}s, adds the listener to the
 * checkbox and creates the UI component with a horizontally oriented group
 * containing the checkbox and text field for the new column name.
 * Then closes the group.
 *
 * @param timeField name of the time field for which a checkbox,
 * a text field and a format selection (int or string) should be created
 */
protected void createUIComponentWithFormatSelection(final String timeField) {
    // create the settings models and add listener
    SettingsModelBoolean checkBoxModel = createUseTimeFieldModel(timeField);
    SettingsModelString colNameModel = createTimeFieldColumnNameModel(timeField);
    SettingsModelString formatModel = createRepresentationModelFor(timeField);
    addListener(checkBoxModel, colNameModel);
    addListener(checkBoxModel, formatModel);
    createNewGroup("");
    setHorizontalPlacement(true);
    addDialogComponent(new DialogComponentBoolean(checkBoxModel, timeField));
    // add radio buttons for string or int representation
    addDialogComponent(new DialogComponentButtonGroup(formatModel, true, "Value as", AS_STRING, AS_INT));
    addDialogComponent(new DialogComponentString(colNameModel, "Column name:", true, 20));
    closeCurrentGroup();
    setHorizontalPlacement(false);
}
Also used : SettingsModelBoolean(org.knime.core.node.defaultnodesettings.SettingsModelBoolean) DialogComponentButtonGroup(org.knime.core.node.defaultnodesettings.DialogComponentButtonGroup) DialogComponentString(org.knime.core.node.defaultnodesettings.DialogComponentString) DialogComponentBoolean(org.knime.core.node.defaultnodesettings.DialogComponentBoolean) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Example 3 with DialogComponentButtonGroup

use of org.knime.core.node.defaultnodesettings.DialogComponentButtonGroup in project knime-core by knime.

the class SleepNodeDialog method waitForFile.

private void waitForFile() {
    m_events = new DialogComponentButtonGroup(new SettingsModelString(SleepNodeModel.CFGKEY_FILESTATUS, "Modification"), false, null, "Creation", "Modification", "Deletion");
    FlowVariableModel fvm = createFlowVariableModel(SleepNodeModel.CFGKEY_FILEPATH, Type.STRING);
    m_fileChooser = new FilesHistoryPanel(fvm, SleepNodeModel.CFGKEY_FILEPATH, LocationValidation.None);
    m_fileRB = new JRadioButton("Wait for file.. ");
    m_fileRB.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(final ItemEvent e) {
            if (m_fileRB.isSelected()) {
                m_selection = 2;
            }
            m_fileChooser.setEnabled(m_fileRB.isSelected());
            m_events.getModel().setEnabled(m_fileRB.isSelected());
        }
    });
}
Also used : FlowVariableModel(org.knime.core.node.FlowVariableModel) DialogComponentButtonGroup(org.knime.core.node.defaultnodesettings.DialogComponentButtonGroup) ItemEvent(java.awt.event.ItemEvent) JRadioButton(javax.swing.JRadioButton) FilesHistoryPanel(org.knime.core.node.util.FilesHistoryPanel) ItemListener(java.awt.event.ItemListener) SettingsModelString(org.knime.core.node.defaultnodesettings.SettingsModelString)

Aggregations

DialogComponentButtonGroup (org.knime.core.node.defaultnodesettings.DialogComponentButtonGroup)3 SettingsModelString (org.knime.core.node.defaultnodesettings.SettingsModelString)3 ItemEvent (java.awt.event.ItemEvent)1 ItemListener (java.awt.event.ItemListener)1 JRadioButton (javax.swing.JRadioButton)1 FlowVariableModel (org.knime.core.node.FlowVariableModel)1 DialogComponentBoolean (org.knime.core.node.defaultnodesettings.DialogComponentBoolean)1 DialogComponentString (org.knime.core.node.defaultnodesettings.DialogComponentString)1 SettingsModelBoolean (org.knime.core.node.defaultnodesettings.SettingsModelBoolean)1 FilesHistoryPanel (org.knime.core.node.util.FilesHistoryPanel)1