|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.knime.core.node.util.ColumnSelectionPanel
public class ColumnSelectionPanel
Class implements a panel to choose a column of a certain type retrieved from
the DataTableSpec
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ColumnSelectionPanel(Border border,
Class<? extends DataValue>... filterValueClasses)
Creates new Panel that will filter columns for particular value classes. |
|
ColumnSelectionPanel(Border border,
ColumnFilter columnFilter)
Creates new Panel that will filter columns using the given ColumnFilter . |
|
ColumnSelectionPanel(Border border,
ColumnFilter columnFilter,
boolean addNoneCol)
Creates new Panel that will filter columns using the given ColumnFilter . |
|
ColumnSelectionPanel(Border border,
ColumnFilter columnFilter,
boolean addNoneCol,
boolean addRowID)
Creates new Panel that will filter columns using the given ColumnFilter . |
|
ColumnSelectionPanel(Class<? extends DataValue>... filterValueClasses)
Creates new Panel that will filter columns for particular value classes. |
|
ColumnSelectionPanel(JLabel label,
Class<? extends DataValue>... filterValueClasses)
Creates a column selection panel with a label instead of a border which preserves the minimum size to either the label width or the combo box width. |
|
ColumnSelectionPanel(JLabel label,
ColumnFilter columnFilter)
Creates a column selection panel with a label instead of a border which preserves the minimum size to either the label width or the combo box width. |
|
ColumnSelectionPanel(String borderTitle)
Creates a new column selection panel with the given border title; all column are included in the combox box. |
|
ColumnSelectionPanel(String borderTitle,
Class<? extends DataValue>... filterValueClasses)
Creates new Panel that will filter columns for particular value classes. |
Method Summary | |
---|---|
void |
addActionListener(ActionListener l)
Delegate method to the underlying combo box. |
void |
addItemListener(ItemListener aListener)
Adds an item listener to the underlying combo box. |
void |
fixSelectablesTo(String... colName)
Attempts to set the argument as selected column and disables the combo box if there is only one available. |
int |
getNrItemsInList()
|
String |
getSelectedColumn()
Gets the selected column. |
DataColumnSpec |
getSelectedColumnAsSpec()
Gets the selected column as DataColumnSpec. |
int |
getSelectedIndex()
|
boolean |
isRequired()
Indicates whether in the current configuration at least one compatible type is required or not. |
void |
removeActionListener(ActionListener l)
Delegate method to the underlying combo box. |
void |
removeItemListener(ItemListener aListener)
Removes an item listener to the underlying combo box. |
boolean |
rowIDSelected()
|
void |
setEnabled(boolean enabled)
|
void |
setRequired(boolean isRequired)
True, if a compatible type is required, false otherwise. |
void |
setRowIDSelected()
Selects the RowID item in the item list if a RowID entry exists. |
void |
setSelectedColumn(String columnName)
|
void |
setSelectedIndex(int index)
Selects the given index in the combo box. |
void |
update(DataTableSpec spec,
String selColName)
Updates this filter panel by removing all current items and adding the columns according to the content of the argument spec . |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ColumnSelectionPanel(Class<? extends DataValue>... filterValueClasses)
filterValueClasses
- classes derived from DataValue. The combo box
will allow to select only columns compatible with one of
these classes. All other columns will be ignored.update(DataTableSpec,String)
public ColumnSelectionPanel(String borderTitle)
borderTitle
- The border title.public ColumnSelectionPanel(String borderTitle, Class<? extends DataValue>... filterValueClasses)
filterValueClasses
- a class derived from DataValue. The combo box
will allow to select only columns compatible with one of
these classes. All other columns will be ignored.borderTitle
- The title of the borderupdate(DataTableSpec,String)
public ColumnSelectionPanel(Border border, ColumnFilter columnFilter)
ColumnFilter
. The panel will have a border as given.
If null, no border is set.
columnFilter
- ColumnFilter
. The combo box
will allow to select only columns compatible with the
column filter. All other columns will be ignored.border
- Border for the panel or null to have no border.update(DataTableSpec,String)
public ColumnSelectionPanel(Border border, ColumnFilter columnFilter, boolean addNoneCol)
ColumnFilter
. The panel will have a border as given.
If null, no border is set.
columnFilter
- ColumnFilter
. The combo box
will allow to select only columns compatible with the
column filter. All other columns will be ignored.border
- Border for the panel or null to have no border.addNoneCol
- true, if a none option should be added to the column
listupdate(DataTableSpec,String)
public ColumnSelectionPanel(Border border, ColumnFilter columnFilter, boolean addNoneCol, boolean addRowID)
ColumnFilter
. The panel will have a border as given.
If null, no border is set.
columnFilter
- ColumnFilter
. The combo box
will allow to select only columns compatible with the
column filter. All other columns will be ignored.border
- Border for the panel or null to have no border.addNoneCol
- true, if a none option should be added to the column
listaddRowID
- true, if a RowID option should be added to the column
listupdate(DataTableSpec,String)
public ColumnSelectionPanel(Border border, Class<? extends DataValue>... filterValueClasses)
filterValueClasses
- classes derived from DataValue. The combo box
will allow to select only columns compatible with one of
theses classes. All other columns will be ignored.border
- Border for the panel or null to have no border.update(DataTableSpec,String)
public ColumnSelectionPanel(JLabel label, ColumnFilter columnFilter)
label
- label of the combo box.columnFilter
- ColumnFilter
. The combo box
will allow to select only columns compatible with the
column filter. All other columns will be ignored.public ColumnSelectionPanel(JLabel label, Class<? extends DataValue>... filterValueClasses)
label
- label of the combo box.filterValueClasses
- allowed classes.Method Detail |
---|
public final void setRequired(boolean isRequired)
isRequired
- True, if at least one compatible type is required,
false otherwise.public final boolean isRequired()
public final void update(DataTableSpec spec, String selColName) throws NotConfigurableException
spec
. If
a column name is provided and it is not filtered out the corresponding
item in the combo box will be selected.
spec
- To get the column names, types and the current index from.selColName
- The column name to be set as chosen.
NotConfigurableException
- If the spec does not contain at least
one compatible type.public boolean rowIDSelected()
true
if the user has selected the RowIDpublic final DataColumnSpec getSelectedColumnAsSpec()
null
if the user
has selected the no column item from the combo box.
null
if the addNoneCol flag is set to true and
the no column item is selected or the addRowID flag is set to true and
the RowID column item is selected. Check the useRowID column if the
RowID option was selected.public final String getSelectedColumn()
null
if the user
has selected the no column item from the combo box.
null
if the addNoneCol flag is set to true and the no column item is selected
or the addRowID flag is set to true and the RowID column item is
selected. Check the useRowID column if the RowID option was selected.public void fixSelectablesTo(String... colName)
colName
- Name of the fixed x columns.public final int getSelectedIndex()
public int getNrItemsInList()
public final void setSelectedIndex(int index)
index
- Select this item.public final void setSelectedColumn(String columnName)
columnName
- - the name of the column to select.public final void setRowIDSelected()
public void setEnabled(boolean enabled)
setEnabled
in class JComponent
enabled
- true if enabled otherwise false.Component.setEnabled(boolean)
public void addItemListener(ItemListener aListener)
aListener
- The listener to be registeredJComboBox.addItemListener(ItemListener)
public void removeItemListener(ItemListener aListener)
aListener
- The listener to be unregisteredJComboBox.removeItemListener(ItemListener)
public void addActionListener(ActionListener l)
l
- The action listener being added from the combo box.JComboBox.addActionListener(ActionListener)
public void removeActionListener(ActionListener l)
l
- The action listener being removed from the combo box.JComboBox.removeActionListener(ActionListener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |