Package jaxx.runtime.swing.editor.bean
Class BeanFilterableComboBoxHandler<O>
java.lang.Object
jaxx.runtime.swing.editor.bean.BeanFilterableComboBoxHandler<O>
- Type Parameters:
O- le type des objet contenus dans le modèle du composant.
- All Implemented Interfaces:
java.beans.PropertyChangeListener,java.util.EventListener
public class BeanFilterableComboBoxHandler<O>
extends java.lang.Object
implements java.beans.PropertyChangeListener
Le handler d'un
BeanFilterableComboBox.
Note: ce handler n'est pas stateless et n'est donc pas partageable entre
plusieurs ui.- Since:
- 2.5.12
- Author:
- Kevin Morin - morin@codelutin.com
- See Also:
BeanFilterableComboBox
-
Field Summary
Fields Modifier and Type Field Description protected org.nuiton.decorator.MultiJXPathDecorator<O>decoratorthe decorator of dataprotected java.awt.event.FocusListenerEDITOR_TEXT_COMP0NENT_FOCUSLISTENERprotected javax.swing.event.DocumentListenerEDITOR_TEXT_COMPONENT_DOCUMENTLISTENERprotected booleaninitstatic org.apache.commons.logging.Loglogprotected java.lang.reflect.Methodmutatorthe mutator method on the property of boxed bean in the uiprotected BeanFilterableComboBox<O>uiui if the handler -
Constructor Summary
Constructors Constructor Description BeanFilterableComboBoxHandler(BeanFilterableComboBox<O> ui) -
Method Summary
Modifier and Type Method Description voidaddItem(O item)Add the given item into the comboBox.voidaddItems(java.lang.Iterable<O> items)Add the given items into the comboBox.protected voidfireEmpty(boolean wasEmpty)voidfocusCombo()Focus combo only if autoFocus ui property is on.java.lang.Class<O>getBeanType()org.nuiton.decorator.MultiJXPathDecorator<O>getDecorator()protected java.lang.reflect.MethodgetMutator()voidinit(org.nuiton.decorator.JXPathDecorator<O> decorator, java.util.List<O> data)Initialise le handler de l'uibooleanisEmpty()voidpropertyChange(java.beans.PropertyChangeEvent evt)voidremoveItem(O item)Remove the given item from the comboBox model.voidremoveItems(java.lang.Iterable<O> items)Remove the given items from the comboBox model.voidreset()Reset the combo-box; says remove any selected item and filter text.protected voidsetFilterable(java.lang.Boolean oldValue, java.lang.Boolean newValue)Modifie l'état filterable de l'ui.protected voidsetIndex(java.lang.Integer oldValue, java.lang.Integer newValue)Modifie l'index du décorateurprotected voidsetSelectedItem(O oldValue, O newValue)Modifie la valeur sélectionnée dans la liste déroulante.protected voidsetSortOrder(java.lang.Boolean oldValue, java.lang.Boolean newValue)Modifie l'index du décorateurvoidsortData()Sort data of the model.voidtogglePopup()Toggle the popup visible state.protected voidunselectItem()protected voidupdateUI(int index, boolean reversesort)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
log
public static final org.apache.commons.logging.Log log -
ui
ui if the handler -
mutator
protected java.lang.reflect.Method mutatorthe mutator method on the property of boxed bean in the ui -
decorator
the decorator of data -
init
protected boolean init -
EDITOR_TEXT_COMP0NENT_FOCUSLISTENER
protected final java.awt.event.FocusListener EDITOR_TEXT_COMP0NENT_FOCUSLISTENER -
EDITOR_TEXT_COMPONENT_DOCUMENTLISTENER
protected final javax.swing.event.DocumentListener EDITOR_TEXT_COMPONENT_DOCUMENTLISTENER
-
-
Constructor Details
-
BeanFilterableComboBoxHandler
-
-
Method Details
-
init
Initialise le handler de l'ui- Parameters:
decorator- le decorateur a utiliserdata- la liste des données a gérer
-
togglePopup
public void togglePopup()Toggle the popup visible state. -
isEmpty
public boolean isEmpty()- Returns:
trueif there is no data in comboBox,falseotherwise.
-
addItems
Add the given items into the comboBox. Note: The item will be inserted at his correct following the selected ordering.- Parameters:
items- items to add in comboBox.- Since:
- 2.5.28
-
removeItems
Remove the given items from the comboBox model. Note: If this item was selected, then selection will be cleared.- Parameters:
items- items to remove from the comboBox model- Since:
- 2.5.28
-
addItem
Add the given item into the comboBox. Note: The item will be inserted at his correct following the selected ordering.- Parameters:
item- item to add in comboBox.- Since:
- 2.5.9
-
removeItem
Remove the given item from the comboBox model. Note: If this item was selected, then selection will be cleared.- Parameters:
item- the item to remove from the comboBox model- Since:
- 2.5.9
-
sortData
public void sortData()Sort data of the model. -
reset
public void reset()Reset the combo-box; says remove any selected item and filter text. -
focusCombo
public void focusCombo()Focus combo only if autoFocus ui property is on.- Since:
- 2.8.5
-
setFilterable
protected void setFilterable(java.lang.Boolean oldValue, java.lang.Boolean newValue)Modifie l'état filterable de l'ui.- Parameters:
oldValue- l'ancienne valeurnewValue- la nouvelle valeur
-
setIndex
protected void setIndex(java.lang.Integer oldValue, java.lang.Integer newValue)Modifie l'index du décorateur- Parameters:
oldValue- l'ancienne valeurnewValue- la nouvelle valeur
-
setSortOrder
protected void setSortOrder(java.lang.Boolean oldValue, java.lang.Boolean newValue)Modifie l'index du décorateur- Parameters:
oldValue- l'ancienne valeurnewValue- la nouvelle valeur
-
updateUI
protected void updateUI(int index, boolean reversesort) -
unselectItem
protected void unselectItem() -
setSelectedItem
Modifie la valeur sélectionnée dans la liste déroulante.- Parameters:
oldValue- l'ancienne valeurnewValue- la nouvelle valeur
-
getDecorator
-
getBeanType
- Returns:
- get the type of objects contained in the comboBox model.
-
getMutator
protected java.lang.reflect.Method getMutator()- Returns:
- le mutateur a utiliser pour modifier le bean associé.
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
fireEmpty
protected void fireEmpty(boolean wasEmpty)
-