JavaGantt 2011.1 API

eu.beesoft.gaia.swing.builder
Class SwingBuilderFactory

java.lang.Object
  extended by eu.beesoft.gaia.util.ObjectBuilderFactory
      extended by eu.beesoft.gaia.swing.builder.SwingBuilderFactory

public class SwingBuilderFactory
extends ObjectBuilderFactory

The builder factory dedicated to create Swing related builders and objects. See documentation to ObjectBuilderFactory for explanation how builder factory and builders work.

This class supports resource bundles and has methods to obtain builders to create list models and "form" actions.

It creates relationships between some tags and builders, that are implemented in package eu.beesoft.gaia.swing.builder. The tags complies with standard Swing class names. Here is the list of accepted tags and prepared builders:

Of course, you can freely complete another {tag : builder} pairs or change the existing - by calling ObjectBuilderFactory.registerBuilderClass(String, Class) method.


Constructor Summary
SwingBuilderFactory()
          Create a new instance of the swing builder factory.
 
Method Summary
 java.util.List<SwingBuilder<javax.swing.Action>> getActionBuilders(SwingBuilder<?> builder)
          Returns a collection of all SwingBuilder instances that are creating an javax.swing.Action instances under the given builder.
 java.util.List<javax.swing.Action> getActions(SwingBuilder<?> builder)
          Returns a collection of all javax.swing.Action instances created by builders under the given builder.
 java.util.List<ListModelBuilder> getListModelBuilders()
          Returns a collection of all instances of ListModelBuilder created by this factory.
 java.util.List<ListModelBuilder> getListModelBuilders(SwingBuilder<?> builder)
          Returns a collection of all instances of ListModelBuilder created by this factory under the given builder.
 java.lang.String getPropertyFromResourceBundle(java.lang.String objectId, java.lang.String objectProperty)
          Combines given objectId and objectProperty to key to the resource bundle and returns value from it.
 java.lang.String getResourceBundle()
          Returns resource bundle bound to this factory.
 void setResourceBundle(java.lang.String resourceBundle)
          Sets resource bundle for this factory.
 
Methods inherited from class eu.beesoft.gaia.util.ObjectBuilderFactory
build, getBuilder, getBuilderByIdMap, getBuilderByTagMap, getRootBuilder, registerBuilderClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingBuilderFactory

public SwingBuilderFactory()
Create a new instance of the swing builder factory. Creates relationships element tags and builders (see comment to this class).

Method Detail

getResourceBundle

public java.lang.String getResourceBundle()
Returns resource bundle bound to this factory.

Returns:
the resource bundle

setResourceBundle

public void setResourceBundle(java.lang.String resourceBundle)
Sets resource bundle for this factory.

Parameters:
resourceBundle - - the resourceBundle to set

getPropertyFromResourceBundle

public java.lang.String getPropertyFromResourceBundle(java.lang.String objectId,
                                                      java.lang.String objectProperty)
Combines given objectId and objectProperty to key to the resource bundle and returns value from it. It returns null if both given arguments are null or no resource bundle was set with method setResourceBundle(String). This method is invoked from SwingBuilder.getPropertyFromResourceBundle(String) and objectId is the builder id property in this case.

Parameters:
objectId - - first part of the key in resource bundle
objectProperty - - last part of the key in resource bundle
Returns:
localized string from resource bundle or null if cannot be obtained

getActions

public java.util.List<javax.swing.Action> getActions(SwingBuilder<?> builder)
Returns a collection of all javax.swing.Action instances created by builders under the given builder. From this lookup are excluded all builders and their children that produce instances of javax.swing.AbstractButton and javax.swing.JPopupMenu.

Parameters:
builder - - a root builder for the action lookup
Returns:
a list of instances of javax.swing.Action

getActionBuilders

public java.util.List<SwingBuilder<javax.swing.Action>> getActionBuilders(SwingBuilder<?> builder)
Returns a collection of all SwingBuilder instances that are creating an javax.swing.Action instances under the given builder.

Parameters:
builder - - a root builder for the action builders lookup
Returns:
a list of instances of SwingBuilder<Action>

getListModelBuilders

public java.util.List<ListModelBuilder> getListModelBuilders()
Returns a collection of all instances of ListModelBuilder created by this factory.

Returns:
a list of instances of ListModelBuilder

getListModelBuilders

public java.util.List<ListModelBuilder> getListModelBuilders(SwingBuilder<?> builder)
Returns a collection of all instances of ListModelBuilder created by this factory under the given builder.

Parameters:
builder - - a root builder for the list model builders lookup
Returns:
a list of instances of ListModelBuilder

JavaGantt 2011.1 API