de.kleopatra.forms.view.builder
Class FormWriter

java.lang.Object
  extended byde.kleopatra.forms.view.builder.FormWriter

Deprecated. replaced by FormLoader/ExtFormLoader (v073, 2003/10/24)

public class FormWriter
extends java.lang.Object

FormWriter responsible for building/filling of containers.

Does use a FormIO to do the actual reading/writing. Does use the shared FormIO from FormFactory if none is set explicitely.

Resources given by name are searched relative to a given class (can be null) as implemented in ResourceManager. Resources given by filepaths are interpreted as absolute file locations.

Version:
$Revision: 1.2 $ $Date: 2004/09/30 10:18:21 $
Author:
(C) 2003 Jeanette Winzenburg, Berlin

Constructor Summary
FormWriter()
          Deprecated.  
 
Method Summary
 java.awt.Container buildCompleteForm(LayoutDescription description, UIFactory factory, boolean customizePlaceHolders)
          Deprecated. experimental: create form from given description and factory, auto-replace placeHolders one level deep.
 java.awt.Container buildCompleteForm(java.lang.String filename, boolean customize)
          Deprecated. experimental: Create container from filename and auto-replace placeholders one level deep.
 java.awt.Container buildCompleteForm(java.lang.String descriptionName, java.lang.Class targetClass, boolean customize)
          Deprecated. experimental: Create container from resource and auto-replace placeholders one level deep.
 java.awt.Container buildForm(java.awt.Container container, LayoutDescription description, UIFactory factory)
          Deprecated. Fill a given Container with children created by the specified UIFactory and LayoutDescription.
protected  java.awt.Container buildForm(FormDescription formDescription, boolean customize)
          Deprecated.  
 java.awt.Container buildForm(LayoutDescription description)
          Deprecated. create default container using the shared UIFactory and fill with children created by the shared UIFactory and LayoutDescription.
 java.awt.Container buildForm(LayoutDescription description, UIFactory factory)
          Deprecated. create default container using the specified UIFactory and fill with children created by the uiFactory and LayoutDescription.
 java.awt.Container buildForm(java.lang.String filename, boolean customize)
          Deprecated. create, fill and customize a form from a resource located in the filesystem.
 java.awt.Container buildForm(java.lang.String descriptionName, java.lang.Class targetClass, boolean customize)
          Deprecated. Create container from resource as found by ResourceManager and customize if requested.
 java.awt.Container buildFromTemplate(java.lang.String resourceName, java.lang.Class targetClass, java.util.Collection components)
          Deprecated. experimental: use the resource as template, replacing the created widgets with those in the collection.
protected  java.awt.Container createDefaultContainer(UIFactory factory)
          Deprecated.  
protected  java.awt.Container createForm(UIFactory factory)
          Deprecated.  
protected  java.util.List createList()
          Deprecated.  
protected  java.util.Map createMap()
          Deprecated.  
 void customizeActions(java.util.List actions, java.lang.String resourceName, java.lang.Class targetClass)
          Deprecated. customize a list of actions from a resource.
protected  FormIO getFormIO()
          Deprecated. returns the used formIO.
protected  UIBuilder getUIBuilder()
          Deprecated.  
protected  UIFactory getUIFactory()
          Deprecated.  
 void rebuildForm(java.awt.Container container)
          Deprecated. unreliably in finding resources - needs targetClass
 void rebuildForm(java.awt.Container container, java.lang.Class targetClass)
          Deprecated. re-arrange the contents of a container from a resource defined by the containers name from a resource location relative to targetclass without customizing the contents.
 void rebuildForm(java.awt.Container container, java.lang.Class targetClass, boolean customize)
          Deprecated. re-arrange the contents of a container according to a resource as defined by the container's name, found relative to some targetclass and optionally customize.
 void rebuildForm(java.awt.Container container, LayoutDescription description)
          Deprecated. re-arrange the contents of a container according to the layoutDescription.
 void replaceComponent(java.awt.Container container, java.lang.Class targetClass, java.awt.Component replacingComponent)
          Deprecated. replace a child of container with newComponent using the layoutDescription of container - as given by the resource with the container's name.
 void replaceComponents(java.awt.Container container, java.lang.Class targetClass, java.util.Collection replacingComponents)
          Deprecated. replace a collection of children in container with a collection of new component using the layoutDescription of container - as given by the resource with the container's name.
 void setFormIO(FormIO io)
          Deprecated. set a custom formIO to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormWriter

public FormWriter()
Deprecated. 
Method Detail

setFormIO

public void setFormIO(FormIO io)
Deprecated. 
set a custom formIO to use.

if null the writer uses the shared FormIO as returned by FormFactory.


buildForm

public java.awt.Container buildForm(LayoutDescription description)
Deprecated. 
create default container using the shared UIFactory and fill with children created by the shared UIFactory and LayoutDescription.


buildForm

public java.awt.Container buildForm(LayoutDescription description,
                                    UIFactory factory)
Deprecated. 
create default container using the specified UIFactory and fill with children created by the uiFactory and LayoutDescription.

Parameters:
description - - the LayoutDescription to use.
factory - -factory to use.
Returns:
created and filled container.

buildForm

public java.awt.Container buildForm(java.awt.Container container,
                                    LayoutDescription description,
                                    UIFactory factory)
Deprecated. 
Fill a given Container with children created by the specified UIFactory and LayoutDescription.

NOTE: any children the container might have are removed.

Parameters:
container - the Container which should be filled with the given layout
description - - the LayoutDescription to use.
factory - -factory to use.
Returns:
the given container re-filled with newly created children.

rebuildForm

public void rebuildForm(java.awt.Container container,
                        LayoutDescription description)
Deprecated. 
re-arrange the contents of a container according to the layoutDescription.

To work as expected all children of the container need to be named (interpreted as componentID) and match the id of the constraints in the description.

CHECK: used where? probably replaced by replaceComponents?

Parameters:
container - - container whose contents needs to be re-arranged
description - - the layoutDescription to use.

buildForm

public java.awt.Container buildForm(java.lang.String descriptionName,
                                    java.lang.Class targetClass,
                                    boolean customize)
Deprecated. 
Create container from resource as found by ResourceManager and customize if requested. uses the shared uifactory.

Parameters:
descriptionName - - id of the FormDescription.
targetClass - - used to find relative resource locations.
customize - - customizes content if true.
Returns:
created, filled and (optionally) customized container.

rebuildForm

public void rebuildForm(java.awt.Container container)
Deprecated. unreliably in finding resources - needs targetClass

re-arrange the contents of a container from a resource defined by the containers name from the shared resource location without customizing the contents.

Parameters:
container - - the container to re-arrange.

rebuildForm

public void rebuildForm(java.awt.Container container,
                        java.lang.Class targetClass)
Deprecated. 
re-arrange the contents of a container from a resource defined by the containers name from a resource location relative to targetclass without customizing the contents.

Parameters:
container - - the container to re-arrange.
targetClass -

rebuildForm

public void rebuildForm(java.awt.Container container,
                        java.lang.Class targetClass,
                        boolean customize)
Deprecated. 
re-arrange the contents of a container according to a resource as defined by the container's name, found relative to some targetclass and optionally customize.

To work as expected all children of the container need to be named (interpreted as componentID) and match the id of the constraints in the description.

Parameters:
container - - container whose contents needs to be re-arranged
targetClass - - to find a relative resource location.
customize - - customize the content if true.

buildForm

public java.awt.Container buildForm(java.lang.String filename,
                                    boolean customize)
Deprecated. 
create, fill and customize a form from a resource located in the filesystem.

PENDING: where to look for the relative resources in Presentation? Client responsible for setting userResourceDir?

Parameters:
filename - - absolute path to resource file
customize - - customizes content if true.
Returns:
created, filled and (optionally) custiomized container.

customizeActions

public void customizeActions(java.util.List actions,
                             java.lang.String resourceName,
                             java.lang.Class targetClass)
Deprecated. 
customize a list of actions from a resource.

NOTE: this couples implicitely into Swing if used.

Parameters:
actions -
resourceName -
targetClass -

buildCompleteForm

public java.awt.Container buildCompleteForm(LayoutDescription description,
                                            UIFactory factory,
                                            boolean customizePlaceHolders)
Deprecated. 
experimental: create form from given description and factory, auto-replace placeHolders one level deep. Customize replacingComponents depending on customizePlaceHolders.

assumes the placeholder resources to be in ResourceManager.getUserResourceDir(). It's the client's responsibility to set the userResourceDir if needed.

PENDING: check which location has precedence!

Parameters:
description -
factory -
customizePlaceHolders -
Returns:

buildCompleteForm

public java.awt.Container buildCompleteForm(java.lang.String descriptionName,
                                            java.lang.Class targetClass,
                                            boolean customize)
Deprecated. 
experimental: Create container from resource and auto-replace placeholders one level deep.

The methods asssumes that the components (constraints) that should be replaced are of generic type "PlaceHolder" and that their name is the id of the resource they should be replaced with.

Parameters:
descriptionName -
targetClass -
customize -
Returns:

buildCompleteForm

public java.awt.Container buildCompleteForm(java.lang.String filename,
                                            boolean customize)
Deprecated. 
experimental: Create container from filename and auto-replace placeholders one level deep.

The methods asssumes that the components (constraints) that should be replaced are of generic type "PlaceHolder" and that their name is the id of the resource they should be replaced with. The resources are assumed to be in the same directory as the parent.

PENDING: where to look for the relative resources in Presentation? Client responsible for setting userResourceDir?

Parameters:
filename -
customize -
Returns:

replaceComponent

public void replaceComponent(java.awt.Container container,
                             java.lang.Class targetClass,
                             java.awt.Component replacingComponent)
Deprecated. 
replace a child of container with newComponent using the layoutDescription of container - as given by the resource with the container's name.

The replaced component is the child with the same name as the name of newComponent.

Parameters:
container -
targetClass -
replacingComponent -

replaceComponents

public void replaceComponents(java.awt.Container container,
                              java.lang.Class targetClass,
                              java.util.Collection replacingComponents)
Deprecated. 
replace a collection of children in container with a collection of new component using the layoutDescription of container - as given by the resource with the container's name.

The replaced components are the children with the same names as the names of components in the list.

Parameters:
container -
targetClass - to find a formDescription relative to a classpath if needed
replacingComponents - collection of replacing components

buildFromTemplate

public java.awt.Container buildFromTemplate(java.lang.String resourceName,
                                            java.lang.Class targetClass,
                                            java.util.Collection components)
Deprecated. 
experimental: use the resource as template, replacing the created widgets with those in the collection.


buildForm

protected java.awt.Container buildForm(FormDescription formDescription,
                                       boolean customize)
Deprecated. 

getUIBuilder

protected UIBuilder getUIBuilder()
Deprecated. 

createDefaultContainer

protected java.awt.Container createDefaultContainer(UIFactory factory)
Deprecated. 

createForm

protected java.awt.Container createForm(UIFactory factory)
Deprecated. 

getUIFactory

protected UIFactory getUIFactory()
Deprecated. 

getFormIO

protected FormIO getFormIO()
Deprecated. 
returns the used formIO.

Returns:
the custom formIO if set or the shared default from FormFactory.

createList

protected java.util.List createList()
Deprecated. 

createMap

protected java.util.Map createMap()
Deprecated. 


Copyright © 2003, 2004 SwingEmpire Jeanette Winzenburg. All Rights Reserved.