public class Util extends Object
Modifier and Type | Field and Description |
---|---|
static String |
charset_utf_8 |
static String |
contentType_xhtml_ |
static String |
contentType_xhtml_utf8 |
static Element_table |
emptyTable |
static String |
http_utf_8 |
static String |
xemacs_utf_8 |
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static Element_a |
anchorNCC(String xname,
@Opt String cls,
String text)
Arriving link target with @name/@id, @class and pure text contents.
|
static Element_a |
anchorNCCT(String xname,
@Opt String cls,
String text,
@Opt String tooltip)
Arriving link target with @name/@id, @class, pure text contents and a tooltip text.
|
static Element_form |
form(Element_form_content[] contents,
String actionUrl,
@Opt String encodings,
Element_form.Attr_method.Value method)
Makes one "form" element.
"get" is default for method. "@target" is not supported, since not allowed in "strict". |
static Element_input |
hidden_input(String key,
String value)
Construct a hidden xhtml "input" element with @name=@id=key parameter, and
the given constant value.
|
static Element_select |
input_select(String id,
boolean multiple,
boolean active,
int displaySize,
String[] values,
String[] shown,
@Opt String onchange,
Set<String> selected)
FIXME Element_optgroup missing
|
static Element_a |
jumpN(String xhref)
Jump to target with @href, and text content plain link address.
|
static Element_a |
jumpNCC(String xhref,
@Opt String cls,
String text)
Jump to target with @href, @class and pure text contents.
|
static Element_a |
jumpNCCT(String xhref,
@Opt String cls,
String text,
@Opt String tooltip)
Jump to target with @href, @class, pure text contents and tooltip.
|
static Element_p.Content |
pText(String text)
Wrap text for use in a Element_p.
|
static Element_p.Content |
pText(String cls,
String text)
Create a xhtml "span" element with plain text content and a given "css class"
and wraps it for use in a Element_p.
|
static void |
sendBack_file(File data,
String mimetype,
OutputStream out)
Send a file back to the sockets output channel.
|
static void |
sendDocumentAsHttpAnswer(OutputStream out,
Document_html doc) |
static void |
sendDocumentAsHttpAnswer(OutputStream out,
Document_html doc,
String encoding) |
static Element_span |
spanCC(String cls,
String text)
Create a xhtml "span" element with plain text content and a given "css class".
|
static Element_span |
spanCStyle(String text,
String styles)
Create a xhtml "span" element with plain text content and direct "css style" values.
|
static Element_span |
spanNCC(String xname,
String cls,
String text)
Create a xhtml "span" element with an @id, plain text content and a given "css class".
|
static Element_button |
text_button(String text,
String command,
boolean submitNotReset,
boolean isActive)
Makes one html-button with simple text as its visible surface.
|
static Element_textarea |
textarea(@Opt String contents,
int rows,
int cols,
String id,
boolean active,
boolean editable)
Makes one "text area" element.
|
static Document_html |
wrap_document(Element_head head,
Element_body body) |
static Element_head |
xhtml_head(String title,
@Opt String encoding,
@Opt String favicon,
@Opt List<String> jses,
@Opt List<String> csses,
@Opt List<Element_link> links,
@Opt Map<String,String> metas,
@Opt List<Element_meta> metas2)
Creates an Xhtml1.0
Element_head according to the syntax
<!ELEMENT head ((script | style | meta | link | object)*,
((title, %head.misc;, (base, %head.misc;)?) |
(base, %head.misc;, (title, %head.misc;)))) >
|
public static final Element_table emptyTable
public static final String xemacs_utf_8
public static final String charset_utf_8
public static final String http_utf_8
public static final String contentType_xhtml_
public static final String contentType_xhtml_utf8
public static Element_span spanCStyle(String text, String styles)
public static Element_span spanCC(String cls, String text)
public static Element_span spanNCC(String xname, String cls, String text)
public static Element_a anchorNCC(String xname, @Opt @Opt String cls, String text)
public static Element_a anchorNCCT(String xname, @Opt @Opt String cls, String text, @Opt @Opt String tooltip)
public static Element_a jumpN(String xhref)
public static Element_a jumpNCC(String xhref, @Opt @Opt String cls, String text)
public static Element_a jumpNCCT(String xhref, @Opt @Opt String cls, String text, @Opt @Opt String tooltip)
public static Element_p.Content pText(String cls, String text)
public static Element_p.Content pText(String text)
public static Element_select input_select(String id, boolean multiple, boolean active, int displaySize, String[] values, String[] shown, @Opt @Opt String onchange, Set<String> selected)
id
- used for @id and @namemultiple
- whether more than one input can be selected, copied to @multipleactive
- whether input field is active or grayed outdisplaySize
- size of the shown section, use ==1 for a drop-down boxvalues
- pure text which is returned as value in case of selectshown
- pure text which is SHOWN for the items on the screen; values and shown
must be in sync.onchange
- pure text, what to do in case of value editing; mostly a ecma-script call.
(not clear whether an editing action or a real value change triggers this command,
may depend on the browser's implementation,
see (and the html specs(?))selected
- the item or items which are initially selected.public static Element_input hidden_input(String key, String value)
public static Element_button text_button(String text, String command, boolean submitNotReset, boolean isActive)
public static Element_textarea textarea(@Opt @Opt String contents, int rows, int cols, String id, boolean active, boolean editable)
public static Element_form form(Element_form_content[] contents, String actionUrl, @Opt @Opt String encodings, @Opt Element_form.Attr_method.Value method)
encodings
- is copied to @accept and are the mime types accepted by an uploadpublic static Element_head xhtml_head(String title, @Opt @Opt String encoding, @Opt @Opt String favicon, @Opt @Opt List<String> jses, @Opt @Opt List<String> csses, @Opt @Opt List<Element_link> links, @Opt @Opt Map<String,String> metas, @Opt @Opt List<Element_meta> metas2)
Element_head
according to the syntax
<!ELEMENT head ((script | style | meta | link | object)*,
((title, %head.misc;, (base, %head.misc;)?) |
(base, %head.misc;, (title, %head.misc;)))) >
title
- is used as contents of Element_title AND is duplicated to meta "DC.title"encoding
- ALWAYS a "meta http_equiv content-type" Element_meta
is
generated. The encoding defaults to utf-8.favicon
- creates a special Element_link
ASSUME that
file name extension == mime type!jses
- make specialized Element_link
objects from file position / url only.csses
- make specialized Element_link
objects from file position / url only.links
- pre-factored Element_link
objects to be inserted,
with @rel, @type and @href attributes.metas
- key/value pairs create a Meta_element
withmetas2
- pre-factored Element_meta
objects to be inserted.public static Document_html wrap_document(Element_head head, Element_body body)
public static void sendDocumentAsHttpAnswer(OutputStream out, Document_html doc)
public static void sendDocumentAsHttpAnswer(OutputStream out, Document_html doc, String encoding)
public static void sendBack_file(File data, String mimetype, OutputStream out) throws IOException
IOException
see also the complete user documentation .