org.knime.core.node.util
Class ColumnSelectionComboxBox

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JComboBox
                  extended by org.knime.core.node.util.ColumnSelectionComboxBox
All Implemented Interfaces:
ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener

public class ColumnSelectionComboxBox
extends JComboBox

Class extends a JComboxBox to choose a column of a certain type retrieved from the DataTableSpec.

Author:
Bernd Wiswedel, University of Konstanz, Thorsten Meinl, University of Konstanz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComboBox
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManager
 
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.JComboBox
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder
 
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
ColumnSelectionComboxBox(Border border, Class<? extends DataValue>... filterValueClasses)
          Creates new Panel that will filter columns for particular value classes.
ColumnSelectionComboxBox(Border border, ColumnFilter columnFilter)
          Creates new Panel that will filter columns for particular value classes.
ColumnSelectionComboxBox(Class<? extends DataValue>... filterValueClasses)
          Creates new Panel that will filter columns for particular value classes.
ColumnSelectionComboxBox(String borderTitle)
          Creates a new column selection panel with the given border title; all column are included in the combox box.
ColumnSelectionComboxBox(String borderTitle, Class<? extends DataValue>... filterValueClasses)
          Creates new Panel that will filter columns for particular value classes.
 
Method Summary
 String getSelectedColumn()
          Gets the selected column.
 void setSelectedColumn(String name)
          Selects the column with the name provided in the argument.
 void update(DataTableSpec sp, String selColName)
          Updates this filter panel by removing all current items and adding the columns according to the content of the argument spec.
 void update(DataTableSpec spec, String selColName, boolean suppressEvents)
          Updates this filter panel by removing all current items and adding the columns according to the content of the argument spec.
 void update(DataTableSpec spec, String selColName, boolean suppressEvents, ColumnFilter filter)
          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.JComboBox
actionPerformed, actionPropertyChanged, addActionListener, addItem, addItemListener, addPopupMenuListener, configureEditor, configurePropertiesFromAction, contentsChanged, createActionPropertyChangeListener, createDefaultKeySelectionManager, fireActionEvent, fireItemStateChanged, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemAt, getItemCount, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedIndex, getSelectedItem, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, installAncestorListener, intervalAdded, intervalRemoved, isEditable, isLightWeightPopupEnabled, isPopupVisible, paramString, processKeyEvent, removeActionListener, removeAllItems, removeItem, removeItemAt, removeItemListener, removePopupMenuListener, selectedItemChanged, selectWithKeyChar, setAction, setActionCommand, setEditable, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, setSelectedIndex, setSelectedItem, setUI, showPopup, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColumnSelectionComboxBox

public ColumnSelectionComboxBox(Class<? extends DataValue>... filterValueClasses)
Creates new Panel that will filter columns for particular value classes. The panel will have a titled border with name "Column Selection".

Parameters:
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.
See Also:
update(DataTableSpec, String)

ColumnSelectionComboxBox

public ColumnSelectionComboxBox(String borderTitle)
Creates a new column selection panel with the given border title; all column are included in the combox box.

Parameters:
borderTitle - The border title.

ColumnSelectionComboxBox

public ColumnSelectionComboxBox(String borderTitle,
                                Class<? extends DataValue>... filterValueClasses)
Creates new Panel that will filter columns for particular value classes. The panel will have a title border with a given title.

Parameters:
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 border
See Also:
update(DataTableSpec, String)

ColumnSelectionComboxBox

public ColumnSelectionComboxBox(Border border,
                                Class<? extends DataValue>... filterValueClasses)
Creates new Panel that will filter columns for particular value classes. The panel will have a border as given. If null, no border is set.

Parameters:
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.
See Also:
update(DataTableSpec, String)

ColumnSelectionComboxBox

public ColumnSelectionComboxBox(Border border,
                                ColumnFilter columnFilter)
Creates new Panel that will filter columns for particular value classes. The panel will have a border as given. If null, no border is set.

Parameters:
columnFilter - The combo box will allow to select only columns which are not filtered by this ColumnFilter
border - Border for the panel or null to have no border.
See Also:
update(DataTableSpec, String)
Method Detail

update

public final void update(DataTableSpec sp,
                         String selColName)
                  throws NotConfigurableException
Updates this filter panel by removing all current items and adding the columns according to the content of the argument spec. If a column name is provided and it is not filtered out the corresponding item in the combo box will be selected.

Parameters:
sp - To get the column names, types and the current index from.
selColName - The column name to be set as chosen.
Throws:
NotConfigurableException - If the spec does not contain any column compatible to the target value class(es) as given in constructor.

update

public final void update(DataTableSpec spec,
                         String selColName,
                         boolean suppressEvents)
                  throws NotConfigurableException
Updates this filter panel by removing all current items and adding the columns according to the content of the argument spec. If a column name is provided and it is not filtered out the corresponding item in the combo box will be selected.

Parameters:
spec - To get the column names, types and the current index from.
selColName - The column name to be set as chosen.
suppressEvents - true if events caused by adding items to the combo box should be suppressed, false otherwise.
Throws:
NotConfigurableException - If the spec does not contain any column compatible to the target value class(es) as given in constructor.

update

public final void update(DataTableSpec spec,
                         String selColName,
                         boolean suppressEvents,
                         ColumnFilter filter)
                  throws NotConfigurableException
Updates this filter panel by removing all current items and adding the columns according to the content of the argument spec. If a column name is provided and it is not filtered out the corresponding item in the combo box will be selected.

Parameters:
spec - To get the column names, types and the current index from.
selColName - The column name to be set as chosen.
suppressEvents - true if events caused by adding items to the combo box should be suppressed, false otherwise.
filter - a filter that filters the columns that should be shown in the combo box; this overrides the value classes given in the constructor
Throws:
NotConfigurableException - If the spec does not contain any column compatible to the target value class(es) as given in constructor.

getSelectedColumn

public final String getSelectedColumn()
Gets the selected column.

Returns:
The cell that is currently being selected.

setSelectedColumn

public final void setSelectedColumn(String name)
Selects the column with the name provided in the argument. Does nothing if the argument is null or the name is invalid.

Parameters:
name - The name of the column.


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
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.