net.sf.jguiraffe.gui.app
Class ApplicationBuilderData

java.lang.Object
  extended by net.sf.jguiraffe.gui.app.ApplicationBuilderData
All Implemented Interfaces:
BuilderData

public class ApplicationBuilderData
extends java.lang.Object
implements BuilderData

The application specific default implementation of the BuilderData interface.

This class provides meaningful implementations of all methods required by the BuilderData interface. An instance can be obtained from the ApplicationContext class 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 158 2009-04-27 19:58:05Z 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
ApplicationBuilderData()
           
 
Method Summary
 ActionStore getActionStore()
          Returns the action store.
 BeanBuilderResult getBeanBuilderResult()
          Returns the result object from the bean builder.
 java.util.Collection<BeanCreationListener> getBeanCreationListeners()
          Returns a collection with BeanCreationListener objects to be registered at the BeanContext created by the builder.
 BindingStrategy getBindingStrategy()
          Returns the BindingStrategy used by the current form.
 Builder getBuilder()
          Returns a reference to the Builder instance that processed this object.
 BeanContext getBuilderContext()
          Returns the bean context used by the builder.
 java.lang.String getBuilderName()
          Returns the name of the builder.
 ClassLoaderProvider getClassLoaderProvider()
          Returns the class loader provider.
 CommandQueue getCommandQueue()
          Returns the CommandQueue.
 java.lang.Object getDefaultResourceGroup()
          Returns the default resource group.
 java.lang.Object getFormBean()
          Returns the form bean.
 FormValidator getFormValidator()
          Returns the FormValidator for validating the current form.
 MessageOutput getMessageOutput()
          Returns the MessageOutput object.
 BeanContext getParentContext()
          Returns the parent bean context.
 Window getParentWindow()
          Returns the parent window.
 BeanStore getRootStore()
          Returns the root store populated by the builder.
 TransformerContext getTransformerContext()
          Returns the transformer context.
 boolean isAutoRelease()
          Returns the auto release flag.
 boolean isMenuIcon()
          Returns the menu icon flag.
 boolean isToolbarText()
          Returns the toolbar text flag.
 void setActionStore(ActionStore actionStore)
          Sets the action store.
 void setAutoRelease(boolean autoRelease)
          Sets the auto release flag.
 void setBeanBuilderResult(BeanBuilderResult res)
          Sets the result object for the bean builder.
 void setBeanCreationListeners(java.util.Collection<BeanCreationListener> beanCreationListeners)
          Sets a collection with BeanCreationListener objects to be registered at the BeanContext created by the builder.
 void setBindingStrategy(BindingStrategy strat)
          Sets the BindingStrategy to be used by the current form.
 void setBuilder(Builder builder)
          Sets the Builder that processed this object.
 void setBuilderContext(BeanContext ctx)
          Sets the bean context used by the builder.
 void setBuilderName(java.lang.String builderName)
          Sets a name for the builder.
 void setClassLoaderProvider(ClassLoaderProvider clp)
          Sets the class loader provider.
 void setCommandQueue(CommandQueue commandQueue)
          Sets the CommandQueue.
 void setDefaultResourceGroup(java.lang.Object defaultResourceGroup)
          Sets the default resource group.
 void setFormBean(java.lang.Object formBean)
          Sets the form bean.
 void setFormValidator(FormValidator validator)
          Sets the FormValidator for validating the current form.
 void setMenuIcon(boolean menuIcon)
          Sets the menu icon flag.
 void setMessageOutput(MessageOutput messageOutput)
          Sets the MessageOutput object.
 void setParentContext(BeanContext ctx)
          Sets the parent bean context.
 void setParentWindow(Window parentWindow)
          Sets the parent window.
 void setToolbarText(boolean toolbarText)
          Sets the toolbar text flag.
 void setTransformerContext(TransformerContext transformerContext)
          Sets the transformer context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationBuilderData

public ApplicationBuilderData()
Method Detail

getActionStore

public ActionStore getActionStore()
Returns the action store.

Specified by:
getActionStore in interface BuilderData
Returns:
the action store

setActionStore

public void setActionStore(ActionStore actionStore)
Sets the action store.

Parameters:
actionStore - the actionStore

getDefaultResourceGroup

public java.lang.Object getDefaultResourceGroup()
Returns the default resource group.

Specified by:
getDefaultResourceGroup in interface BuilderData
Returns:
the default resource group

setDefaultResourceGroup

public void setDefaultResourceGroup(java.lang.Object defaultResourceGroup)
Sets the default resource group.

Parameters:
defaultResourceGroup - the default resource group

getFormBean

public java.lang.Object getFormBean()
Returns the form bean.

Specified by:
getFormBean in interface BuilderData
Returns:
the form bean

setFormBean

public void setFormBean(java.lang.Object formBean)
Sets the form bean.

Parameters:
formBean - the form bean

getBindingStrategy

public BindingStrategy getBindingStrategy()
Returns the BindingStrategy used by the current form.

Specified by:
getBindingStrategy in interface BuilderData
Returns:
the BindingStrategy
See Also:
BuilderData.getFormBean()

setBindingStrategy

public void setBindingStrategy(BindingStrategy strat)
Sets the BindingStrategy to be used by the current form.

Parameters:
strat - the BindingStrategy

getFormValidator

public FormValidator getFormValidator()
Returns the FormValidator for validating the current form.

Specified by:
getFormValidator in interface BuilderData
Returns:
the FormValidator

setFormValidator

public void setFormValidator(FormValidator validator)
Sets the FormValidator for validating the current form. If no FormValidator is set, no form-level validation is performed. The form's fields may be validated though if corresponding validators have been defined.

Parameters:
validator - the FormValidator

isMenuIcon

public boolean isMenuIcon()
Returns the menu icon flag.

Specified by:
isMenuIcon in interface BuilderData
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:
getParentWindow in interface BuilderData
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:
isToolbarText in interface BuilderData
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:
getTransformerContext in interface BuilderData
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:
getBeanBuilderResult in interface BuilderData
Returns:
the results of the bean builder

setBeanBuilderResult

public void setBeanBuilderResult(BeanBuilderResult res)
Sets the result object for the bean builder.

Specified by:
setBeanBuilderResult in interface BuilderData
Parameters:
res - the results of the bean builder

getParentContext

public BeanContext getParentContext()
Returns the parent bean context.

Specified by:
getParentContext in interface BuilderData
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:
getRootStore in interface BuilderData
Returns:
the root store returned from the builder
Throws:
java.lang.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:
getBuilderContext in interface BuilderData
Returns:
the builder's bean context

setBuilderContext

public void setBuilderContext(BeanContext ctx)
Sets the bean context used by the builder.

Specified by:
setBuilderContext in interface BuilderData
Parameters:
ctx - the builder's bean context

getClassLoaderProvider

public ClassLoaderProvider getClassLoaderProvider()
Returns the class loader provider.

Specified by:
getClassLoaderProvider in interface BuilderData
Returns:
the class loader provider

setClassLoaderProvider

public void setClassLoaderProvider(ClassLoaderProvider clp)
Sets the class loader provider.

Parameters:
clp - the class loader provider

getMessageOutput

public MessageOutput getMessageOutput()
Returns the MessageOutput object.

Specified by:
getMessageOutput in interface BuilderData
Returns:
the message output object

setMessageOutput

public void setMessageOutput(MessageOutput messageOutput)
Sets the MessageOutput object.

Parameters:
messageOutput - the message output object

getCommandQueue

public CommandQueue getCommandQueue()
Returns the CommandQueue.

Specified by:
getCommandQueue in interface BuilderData
Returns:
the command queue

setCommandQueue

public void setCommandQueue(CommandQueue commandQueue)
Sets the CommandQueue.

Parameters:
commandQueue - the command queue

getBeanCreationListeners

public java.util.Collection<BeanCreationListener> getBeanCreationListeners()
Returns a collection with BeanCreationListener objects to be registered at the BeanContext created by the builder.

Specified by:
getBeanCreationListeners in interface BuilderData
Returns:
a collection with BeanCreationListener objects

setBeanCreationListeners

public void setBeanCreationListeners(java.util.Collection<BeanCreationListener> beanCreationListeners)
Sets a collection with BeanCreationListener objects to be registered at the BeanContext created by the builder. When the BeanContext used by the builder is created, the listeners contained in this collection will be automatically registered. Note: By calling this method the ApplicationBuilderData object takes ownership of the collection; it should not be changed afterwards.

Parameters:
beanCreationListeners - the collection with the bean creation listeners to be registered at the builder's bean context

getBuilder

public Builder getBuilder()
Returns a reference to the Builder instance that processed this object. This value is available only after the Builder was called.

Specified by:
getBuilder in interface BuilderData
Returns:
the Builder that processed this BuilderData object

setBuilder

public void setBuilder(Builder builder)
Sets the Builder that processed this object. This method is called by the Builder instance during the builder operation.

Specified by:
setBuilder in interface BuilderData
Parameters:
builder - the Builder

getBuilderName

public java.lang.String getBuilderName()
Returns the name of the builder.

Specified by:
getBuilderName in interface BuilderData
Returns:
the name of the builder

setBuilderName

public void setBuilderName(java.lang.String builderName)
Sets a name for the builder. This name is available during the build process (through the ComponentBuilderData object). 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:
isAutoRelease in interface BuilderData
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 invoking Builder.release(BuilderData) on the Builder responsible. 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


Copyright © 2009 The JGUIraffe Team. All Rights Reserved.