|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.abstractics.xmlpanel.swing.componentcreator.ComponentFactory
Singleton factory that can create Swing components from XML. The factory is
loaded with XmlPanelComponentCreator
objects that handle the
details of how the XML is converted into a component.
XmlPanelComponentCreator objects can be added to the factory at runtime via
the addXmlPanelComponentCreator
method.
The factory is preloaded with the following creators:
javax.swing.JLabel
javax.swing.JTextField
javax.swing.JButton
javax.swing.JTextArea
javax.swing.JRadioButton
javax.swing.JCheckBox
JScrollPaneCreator
com.abstractics.xmlpanel.swing.xmlpanel.XmlPanelComponentCreator
,
GenericClassComponentCreator
Constructor Summary | |
protected |
ComponentFactory()
Constructor left as protected for testing purposes, but in general, this class is a singleton and should be used via the getInstance() method. |
Method Summary | |
void |
addXmlPanelComponentCreator(ComponentCreator creator)
|
java.awt.Component |
createComponent(org.w3c.dom.Element element)
Calls the other createComponent method with a null XmlPanel parameter |
java.awt.Component |
createComponent(org.w3c.dom.Element element,
XmlPanel panel)
Gets the XmlPanelComponentCreator according to the "type" attribute specified in the element, then calls the createComponent method on the creator to generate the Component. |
static ComponentFactory |
getInstance()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected ComponentFactory()
getInstance()
Method Detail |
public static ComponentFactory getInstance()
public void addXmlPanelComponentCreator(ComponentCreator creator)
public java.awt.Component createComponent(org.w3c.dom.Element element, XmlPanel panel)
element
- XML element that is to represent the componentpanel
- The XmlPanel that this component is being placed into - for
reference only.
ComponentCreator#createComponent(Element)
public java.awt.Component createComponent(org.w3c.dom.Element element)
element
- XML element that is to represent the component
createComponent(Element, XmlPanel)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |