| com.xoetrope.builder.w3c.html.XHtmlBuilder
All known Subclasses: com.xoetrope.carousel.builder.XEditorHtmlBuilder,
XHtmlBuilder | public class XHtmlBuilder extends XuiBuilder (Code) | | 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.8 $
License: see License.txt
|
Method Summary | |
public void | addScript(String componentName, String eventName, String methodName, String script) | public static URL | findResource(String fileName) Find a resource URl from a resource string, resolving relative resource
names in the process. | public static Color | getColor(String colorSpec) | public Object | getComponentAttribute(String compName, String attribName) Get a named attributes. | public static int | getSwingConstant(String name) | public XHtmlTagHandler | getTagHandler(HTML.Tag t) | public String | getType() | protected InputStream | getUrlInputStream(String urlStr) | public static boolean | isDebugLayout() | public PageSupport | loadPage(String defPackageName, String pageName, boolean include) Loads an XPage via a reader obtained from the XProject (searches
the classpath). | public void | processEvent(XHtmlTagHandler handler, String attribName, String attribValue) | public PageSupport | readPage(Reader reader, String pageName, String ext, boolean include) Read an XML description of the page and construct a new XPage. | public void | setClass(Component c, String className) | public void | setComponentAttribute(String compName, String attribName, Object attribValue) Set a named attributes. | public static void | setDebugLayout(boolean state) | protected void | setupHtmlTags() | protected void | setupPage(String pageName, String ext, boolean include) Loads the page based on the contents of the page tag or by using default
values. | public void | setupStyle(String styleInfo) |
debugLayout | protected static boolean debugLayout(Code) | | |
documentUrl | protected static URL documentUrl(Code) | | |
XHtmlBuilder | public XHtmlBuilder(XProject project)(Code) | | Create a new builder
Parameters: project - the current xui project Parameters: factory - the component factory |
addScript | public void addScript(String componentName, String eventName, String methodName, String script)(Code) | | Add a new script function to the current class
Parameters: componentName - the name of the element being processed Parameters: eventName - the name of the html event or null if a page event is being processed Parameters: methodName - the name of the new method Parameters: script - the contents of the method - the original javascript (assuming it is javascript) |
findResource | public static URL findResource(String fileName)(Code) | | Find a resource URl from a resource string, resolving relative resource
names in the process.
Parameters: fileName - the resource string the resource url |
getColor | public static Color getColor(String colorSpec)(Code) | | Get a color from a color specification
Parameters: the - html color spec the Color object |
getComponentAttribute | public Object getComponentAttribute(String compName, String attribName)(Code) | | 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.
Parameters: attribName - the attribute name Parameters: compName - the component name or null if it is a page attribute |
getSwingConstant | public static int getSwingConstant(String name)(Code) | | Get a SwingConstant for an attribute
Parameters: the - attribute name as a string the constant |
getType | public String getType()(Code) | | Get the page loader type - a unique name identifying the loader
"html" |
getUrlInputStream | protected InputStream getUrlInputStream(String urlStr)(Code) | | Attempt to get an input stream from the specified path
Parameters: urlStr - the url string the inputstream or null if the strean cannot be opened. |
isDebugLayout | public static boolean isDebugLayout()(Code) | | Is a debug layout to be used?
true if the debug layout is to be used |
loadPage | public PageSupport loadPage(String defPackageName, String pageName, boolean include)(Code) | | Loads an XPage via a reader obtained from the XProject (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 |
processEvent | public void processEvent(XHtmlTagHandler handler, String attribName, String attribValue)(Code) | | Process the event specification, specified as an attribute of an HTML element
Parameters: handler - the tag handler Parameters: attribName - the attribute name Parameters: attribValue - the attribute value, containing the script |
readPage | public PageSupport readPage(Reader reader, String pageName, String ext, 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: ext - the file extension Parameters: include - the page to be loaded is being included in another page the page |
setClass | public void setClass(Component c, String className)(Code) | | Set the class of an element
Parameters: c - the component affected by the style Parameters: className - the name of the class |
setComponentAttribute | public void setComponentAttribute(String compName, String attribName, Object attribValue)(Code) | | 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.
Parameters: attribName - the attribute name Parameters: compName - the component name or null if it is a page attribute Parameters: attribValue - the attribute value |
setDebugLayout | public static void setDebugLayout(boolean state)(Code) | | Set the debug layout flag
Parameters: state - true if the debug layout is to be used |
setupHtmlTags | protected void setupHtmlTags()(Code) | | Create a hashtable of tags and ids to speed processing of HTML
|
setupPage | protected void setupPage(String pageName, String ext, 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: ext - the file extension Parameters: include - the page to be loaded is being included in another page |
setupStyle | public void setupStyle(String styleInfo)(Code) | | Setup a new style or styles by parsing the stylesheet
Parameters: styleInfo - the full style information |
|
|