net.xoetrope.xui
Interface XComponentConstructor

All Known Implementing Classes:
SwingComponentFactory, SwtComponentFactory, XHtmlComponentFactory, XRegisteredComponentFactory

public interface XComponentConstructor

An interface for building components, used by and to extend componentFactory. This interface can be used to allow new component types to be instantiated by the component factory. Each instance of this interface should be registered with the component factory by calling the registerComponentFactory method. The registration is static so it does not matter what instance of the component factory is used.

Copyright (c) Xoetrope Ltd., 2002-2003

License: see license.txt

$Revision: 2.6 $


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
 

Method Detail

constructComponent

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. When a ScrollPane is addd it becomes the parent.

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

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.

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

void update()
Notify the component factories that some of their settings may have changed


setPackageName

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

Parameters:
defPackage - the default package name

getComponentAdapter

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

Parameters:
type - the name identifying the type