net.xoetrope.swt
Class SwtComponentFactory

java.lang.Object
  extended by net.xoetrope.swt.SwtComponentFactory
All Implemented Interfaces:
XComponentConstructor

public class SwtComponentFactory
extends java.lang.Object
implements XComponentConstructor

A factory for non-base Swing components such as trees, tables and split panes

Copyright: Copyright (c) Xoetrope Ltd., 2001-2004

$Revision: 2.7 $

License see license.txt


Field Summary
protected  XProject currentProject
           
 
Constructor Summary
SwtComponentFactory(XProject project)
          Create a new component factory
 
Method Summary
 java.lang.Object addElement(XComponentFactory cf, java.lang.String type, java.lang.String name, java.lang.String content, java.util.Hashtable attribs)
          A generic factory method for adding non component elements.
 java.lang.Object constructComponent(XComponentFactory cf, java.lang.String type, java.lang.String content)
          A generic factory for adding XComponents.
 ComponentAdapter getComponentAdapter(java.lang.String type)
          Get the component adapter for this type
 void setPackageName(java.lang.String defPackage)
          Set the package name for the factory's widgets.
 void update()
          Notify the component factories that some of their settings may have changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentProject

protected XProject currentProject
Constructor Detail

SwtComponentFactory

public SwtComponentFactory(XProject project)
Create a new component factory

Method Detail

constructComponent

public java.lang.Object constructComponent(XComponentFactory cf,
                                           java.lang.String type,
                                           java.lang.String content)
A generic factory for adding XComponents. The component is constructed, positioned and added to the parent panel if one exists. The component is named with a counter value to uniquely identify the control.

Specified by:
constructComponent in interface XComponentConstructor
Parameters:
cf - The calling component factory.
type - A name identifying the type of component to be created.
content - The component text/content.
Returns:
the new component.

addElement

public java.lang.Object addElement(XComponentFactory cf,
                                   java.lang.String type,
                                   java.lang.String name,
                                   java.lang.String content,
                                   java.util.Hashtable attribs)
A generic factory method for adding non component elements. The method can be useful in conjunction with the 'repeat' and 'include' keywords where a component may not have a one to one relationship with the XML element.

Specified by:
addElement in interface XComponentConstructor
Parameters:
cf - The calling component factory.
type - The object type.
name - A name identifying the element to be created.
content - The component text/content.
attribs - The element attributes if any.
Returns:
the new component.

update

public void update()
Notify the component factories that some of their settings may have changed. This factory does not yet use any startup properties or parameters

Specified by:
update in interface XComponentConstructor

setPackageName

public void setPackageName(java.lang.String defPackage)
Set the package name for the factory's widgets.

Specified by:
setPackageName in interface XComponentConstructor
Parameters:
defPackage - The default package name.

getComponentAdapter

public ComponentAdapter getComponentAdapter(java.lang.String type)
Get the component adapter for this type

Specified by:
getComponentAdapter in interface XComponentConstructor
Parameters:
type - The component type name.
Returns:
the ComponentAdapter.