01: package net.xoetrope.xui;
02:
03: import java.util.Hashtable;
04:
05: import java.awt.Component;
06:
07: /**
08: * An interface for building components, used by and to extend componentFactory.
09: * This interface can be used to allow new component types to be instantiated by
10: * the component factory. Each instance of this interface should be registered
11: * with the component factory by calling the registerComponentFactory method. The
12: * registration is static so it does not matter what instance of the component
13: * factory is used.
14: * <p>Copyright (c) Xoetrope Ltd., 2002-2003</p>
15: * <p>License: see license.txt</p>
16: * $Revision: 1.8 $
17: */
18: public interface XComponentConstructor {
19: /**
20: * A generic factory for adding XComponents. The component is constructed, positioned and
21: * added to the parent panel if one exists. The component is named with a counter value
22: * to uniquely identify the control.
23: * When a ScrollPane is addd it becomes the parent.
24: * @param cf the calling component factory
25: * @param type a constant identifying the type of component to be created
26: * @param content the component text/content
27: */
28: public Component constructComponent(XComponentFactory cf, int type,
29: String content);
30:
31: /**
32: * A generic factory for adding XComponents. The component is constructed, positioned and
33: * added to the parent panel if one exists. The component is named with a counter value
34: * to uniquely identify the control.
35: * When a ScrollPane is addd it becomes the parent.
36: * @param cf the calling component factory
37: * @param type a name identifying the type of component to be created
38: * @param content the component text/content
39: */
40: public Component constructComponent(XComponentFactory cf,
41: String type, String content);
42:
43: /**
44: * A generic factory method for adding non component elements.
45: * @param cf the calling component factory
46: * @param type the object type
47: * @param name a name identifying the element to be created
48: * @param content the component text/content
49: * @param attribs the element attributes if any
50: */
51: public Object addElement(XComponentFactory cf, String type,
52: String name, String content, Hashtable attribs);
53:
54: /**
55: * Notify the component factories that some of their settings may have changed
56: */
57: public void update();
58:
59: /**
60: * Set the package name for the factory's widgets.
61: */
62: public void setPackageName(String defPackage);
63: }
|