Package jaxx.runtime.swing.config.model
Class CallBacksManager
java.lang.Object
jaxx.runtime.swing.config.model.CallBacksManager
public class CallBacksManager
extends java.lang.Object
CallBack manager.
- Since:
- 2.5.11
- Author:
- Tony Chemit - chemit@codelutin.com
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<CallBackEntry>callbackslists of registred callback.protected CallBackFinalizerfinalizeroptional callbacks finalizer -
Constructor Summary
Constructors Constructor Description CallBacksManager() -
Method Summary
Modifier and Type Method Description protected CallBackEntrygetCallBack(java.lang.String name)Obtain a registred callBack from his name.protected CallBackEntrygetCallBack(OptionModel option)Get the first callBack for a given option.CallBackMapgetCallBacks(CategoryModel category, boolean saved, boolean modified)Scan a category and grab per callBack the options.CallBackMapgetCallBacks(ConfigUIModel model, boolean saved, boolean modified)Scan a model and grab per callBack the options.CallBackMapgetCallBacksForSaved(CategoryModel category)Scan a category and grab per callBack the options saved.CallBackMapgetCallBacksForSaved(ConfigUIModel model)Scan a model and grab per callBack the options saved.CallBackFinalizergetFinalizer()Obtain the finalizer to use.voidregisterCallBack(java.lang.String name, java.lang.String description, javax.swing.Icon icon, java.lang.Runnable action)Registers a new callback.voidregisterOption(java.lang.String name, OptionModel option)Registers a option into a known callback.voidsetFinalizer(CallBackFinalizer finalizer)Sets the finalizer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
callbacks
lists of registred callback. -
finalizer
optional callbacks finalizer
-
-
Constructor Details
-
CallBacksManager
public CallBacksManager()
-
-
Method Details
-
getFinalizer
Obtain the finalizer to use.- Returns:
- the finalizer (can be
null). - See Also:
CallBackFinalizer
-
setFinalizer
Sets the finalizer.- Parameters:
finalizer- the new finalizer- See Also:
CallBackFinalizer
-
registerCallBack
public void registerCallBack(java.lang.String name, java.lang.String description, javax.swing.Icon icon, java.lang.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- icon of callBack (used in ui)action- the action of the callback
-
registerOption
Registers a option into a known callback.- Parameters:
name- the name of the callbackoption- the option to register for the given callback
-
getCallBacksForSaved
Scan a model and grab per callBack the options saved.- Parameters:
model- the model to scan- Returns:
- the dictionnary of options for each callback to launch
-
getCallBacksForSaved
Scan a category and grab per callBack the options saved.- Parameters:
category- the category to scan- Returns:
- the dictionnary of options for each callBack to launch
-
getCallBacks
Scan a model and grab per callBack the options.- Parameters:
model- the model to scanmodified-trueto include modified optionssaved-trueto include saved options- Returns:
- the dictionnary of options for each callback to launch
-
getCallBacks
Scan a category and grab per callBack the options.- Parameters:
category- the category to scanmodified-trueto include modified optionssaved-trueto include saved options- Returns:
- the dictionnary of options for each callBack to launch
-
getCallBack
Get the first callBack for a given option.- Parameters:
option- the option- Returns:
- the first callBack (so the most important) on which the given option is attacjed. (can be null)
-
getCallBack
Obtain a registred callBack from his name.- Parameters:
name- the name of the searched callBack- Returns:
- the callBack for the given name (or
nullif not found).
-