public class HtmlBuilder extends HtmlPrinter implements XMLContentBuilder
HtmlPrinter
that also implements ContentBuilder
in terms of web based interfaces.HtmlWriter
![]() |
![]() |
![]() |
![]() |
Modifier and Type | Class and Description |
---|---|
protected static class |
HtmlBuilder.Heading |
static class |
HtmlBuilder.Panel
A nested
HtmlBuilder representing an element. |
protected static class |
HtmlBuilder.SpanText
A
HtmlBuilder.Panel for in-line text. |
protected static class |
HtmlBuilder.Text |
Modifier and Type | Field and Description |
---|---|
static Feature |
HTML_TABLE_HEADER_SCOPE_FEATURE |
static Feature |
HTML_TABLE_SECTIONS_FEATURE |
sb
STREAM_BUILDER_FEATURE
Constructor and Description |
---|
HtmlBuilder() |
HtmlBuilder(AbstractXMLBuilder parent) |
Modifier and Type | Method and Description |
---|---|
void |
addActionButtons(Form f,
java.lang.String legend,
java.util.Set<java.lang.String> actions)
A a set of action buttons to the content
|
ContentBuilder |
addParent()
append a nested panel to its parent content.
|
void |
addScript(java.lang.String script)
Add a script element to HTML.
|
void |
addScriptFile(java.lang.String path) |
<C,R> void |
addTable(AppContext conn,
Table<C,R> t,
java.text.NumberFormat nf,
java.lang.String style)
Add a table to the content.
|
void |
closeDetails()
finish a section started by
ContentBuilder.getDetails(Object)
this may be a no-op if expended section are not supported |
ContentBuilder |
getDetails(java.lang.Object summary_text)
get an expanding/folding section if supported
This method can either return a new
ContentBuilder or
the current object. |
HtmlFormPolicy |
getFormPolicy() |
ContentBuilder |
getHeading(int level)
create a
ContentBuilder that appends its contents as a
heading when the ContentBuilder.addParent() method is called. |
Logger |
getLogger(AppContext conn) |
ContentBuilder |
getPanel(java.lang.String... type)
create a nested content panel
|
ContentBuilder |
getPanel(java.lang.String type) |
ExtendedXMLBuilder |
getSpan()
create a
ExtendedXMLBuilder that appends its contents as XML
text when the SimpleXMLBuilder.appendParent() method is called. |
ExtendedXMLBuilder |
getText()
create a
ExtendedXMLBuilder that appends its contents as XML
text when the SimpleXMLBuilder.appendParent() method is called. |
void |
paragraph(java.lang.String text) |
boolean |
setNewTab(boolean new_tab) |
void |
setTableSections(boolean value) |
static java.lang.String |
strip(java.lang.String input) |
boolean |
useNewTab() |
append, append, appendParent, appendTo, clear, getNested, getParent, hasContent, toString
addClass, append, attr, attr, badAttribute, br, clean, clean, clean, cleanFormatted, close, closeElement, doClean, doClean, endOpen, getAttribute, getEscapeUnicode, getTags, getValidXML, isInOpen, longLines, matched, nbs, open, open, openElement, setEscapeUnicode, setValidXML
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addButton, addButton, addColumn, addFormInput, addFormLabel, addFormTable, addHeading, addImage, addLink, addLink, addList, addList, addList, addNumberedList, addObject, addTable, addTable, addTable, addText, append, canAdd
addActionButtons, addFormLabel, cleanFormatted, getSpan
addClass, br, nbs
appendParent, attr, attr, clean, clean, clean, close, getNested, getParent, open, open, setEscapeUnicode
public static final Feature HTML_TABLE_SECTIONS_FEATURE
public static final Feature HTML_TABLE_HEADER_SCOPE_FEATURE
public HtmlBuilder()
public HtmlBuilder(AbstractXMLBuilder parent)
public <C,R> void addTable(AppContext conn, Table<C,R> t, java.text.NumberFormat nf, java.lang.String style)
ContentBuilder
UIGenerator
should be added via UIGenerator.addContent(ContentBuilder)
addTable
in interface ContentBuilder
addTable
in interface XMLContentBuilder
public void paragraph(java.lang.String text)
public ExtendedXMLBuilder getText()
ContentBuilder
ExtendedXMLBuilder
that appends its contents as XML
text when the SimpleXMLBuilder.appendParent()
method is called.
Normally this represents a separate paragraph of text but this can be mapped
onto ContentBuilder.getSpan()
where this does not make sense for example where the
ContentBuilder
represents a heading or table cell.getText
in interface ContentBuilder
public ExtendedXMLBuilder getSpan()
ContentBuilder
ExtendedXMLBuilder
that appends its contents as XML
text when the SimpleXMLBuilder.appendParent()
method is called.
This is intended for in-line text rather than creating a paragraph.getSpan
in interface ContentBuilder
ExtendedXMLBuilder
public ContentBuilder getHeading(int level)
ContentBuilder
ContentBuilder
that appends its contents as a
heading when the ContentBuilder.addParent()
method is called.
If the heading is to only contain text use the ContentBuilder.addHeading(int, String)
method.getHeading
in interface ContentBuilder
level
- level of headingpublic ContentBuilder getPanel(java.lang.String... type) throws java.lang.UnsupportedOperationException
ContentBuilder
getPanel
in interface ContentBuilder
type
- Strings specifying a formatting types for the panel.java.lang.UnsupportedOperationException
public ContentBuilder getPanel(java.lang.String type) throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
public ContentBuilder addParent() throws java.lang.UnsupportedOperationException
ContentBuilder
addParent
in interface ContentBuilder
java.lang.UnsupportedOperationException
public void addActionButtons(Form f, java.lang.String legend, java.util.Set<java.lang.String> actions)
ContentBuilder
addActionButtons
in interface ContentBuilder
addActionButtons
in interface XMLContentBuilder
f
- Form
legend
- optional legend for the button setactions
- Set
of action namespublic void setTableSections(boolean value)
public final ContentBuilder getDetails(java.lang.Object summary_text)
ContentBuilder
ContentBuilder
or
the current object. Once content has been added the ContentBuilder.closeDetails()
method should be called on whichever object was returned which will
perform any additional actions necessary.
If expanded/folding sections are not supported this will map to
ContentBuilder.addObject(Object)
on the summary text
and the current ContentBuilder
will be returned.getDetails
in interface ContentBuilder
getDetails
in interface XMLContentBuilder
public final void closeDetails()
ContentBuilder
ContentBuilder.getDetails(Object)
this may be a no-op if expended section are not supportedcloseDetails
in interface ContentBuilder
closeDetails
in interface XMLContentBuilder
public void addScript(java.lang.String script)
script
- public void addScriptFile(java.lang.String path)
public final Logger getLogger(AppContext conn)
getLogger
in interface XMLContentBuilder
public boolean useNewTab()
useNewTab
in interface XMLContentBuilder
public HtmlFormPolicy getFormPolicy()
getFormPolicy
in interface XMLContentBuilder
public boolean setNewTab(boolean new_tab)
setNewTab
in interface XMLContentBuilder
public static java.lang.String strip(java.lang.String input)