Interface BuilderData
-
- All Known Implementing Classes:
ApplicationBuilderData
public interface BuilderData
Definition 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
BeanStore
is 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 theComponentBuilderData
class.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 String
KEY_RESULT_WINDOW
Constant for the key under which the result window is stored.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ActionStore
getActionStore()
Returns a reference to the action store.BeanBuilderResult
getBeanBuilderResult()
Returns the result of the bean builder.Collection<BeanCreationListener>
getBeanCreationListeners()
Returns a collection with objects to be registered asBeanCreationListener
at theBeanContext
created during the builder operation.BindingStrategy
getBindingStrategy()
Returns theBindingStrategy
to be used by the form.Builder
getBuilder()
Returns a reference to theBuilder
object that generated the builder results.BeanContext
getBuilderContext()
Returns the bean context that is used by the builder and the created components.String
getBuilderName()
Returns a name for the builder.CommandQueue
getCommandQueue()
Returns a reference to the globalCommandQueue
object.Object
getDefaultResourceGroup()
Returns the default resource group.Object
getFormBean()
Returns the form bean.FormValidator
getFormValidator()
Returns theFormValidator
for validating theForm
object.InvocationHelper
getInvocationHelper()
Returns theInvocationHelper
object to be used during this builder operation.MessageOutput
getMessageOutput()
Returns a reference to theMessageOutput
object to be used by the builder and dependent objects.BeanContext
getParentContext()
Returns a reference to the parent bean context.Window
getParentWindow()
Returns the parent window.Map<String,Object>
getProperties()
Returns a map with properties that should be available during the builder operation.BeanStore
getRootStore()
Returns the root store created during the builder operation.TransformerContext
getTransformerContext()
Returns the transformer context to be used by the builder.boolean
isAutoRelease()
Returns the auto release flag.boolean
isMenuIcon()
Returns the value of the menu icon flag.boolean
isToolbarText()
Returns the value of the toolbar text flag.void
setBeanBuilderResult(BeanBuilderResult res)
Sets the result of the bean builder.void
setBuilder(Builder bldr)
Sets a reference to theBuilder
that performs this builder operation.void
setBuilderContext(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 theMessageOutput
object 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
MessageOutput
object
-
getCommandQueue
CommandQueue getCommandQueue()
Returns a reference to the globalCommandQueue
object. 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 standardifName
andunlessName
attributes. 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 theBindingStrategy
to be used by the form. TheBindingStrategy
must 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
BindingStrategy
for theForm
- See Also:
getFormBean()
-
getFormValidator
FormValidator getFormValidator()
Returns theFormValidator
for validating theForm
object. This property is optional. If aFormValidator
is 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 defaultBeanStore
set 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 asBeanCreationListener
at theBeanContext
created during the builder operation. The objects contained in this collection are added before the builder operation actually starts as listeners at theBeanContext
that 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
BeanCreationListener
objects to be registered at theBeanContext
created 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 parentBeanStore
is 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 parentBeanStore
only for this purpose. TheBuilder
implementation 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 the
objects 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 theBeanBuilderResult
object.- Returns:
- the root store of the builder operation
- See Also:
getBeanBuilderResult()
-
getInvocationHelper
InvocationHelper getInvocationHelper()
Returns theInvocationHelper
object to be used during this builder operation. This object is used for reflection operation and data type conversions. If noInvocationHelper
is 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
InvocationHelper
to 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 thebuilder
property.)- Returns:
- the auto release flag
-
getBuilder
Builder getBuilder()
Returns a reference to theBuilder
object that generated the builder results. This property is set by the builder.- Returns:
- a reference to the the
Builder
used
-
setBuilder
void setBuilder(Builder bldr)
Sets a reference to theBuilder
that performs this builder operation. This method is called by the builder at the beginning of a builder operation. Having a reference to theBuilder
in theBuilderData
object can be convenient, especially when the object is to be released.- Parameters:
bldr
- theBuilder
performing the builder operation
-
-