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:
tchemit

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  Runnable closeAction
          optional action to execute (if not null) if no call backs fits.
protected  org.nuiton.util.ApplicationConfig config
          La configuration de l'application
protected  PropertyChangeSupport pcs
          support of modification notifications
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 addPropertyChangeListener(PropertyChangeListener listener)
           
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
           
 void destroy()
           
protected  void finalize()
           
 void firePropertyChange(String propertyName, Object oldValue, Object newValue)
           
 CallBackMap getCallBacksForSaved()
          Obtain the dictionnary of callback for all to saved modified options.
protected  CallBacksManager getCallBacksManager()
           
 int getCategoryIndex(String category)
           
 CategoryModel getCategoryModel()
           
 Runnable getCloseAction()
           
protected  org.nuiton.util.ApplicationConfig getConfig()
           
 PropertyChangeListener[] getPropertyChangeListeners()
           
 PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
           
 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)
           
 void setCloseAction(Runnable closeAction)
           
 void setFinalizer(CallBackFinalizer finalizer)
           
 void setSaved(boolean saved)
           
 void setStandalone(boolean standalone)
           
 
Methods inherited from class java.lang.Object
clone, equals, 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


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(org.nuiton.util.ApplicationConfig config)
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 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

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

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
Overrides:
finalize in class Object
Throws:
Throwable

getConfig

protected org.nuiton.util.ApplicationConfig getConfig()

getCallBacksManager

protected CallBacksManager getCallBacksManager()


Copyright © 2008-2010 CodeLutin. All Rights Reserved.