Package org.jpos.ui
Class UI
- java.lang.Object
-
- org.jpos.ui.UI
-
- All Implemented Interfaces:
UIFactory
,UIObjectFactory
- Direct Known Subclasses:
BSHUI
public class UI extends java.lang.Object implements UIFactory, UIObjectFactory
- See Also:
See src/examples/ui/* for usage details
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure()
configure this UI objectprotected void
configure(org.jdom2.Element ui)
javax.swing.JComponent
create(org.jdom2.Element e)
javax.swing.JComponent
create(UI ui, org.jdom2.Element e)
UI is itself a UIFactory.void
dispose()
dispose this UI objectprotected javax.swing.JComponent
doScript(javax.swing.JComponent component, org.jdom2.Element e)
java.lang.Object
get(java.lang.String id)
Log
getLog()
javax.swing.JFrame
getMainFrame()
java.util.Map
getRegistrar()
UI uses a map to hold references to its components ("id" attribute)boolean
isDestroyed()
java.lang.Object
newInstance(java.lang.String clazz)
UIObjectFactory implementation.void
reconfigure(java.lang.String elementName, java.lang.String panelName)
reconfigure can be used in order to re-configure components inside a container (i.e.void
setConfig(org.jdom2.Element config)
void
setLog(Log log)
protected void
setLookAndFeel(org.jdom2.Element ui)
void
setObjectFactory(UIObjectFactory objFactory)
Assigns an object factory use to create new object instances.protected void
warn(java.lang.Object obj)
protected void
warn(java.lang.Object obj, java.lang.Exception ex)
-
-
-
Method Detail
-
setObjectFactory
public void setObjectFactory(UIObjectFactory objFactory)
Assigns an object factory use to create new object instances. If no object factory is asigned, UI uses the default classloader- Parameters:
objFactory
- reference to an Object Factory
-
setConfig
public void setConfig(org.jdom2.Element config)
- Parameters:
config
- the Configuration element
-
getRegistrar
public java.util.Map getRegistrar()
UI uses a map to hold references to its components ("id" attribute)- Returns:
- UI component registrar
-
get
public java.lang.Object get(java.lang.String id)
- Parameters:
id
- Component id ("id" configuration attribute)- Returns:
- the Object or null
-
create
public javax.swing.JComponent create(UI ui, org.jdom2.Element e)
UI is itself a UIFactory. This strategy is used to recursively instantiate components inside a container
-
newInstance
public java.lang.Object newInstance(java.lang.String clazz) throws java.lang.Exception
UIObjectFactory implementation. uses default classloader- Specified by:
newInstance
in interfaceUIObjectFactory
- Parameters:
clazz
- the Clazzzz- Returns:
- the Object
- Throws:
java.lang.Exception
- if unable to instantiate- See Also:
setLog(org.jpos.util.Log)
-
configure
public void configure() throws org.jdom2.JDOMException
configure this UI object- Throws:
org.jdom2.JDOMException
-
reconfigure
public void reconfigure(java.lang.String elementName, java.lang.String panelName)
reconfigure can be used in order to re-configure components inside a container (i.e. changing a panel in response to an event).- Parameters:
elementName
- the element name used as new configurationpanelName
- panel ID (see "id" attribute)- See Also:
Redirect
-
dispose
public void dispose()
dispose this UI object
-
isDestroyed
public boolean isDestroyed()
- Returns:
- true if this UI object has been disposed and is no longer valid
-
configure
protected void configure(org.jdom2.Element ui) throws org.jdom2.JDOMException
- Throws:
org.jdom2.JDOMException
-
setLookAndFeel
protected void setLookAndFeel(org.jdom2.Element ui)
-
doScript
protected javax.swing.JComponent doScript(javax.swing.JComponent component, org.jdom2.Element e)
-
create
public javax.swing.JComponent create(org.jdom2.Element e)
-
getMainFrame
public javax.swing.JFrame getMainFrame()
-
warn
protected void warn(java.lang.Object obj)
-
warn
protected void warn(java.lang.Object obj, java.lang.Exception ex)
-
-