public class VariableChoice extends MustComboBox implements ModifiedInformer
javax.swing.JComboBox.AccessibleJComboBox, javax.swing.JComboBox.KeySelectionManager
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
editBeginValue |
programmaticChange
actionCommand, dataModel, 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
Constructor and Description |
---|
VariableChoice(KeyValuePair[] keyValuePairs)
Constructs an new variable choice with the specified content.
|
VariableChoice(KeyValuePair[] keyValuePairs,
boolean noChoicePossible)
Constructs an new variable choice with the specified content and offer control.
|
VariableChoice(KeyValuePair[] keyValuePairs,
java.lang.String nameForNoChoice)
Constructs an new variable choice with the specified content and offer control.
|
VariableChoice(java.lang.String[][] content)
Constructs an new variable choice with the specified content.
|
VariableChoice(java.lang.String[][] content,
boolean noChoicePossible)
Constructs an new variable choice with the specified content and offer control.
|
VariableChoice(java.lang.String[][] content,
boolean noChoicePossible,
boolean suppressKey)
Constructs an new variable choice with the specified content and offer control.
|
VariableChoice(java.lang.String[][] content,
boolean noChoicePossible,
java.lang.String nameForNoChoice)
Constructs an new variable choice with the specified content and offer control.
|
VariableChoice(java.lang.String[][] content,
boolean noChoicePossible,
java.lang.String nameForNoChoice,
boolean suppressKey)
Constructs an new variable choice with the specified content and offer control.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getSelectedItemKey()
Returns the key of the selected item.
|
int |
getSelectedItemKeyAsInt()
Returns the key of the selected item as integer value.
|
protected java.lang.String |
getTranslation(java.lang.String resourceKey)
Returns a text in the corresponding language according to the locale
specific resource bundle of the package.
|
boolean |
isModified()
Indicates whether the component's value differs from its initial value.
|
boolean |
isSpecialChoice()
Returns true if the selected item is not the placeholder for "none" or "any".
|
void |
setNoSpecialChoice()
Selects the item to be used to indicate "no special choice"
|
void |
setSelectedItemKey(java.lang.String key)
Selects the item by its key.
|
void |
setSelectedItemKeyAsBeginValue(java.lang.String key)
Selects an item of the combo box by identifier.
|
getBackground, getHelpTarget, getHelpTopic, getIndexIfUnique, resetEditBeginValue, setEditable, setEditableForUserTyping, setEditableForUserTyping, setEditableForUserTyping, setHelpContext, setHelpContext, setSelectedIndex, setSelectedIndexAsEditBeginValue, setSelectedItem, setSelectedItemAsEditBeginValue
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, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, 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, 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 VariableChoice(java.lang.String[][] content)
content
- the statically filled content, each line is a pair of key and value.public VariableChoice(java.lang.String[][] content, boolean noChoicePossible)
content
- the statically filled content, each line is a pair of key and valuenoChoicePossible
- if true, an item is offered which represents the "no choice"public VariableChoice(java.lang.String[][] content, boolean noChoicePossible, boolean suppressKey)
content
- the statically filled content, each line is a pair of key and valuenoChoicePossible
- if true, an item is offered which represents the "no choice"suppressKey
- whether or not keys should be suppressed in ComboBoxpublic VariableChoice(java.lang.String[][] content, boolean noChoicePossible, java.lang.String nameForNoChoice)
content
- the statically filled content, each line is a pair of key and valuenoChoicePossible
- if true, an item is offered which represents the "no choice"nameForNoChoice
- the expression to be used to indicate "no choice"public VariableChoice(java.lang.String[][] content, boolean noChoicePossible, java.lang.String nameForNoChoice, boolean suppressKey)
content
- the statically filled content, each line is a pair of key and valuenoChoicePossible
- if true, an item is offered which represents the "no choice"nameForNoChoice
- the expression to be used to indicate "no choice"suppressKey
- whether or not keys should be suppressed in ComboBoxpublic VariableChoice(KeyValuePair[] keyValuePairs)
keyValuePairs
- the content as an array of key value pairspublic VariableChoice(KeyValuePair[] keyValuePairs, java.lang.String nameForNoChoice)
keyValuePairs
- the content as an array of key value pairsnameForNoChoice
- the expression to be used to indicate "no choice"public VariableChoice(KeyValuePair[] keyValuePairs, boolean noChoicePossible)
keyValuePairs
- the content as an array of key value pairsnoChoicePossible
- if true, an item is offered which represents the "no choice"protected java.lang.String getTranslation(java.lang.String resourceKey)
resourceKey
- the key of the resource to retrievepublic int getSelectedItemKeyAsInt()
public java.lang.String getSelectedItemKey()
public void setSelectedItemKeyAsBeginValue(java.lang.String key)
selectIdentifier
- the identifier (primary key) of the item to selectpublic void setSelectedItemKey(java.lang.String key)
key
- the key of the item to selectpublic boolean isSpecialChoice()
public void setNoSpecialChoice()
public boolean isModified()
ModifiedInformer
isModified
in interface ModifiedInformer
isModified
in class MustComboBox
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de