Java Doc for XuiBuilder.java in  » XML-UI » XUI » net » xoetrope » builder » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML UI » XUI » net.xoetrope.builder 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.xoetrope.builder.XuiBuilder

All known Subclasses:   net.xoetrope.builder.editor.XEditorXuiBuilder,
XuiBuilder
public class XuiBuilder implements XPageLoader(Code)
A builder of XUI pages from an XML source. An instance of the class is setup by XApplet as a secondary page loader so that if a class file for the page is not found then an attempt is made to load the page from an XML file with the same base name.
Components, Menus, Events, Validations and Data Binding can be configured via the XML declarations.
The loading process itself relies heavily on the component factories to do the bulk of the work involved in constructing and adding components. The XPage class also performs much of the work involved in adding events and binding data.

Copyright (c) Xoetrope Ltd., 2002-2003

License: see license.txt

$Revision: 1.29 $


Field Summary
protected  ObjectcheckBoxGroup
    
protected  XStyleFactorycomponentFactory
    
protected static  HashtablecurrentAttributes
    
protected  XLayoutHelperlayoutHelper
    
protected  XAppendermenuBar
    
protected  StringpackageName
    
protected  XPagepage
    
protected  XPagerootPage
    
protected  HashtablevalidationFactories
    

Constructor Summary
public  XuiBuilder()
    
public  XuiBuilder(String packageName)
     Construct a new builder and set the default package
Parameters:
  packageName - the name of the default package e.g.

Method Summary
protected  voidaddBindings(XPage page, XmlElement model)
     Adds data bindings to the page.
protected  ComponentaddComponent(XmlElement childNode)
     Adds an individual component element to the page (this method may be called recursively for nested elements).
protected  voidaddComponents(Component page, XmlElement model)
    
protected  voidaddEvents(XPage page, XmlElement model)
     Adds the event handlers.
protected  voidaddHandler(XPage xpage, Component targetComp, String typeStr, String name)
     Adds an event handler.
protected  voidaddMenu(XPage page, XmlElement model)
     Adds a menu to the application.
protected  voidaddValidations(XPage page, XmlElement model)
    
public  ObjectevaluateAttribute(XPage page, String attributeValue)
     Get the value of an attribute.
public static  HashtablegetCurrentAttributes()
    
protected  XDataBindinggetFactoryBinding(Component compType, XModel model, XmlElement bindingNode)
    
protected  intgetInt(String s, int def)
    
protected  ObjectgetMenuItem(String name)
    
protected  XValidationFactorygetValidationFactory(String validationFileName)
    
protected  voidinit(String packageName)
    
protected  XPageloadClass(String className)
    
public  voidloadFrames(String defPackageName, String frameSetName, XPageDisplay pageDisplay)
     Loads a frameset.
public  XPageloadPage(String defPackageName, String pageName, boolean include)
     Loads an XPage via a reader obtained from the XResourceManager (searches the classpath).
public  XPagereadPage(Reader reader, String pageName, boolean include)
     Read an XML description of the page and construct a new XPage.
public static  voidregisterBindingFactory(XDataBindingFactory fact)
     Register a data binding factory.
protected  voidsetComponentAttributes(Component comp, Hashtable attribs)
    
public  voidsetPackageName(String defPackageName)
     Set the default package name.
public  voidsetPageAttribute(Component c, String name, String value)
    
protected  voidsetPageName(String pageName)
    
protected  voidsetupPage(XmlElement model, String pageName, boolean include)
     Loads the page based on the contents of the page tag or by using default values.

Field Detail
checkBoxGroup
protected Object checkBoxGroup(Code)



componentFactory
protected XStyleFactory componentFactory(Code)



currentAttributes
protected static Hashtable currentAttributes(Code)



layoutHelper
protected XLayoutHelper layoutHelper(Code)



menuBar
protected XAppender menuBar(Code)



packageName
protected String packageName(Code)



page
protected XPage page(Code)



rootPage
protected XPage rootPage(Code)



validationFactories
protected Hashtable validationFactories(Code)




Constructor Detail
XuiBuilder
public XuiBuilder()(Code)
Construct an instance of the builder with the default package set to net.xoetrope.awt



XuiBuilder
public XuiBuilder(String packageName)(Code)
Construct a new builder and set the default package
Parameters:
  packageName - the name of the default package e.g. net.xoetrope.awt




Method Detail
addBindings
protected void addBindings(XPage page, XmlElement model)(Code)
Adds data bindings to the page.
Parameters:
  page - the page to which the component/data bindings are added
Parameters:
  model - the data model



addComponent
protected Component addComponent(XmlElement childNode)(Code)
Adds an individual component element to the page (this method may be called recursively for nested elements). Several methods will be attempted until a component is successfully created. Firstly the built-in component types are checked, then any additional registered component constructors. The types can be specified by type ID, type name or class name.
Parameters:
  childName - the name of the child element
Parameters:
  childNode - the XML element containing the component specification. the new component



addComponents
protected void addComponents(Component page, XmlElement model)(Code)
Adds the elements specified by the Components element and its children
Parameters:
  page - the new page object
Parameters:
  model - the Components XML element (and implicitly its children)



addEvents
protected void addEvents(XPage page, XmlElement model)(Code)
Adds the event handlers. Events are specified in the XML as having 'type' (e.g. MouseHandler, ActionHandler etc...), 'name' (the method name to be invoked) and 'target' (the name of the component to which the handler is attached) attributes
Parameters:
  page - The page that contains the response methods
Parameters:
  model - the 'events' XML element



addHandler
protected void addHandler(XPage xpage, Component targetComp, String typeStr, String name)(Code)
Adds an event handler.
Parameters:
  xpage - The page that contains the response methods
Parameters:
  targetComp - the component to which the event handler is added
Parameters:
  typeStr - the type of handler
Parameters:
  name - the name of the response method



addMenu
protected void addMenu(XPage page, XmlElement model)(Code)
Adds a menu to the application. Although specified in the XML as part of the page the menu is actually added to the application frame.
Parameters:
  page - the page
Parameters:
  model - the Menu XML element



addValidations
protected void addValidations(XPage page, XmlElement model)(Code)
Adds validation rules to the components
Parameters:
  page - the page
Parameters:
  model - the Validations XML element



evaluateAttribute
public Object evaluateAttribute(XPage page, String attributeValue)(Code)
Get the value of an attribute.
Parameters:
  page - the page being loaded
Parameters:
  attributeValue - the raw value of the attribute the evaluated value of the attribute



getCurrentAttributes
public static Hashtable getCurrentAttributes()(Code)
Get the table of component attributes the attributes hash table.



getFactoryBinding
protected XDataBinding getFactoryBinding(Component compType, XModel model, XmlElement bindingNode)(Code)
Try to get a binding factory to construct the binding
Parameters:
  compType - the component type
Parameters:
  model - the source data model
Parameters:
  bindingNode - the XML element defining the binding the new binding if one could be constructed



getInt
protected int getInt(String s, int def)(Code)
Convert a string to an int or else return the default value
Parameters:
  s - the number as a string
Parameters:
  def - the default value the converted value



getMenuItem
protected Object getMenuItem(String name)(Code)
Gets a reference to a menu object
Parameters:
  name - the name of the menu item



getValidationFactory
protected XValidationFactory getValidationFactory(String validationFileName)(Code)
Construct a validation factory appropriate to this builder
Parameters:
  validationFileName - the validations file to read the validation factory



init
protected void init(String packageName)(Code)
Initialize the builder
Parameters:
  packageName - the default componnet package or use AWT if none is specified



loadClass
protected XPage loadClass(String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException(Code)
Loads a class as the basis for a page
Parameters:
  className - the full class name an instance of the XPage class or a derivative
throws:
  ClassNotFoundException -
throws:
  IllegalAccessException -
throws:
  InstantiationException -



loadFrames
public void loadFrames(String defPackageName, String frameSetName, XPageDisplay pageDisplay)(Code)
Loads a frameset. If a frameset is used then the calls to the XPageDisplay interface should use the form that specifies the target areas. By default frames are specified in a file (if found) called frames.xml. The frames are added to a container laid out with a BorderLayout.
Frames can be used to control how parts of the screen are updated. The default page updated by the page transition/swapping methods is the 'content' frame. Other areas can be used as non swapping areas for toolbars, navigation controls, sidebars or status areas. Frames may also be hidden and shown as needed.
Parameters:
  defPackageName - the package or path to the page
Parameters:
  frameSetName - the page name or the name of the class implementing the page
Parameters:
  pageDisplay - the object that will display the pages and frameset



loadPage
public XPage loadPage(String defPackageName, String pageName, boolean include)(Code)
Loads an XPage via a reader obtained from the XResourceManager (searches the classpath). The pageName is assumed to be the name of an XML file. For example if the pageName is 'welcome' then the 'welcome.xml' file is read as a UTF8 encoded XML file (by default).
Parameters:
  defPackageName - the package or path to the page
Parameters:
  pageName - the page name or the name of the class implementing the page
Parameters:
  include - true if the page to be loaded is being included in anotherpage in which case any class attribute of the included page is ignored the page



readPage
public XPage readPage(Reader reader, String pageName, boolean include)(Code)
Read an XML description of the page and construct a new XPage. An instance of the class specified by the class attribute is constructed or else an instance of XPage if no class attribute is specified. The new page is populated but is not yet added to its parent.
The startup file parameter 'DefaultClass' is used to obtain a default for each page's class if a class parameter is not specified in the page's XML
The startup file parameter 'Validations' is used to obtain a default for each page's set of validation rules
Parameters:
  reader - a input stream from which to read the page
Parameters:
  pageName - the name of the page
Parameters:
  include - the page to be loaded is being included in another page the page



registerBindingFactory
public static void registerBindingFactory(XDataBindingFactory fact)(Code)
Register a data binding factory. An add-on library or plug-in may wish to customize the data bindings, particularly if it provides extended model node types. Such extended nodes may need adapters to be useful for some or all widgets and other binding contexts. Registration of the binding factory allows the necessary adapters and bindings to be created on request.
Parameters:
  fact - the new binding factory



setComponentAttributes
protected void setComponentAttributes(Component comp, Hashtable attribs)(Code)
Iterate through the attributes and set the attributes for a component
Parameters:
  comp - the component
Parameters:
  attribs - the attributes.



setPackageName
public void setPackageName(String defPackageName)(Code)
Set the default package name. The default package name is used when creating widgets such that a button class like XButton is instatiated as .XButton.class. By default this expands to net.xoetrope.awt.XButton.clas
Parameters:
  defPackageName - the default package name



setPageAttribute
public void setPageAttribute(Component c, String name, String value)(Code)
Get a page attribute (this version does nothing)
Parameters:
  c -
Parameters:
  name -
Parameters:
  value -



setPageName
protected void setPageName(String pageName)(Code)
Set the name of the page
Parameters:
  pageName - the new page name.



setupPage
protected void setupPage(XmlElement model, String pageName, boolean include)(Code)
Loads the page based on the contents of the page tag or by using default values.
Parameters:
  pageName - the name of the page
Parameters:
  include - the page to be loaded is being included in another page the page



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.