org.montsuqi.monsia.builders
Class WidgetBuilder

java.lang.Object
  extended by org.montsuqi.monsia.builders.WidgetBuilder
Direct Known Subclasses:
CheckButtonBuilder, ContainerBuilder, EntryBuilder, FileEntryBuilder, MenuItemBuilder, TextAreaBuilder

public class WidgetBuilder
extends java.lang.Object

Super class for all widget builders.

A widget builder is a class which provides methods to create instances of a specific class.


Field Summary
protected static Logger logger
           
 
Constructor Summary
WidgetBuilder()
           
 
Method Summary
(package private)  void buildChildren(Interface xml, java.awt.Container parent, WidgetInfo info)
           
(package private)  java.awt.Component buildSelf(Interface xml, java.awt.Container parent, WidgetInfo info)
          Instantiate a specific component.
static java.awt.Component buildWidget(Interface xml, WidgetInfo info, java.awt.Container parent)
          Builds a widget.
protected  void setCommonParameters(Interface xml, java.awt.Component widget, WidgetInfo info)
           
(package private)  void setProperties(Interface xml, java.awt.Container parent, java.awt.Component widget, java.util.Map properties)
           
protected  void setSignals(Interface xml, java.awt.Component widget, WidgetInfo info)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final Logger logger
Constructor Detail

WidgetBuilder

public WidgetBuilder()
Method Detail

buildWidget

public static java.awt.Component buildWidget(Interface xml,
                                             WidgetInfo info,
                                             java.awt.Container parent)

Builds a widget.

A widget is build in following steps:

  1. Build Self. Build the widget itself using the widget info and other stuff. This is performed by buildSelf method. Properties in widget info are set. Accelerators are set too.
  2. Build Children. Build children widgets in it. This is performed by buildChildren method. Basic procedure of building children is defined in ContainerBuilder widget builder.
  3. Names are assigned.
  4. Signals are set.

Parameters:
xml - glade interface definition.
info - widget info for the target widget.
parent - parent component of the target widget.
Returns:
a widget.

buildSelf

java.awt.Component buildSelf(Interface xml,
                             java.awt.Container parent,
                             WidgetInfo info)

Instantiate a specific component.

When one is created successfuly, properties are set and accelerators are assigned.

Parameters:
xml - glade screen definition.
parent - parent widget.
info - widget info.
Returns:
constructed widget.

buildChildren

void buildChildren(Interface xml,
                   java.awt.Container parent,
                   WidgetInfo info)

setCommonParameters

protected void setCommonParameters(Interface xml,
                                   java.awt.Component widget,
                                   WidgetInfo info)

setSignals

protected void setSignals(Interface xml,
                          java.awt.Component widget,
                          WidgetInfo info)

setProperties

void setProperties(Interface xml,
                   java.awt.Container parent,
                   java.awt.Component widget,
                   java.util.Map properties)