Package org.nuiton.jaxx.widgets.select
Class BeanComboBoxHandler<O>
- java.lang.Object
-
- org.nuiton.jaxx.widgets.select.BeanComboBoxHandler<O>
-
- Type Parameters:
O- le type des objet contenus dans le modèle du composant.
- All Implemented Interfaces:
PropertyChangeListener,EventListener,UIHandler<BeanComboBox<O>>
public class BeanComboBoxHandler<O> extends Object implements PropertyChangeListener, UIHandler<BeanComboBox<O>>
Le handler d'unBeanComboBox.Note: ce handler n'est pas stateless et n'est donc pas partageable entre plusieurs ui.
- Author:
- Tony Chemit - dev@tchemit.fr
- See Also:
BeanComboBox
-
-
Field Summary
Fields Modifier and Type Field Description protected org.jdesktop.swingx.autocomplete.ObjectToStringConverterconvertorthe convertor used to auto-completeprotected org.nuiton.decorator.MultiJXPathDecorator<O>decoratorthe decorator of dataprotected booleaninitstatic org.apache.logging.log4j.Loggerlogprotected Methodmutatorthe mutator method on the property of boxed bean in the uiprotected BeanComboBox<O>ui
-
Constructor Summary
Constructors Constructor Description BeanComboBoxHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterInit(BeanComboBox<O> ui)voidbeforeInit(BeanComboBox<O> ui)Class<O>getBeanType()org.nuiton.decorator.MultiJXPathDecorator<O>getDecorator()protected MethodgetMutator()DocumentgetOriginalDocument()Class<?>getTargetClass()Deprecated.since 2.5.9 (use now methodgetBeanType())voidinit(org.nuiton.decorator.JXPathDecorator<O> decorator, List<O> data)Initialise le handler de l'uibooleanisEmpty()voidpropertyChange(PropertyChangeEvent evt)protected voidsetIndex(Integer oldValue, Integer newValue)Modifie l'index du décorateurprotected voidsetSelectedItem(O oldValue, O newValue)Modifie la valeur sélectionnée dans la liste déroulante.voidsortData()Sort data of the model.voidtogglePopup()Toggle the popup visible state.protected voidupdateUI(int index, boolean reversesort)
-
-
-
Field Detail
-
log
public static final org.apache.logging.log4j.Logger log
-
ui
protected BeanComboBox<O> ui
-
mutator
protected Method mutator
the mutator method on the property of boxed bean in the ui
-
convertor
protected org.jdesktop.swingx.autocomplete.ObjectToStringConverter convertor
the convertor used to auto-complete
-
decorator
protected org.nuiton.decorator.MultiJXPathDecorator<O> decorator
the decorator of data
-
init
protected boolean init
-
-
Method Detail
-
init
public void init(org.nuiton.decorator.JXPathDecorator<O> decorator, List<O> data)
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.- Since:
- 2.5.9
-
sortData
public void sortData()
Sort data of the model.- Since:
- 2.5.10
-
setIndex
protected void setIndex(Integer oldValue, Integer newValue)
Modifie l'index du décorateur- Parameters:
oldValue- l'ancienne valeurnewValue- la nouvelle valeur
-
updateUI
protected void updateUI(int index, boolean reversesort)
-
setSelectedItem
protected void setSelectedItem(O oldValue, O newValue)
Modifie la valeur sélectionnée dans la liste déroulante.- Parameters:
oldValue- l'ancienne valeurnewValue- la nouvelle valeur
-
getOriginalDocument
public Document getOriginalDocument()
- Returns:
- le document de l'éditeur avant complétion.
-
getDecorator
public org.nuiton.decorator.MultiJXPathDecorator<O> getDecorator()
-
getBeanType
public Class<O> getBeanType()
- Returns:
- get the type of objects contained in the comboBox model.
- Since:
- 2.5.9
-
getTargetClass
@Deprecated public Class<?> getTargetClass()
Deprecated.since 2.5.9 (use now methodgetBeanType())Obtain the type of objects contained in the comboBox using the model mutator.- Returns:
- get the type of objects contained in the comboBox model.
-
getMutator
protected Method getMutator()
- Returns:
- le mutateur a utiliser pour modifier le bean associé.
-
propertyChange
public void propertyChange(PropertyChangeEvent evt)
- Specified by:
propertyChangein interfacePropertyChangeListener
-
beforeInit
public void beforeInit(BeanComboBox<O> ui)
- Specified by:
beforeInitin interfaceUIHandler<O>
-
afterInit
public void afterInit(BeanComboBox<O> ui)
-
-