|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.builder.XuiBuilder
net.xoetrope.builder.w3c.html.XHtmlBuilder
public class XHtmlBuilder
A build for W3C HTML forms/pages. The builder can create XUI pages on-the-fly or it can be used to convert and save an html page to a xui format.
Copyright (c) Xoetrope Ltd., 2002-2006
$Revision: 1.7 $
License: see License.txt
| Field Summary | |
|---|---|
protected static boolean |
debugLayout
|
protected static java.net.URL |
documentUrl
|
protected XHtmlComponentFactory |
htmlFactory
|
protected XHtmlTagHandler |
lastHandler
|
protected java.lang.String |
packageName
|
protected java.lang.String |
selectStyle
|
| Fields inherited from class net.xoetrope.builder.XuiBuilder |
|---|
adapter, attributeSets, checkBoxGroup, componentFactory, currentAttributes, currentProject, customizer, DEFAULT_PAGE_CLASS, evaluator, eventHandler, includeFileName, layoutHelper, menuBar, page, rootPage, secondaryClassloader, validationFactories |
| Constructor Summary | |
|---|---|
XHtmlBuilder(XProject project)
Create a new builder |
|
| Method Summary | |
|---|---|
void |
addScript(java.lang.String componentName,
java.lang.String eventName,
java.lang.String methodName,
java.lang.String script)
Add a new script function to the current class |
static java.net.URL |
findResource(java.lang.String fileName)
Find a resource URl from a resource string, resolving relative resource names in the process. |
static java.awt.Color |
getColor(java.lang.String colorSpec)
Get a color from a color specification |
java.lang.Object |
getComponentAttribute(java.lang.String compName,
java.lang.String attribName)
Get a named attributes. |
static int |
getSwingConstant(java.lang.String name)
Get a SwingConstant for an attribute |
XHtmlTagHandler |
getTagHandler(javax.swing.text.html.HTML.Tag t)
|
protected java.io.InputStream |
getUrlInputStream(java.lang.String urlStr)
Attempt to get an input stream from the specified path |
static boolean |
isDebugLayout()
Is a debug layout to be used? |
PageSupport |
loadPage(java.lang.String defPackageName,
java.lang.String pageName,
boolean include)
Loads an XPage via a reader obtained from the XProject (searches the classpath). |
void |
processEvent(XHtmlTagHandler handler,
java.lang.String attribName,
java.lang.String attribValue)
Process the event specification, specified as an attribute of an HTML element |
PageSupport |
readPage(java.io.Reader reader,
java.lang.String pageName,
java.lang.String ext,
boolean include)
Read an XML description of the page and construct a new XPage. |
void |
setClass(java.awt.Component c,
java.lang.String className)
Set the class of an element |
void |
setComponentAttribute(java.lang.String compName,
java.lang.String attribName,
java.lang.Object attribValue)
Set a named attributes. |
static void |
setDebugLayout(boolean state)
Set the debug layout flag |
protected void |
setupHtmlTags()
Create a hashtable of tags and ids to speed processing of HTML |
protected void |
setupPage(java.lang.String pageName,
java.lang.String ext,
boolean include)
Loads the page based on the contents of the page tag or by using default values. |
void |
setupStyle(java.lang.String styleInfo)
Setup a new style or styles by parsing the stylesheet |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static boolean debugLayout
protected java.lang.String packageName
protected java.lang.String selectStyle
protected XHtmlComponentFactory htmlFactory
protected XHtmlTagHandler lastHandler
protected static java.net.URL documentUrl
| Constructor Detail |
|---|
public XHtmlBuilder(XProject project)
project - the current xui projectfactory - the component factory| Method Detail |
|---|
public static boolean isDebugLayout()
public static void setDebugLayout(boolean state)
state - true if the debug layout is to be usedprotected java.io.InputStream getUrlInputStream(java.lang.String urlStr)
urlStr - the url string
public PageSupport loadPage(java.lang.String defPackageName,
java.lang.String pageName,
boolean include)
loadPage in interface XPageLoaderloadPage in class XuiBuilderdefPackageName - the package or path to the pagepageName - the page name or the name of the class implementing the pageinclude - true if the page to be loaded is being included in another
page in which case any class attribute of the included page is ignored
public PageSupport readPage(java.io.Reader reader,
java.lang.String pageName,
java.lang.String ext,
boolean include)
readPage in interface XPageLoaderreadPage in class XuiBuilderreader - a input stream from which to read the pagepageName - the name of the pageext - the file extensioninclude - the page to be loaded is being included in another page
protected void setupPage(java.lang.String pageName,
java.lang.String ext,
boolean include)
pageName - the name of the pageext - the file extensioninclude - the page to be loaded is being included in another pagepublic static java.net.URL findResource(java.lang.String fileName)
fileName - the resource string
public void setComponentAttribute(java.lang.String compName,
java.lang.String attribName,
java.lang.Object attribValue)
Set a named attributes. The attributes are stored in a hashtable owned by the page. Derived classes may access the hashtable directly but the preferred method of access is the getAttribute method. Attributes are used by the XuiBuilder class for component attributes other than those it handles directly. The attributes can be thought of as component properties or extra data and need not be used directly by the component.
Attributes are stored using a key in the form attribName_compName or just the attribName if compName is null.
attribName - the attribute namecompName - the component name or null if it is a page attributeattribValue - the attribute value
public java.lang.Object getComponentAttribute(java.lang.String compName,
java.lang.String attribName)
Get a named attributes. The attributes are stored in a hashtable owned by the page. Derived classes may access the hashtable directly but the preferred method of access is the getAttribute method. Attributes are used by the XuiBuilder class for component attributes other than those it handles directly. The attributes can be thought of as component properties or extra data and need not be used directly by the component.
Attributes are stored using a key in the form attribName_compName or just the attribName if compName is null.
attribName - the attribute namecompName - the component name or null if it is a page attribute
public void addScript(java.lang.String componentName,
java.lang.String eventName,
java.lang.String methodName,
java.lang.String script)
componentName - the name of the element being processedeventName - the name of the html event or null if a page event is being processedmethodName - the name of the new methodscript - the contents of the method - the original javascript (assuming it is javascript)
public void processEvent(XHtmlTagHandler handler,
java.lang.String attribName,
java.lang.String attribValue)
handler - the tag handlerattribName - the attribute nameattribValue - the attribute value, containing the scriptprotected void setupHtmlTags()
public XHtmlTagHandler getTagHandler(javax.swing.text.html.HTML.Tag t)
public void setClass(java.awt.Component c,
java.lang.String className)
c - the component affected by the styleclassName - the name of the classpublic void setupStyle(java.lang.String styleInfo)
styleInfo - the full style informationpublic static java.awt.Color getColor(java.lang.String colorSpec)
the - html color spec
public static int getSwingConstant(java.lang.String name)
the - attribute name as a string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||