public class HalfDataComboBox extends MustComboBox implements DataChangeListener
Modifier and Type | Class and Description |
---|---|
static class |
HalfDataComboBox.Variant
The variant builder wrapper to simplify construction detail definition.
|
Modifier and Type | Field and Description |
---|---|
protected Callback |
callbackIfTableChanged |
protected boolean |
containsNoSpecification |
protected DataObject |
contentDataObject |
protected boolean |
contentIsToRenew |
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 |
index, items, value
context, editable, enabled, lastEditability, lastVisibility, name, nonstandardPanel, nonstandardPosition, sessionData, toolTipText, visible
Constructor and Description |
---|
HalfDataComboBox(SessionData sessionData,
DataObject sourceDataObject,
java.lang.String visibleColumnName)
Constructs a new combo box.
|
HalfDataComboBox(SessionData sessionData,
DataObject sourceDataObject,
java.lang.String visibleColumnName,
boolean fillWhileConstruction)
Constructs a new combo box.
|
HalfDataComboBox(SessionData sessionData,
DataObject sourceDataObject,
java.lang.String visibleColumnName,
HalfDataComboBox.Variant variant)
Constructs a new combo box.
|
HalfDataComboBox(SessionData sessionData,
DataObject sourceDataObject,
java.lang.String visibleColumnName,
java.lang.String orderByColumnName,
boolean fillWhileConstruction)
Constructs a new combo box.
|
HalfDataComboBox(SessionData sessionData,
DataObject sourceDataObject,
java.lang.String visibleColumnName,
java.lang.String orderByColumnName,
java.lang.String nameForNoChoice)
Constructs a new combo box.
|
HalfDataComboBox(SessionData sessionData,
DataObject sourceDataObject,
java.lang.String visibleColumnName,
java.lang.String orderByColumnName,
java.lang.String nameForNoChoice,
int width)
Constructs a new combo box.
|
HalfDataComboBox(SessionData sessionData,
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) |
void |
destroy()
Don't wait until garbage collector removed weak reference.
|
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 |
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".
|
void |
reloadContentIfIsToRenew(ToAppletWriter out)
Reloads content if it is to renew, which is e.g. the case if an item has been added to the source data object.
|
void |
removeAllItems() |
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 |
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.
|
void |
setValues(ToAppletWriter out) |
addItem, addItemListener, buildRemoteView, fetchValuesFromRequest, getItemAt, getItemCount, getSelectedItem, perform, requestFocusInWindow, resetEditBeginValue, setSelectedIndex, setSelectedIndexAsEditBeginValue, setSelectedItem, updateRemoteView
beginAction, endAction, getContext, getName, isEnabled, isVisible, register, resetLastStatus, setEditable, setEnabled, setToolTipText, setVisible
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
protected boolean contentIsToRenew
protected Callback callbackIfTableChanged
public HalfDataComboBox(SessionData sessionData, DataObject sourceDataObject, java.lang.String visibleColumnName, HalfDataComboBox.Variant variant)
sourceDataObject
- the source data objectvariant
- the wrapper containing variant definitions.public HalfDataComboBox(SessionData sessionData, DataObject sourceDataObject, java.lang.String visibleColumnName)
sessionData
- the session datasourceDataObject
- the source data objectvisibleColumnName
- the name of the column to be displayedpublic HalfDataComboBox(SessionData sessionData, DataObject sourceDataObject, java.lang.String visibleColumnName, boolean fillWhileConstruction)
sessionData
- the session datasourceDataObject
- the source data objectvisibleColumnName
- the name of the column to be displayedfillWhileConstruction
- whether or not this combo box should be filled while construction processpublic HalfDataComboBox(SessionData sessionData, DataObject sourceDataObject, java.lang.String visibleColumnName, java.lang.String orderByColumnName, boolean fillWhileConstruction)
sessionData
- the session datasourceDataObject
- the source data objectvisibleColumnName
- the name of the column to be displayedorderByColumnName
- the sorting column name of the content data objectfillWhileConstruction
- whether or not this combo box should be filled while construction processpublic HalfDataComboBox(SessionData sessionData, DataObject sourceDataObject, java.lang.String visibleColumnName, java.lang.String orderByColumnName, java.lang.String nameForNoChoice)
sessionData
- the session datasourceDataObject
- 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(SessionData sessionData, DataObject sourceDataObject, java.lang.String visibleColumnName, java.lang.String orderByColumnName, java.lang.String nameForNoChoice, int width)
sessionData
- the session datasourceDataObject
- 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(SessionData sessionData, DataObject sourceDataObject, java.lang.String visibleColumnName, java.lang.String orderByColumnName, java.lang.String nameForNoChoice, int width, boolean fillWhileConstruction, boolean containsNoSpecification)
sessionData
- the session datasourceDataObject
- 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
- TODOpublic void setSpecialChoices(java.lang.String[] specialChoices)
specialChoices
- the specialChoices to set.public 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)
getTranslation
in class RemoteElement
resourceKey
- the key of the resource to retrievepublic void removeAllItems()
removeAllItems
in class MustComboBox
protected void fill()
public void fill(java.lang.String whereCondition)
whereCondition
- the where condition to shorten the contentpublic void reloadContentIfIsToRenew(ToAppletWriter out)
out
- the response writerpublic void setValues(ToAppletWriter out)
setValues
in interface RemoteContent
setValues
in class MustComboBox
public void selectAll()
selectAll
in interface RemoteContent
selectAll
in class MustComboBox
public void addItem(java.lang.String item, Identifier identifier)
item
- the item to addidentifyValueInt
- the identifier of the item to addpublic 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 boolean isModified()
isModified
in class MustComboBox
public boolean isSpecialChoice()
public void setNoSpecialChoice()
public void dataChangePerformed(DataChangedEvent e)
dataChangePerformed
in interface DataChangeListener
public void destroy()
Remotable
destroy
in interface Remotable
destroy
in class MustComboBox
public void free()
free
in interface Exemptible
free
in interface ExemptibleManager
free
in class RemoteElement
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