com.abstractics.xmlpanel.swing
Class XmlPanel.XmlPanelComponentCreator

java.lang.Object
  extended bycom.abstractics.xmlpanel.swing.XmlPanel.XmlPanelComponentCreator
All Implemented Interfaces:
ComponentCreator
Enclosing class:
XmlPanel

public static class XmlPanel.XmlPanelComponentCreator
extends java.lang.Object
implements ComponentCreator

ComponentCreator that creates XmlPanels. Used to create both the inital and child panels


Constructor Summary
XmlPanel.XmlPanelComponentCreator()
           
 
Method Summary
 java.awt.Component createComponent(org.w3c.dom.Element element, XmlPanel panel)
          Given an element representing a cell in an XMLPanel, this method should construct the appropriate Component for the type that this component is looking for, setting all of the properties necessary.
The XmlPanel is given in case it is needed to determine properties of the component.
 java.lang.String[] getComponentTypes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlPanel.XmlPanelComponentCreator

public XmlPanel.XmlPanelComponentCreator()
Method Detail

getComponentTypes

public java.lang.String[] getComponentTypes()
Specified by:
getComponentTypes in interface ComponentCreator
Returns:
Return the type name(s) that this XmlPanelComponentCreator is known by. When cell tags are found with a type attribute that matches one of these values (case-insensitive), then this component creator will be used
See Also:
ComponentCreator.getComponentTypes()

createComponent

public java.awt.Component createComponent(org.w3c.dom.Element element,
                                          XmlPanel panel)
Description copied from interface: ComponentCreator
Given an element representing a cell in an XMLPanel, this method should construct the appropriate Component for the type that this component is looking for, setting all of the properties necessary.
The XmlPanel is given in case it is needed to determine properties of the component. Implementors should also consider using the XmlPanel to see if there is already a component with the same type and name in the panel, and use that component, instead of creating a new one. This will help with components retaining the properties they have set in code when runtime editing occurs.

Specified by:
createComponent in interface ComponentCreator
Parameters:
element - XML element to parse through
panel - The XmlPanel that this component is being placed into - for reference only!. This method should not mutate the panel in any way. It is also possible that this parameter could be null, so always check first.
Returns:
The resulting java.awt.Component
See Also:
andrewtest.componentcreator.ComponentCreator#createComponent(org.w3c.dom.Element, andrewtest.XmlPanel)