Package net.sf.jguiraffe.gui.builder
Schnittstelle Builder
- Alle bekannten Implementierungsklassen:
JellyBuilder
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.
- Version:
- $Id: Builder.java 205 2012-01-29 18:29:57Z oheger $
- Autor:
- Oliver Heger
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidbuild(Locator script, BuilderData data) A generic builder method.voidbuildContainer(Locator script, BuilderData data, Object container) A convenience method for constructing the GUI of the given passed in container.buildWindow(Locator script, BuilderData data) A convenience method for building windows like top-level frames or dialogs.voidrelease(BuilderData data) Releases the specifiedBuilderDataobject.
-
Methodendetails
-
build
A generic builder method. This method initializes the builder with the passed in parameter object and then executes the given builder script. Results of the builder operation are stored in the parameter object, from which they can be obtained using themethod with appropriate keys.Ungültige Referenz
BuilderData#getProperty(String)- Parameter:
script- the script to be executeddata- the parameter object- Löst aus:
BuilderException- if an error occurs
-
buildWindow
A convenience method for building windows like top-level frames or dialogs. This method behaves similar to the genericbuild()method, but directly returns the resulting window object.- Parameter:
script- the script to be executeddata- the parameter object- Gibt zurück:
- the result window of the builder operation
- Löst aus:
BuilderException- if an error occurs
-
buildContainer
A convenience method for constructing the GUI of the given passed in container. This method is useful if an application already has a reference to an (empty) window or panel, which now should be filled. It sets the container as the builder's root container and then invokes the specified script.- Parameter:
script- the script to be executeddata- the parameter objectcontainer- the container to be filled with components- Löst aus:
BuilderException- if an error occurs
-
release
Releases the specifiedBuilderDataobject. This will free all resources associated with this data object. Especially theBeanContextcreated by theBuilderwill be closed, and on allBeanProviderobjects found in theBeanStores that are part of theBeanBuilderResulttheshutdown()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.- Parameter:
data- theBuilderDataobject used for a builder operation (must not be null)- Löst aus:
IllegalArgumentException- if the passed in object is null or invalid
-