public interface Builder
The main builder interface.
A builder is an object that can produce artifacts of the GUI from builder scripts. So the GUI is no longer constructed in the application's code, but can be defined in external resources, which are easier to maintain. This also allows for dynamic GUIs, e.g. when different builder scripts are processed based on some condition or even when builder scripts are generated at runtime.
The builder interface itself is not too complex. There is one very generic
build()
method that can be used to build arbitrary GUI
elements. Then there are a few convenience methods that are suitable for
specific elements like windows.
Modifier and Type | Method and Description |
---|---|
void |
build(Locator script,
BuilderData data)
A generic builder method.
|
void |
buildContainer(Locator script,
BuilderData data,
Object container)
A convenience method for constructing the GUI of the given passed in
container.
|
Window |
buildWindow(Locator script,
BuilderData data)
A convenience method for building windows like top-level frames or
dialogs.
|
void |
release(BuilderData data)
Releases the specified
BuilderData object. |
void build(Locator script, BuilderData data) throws BuilderException
BuilderData#getProperty(String)
method with
appropriate keys.script
- the script to be executeddata
- the parameter objectBuilderException
- if an error occursWindow buildWindow(Locator script, BuilderData data) throws BuilderException
build()
method, but directly returns the resulting window object.script
- the script to be executeddata
- the parameter objectBuilderException
- if an error occursvoid buildContainer(Locator script, BuilderData data, Object container) throws BuilderException
script
- the script to be executeddata
- the parameter objectcontainer
- the container to be filled with componentsBuilderException
- if an error occursvoid release(BuilderData data)
BuilderData
object. This will free all
resources associated with this data object. Especially the BeanContext
created by the Builder
will be closed, and on all
BeanProvider
objects found in the BeanStore
s that are
part of the BeanBuilderResult
the shutdown()
method is
invoked. Clients of the builder should call this method when the results
of a builder operation are no more needed, e.g. when closing a window
created by a builder.data
- the BuilderData
object used for a builder operation
(must not be null)IllegalArgumentException
- if the passed in object is null
or invalidCopyright © 2016 The JGUIraffe Team. All rights reserved.