|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.core.node.defaultnodesettings.DialogComponent
org.knime.core.node.defaultnodesettings.DialogComponentNumber
public class DialogComponentNumber
Provide a standard component for a dialog that allows to edit number value.
Provides label and spinner that checks ranges as well as functionality to
load/store into config object. The type of the number entered is determined
by the SettingsModel
passed to the constructor (currently supported
are double and int).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.knime.core.node.defaultnodesettings.DialogComponent |
---|
DialogComponent.EmptySettingsModel |
Field Summary |
---|
Fields inherited from class org.knime.core.node.defaultnodesettings.DialogComponent |
---|
DEFAULT_BG, DEFAULT_FG |
Constructor Summary | |
---|---|
DialogComponentNumber(SettingsModelNumber numberModel,
String label,
Number stepSize)
Constructor puts a label and spinner (with default width) into a panel. |
|
DialogComponentNumber(SettingsModelNumber numberModel,
String label,
Number stepSize,
FlowVariableModel fvm)
Puts a label and spinner with default width into panel, offers also the registration of a FlowVariableModel . |
|
DialogComponentNumber(SettingsModelNumber numberModel,
String label,
Number stepSize,
int compWidth)
Constructor puts label and spinner into panel. |
|
DialogComponentNumber(SettingsModelNumber numberModel,
String label,
Number stepSize,
int compWidth,
FlowVariableModel fvm)
Constructor puts label and spinner into panel and allows to specify width (in #characters) of component. |
Method Summary | |
---|---|
protected void |
checkConfigurabilityBeforeLoad(PortObjectSpec[] specs)
Will be called before the new values are loaded from the NodeSettings object. |
protected void |
setEnabledComponents(boolean enabled)
This method is called by the above (final) DialogComponent.setEnabled(boolean)
method. |
void |
setToolTipText(String text)
Implement this so it sets the tooltip on your component(s). |
protected void |
updateComponent()
Read the value from the DialogComponent.EmptySettingsModel and set/display it in the
component. |
protected void |
validateSettingsBeforeSave()
Will be called before the value of the component is saved into the NodeSettings object. |
Methods inherited from class org.knime.core.node.defaultnodesettings.DialogComponent |
---|
clearError, getComponentPanel, getLastTableSpec, getLastTableSpecs, getModel, loadSettingsFrom, saveSettingsTo, setEnabled, showError |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DialogComponentNumber(SettingsModelNumber numberModel, String label, Number stepSize)
numberModel
- the SettingsModel determining the number type (double
or int)label
- label for dialog in front of the spinnerstepSize
- step size for the spinnerpublic DialogComponentNumber(SettingsModelNumber numberModel, String label, Number stepSize, FlowVariableModel fvm)
FlowVariableModel
.
numberModel
- the SettingsModel determining the number type (double
or int)label
- label for dialog in front of the spinnerstepSize
- step size for the spinnerfvm
- The variable model (for displaying a little icon next to the
component to overwrite the settings with variables). Can be null.public DialogComponentNumber(SettingsModelNumber numberModel, String label, Number stepSize, int compWidth)
numberModel
- the SettingsModel determining the number type (double
or int)label
- label for dialog in front of the spinnerstepSize
- step size for the spinnercompWidth
- the width (number of columns/characters) of the spinnerpublic DialogComponentNumber(SettingsModelNumber numberModel, String label, Number stepSize, int compWidth, FlowVariableModel fvm)
numberModel
- the SettingsModel determining the number type (double
or int)label
- label for dialog in front of the spinnerstepSize
- step size for the spinnercompWidth
- the width (number of columns/characters) of the spinnerfvm
- The variable model (for displaying a little icon next to the
component to overwrite the settings with variables). Can be null.Method Detail |
---|
protected void updateComponent()
DialogComponent.EmptySettingsModel
and set/display it in the
component. (Called after loading new values in the model to ensure they
are transfered into the component.) Implementations should set the new
value(s) in the components, should clear any possible error indications,
and should also take over the enable state.
updateComponent
in class DialogComponent
protected void validateSettingsBeforeSave() throws InvalidSettingsException
validateSettingsBeforeSave
in class DialogComponent
InvalidSettingsException
- if the entered values are invalidprotected void checkConfigurabilityBeforeLoad(PortObjectSpec[] specs) throws NotConfigurableException
checkConfigurabilityBeforeLoad
in class DialogComponent
specs
- the specs from the input ports.
NotConfigurableException
- if the component can't be used due to
inappropriate table specs. (Prevents the dialog from being
opened.)protected void setEnabledComponents(boolean enabled)
DialogComponent.setEnabled(boolean)
method. Derived classes should disable all the contained components in
here.
setEnabledComponents
in class DialogComponent
enabled
- the new status of the componentDialogComponent.setEnabled(boolean)
public void setToolTipText(String text)
setToolTipText
in class DialogComponent
text
- the tool tip text to set.JComponent.setToolTipText(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |