net.sf.jguiraffe.gui.builder.window
Class WindowBuilderData

java.lang.Object
  extended by net.sf.jguiraffe.gui.builder.window.WindowBuilderData
All Implemented Interfaces:
SimpleBeanStoreImpl.BeanContributor

public class WindowBuilderData
extends java.lang.Object
implements SimpleBeanStoreImpl.BeanContributor

A data class that stores important information needed during a window builder process.

An instance of this class lives in the Jelly context during execution of a Jelly script that makes use of the window builder library. It contains parameters required by tag handler classes, e.g. the window manager to use. It will also store the results of the builder operation.

Some objects managed by this class are available to the dependency injection framework (they can be obtained through the BeanContext of the active builder). These are the following:

Version:
$Id: WindowBuilderData.java 156 2009-03-03 21:04:47Z oheger $
Author:
Oliver Heger

Field Summary
static java.lang.String KEY_CURRENT_WINDOW
          Constant for the key, under which the current result window can be obtained from the builder's bean context.
static java.lang.String KEY_FORM_BEAN
          Constant for the key, under which the current form bean can be obtained from the builder's bean context.
static java.lang.String KEY_PARENT_WINDOW
          Constant for the key, under which the parent window can be obtained from the builder's bean context.
static java.lang.String KEY_WINDOW_BUILDER_DATA
          Constant for the key, under which the instance of this class can be obtained from the builder's bean context.
 
Constructor Summary
WindowBuilderData()
           
 
Method Summary
 void beanNames(java.util.Set<java.lang.String> names)
          Obtains the names of the supported beans.
static WindowBuilderData get(org.apache.commons.jelly.JellyContext context)
          Returns the instance of this class stored in the specified Jelly context.
 java.lang.Object getBean(java.lang.String name)
          Returns the bean with the specified name.
 java.lang.Object getFormBean()
          Returns the form bean.
 Window getParentWindow()
          Returns the parent window of the new window.
 Window getResultWindow()
          Returns the result window of the builder process.
 WindowManager getWindowManager()
          Returns the window manager.
 void initBeanStore(SimpleBeanStoreImpl store)
          Initializes the specified bean store.
 void put(org.apache.commons.jelly.JellyContext ctx)
          Stores this instance in the specified Jelly context.
 void setFormBean(java.lang.Object formBean)
          Sets the form bean.
 void setParentWindow(Window parentWindow)
          Sets the parent window.
 void setResultWindow(Window resultWindow)
          Sets the result window.
 void setWindowManager(WindowManager windowManager)
          Sets the window manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_CURRENT_WINDOW

public static final java.lang.String KEY_CURRENT_WINDOW
Constant for the key, under which the current result window can be obtained from the builder's bean context.

See Also:
Constant Field Values

KEY_PARENT_WINDOW

public static final java.lang.String KEY_PARENT_WINDOW
Constant for the key, under which the parent window can be obtained from the builder's bean context.

See Also:
Constant Field Values

KEY_FORM_BEAN

public static final java.lang.String KEY_FORM_BEAN
Constant for the key, under which the current form bean can be obtained from the builder's bean context.

See Also:
Constant Field Values

KEY_WINDOW_BUILDER_DATA

public static final java.lang.String KEY_WINDOW_BUILDER_DATA
Constant for the key, under which the instance of this class can be obtained from the builder's bean context.

See Also:
Constant Field Values
Constructor Detail

WindowBuilderData

public WindowBuilderData()
Method Detail

getFormBean

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

Returns:
the form bean

setFormBean

public void setFormBean(java.lang.Object formBean)
Sets the form bean. This information will be processed by form controllers that can use it to initialize forms and store user input.

Parameters:
formBean - the form bean

getParentWindow

public Window getParentWindow()
Returns the parent window of the new window.

Returns:
the parent window

setParentWindow

public void setParentWindow(Window parentWindow)
Sets the parent window. The newly created window will be a child of this window. For top level windows this property should be null.

Parameters:
parentWindow - the parent window

getResultWindow

public Window getResultWindow()
Returns the result window of the builder process.

Returns:
the result window

setResultWindow

public void setResultWindow(Window resultWindow)
Sets the result window. Used by window creating tag handler classes to store their results.

Parameters:
resultWindow - the result window

getWindowManager

public WindowManager getWindowManager()
Returns the window manager.

Returns:
the window manager

setWindowManager

public void setWindowManager(WindowManager windowManager)
Sets the window manager. Here the platform specific window manager must be set, which will be used for creating windows.

Parameters:
windowManager - the window manager to use

beanNames

public void beanNames(java.util.Set<java.lang.String> names)
Obtains the names of the supported beans.

Specified by:
beanNames in interface SimpleBeanStoreImpl.BeanContributor
Parameters:
names - a set in which to store the bean names

getBean

public java.lang.Object getBean(java.lang.String name)
Returns the bean with the specified name. This implementation supports a few objects that are managed by this object.

Specified by:
getBean in interface SimpleBeanStoreImpl.BeanContributor
Parameters:
name - the name of the desired bean
Returns:
the bean with this name or null if it cannot be found

initBeanStore

public void initBeanStore(SimpleBeanStoreImpl store)
Initializes the specified bean store. This implementation adds the static object references to the store and registers this object as bean contributor.

Parameters:
store - the store to be initialized

put

public void put(org.apache.commons.jelly.JellyContext ctx)
Stores this instance in the specified Jelly context.

Parameters:
ctx - the context (must not be null)
Throws:
java.lang.IllegalArgumentException - if the context is null

get

public static WindowBuilderData get(org.apache.commons.jelly.JellyContext context)
Returns the instance of this class stored in the specified Jelly context. If no instance can be found, null will be returned.

Parameters:
context - the Jelly context
Returns:
the instance found in this context


Copyright © 2009 The JGUIraffe Team. All Rights Reserved.