jaxx.runtime.swing
Class EntityComboBoxHandler<O>

java.lang.Object
  extended by jaxx.runtime.swing.EntityComboBoxHandler<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 EntityComboBoxHandler<O>
extends java.lang.Object
implements java.beans.PropertyChangeListener

Le handler d'un EntityComboBox.

Note: ce handler n'est pas staeless et n'est donc pas partageable entre plusieurs ui.

Author:
chemit
See Also:
EntityComboBox

Field Summary
static java.lang.String AUTO_COMPLETE_PROPERTY
           
protected  org.jdesktop.swingx.autocomplete.ObjectToStringConverter convertor
          the convertor used to auto-complete
static java.lang.String DATA_PROPERTY
           
protected  MultiJXPathDecorator<O> decorator
          the decorator of data
protected  java.awt.event.FocusListener EDITOR_TEXT_COMP0NENT_FOCUSLISTENER
           
static java.lang.String INDEX_PROPERTY
           
protected  boolean init
           
static org.apache.commons.logging.Log log
           
protected  java.lang.reflect.Method mutator
          the mutator method on the property of boxed bean in the ui
protected  javax.swing.text.Document originalDocument
          the original document of the combbo box editor (keep it to make possible undecorate)
static java.lang.String SELECTED_ITEM_PROPERTY
           
protected  EntityComboBox ui
          ui if the handler
 
Constructor Summary
EntityComboBoxHandler(EntityComboBox ui)
           
 
Method Summary
static void decorate(javax.swing.JComboBox combo, org.jdesktop.swingx.autocomplete.ObjectToStringConverter convertor)
          Ajout l'auto-complétion sur une liste déroulante, en utilisant le converteur donné pour afficher les données.
 MultiJXPathDecorator<O> getDecorator()
           
protected  java.lang.reflect.Method getMutator()
           
 javax.swing.text.Document getOriginalDocument()
           
 java.lang.Class<?> getTargetClass()
           
 void init(JXPathDecorator<O> decorator, java.util.List<O> data)
          Initialise le handler de l'ui
static org.jdesktop.swingx.autocomplete.ObjectToStringConverter newDecoratedObjectToStringConverter(Decorator<?> decorator)
          Encapsule un Decorator dans un ObjectToStringConverter.
protected  void preparePopup(MultiJXPathDecorator<?> decorator)
          Creation de l'ui pour modifier le décorateur.
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
protected  void setAutoComplete(java.lang.Boolean oldValue, java.lang.Boolean newValue)
          Modifie l'état autoComplete de l'ui.
protected  void setIndex(java.lang.Integer oldValue, java.lang.Integer newValue)
          Modifie l'index du décorateur
protected  void setSelectedItem(java.lang.Object oldValue, java.lang.Object newValue)
          Modifie la valeur sélectionnée dans la liste déroulante.
 void togglePopup()
          Toggle the popup visible state.
static void undecorate(javax.swing.JComboBox combo, javax.swing.text.Document originalDocument)
          Désactive l'aut-complétion sur une liste déroulante, en y repositionnant le modèle du document d'édition d'avant auto-complétion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.commons.logging.Log log

SELECTED_ITEM_PROPERTY

public static final java.lang.String SELECTED_ITEM_PROPERTY
See Also:
Constant Field Values

INDEX_PROPERTY

public static final java.lang.String INDEX_PROPERTY
See Also:
Constant Field Values

AUTO_COMPLETE_PROPERTY

public static final java.lang.String AUTO_COMPLETE_PROPERTY
See Also:
Constant Field Values

DATA_PROPERTY

public static final java.lang.String DATA_PROPERTY
See Also:
Constant Field Values

ui

protected EntityComboBox ui
ui if the handler


mutator

protected java.lang.reflect.Method mutator
the mutator method on the property of boxed bean in the ui


originalDocument

protected javax.swing.text.Document originalDocument
the original document of the combbo box editor (keep it to make possible undecorate)


convertor

protected org.jdesktop.swingx.autocomplete.ObjectToStringConverter convertor
the convertor used to auto-complete


decorator

protected MultiJXPathDecorator<O> decorator
the decorator of data


init

protected boolean init

EDITOR_TEXT_COMP0NENT_FOCUSLISTENER

protected final java.awt.event.FocusListener EDITOR_TEXT_COMP0NENT_FOCUSLISTENER
Constructor Detail

EntityComboBoxHandler

public EntityComboBoxHandler(EntityComboBox ui)
Method Detail

init

public void init(JXPathDecorator<O> decorator,
                 java.util.List<O> data)
Initialise le handler de l'ui

Parameters:
decorator - le decorateur a utiliser
data - la liste des données a gérer

togglePopup

public void togglePopup()
Toggle the popup visible state.


setAutoComplete

protected void setAutoComplete(java.lang.Boolean oldValue,
                               java.lang.Boolean newValue)
Modifie l'état autoComplete de l'ui.

Parameters:
oldValue - l'ancienne valeur
newValue - 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 valeur
newValue - la nouvelle valeur

setSelectedItem

protected void setSelectedItem(java.lang.Object oldValue,
                               java.lang.Object newValue)
Modifie la valeur sélectionnée dans la liste déroulante.

Parameters:
oldValue - l'ancienne valeur
newValue - la nouvelle valeur

getOriginalDocument

public javax.swing.text.Document getOriginalDocument()
Returns:
le document de l'éditeur avant complétion.

getDecorator

public MultiJXPathDecorator<O> getDecorator()

preparePopup

protected void preparePopup(MultiJXPathDecorator<?> decorator)
Creation de l'ui pour modifier le décorateur.

Parameters:
decorator - le decorateur a utiliser

getTargetClass

public java.lang.Class<?> getTargetClass()

getMutator

protected java.lang.reflect.Method getMutator()
Returns:
le mutateur a utiliser pour modifier le bean associé.

newDecoratedObjectToStringConverter

public static org.jdesktop.swingx.autocomplete.ObjectToStringConverter newDecoratedObjectToStringConverter(Decorator<?> decorator)
Encapsule un Decorator dans un ObjectToStringConverter.

Parameters:
decorator - le decorateur a encapsuler.
Returns:
le converter encapsule dans un ObjectToStringConverter

decorate

public static void decorate(javax.swing.JComboBox combo,
                            org.jdesktop.swingx.autocomplete.ObjectToStringConverter convertor)
Ajout l'auto-complétion sur une liste déroulante, en utilisant le converteur donné pour afficher les données.

Parameters:
combo - la combo à décorer
convertor - le converter utilisé pour afficher les données.

undecorate

public static void undecorate(javax.swing.JComboBox combo,
                              javax.swing.text.Document originalDocument)
Désactive l'aut-complétion sur une liste déroulante, en y repositionnant le modèle du document d'édition d'avant auto-complétion.

Parameters:
combo - la liste déroulante à décorer
originalDocument - le document original de l'édtieur de la liste déroulante.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener


Copyright © 2008-2009 CodeLutin. All Rights Reserved.