public final class DialogComponentStringSelection extends DialogComponent
DialogComponent.EmptySettingsModel
DEFAULT_BG, DEFAULT_FG
Constructor and Description |
---|
DialogComponentStringSelection(SettingsModelString stringModel,
String label,
Collection<String> list)
Constructor that puts label and combobox into panel.
|
DialogComponentStringSelection(SettingsModelString stringModel,
String label,
Collection<String> list,
boolean editable)
Constructor that puts label and combobox into panel.
|
DialogComponentStringSelection(SettingsModelString stringModel,
String label,
Collection<String> list,
boolean editable,
FlowVariableModel fvm)
Constructor that puts label and combobox into panel.
|
DialogComponentStringSelection(SettingsModelString stringModel,
String label,
String... list)
Constructor that puts label and combobox into panel.
|
DialogComponentStringSelection(SettingsModelString stringModel,
String label,
StringIconOption[] list)
Constructor that puts label and combobox into panel.
|
DialogComponentStringSelection(SettingsModelString stringModel,
String label,
StringIconOption[] list,
FlowVariableModel fvm)
Constructor that puts label and combobox into panel.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkConfigurabilityBeforeLoad(PortObjectSpec[] specs)
Will be called before the new values are loaded from the NodeSettings
object.
|
void |
replaceListItems(Collection<String> newItems,
String select)
Replaces the list of selectable strings in the component.
|
void |
replaceListItems(StringIconOption[] newItems,
String select)
Replaces the list of selectable strings in the component.
|
protected void |
setEnabledComponents(boolean enabled)
This method is called by the above (final)
DialogComponent.setEnabled(boolean)
method. |
void |
setSizeComponents(int width,
int height)
Sets the preferred size of the internal component.
|
void |
setToolTipText(String text)
Implement this so it sets the tooltip on your component(s).
|
protected void |
updateComponent()
Read the value from the
SettingsModel 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.
|
clearError, getComponentPanel, getLastTableSpec, getLastTableSpecs, getModel, loadSettingsFrom, saveSettingsTo, setEnabled, showError
public DialogComponentStringSelection(SettingsModelString stringModel, String label, String... list)
stringModel
- the model that stores the value for this component.label
- label for dialog in front of comboboxlist
- list of items for the comboboxpublic DialogComponentStringSelection(SettingsModelString stringModel, String label, Collection<String> list)
stringModel
- the model that stores the value for this component.label
- label for dialog in front of comboboxlist
- list (not empty) of strings (not null) for the comboboxNullPointerException
- if one of the strings in the list is nullIllegalArgumentException
- if the list is empty or null.public DialogComponentStringSelection(SettingsModelString stringModel, String label, Collection<String> list, boolean editable)
stringModel
- the model that stores the value for this component.label
- label for dialog in front of comboboxlist
- list (not empty) of strings (not null) for the comboboxeditable
- true if the user should be able to add a value to the
combo boxNullPointerException
- if one of the strings in the list is nullIllegalArgumentException
- if the list is empty or null.public DialogComponentStringSelection(SettingsModelString stringModel, String label, Collection<String> list, boolean editable, FlowVariableModel fvm)
stringModel
- the model that stores the value for this component.label
- label for dialog in front of comboboxlist
- list (not empty) of strings (not null) for the comboboxeditable
- true if the user should be able to add a value to the
combo boxfvm
- model exposed to choose from available flow variablesNullPointerException
- if one of the strings in the list is nullIllegalArgumentException
- if the list is empty or null.public DialogComponentStringSelection(SettingsModelString stringModel, String label, StringIconOption[] list)
stringModel
- the model that stores the value for this component.label
- label for dialog in front of comboboxlist
- list (not empty) of StringIconOption
s for
the combobox. The text of the selected component is stored in the
SettingsModelString
.NullPointerException
- if one of the strings in the list is nullIllegalArgumentException
- if the list is empty or null.public DialogComponentStringSelection(SettingsModelString stringModel, String label, StringIconOption[] list, FlowVariableModel fvm)
stringModel
- the model that stores the value for this component.label
- label for dialog in front of comboboxlist
- list (not empty) of StringIconOption
s for
the combobox. The text of the selected component is stored in the
SettingsModelString
.fvm
- model exposed to choose from available flow variablesNullPointerException
- if one of the strings in the list is nullIllegalArgumentException
- if the list is empty or null.protected void updateComponent()
SettingsModel
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 setSizeComponents(int width, int height)
width
- The width.height
- The height.public void setToolTipText(String text)
setToolTipText
in class DialogComponent
text
- the tool tip text to set.JComponent.setToolTipText(java.lang.String)
public void replaceListItems(Collection<String> newItems, String select)
select
is specified (not null) and it exists in the
collection it will be selected. If select
is null, the
previous value will stay selected (if it exists in the new list).newItems
- new strings for the combo boxselect
- the item to select after the replace. Can be null, in which
case the previous selection remains - if it exists in the new
list.public void replaceListItems(StringIconOption[] newItems, String select)
select
is specified (not null) and it exists in the
collection it will be selected. If select
is null, the
previous value will stay selected (if it exists in the new list).newItems
- new StringIconOption
s for the combo boxselect
- the item to select after the replace. Can be null, in which
case the previous selection remains - if it exists in the new
list.
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.