Interface BuilderData
-
- All Known Implementing Classes:
ApplicationBuilderData
public interface BuilderDataDefinition of an interface that describes the parameters of a builder operation.
An implementation of this interface is used in calls of builder methods to pass all required parameters. There is a bunch of parameters supported by the builder, all of which must be defined so that the builder can work properly.
In addition to the input parameters required by the builder, the builder will also store its results in this object. During the builder operation a
BeanStoreis created and populated, which can be queried for obtaining objects created by the builder. Some constants define reserved keys for typical objects involved in a builder operation. More of these keys allowing access to typical builder results are defined by theComponentBuilderDataclass.There will be implementations of this interface that provide default values for many of the settings defined here. So an application won't have to bother with all. If not marked otherwise in the description of a getter method, the corresponding property is expected to be set by the application invoking the builder.
- Version:
- $Id: BuilderData.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_RESULT_WINDOWConstant for the key under which the result window is stored.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ActionStoregetActionStore()Returns a reference to the action store.BeanBuilderResultgetBeanBuilderResult()Returns the result of the bean builder.Collection<BeanCreationListener>getBeanCreationListeners()Returns a collection with objects to be registered asBeanCreationListenerat theBeanContextcreated during the builder operation.BindingStrategygetBindingStrategy()Returns theBindingStrategyto be used by the form.BuildergetBuilder()Returns a reference to theBuilderobject that generated the builder results.BeanContextgetBuilderContext()Returns the bean context that is used by the builder and the created components.StringgetBuilderName()Returns a name for the builder.CommandQueuegetCommandQueue()Returns a reference to the globalCommandQueueobject.ObjectgetDefaultResourceGroup()Returns the default resource group.ObjectgetFormBean()Returns the form bean.FormValidatorgetFormValidator()Returns theFormValidatorfor validating theFormobject.InvocationHelpergetInvocationHelper()Returns theInvocationHelperobject to be used during this builder operation.MessageOutputgetMessageOutput()Returns a reference to theMessageOutputobject to be used by the builder and dependent objects.BeanContextgetParentContext()Returns a reference to the parent bean context.WindowgetParentWindow()Returns the parent window.Map<String,Object>getProperties()Returns a map with properties that should be available during the builder operation.BeanStoregetRootStore()Returns the root store created during the builder operation.TransformerContextgetTransformerContext()Returns the transformer context to be used by the builder.booleanisAutoRelease()Returns the auto release flag.booleanisMenuIcon()Returns the value of the menu icon flag.booleanisToolbarText()Returns the value of the toolbar text flag.voidsetBeanBuilderResult(BeanBuilderResult res)Sets the result of the bean builder.voidsetBuilder(Builder bldr)Sets a reference to theBuilderthat performs this builder operation.voidsetBuilderContext(BeanContext ctx)Sets the bean context used during the builder operation.
-
-
-
Field Detail
-
KEY_RESULT_WINDOW
static final String KEY_RESULT_WINDOW
Constant for the key under which the result window is stored.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultResourceGroup
Object getDefaultResourceGroup()
Returns the default resource group. This property is used for i18n support. If builder scripts contain only resource IDs without a corresponding group definition, this default group will be used.- Returns:
- the default resource group
-
getTransformerContext
TransformerContext getTransformerContext()
Returns the transformer context to be used by the builder. This context contains some important data required for resolving resources and for validators and transformers.- Returns:
- the transformer context
-
getActionStore
ActionStore getActionStore()
Returns a reference to the action store. Actions defined during the builder process will be stored here.- Returns:
- the action store
-
getMessageOutput
MessageOutput getMessageOutput()
Returns a reference to theMessageOutputobject to be used by the builder and dependent objects. Components that need to output messages to the user can make use of this object.- Returns:
- the
MessageOutputobject
-
getCommandQueue
CommandQueue getCommandQueue()
Returns a reference to the globalCommandQueueobject. This object can be used by the builder (or objects created by the builder) if commands have to be issued.- Returns:
- the
CommandQueue
-
getBuilderName
String getBuilderName()
Returns a name for the builder. The name returned by this method is evaluated by most of the tags defined by this library. It can be tested using the standardifNameandunlessNameattributes. This is a very easy means for supporting conditional execution of builder scripts. Per default no builder name is set.- Returns:
- a name for the builder
-
isMenuIcon
boolean isMenuIcon()
Returns the value of the menu icon flag. This is a hint for the builder that indicates whether menu items should have icons (if defined and supported by the platform).- Returns:
- the menu icon flag
-
isToolbarText
boolean isToolbarText()
Returns the value of the toolbar text flag. This is a hint for the builder that indicates whether toolbar buttons should have texts.- Returns:
- the toolbar text flag
-
getFormBean
Object getFormBean()
Returns the form bean. This is a data object that will be used to initialize the input components defined in the GUI and for later storing the current values.- Returns:
- the form bean
-
getBindingStrategy
BindingStrategy getBindingStrategy()
Returns theBindingStrategyto be used by the form. TheBindingStrategymust be compatible with the model object used as form bean, i.e. it determines the type of model objects that can be used.- Returns:
- the
BindingStrategyfor theForm - See Also:
getFormBean()
-
getFormValidator
FormValidator getFormValidator()
Returns theFormValidatorfor validating theFormobject. This property is optional. If aFormValidatoris defined, input validation on the form-level is performed before the data is stored in the model object.- Returns:
- the
FormValidator
-
getParentWindow
Window getParentWindow()
Returns the parent window. This information is needed if a (child) window is to be created.- Returns:
- the parent window
-
getParentContext
BeanContext getParentContext()
Returns a reference to the parent bean context. This object - and especially the defaultBeanStoreset for the context - provides access to the global bean definitions. These can be accessed during the builder operation.- Returns:
- the parent bean context
-
getBeanCreationListeners
Collection<BeanCreationListener> getBeanCreationListeners()
Returns a collection with objects to be registered asBeanCreationListenerat theBeanContextcreated during the builder operation. The objects contained in this collection are added before the builder operation actually starts as listeners at theBeanContextthat can be queried through thegetBuilderContext()method. These listeners are triggered immediately for newly created beans, even if beans are created during the builder operation. This is an optional property; an implementation can return null if there are no listeners to register.- Returns:
- a collection with the
BeanCreationListenerobjects to be registered at theBeanContextcreated by the builder
-
getProperties
Map<String,Object> getProperties()
Returns a map with properties that should be available during the builder operation. An application can use this map to pass in data objects that should be accessible by tags in builder scripts. While executing a builder script access to all beans in the parentBeanStoreis possible. However, sometimes additional objects need to be passed to the builder, for instance model objects for lists, tables, or tree views. These additional objects can be passed through the map returned by this method. This is more convenient than adding objects to the parentBeanStoreonly for this purpose. TheBuilderimplementation evaluates this map and ensures that its content is made available during the execution of the builder script. An implementation is allowed to return null if there are no additional properties.- Returns:
- a map with additional properties for the builder operation
-
getBuilderContext
BeanContext getBuilderContext()
Returns the bean context that is used by the builder and the created components. This property is initialized by the builder. From the context returned by this method access to all objects created during the builder operation is possible.- Returns:
- the bean context of the current builder operation
-
setBuilderContext
void setBuilderContext(BeanContext ctx)
Sets the bean context used during the builder operation. This method is called by the builder.- Parameters:
ctx- the new bean context used during the builder operation
-
getBeanBuilderResult
BeanBuilderResult getBeanBuilderResult()
Returns the result of the bean builder. This object contains theobjects created during the build. From here access to the components created during the builder operation is possible. This property is initialized by the builder.BeanStore- Returns:
- the object with the results of the bean builder
-
setBeanBuilderResult
void setBeanBuilderResult(BeanBuilderResult res)
Sets the result of the bean builder. This method is called by the builder for passing this result object to the caller.- Parameters:
res- the result object of the bean builder
-
getRootStore
BeanStore getRootStore()
Returns the root store created during the builder operation. This is a convenience method for callers to directly access the populated bean store. (Access to this object is also possible through theBeanBuilderResultobject.- Returns:
- the root store of the builder operation
- See Also:
getBeanBuilderResult()
-
getInvocationHelper
InvocationHelper getInvocationHelper()
Returns theInvocationHelperobject to be used during this builder operation. This object is used for reflection operation and data type conversions. If noInvocationHelperis provided, a default one is used by the builder. In most cases the default invocation helper will be sufficient. It is initialized in a way that it can access converters defined for the parent bean stores. If there are specific requirements related to converters, a custom object can be returned here.- Returns:
- the
InvocationHelperto be used
-
isAutoRelease
boolean isAutoRelease()
Returns the auto release flag. If this flag is set to true, at the main window produced by the builder operation a specialized window listener will be registered. When the window is closed this listener ensures that the builder'sBuilder.release(BuilderData)method is invoked. This is a very convenient way to automatically free resources obtained during the builder operation and used by the UI. Note that this flag is only evaluated if a window is produced by the builder operation. If the flag is set to false or if no window is generated by the builder operation, the caller is responsible for releasing the results of the builder. This can be done by passing this object to the builder'srelease()method. (A reference to the builder is also stored in thebuilderproperty.)- Returns:
- the auto release flag
-
getBuilder
Builder getBuilder()
Returns a reference to theBuilderobject that generated the builder results. This property is set by the builder.- Returns:
- a reference to the the
Builderused
-
setBuilder
void setBuilder(Builder bldr)
Sets a reference to theBuilderthat performs this builder operation. This method is called by the builder at the beginning of a builder operation. Having a reference to theBuilderin theBuilderDataobject can be convenient, especially when the object is to be released.- Parameters:
bldr- theBuilderperforming the builder operation
-
-