public class HalfDataComboBox extends MustComboBox implements DataChangeListener, ModifiedInformer
Modifier and Type | Class and Description |
---|---|
static class |
HalfDataComboBox.Variant
The variant builder wrapper to simplify construction detail definition.
|
javax.swing.JComboBox.AccessibleJComboBox, javax.swing.JComboBox.KeySelectionManager
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected boolean |
containsNoSpecification |
protected DataObject |
contentDataObject |
protected Identifier |
editBeginValue |
protected java.lang.String |
filterCondition |
protected IdentifierTextTable |
identifierTable |
protected java.lang.String |
inactiveColumnName |
protected java.lang.String |
nameForNoChoice |
protected java.lang.String[] |
orderByColumnNames |
static java.lang.String |
SPECIAL_NAME_FOR_NO_CHOICE_WHICH_MEANS_NOT_APPLICABLE |
protected java.lang.String[] |
specialChoices |
protected java.lang.String[] |
visibleColumnNames |
protected java.util.Hashtable<Identifier,java.lang.String> |
weakItems |
static int |
WIDTH_FITTING_TO_CONTENT |
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 |
---|
HalfDataComboBox(DataObject sourceDataObject,
java.lang.String visibleColumnName)
Constructs a new combo box.
|
HalfDataComboBox(DataObject sourceDataObject,
java.lang.String visibleColumnName,
HalfDataComboBox.Variant variant)
Constructs a new combo box.
|
HalfDataComboBox(DataObject sourceDataObject,
java.lang.String visibleColumnName,
java.lang.String orderByColumnName,
java.lang.String nameForNoChoice)
Constructs a new combo box.
|
HalfDataComboBox(DataObject sourceDataObject,
java.lang.String visibleColumnName,
java.lang.String orderByColumnName,
java.lang.String nameForNoChoice,
int width)
Constructs a new combo box.
|
HalfDataComboBox(DataObject sourceDataObject,
java.lang.String visibleColumnName,
java.lang.String orderByColumnName,
java.lang.String nameForNoChoice,
int width,
boolean fillWhileConstruction,
boolean containsNoSpecification)
Constructs a new combo box.
|
Modifier and Type | Method and Description |
---|---|
void |
addItem(java.lang.String item,
Identifier identifier)
Adds an item to the combo box.
|
void |
dataChangePerformed(DataChangedEvent e) |
protected void |
fill()
Fills or refills the content of the data combo box by reading the source
data object.
|
void |
fill(java.lang.String whereCondition)
Fills or refills the content of the data combo box by reading the source
data object.
|
protected void |
finalize() |
void |
free()
Frees external resources.
|
Identifier |
getEditBeginValue()
Returns the value of the input field before user was able to edit it.
|
Identifier |
getSelectedIdentifier()
Returns the identifier of the selected entry.
|
java.lang.String |
getSelectedItemWithoutNameForNoChoice()
Returns the selected item as String after replacing '
|
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 |
isFilled()
Returns true if the component has a value.
|
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".
|
protected void |
removeItem(Identifier identifier) |
void |
selectAll()
Selects all input of the component, if it is supported - e.g. in JTextField.
|
void |
setFilterCondition(java.lang.String filterCondition)
Sets the filter condition, e.g. not to present entries declared as inactive
|
void |
setFilterCondition(java.lang.String columnName,
boolean booleanValue)
Sets a boolean filter condition, e.g. not to present entries declared as inactive
- uses the appropriate SQL value to build the comparison string
|
void |
setHelpContext(java.lang.String helpTopic)
Sets the component's context help.
|
void |
setInactiveColumnName(java.lang.String inactiveColumnName)
Sets the column name to determine inactive items.
|
void |
setNoSpecialChoice()
Selects the item to be used to indicate "no special choice"
|
boolean |
setSelectedIdentifier(Identifier selectedIdentifier)
Selects an item by the identifier.
|
void |
setSelectedIdentifierAsBeginValue(Identifier identifier)
Selects an item of the combo box by identifier.
|
void |
setSpecialChoices(java.lang.String[] specialChoices)
Sets special choices to be displayed after 'name for no choice' and values from source data object.
|
getBackground, getHelpTarget, getHelpTopic, getIndexIfUnique, resetEditBeginValue, setEditable, setEditableForUserTyping, setEditableForUserTyping, setEditableForUserTyping, 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 static final java.lang.String SPECIAL_NAME_FOR_NO_CHOICE_WHICH_MEANS_NOT_APPLICABLE
public static final int WIDTH_FITTING_TO_CONTENT
protected DataObject contentDataObject
protected java.lang.String[] visibleColumnNames
protected java.lang.String[] orderByColumnNames
protected java.lang.String nameForNoChoice
protected java.lang.String[] specialChoices
protected boolean containsNoSpecification
protected java.lang.String filterCondition
protected java.lang.String inactiveColumnName
protected IdentifierTextTable identifierTable
protected Identifier editBeginValue
protected java.util.Hashtable<Identifier,java.lang.String> weakItems
public HalfDataComboBox(DataObject sourceDataObject, java.lang.String visibleColumnName, HalfDataComboBox.Variant variant)
sourceDataObject
- the source data objectvariant
- the wrapper containing variant definitions.public HalfDataComboBox(DataObject sourceDataObject, java.lang.String visibleColumnName)
sourceDataObject
- the source data objectvisibleColumnName
- the name of the column to be displayedpublic HalfDataComboBox(DataObject sourceDataObject, java.lang.String visibleColumnName, java.lang.String orderByColumnName, java.lang.String nameForNoChoice)
sourceDataObject
- the source data objectvisibleColumnName
- the name of the column to be displayedorderByColumnName
- the sorting column name of the content data objectnameForNoChoice
- the expression to be used to indicate "no choice"public HalfDataComboBox(DataObject sourceDataObject, java.lang.String visibleColumnName, java.lang.String orderByColumnName, java.lang.String nameForNoChoice, int width)
sourceDataObject
- the source data objectvisibleColumnName
- the name of the column to be displayedorderByColumnName
- the sorting column name of the content data objectnameForNoChoice
- the expression to be used to indicate "no choice"width
- the width of the component - if 0 it's automatically sizedpublic HalfDataComboBox(DataObject sourceDataObject, java.lang.String visibleColumnName, java.lang.String orderByColumnName, java.lang.String nameForNoChoice, int width, boolean fillWhileConstruction, boolean containsNoSpecification)
sourceDataObject
- the source data objectvisibleColumnName
- the name of the column to be displayedorderByColumnName
- the sorting column name of the content data objectnameForNoChoice
- the expression to be used to indicate "no choice"width
- the width of the component - if 0 it's automatically sizedfillWhileConstruction
- whether or not this combo box should be filled while construction processcontainsNoSpecification
- whether or not this combo box should include an item to represent 'nothing'public void setSpecialChoices(java.lang.String[] specialChoices)
specialChoices
- the specialChoices to set.public void setHelpContext(java.lang.String helpTopic)
setHelpContext
in class MustComboBox
helpTopic
- the context help's topicpublic void setFilterCondition(java.lang.String columnName, boolean booleanValue)
columnName
- the column name for the boolean conditionbooleanValue
- the boolean value to selectpublic void setFilterCondition(java.lang.String filterCondition)
filterCondition
- the condition to reduce the contentpublic void setInactiveColumnName(java.lang.String inactiveColumnName)
inactiveColumnName
- the name to determine inactive itemsprotected java.lang.String getTranslation(java.lang.String resourceKey)
resourceKey
- the key of the resource to retrieveprotected void fill()
public void fill(java.lang.String whereCondition)
whereCondition
- the where condition to shorten the contentpublic void selectAll()
public void addItem(java.lang.String item, Identifier identifier)
item
- the item to addidentifyValueInt
- the identifier of the item to addprotected void removeItem(Identifier identifier)
public boolean setSelectedIdentifier(Identifier selectedIdentifier)
selectedIdentifier
- the identifier to select an entrypublic void setSelectedIdentifierAsBeginValue(Identifier identifier)
selectIdentifier
- the identifier (primary key) of the item to selectpublic Identifier getSelectedIdentifier()
public java.lang.String getSelectedItemWithoutNameForNoChoice()
public boolean isFilled()
public Identifier getEditBeginValue()
public boolean isModified()
ModifiedInformer
isModified
in interface ModifiedInformer
isModified
in class MustComboBox
public boolean isSpecialChoice()
public void setNoSpecialChoice()
public void dataChangePerformed(DataChangedEvent e)
dataChangePerformed
in interface DataChangeListener
public void free()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de