Class ConfigUIModel
- java.lang.Object
-
- org.nuiton.jaxx.widgets.config.model.ConfigUIModel
-
- All Implemented Interfaces:
Iterable<CategoryModel>
public class ConfigUIModel extends Object implements Iterable<CategoryModel>
Le modele de l'ui des preferences. Ce modele contient les catégories des options.- Since:
- 2.5.11
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Field Summary
Fields Modifier and Type Field Description protected io.ultreia.java4all.config.ApplicationConfigapplicationConfigLa configuration de l'applicationprotected CallBacksManagercallBacksManagerCallbacks managerprotected Map<String,CategoryModel>categoriesle dictionnaire des options disponibles par categoriestatic StringCATEGORY_MODEL_PROPERTY_NAMEprotected CategoryModelcategoryModella cateogrie en cours d'utilisationprotected RunnablecloseActionoptional action to execute (if not null) if no call backs fits.protected ObjectconfigBeanLa configuration de l'applicationprotected FileconfigFileLe fichier où sauvegarder la configuration.protected PropertyChangeSupportpcssupport of modification notificationsprotected booleansavedun drapeau pour savoir si la configuration a été modifiée au moins une fois.protected booleanstandaloneun drapeau pour savoir si l'ui de configuration a été lancée en mode standalone ou pas.
-
Constructor Summary
Constructors Constructor Description ConfigUIModel(com.google.common.base.Supplier<io.ultreia.java4all.config.ApplicationConfig> config)Deprecated.ConfigUIModel(com.google.common.base.Supplier<io.ultreia.java4all.config.ApplicationConfig> config, File configFile)Deprecated.ConfigUIModel(io.ultreia.java4all.config.ApplicationConfig applicationConfig)Deprecated.ConfigUIModel(io.ultreia.java4all.config.ApplicationConfig applicationConfig, File configFile)Deprecated.ConfigUIModel(Object configBean, io.ultreia.java4all.config.ApplicationConfig applicationConfig)Deprecated.ConfigUIModel(Object configBean, io.ultreia.java4all.config.ApplicationConfig applicationConfig, File configFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCategory(CategoryModel category)Ajoute une categorie dans le modele.voidaddPropertyChangeListener(PropertyChangeListener listener)voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener)voiddestroy()protected voidfinalize()voidfirePropertyChange(String propertyName, Object oldValue, Object newValue)protected io.ultreia.java4all.config.ApplicationConfiggetApplicationConfig()CallBackMapgetCallBacksForSaved()Obtain the dictionnary of callback for all to saved modified options.protected CallBacksManagergetCallBacksManager()intgetCategoryIndex(String category)CategoryModelgetCategoryModel()StringgetCategoryName(int index)RunnablegetCloseAction()protected io.ultreia.java4all.config.ApplicationConfiggetConfig()Deprecated.since 2.5.4 use nowgetApplicationConfig().PropertyChangeListener[]getPropertyChangeListeners()PropertyChangeListener[]getPropertyChangeListeners(String propertyName)booleanhasListeners(String propertyName)booleanisSaved()booleanisStandalone()Iterator<CategoryModel>iterator()voidregisterCallBack(String name, String description, Icon icon, Runnable action)Registers a new callback.voidregisterOptionCallBack(String name, OptionModel option)Registers a option into a known callback.voidremovePropertyChangeListener(PropertyChangeListener listener)voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener)voidreset()voidsaveModified()voidsetCategory(String category)Change la categorie en cours d'édition.voidsetCategoryModel(CategoryModel categoryModel)voidsetCloseAction(Runnable closeAction)voidsetFinalizer(CallBackFinalizer finalizer)voidsetSaved(boolean saved)voidsetStandalone(boolean standalone)-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
CATEGORY_MODEL_PROPERTY_NAME
public static final String CATEGORY_MODEL_PROPERTY_NAME
- See Also:
- Constant Field Values
-
categories
protected final Map<String,CategoryModel> categories
le dictionnaire des options disponibles par categorie
-
configFile
protected final File configFile
Le fichier où sauvegarder la configuration.- Since:
- 2.5.21
-
configBean
protected final Object configBean
La configuration de l'application
-
applicationConfig
protected final io.ultreia.java4all.config.ApplicationConfig applicationConfig
La configuration de l'application
-
categoryModel
protected CategoryModel categoryModel
la cateogrie en cours d'utilisation
-
saved
protected boolean saved
un drapeau pour savoir si la configuration a été modifiée au moins une fois. On utilise ce drapeau lors de la sortie pour verifier s'il faut ou non redemarer l'application (si non en mode standalone)
-
standalone
protected boolean standalone
un drapeau pour savoir si l'ui de configuration a été lancée en mode standalone ou pas. Si pas lancée en mode standalone, et si la confi a été sauvé on vérifie s'il ne faut pas relancer l'application.
-
callBacksManager
protected final CallBacksManager callBacksManager
Callbacks manager
-
closeAction
protected Runnable closeAction
optional action to execute (if not null) if no call backs fits.- Since:
- 1.4.2
-
pcs
protected final PropertyChangeSupport pcs
support of modification notifications
-
-
Constructor Detail
-
ConfigUIModel
public ConfigUIModel(Object configBean, io.ultreia.java4all.config.ApplicationConfig applicationConfig, File configFile)
-
ConfigUIModel
@Deprecated public ConfigUIModel(com.google.common.base.Supplier<io.ultreia.java4all.config.ApplicationConfig> config)
Deprecated.
-
ConfigUIModel
@Deprecated public ConfigUIModel(Object configBean, io.ultreia.java4all.config.ApplicationConfig applicationConfig)
Deprecated.
-
ConfigUIModel
@Deprecated public ConfigUIModel(com.google.common.base.Supplier<io.ultreia.java4all.config.ApplicationConfig> config, File configFile)
Deprecated.
-
ConfigUIModel
@Deprecated public ConfigUIModel(io.ultreia.java4all.config.ApplicationConfig applicationConfig)
Deprecated.
-
ConfigUIModel
@Deprecated public ConfigUIModel(io.ultreia.java4all.config.ApplicationConfig applicationConfig, File configFile)
Deprecated.
-
-
Method Detail
-
addCategory
public void addCategory(CategoryModel category)
Ajoute une categorie dans le modele.- Parameters:
category- la categorie a ajouter au modèle.
-
setCategory
public void setCategory(String category)
Change la categorie en cours d'édition.- Parameters:
category- l'id de la categorie courante
-
registerCallBack
public void registerCallBack(String name, String description, Icon icon, Runnable action)
Registers a new callback. Note: the order of registred callback is used to determine the higher priority of callback to launch if required.- Parameters:
name- the unique name of a callbackdescription- the i18n key to describe the actionicon- the icon of the callBack (used in ui)action- the action of the callback
-
registerOptionCallBack
public void registerOptionCallBack(String name, OptionModel option)
Registers a option into a known callback.- Parameters:
name- the name of the callbackoption- the option to register for the given callback
-
setFinalizer
public void setFinalizer(CallBackFinalizer finalizer)
-
getCloseAction
public Runnable getCloseAction()
-
setCloseAction
public void setCloseAction(Runnable closeAction)
-
getCallBacksForSaved
public CallBackMap getCallBacksForSaved()
Obtain the dictionnary of callback for all to saved modified options.- Returns:
- the dictonnary
-
iterator
public Iterator<CategoryModel> iterator()
- Specified by:
iteratorin interfaceIterable<CategoryModel>
-
getCategoryModel
public CategoryModel getCategoryModel()
-
setCategoryModel
public void setCategoryModel(CategoryModel categoryModel)
-
isSaved
public boolean isSaved()
-
setSaved
public void setSaved(boolean saved)
-
isStandalone
public boolean isStandalone()
-
setStandalone
public void setStandalone(boolean standalone)
-
saveModified
public void saveModified()
-
reset
public void reset()
-
getCategoryIndex
public int getCategoryIndex(String category)
-
firePropertyChange
public void firePropertyChange(String propertyName, Object oldValue, Object newValue)
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
-
addPropertyChangeListener
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
-
removePropertyChangeListener
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
-
hasListeners
public boolean hasListeners(String propertyName)
-
getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
-
getPropertyChangeListeners
public PropertyChangeListener[] getPropertyChangeListeners()
-
destroy
public void destroy()
-
finalize
protected void finalize() throws Throwable
-
getConfig
protected io.ultreia.java4all.config.ApplicationConfig getConfig()
Deprecated.since 2.5.4 use nowgetApplicationConfig().- Returns:
- the underlined application config
-
getApplicationConfig
protected io.ultreia.java4all.config.ApplicationConfig getApplicationConfig()
- Returns:
- the underlined application config
- Since:
- 2.5.4
-
getCallBacksManager
protected CallBacksManager getCallBacksManager()
-
getCategoryName
public String getCategoryName(int index)
-
-