jaxx.runtime.swing.editor.config.model
Class ConfigUIModel

java.lang.Object
  extended by jaxx.runtime.swing.editor.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.

Author:
chemit

Field Summary
protected  CallBacksManager callBacksManager
          Callbacks manager
protected  Map<String,CategoryModel> categories
          le dictionnaire des options disponibles par categorie
static String CATEGORY_MODEL_PROPERTY_NAME
           
protected  CategoryModel categoryModel
          la cateogrie en cours d'utilisation
protected  org.nuiton.util.ApplicationConfig config
          La configuration de l'application
protected  PropertyChangeSupport pcs
          suport of modification
protected  Runnable reloadApplicationCallback
          Deprecated. 
protected  Runnable reloadUICallback
          Deprecated. 
protected  boolean saved
          un drapeau pour savoir si la configuration a été modifiée au moins une fois.
protected  boolean standalone
          un drapeau pour savoir si l'ui de configuration a été lancée en mode standalone ou pas.
 
Constructor Summary
ConfigUIModel(org.nuiton.util.ApplicationConfig config)
           
 
Method Summary
 void addCategory(CategoryModel category)
          Ajoute une categorie dans le modele.
 void addCategory(String category, String categoryLabel, org.nuiton.util.ApplicationConfig.OptionDef... keys)
          Deprecated. since 2.0.0 prefer use the addCategory(CategoryModel)
 void addPropertyChangeListener(PropertyChangeListener listener)
           
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
           
 void firePropertyChange(String propertyName, Object oldValue, Object newValue)
           
 Map<CallBackEntry,List<OptionModel>> getCallBacksForSaved()
           
protected  CallBacksManager getCallBacksManager()
           
 int getCategoryIndex(String category)
           
 CategoryModel getCategoryModel()
           
protected  org.nuiton.util.ApplicationConfig getConfig()
           
 PropertyChangeListener[] getPropertyChangeListeners()
           
 PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
           
 Runnable getReloadApplicationCallback()
          Deprecated. 
 Runnable getReloadUICallback()
          Deprecated. 
 boolean hasListeners(String propertyName)
           
 boolean isSaved()
           
 boolean isStandalone()
           
 Iterator<CategoryModel> iterator()
           
 void registerCallBack(String name, String description, Icon icon, Runnable action)
          Registers a new callback.
 void registerOptionCallBack(String name, OptionModel option)
          Registers a option into a known callback.
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
           
 void reset()
           
 void saveModified()
           
 void setCategory(String category)
          Change la categorie en cours d'édition.
 void setCategoryModel(CategoryModel categoryModel)
           
protected  void setReloadApplicationCallback(Runnable reloadApplicationCallback)
          Deprecated. 
protected  void setReloadUICallback(Runnable reloadUICallback)
          Deprecated. 
 void setSaved(boolean saved)
           
 void setStandalone(boolean standalone)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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


config

protected final org.nuiton.util.ApplicationConfig config
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 CallBacksManager callBacksManager
Callbacks manager


reloadUICallback

@Deprecated
protected Runnable reloadUICallback
Deprecated. 
call back when reload ui is necessary


reloadApplicationCallback

@Deprecated
protected Runnable reloadApplicationCallback
Deprecated. 
call back when reload application is necessary


pcs

protected final PropertyChangeSupport pcs
suport of modification

Constructor Detail

ConfigUIModel

public ConfigUIModel(org.nuiton.util.ApplicationConfig config)
Method Detail

addCategory

@Deprecated
public void addCategory(String category,
                                   String categoryLabel,
                                   org.nuiton.util.ApplicationConfig.OptionDef... keys)
Deprecated. since 2.0.0 prefer use the addCategory(CategoryModel)

Ajoute une categorie dans le modele.

Parameters:
category - l'id de la categorie (la clef de traduction du nom de la categorie)
categoryLabel - la clef de traduction de la description de la categorie
keys - les options de la categorie

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 callback
description - the i18n key to describe the action
icon - 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 callback
option - the option to register for the given callback

getCallBacksForSaved

public Map<CallBackEntry,List<OptionModel>> getCallBacksForSaved()

iterator

public Iterator<CategoryModel> iterator()
Specified by:
iterator in interface Iterable<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)

getReloadApplicationCallback

@Deprecated
public Runnable getReloadApplicationCallback()
Deprecated. 


getReloadUICallback

@Deprecated
public Runnable getReloadUICallback()
Deprecated. 


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()

setReloadApplicationCallback

@Deprecated
protected void setReloadApplicationCallback(Runnable reloadApplicationCallback)
Deprecated. 


setReloadUICallback

@Deprecated
protected void setReloadUICallback(Runnable reloadUICallback)
Deprecated. 


getConfig

protected org.nuiton.util.ApplicationConfig getConfig()

getCallBacksManager

protected CallBacksManager getCallBacksManager()


Copyright © 2008-2010 CodeLutin. All Rights Reserved.