public class ColumnSelectionComboxBox extends JComboBox
DataTableSpec
.
Note, consider to use ColumnSelectionPanel
to have more options like ability to select
row ID column or "<none>", show error marker for non-existing columns etc.
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManager
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
String |
getSelectedColumn()
Gets the selected column.
|
void |
setAllowedTypes(Class<? extends DataValue>... allowedTypes) |
void |
setColumnFilter(ColumnFilter filter)
Sets the internal used
ColumnFilter to the given one and calls
the update(DataTableSpec, String, boolean, ColumnFilter)
method to update the column panel. |
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 . |
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, processKeyBinding, 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
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
public ColumnSelectionComboxBox(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 ColumnSelectionComboxBox(String borderTitle)
borderTitle
- The border title.public ColumnSelectionComboxBox(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 ColumnSelectionComboxBox(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 ColumnSelectionComboxBox(Border border, ColumnFilter columnFilter)
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.update(DataTableSpec, String)
public final void update(DataTableSpec sp, 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.sp
- 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 any column
compatible to the target value class(es) as given in
constructor.public final void update(DataTableSpec spec, String selColName, boolean suppressEvents) 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.suppressEvents
- true
if events caused by adding
items to the combo box should be suppressed,
false
otherwise.NotConfigurableException
- If the spec does not contain any column
compatible to the target value class(es) as given in
constructor.public final void update(DataTableSpec spec, String selColName, boolean suppressEvents, ColumnFilter filter) 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.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
constructorNotConfigurableException
- If the spec does not contain any column
compatible to the target value class(es) as given in
constructor.public void setAllowedTypes(Class<? extends DataValue>... allowedTypes) throws NotConfigurableException
allowedTypes
- filter for the columns all column not compatible with
any of the allowed types are not displayed.NotConfigurableException
- If the spec does not contain any column
compatible to the given filter.public void setColumnFilter(ColumnFilter filter) throws NotConfigurableException
ColumnFilter
to the given one and calls
the update(DataTableSpec, String, boolean, ColumnFilter)
method to update the column panel.filter
- the new ColumnFilter
to useNotConfigurableException
- If the spec does not contain any column
compatible to the given filter.public final String getSelectedColumn()
public final void setSelectedColumn(String name)
null
or the name is invalid.name
- The name of the column.
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.