Package net.sf.jguiraffe.gui.app
Class ApplicationBuilderData
- java.lang.Object
-
- net.sf.jguiraffe.gui.app.ApplicationBuilderData
-
- All Implemented Interfaces:
BuilderData
public class ApplicationBuilderData extends Object implements BuilderData
The application specific default implementation of the
BuilderDatainterface.This class provides meaningful implementations of all methods required by the
BuilderDatainterface. An instance can be obtained from theApplicationContextclass that is already initialized with predefined values for many fields. So a client need not bother with all of the data supported by this interface, but has only to set the values it is specially interested in.Implementation note: this class is not thread-safe. The typical usage scenario is that an instance is requested from
ApplicationContext, initialized with the properties required by the application and passed to a builder.- Version:
- $Id: ApplicationBuilderData.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
- See Also:
ApplicationContext.initBuilderData()
-
-
Field Summary
-
Fields inherited from interface net.sf.jguiraffe.gui.builder.BuilderData
KEY_RESULT_WINDOW
-
-
Constructor Summary
Constructors Constructor Description ApplicationBuilderData()Creates a new instance ofApplicationBuilderData.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBeanCreationListener(BeanCreationListener l)Adds the specifiedBeanCreationListenerto this object.voidaddBeanCreationListeners(Collection<? extends BeanCreationListener> listeners)Adds allBeanCreationListenerobjects contained in the given collection to this object.voidaddProperty(String key, Object value)Adds an additional property for the builder operation.ActionStoregetActionStore()Returns the action store.BeanBuilderResultgetBeanBuilderResult()Returns the result object from the bean builder.Collection<BeanCreationListener>getBeanCreationListeners()Returns a collection withBeanCreationListenerobjects to be registered at theBeanContextcreated by the builder.BindingStrategygetBindingStrategy()Returns theBindingStrategyused by the current form.BuildergetBuilder()Returns a reference to theBuilderinstance that processed this object.BeanContextgetBuilderContext()Returns the bean context used by the builder.StringgetBuilderName()Returns the name of the builder.CommandQueuegetCommandQueue()Returns theCommandQueue.ObjectgetDefaultResourceGroup()Returns the default resource group.ObjectgetFormBean()Returns the form bean.FormValidatorgetFormValidator()Returns theFormValidatorfor validating the current form.InvocationHelpergetInvocationHelper()Returns theInvocationHelper.MessageOutputgetMessageOutput()Returns theMessageOutputobject.BeanContextgetParentContext()Returns the parent bean context.WindowgetParentWindow()Returns the parent window.Map<String,Object>getProperties()Returns a map with additional properties for the builder operation.BeanStoregetRootStore()Returns the root store populated by the builder.TransformerContextgetTransformerContext()Returns the transformer context.booleanisAutoRelease()Returns the auto release flag.booleanisMenuIcon()Returns the menu icon flag.booleanisToolbarText()Returns the toolbar text flag.voidsetActionStore(ActionStore actionStore)Sets the action store.voidsetAutoRelease(boolean autoRelease)Sets the auto release flag.voidsetBeanBuilderResult(BeanBuilderResult res)Sets the result object for the bean builder.voidsetBindingStrategy(BindingStrategy strat)Sets theBindingStrategyto be used by the current form.voidsetBuilder(Builder builder)Sets theBuilderthat processed this object.voidsetBuilderContext(BeanContext ctx)Sets the bean context used by the builder.voidsetBuilderName(String builderName)Sets a name for the builder.voidsetCommandQueue(CommandQueue commandQueue)Sets theCommandQueue.voidsetDefaultResourceGroup(Object defaultResourceGroup)Sets the default resource group.voidsetFormBean(Object formBean)Sets the form bean.voidsetFormValidator(FormValidator validator)Sets theFormValidatorfor validating the current form.voidsetInvocationHelper(InvocationHelper invocationHelper)Sets theInvocationHelper.voidsetMenuIcon(boolean menuIcon)Sets the menu icon flag.voidsetMessageOutput(MessageOutput messageOutput)Sets theMessageOutputobject.voidsetParentContext(BeanContext ctx)Sets the parent bean context.voidsetParentWindow(Window parentWindow)Sets the parent window.voidsetProperties(Map<String,Object> props)Sets additional properties for the builder operation.voidsetToolbarText(boolean toolbarText)Sets the toolbar text flag.voidsetTransformerContext(TransformerContext transformerContext)Sets the transformer context.
-
-
-
Method Detail
-
getActionStore
public ActionStore getActionStore()
Returns the action store.- Specified by:
getActionStorein interfaceBuilderData- Returns:
- the action store
-
setActionStore
public void setActionStore(ActionStore actionStore)
Sets the action store.- Parameters:
actionStore- the actionStore
-
getDefaultResourceGroup
public Object getDefaultResourceGroup()
Returns the default resource group.- Specified by:
getDefaultResourceGroupin interfaceBuilderData- Returns:
- the default resource group
-
setDefaultResourceGroup
public void setDefaultResourceGroup(Object defaultResourceGroup)
Sets the default resource group.- Parameters:
defaultResourceGroup- the default resource group
-
getFormBean
public Object getFormBean()
Returns the form bean.- Specified by:
getFormBeanin interfaceBuilderData- Returns:
- the form bean
-
setFormBean
public void setFormBean(Object formBean)
Sets the form bean.- Parameters:
formBean- the form bean
-
getBindingStrategy
public BindingStrategy getBindingStrategy()
Returns theBindingStrategyused by the current form.- Specified by:
getBindingStrategyin interfaceBuilderData- Returns:
- the
BindingStrategy - See Also:
BuilderData.getFormBean()
-
setBindingStrategy
public void setBindingStrategy(BindingStrategy strat)
Sets theBindingStrategyto be used by the current form.- Parameters:
strat- theBindingStrategy
-
getFormValidator
public FormValidator getFormValidator()
Returns theFormValidatorfor validating the current form.- Specified by:
getFormValidatorin interfaceBuilderData- Returns:
- the
FormValidator
-
setFormValidator
public void setFormValidator(FormValidator validator)
Sets theFormValidatorfor validating the current form. If noFormValidatoris set, no form-level validation is performed. The form's fields may be validated though if corresponding validators have been defined.- Parameters:
validator- theFormValidator
-
isMenuIcon
public boolean isMenuIcon()
Returns the menu icon flag.- Specified by:
isMenuIconin interfaceBuilderData- Returns:
- the menu icon flag
-
setMenuIcon
public void setMenuIcon(boolean menuIcon)
Sets the menu icon flag.- Parameters:
menuIcon- the flag value
-
getParentWindow
public Window getParentWindow()
Returns the parent window.- Specified by:
getParentWindowin interfaceBuilderData- Returns:
- the parent window
-
setParentWindow
public void setParentWindow(Window parentWindow)
Sets the parent window.- Parameters:
parentWindow- the parent window
-
isToolbarText
public boolean isToolbarText()
Returns the toolbar text flag.- Specified by:
isToolbarTextin interfaceBuilderData- Returns:
- the toolbar text flag
-
setToolbarText
public void setToolbarText(boolean toolbarText)
Sets the toolbar text flag.- Parameters:
toolbarText- the toolbar text flag
-
getTransformerContext
public TransformerContext getTransformerContext()
Returns the transformer context.- Specified by:
getTransformerContextin interfaceBuilderData- Returns:
- the transformer context
-
setTransformerContext
public void setTransformerContext(TransformerContext transformerContext)
Sets the transformer context.- Parameters:
transformerContext- the transformer context
-
getBeanBuilderResult
public BeanBuilderResult getBeanBuilderResult()
Returns the result object from the bean builder.- Specified by:
getBeanBuilderResultin interfaceBuilderData- Returns:
- the results of the bean builder
-
setBeanBuilderResult
public void setBeanBuilderResult(BeanBuilderResult res)
Sets the result object for the bean builder.- Specified by:
setBeanBuilderResultin interfaceBuilderData- Parameters:
res- the results of the bean builder
-
getParentContext
public BeanContext getParentContext()
Returns the parent bean context.- Specified by:
getParentContextin interfaceBuilderData- Returns:
- the parent bean context
-
setParentContext
public void setParentContext(BeanContext ctx)
Sets the parent bean context.- Parameters:
ctx- the parent bean context
-
getRootStore
public BeanStore getRootStore()
Returns the root store populated by the builder. This method can only be called after the builder operation.- Specified by:
getRootStorein interfaceBuilderData- Returns:
- the root store returned from the builder
- Throws:
IllegalStateException- if no builder results are available yet- See Also:
BuilderData.getBeanBuilderResult()
-
getBuilderContext
public BeanContext getBuilderContext()
Returns the bean context used by the builder.- Specified by:
getBuilderContextin interfaceBuilderData- Returns:
- the builder's bean context
-
setBuilderContext
public void setBuilderContext(BeanContext ctx)
Sets the bean context used by the builder.- Specified by:
setBuilderContextin interfaceBuilderData- Parameters:
ctx- the builder's bean context
-
getInvocationHelper
public InvocationHelper getInvocationHelper()
Returns theInvocationHelper.- Specified by:
getInvocationHelperin interfaceBuilderData- Returns:
- the
InvocationHelper
-
setInvocationHelper
public void setInvocationHelper(InvocationHelper invocationHelper)
Sets theInvocationHelper.- Parameters:
invocationHelper- theInvocationHelper
-
getMessageOutput
public MessageOutput getMessageOutput()
Returns theMessageOutputobject.- Specified by:
getMessageOutputin interfaceBuilderData- Returns:
- the message output object
-
setMessageOutput
public void setMessageOutput(MessageOutput messageOutput)
Sets theMessageOutputobject.- Parameters:
messageOutput- the message output object
-
getCommandQueue
public CommandQueue getCommandQueue()
Returns theCommandQueue.- Specified by:
getCommandQueuein interfaceBuilderData- Returns:
- the command queue
-
setCommandQueue
public void setCommandQueue(CommandQueue commandQueue)
Sets theCommandQueue.- Parameters:
commandQueue- the command queue
-
getBeanCreationListeners
public Collection<BeanCreationListener> getBeanCreationListeners()
Returns a collection withBeanCreationListenerobjects to be registered at theBeanContextcreated by the builder. Note: this collection cannot be modified.- Specified by:
getBeanCreationListenersin interfaceBuilderData- Returns:
- a collection with
BeanCreationListenerobjects
-
addBeanCreationListener
public void addBeanCreationListener(BeanCreationListener l)
Adds the specifiedBeanCreationListenerto this object. It will be registered at theBeanContextcreated by the builder and thus notified for all bean created by the dependency injection framework.- Parameters:
l- theBeanCreationListenerto be added (must not be null)- Throws:
IllegalArgumentException- if theBeanCreationListeneris null
-
addBeanCreationListeners
public void addBeanCreationListeners(Collection<? extends BeanCreationListener> listeners)
Adds allBeanCreationListenerobjects contained in the given collection to this object. They will be registered at theBeanContextcreated by the builder and thus notified for all bean created by the dependency injection framework.- Parameters:
listeners- the collection withBeanCreationListenerobjects (must not be null)- Throws:
IllegalArgumentException- if the collection is null or contains null elements
-
getBuilder
public Builder getBuilder()
Returns a reference to theBuilderinstance that processed this object. This value is available only after theBuilderwas called.- Specified by:
getBuilderin interfaceBuilderData- Returns:
- the
Builderthat processed thisBuilderDataobject
-
setBuilder
public void setBuilder(Builder builder)
Sets theBuilderthat processed this object. This method is called by theBuilderinstance during the builder operation.- Specified by:
setBuilderin interfaceBuilderData- Parameters:
builder- theBuilder
-
getBuilderName
public String getBuilderName()
Returns the name of the builder.- Specified by:
getBuilderNamein interfaceBuilderData- Returns:
- the name of the builder
-
setBuilderName
public void setBuilderName(String builderName)
Sets a name for the builder. This name is available during the build process (through theComponentBuilderDataobject). It can be used for conditional execution of builder scripts.- Parameters:
builderName- the name of the builder
-
isAutoRelease
public boolean isAutoRelease()
Returns the auto release flag.- Specified by:
isAutoReleasein interfaceBuilderData- Returns:
- the auto release flag
-
setAutoRelease
public void setAutoRelease(boolean autoRelease)
Sets the auto release flag. This flag is evaluated if a window is generated during the builder operation. A value of true means that this object and all resources referenced by it should be freed automatically when the window is closed. This is done by invokingBuilder.release(BuilderData)on theBuilderresponsible. Note that the default value of this flag is true, so auto release is enabled per default.- Parameters:
autoRelease- the value of the auto release flag
-
getProperties
public Map<String,Object> getProperties()
Returns a map with additional properties for the builder operation. This implementation either returns the map set bysetProperties(Map)or the one that was created automatically when#addProperty()was called. Result may also be null if no properties have been set.- Specified by:
getPropertiesin interfaceBuilderData- Returns:
- a map with additional properties for the builder operation
- See Also:
setProperties(Map),addProperty(String, Object)
-
setProperties
public void setProperties(Map<String,Object> props)
Sets additional properties for the builder operation. The map passed to this method is directly stored and passed to the builder.- Parameters:
props- the map with additional properties
-
addProperty
public void addProperty(String key, Object value)
Adds an additional property for the builder operation. This method can be used to populate the map with additional properties that is returned bygetProperties(). If no map with properties has been set yet, a new one is created (getProperties()will return this new map). Otherwise, the property is added to the existing map.- Parameters:
key- the key of the propertyvalue- the value of the property
-
-