Search in sources :

Example 6 with FlowVariableModel

use of org.knime.core.node.FlowVariableModel 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)

Example 7 with FlowVariableModel

use of org.knime.core.node.FlowVariableModel in project knime-core by knime.

the class DialogComponentNumber method setEnabledComponents.

/**
 * {@inheritDoc}
 */
@Override
protected void setEnabledComponents(final boolean enabled) {
    boolean spinnerEnabled = enabled;
    // enable the spinner according to the variable model
    if (m_fvmButton != null) {
        FlowVariableModel svmModel = m_fvmButton.getFlowVariableModel();
        if (svmModel.isVariableReplacementEnabled()) {
            spinnerEnabled = false;
        }
        m_fvmButton.setEnabled(enabled);
    }
    m_spinner.setEnabled(spinnerEnabled);
}
Also used : FlowVariableModel(org.knime.core.node.FlowVariableModel)

Aggregations

FlowVariableModel (org.knime.core.node.FlowVariableModel)7 JCheckBox (javax.swing.JCheckBox)4 Dimension (java.awt.Dimension)3 JPanel (javax.swing.JPanel)3 ChangeEvent (javax.swing.event.ChangeEvent)3 ChangeListener (javax.swing.event.ChangeListener)3 FilesHistoryPanel (org.knime.core.node.util.FilesHistoryPanel)3 GridBagConstraints (java.awt.GridBagConstraints)2 GridBagLayout (java.awt.GridBagLayout)2 ItemEvent (java.awt.event.ItemEvent)2 ItemListener (java.awt.event.ItemListener)2 Box (javax.swing.Box)2 JLabel (javax.swing.JLabel)2 JRadioButton (javax.swing.JRadioButton)2 JTextField (javax.swing.JTextField)2 FlowVariableModelButton (org.knime.core.node.FlowVariableModelButton)2 Font (java.awt.Font)1 Insets (java.awt.Insets)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1