|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kiurubeans.HtmlBean
Facilitates HTML output and translations.
Field Summary | |
User |
user
used for translation. if user is not set, text is translated 'as is'. |
Constructor Summary | |
HtmlBean()
Creates a new instance of HtmlBean. |
Method Summary | |
static java.lang.String |
begin_javascript()
Retuns script tag and begin HTML comment. |
static java.lang.String |
begin_table()
return begin table tag with parameters, standard formatting |
static java.lang.String |
bottomNavigator()
Standard navigation text for bottom of pages concerning spaces, spacegroups & reports. probably obsolete. |
static java.lang.String |
createSearchForm(java.lang.String targetPage,
java.lang.String editName,
java.lang.String editContent)
Creates simple search form. |
static java.lang.String |
createSearchForm(java.lang.String targetPage,
java.lang.String editName,
java.lang.String editContent,
boolean closeForm)
Creates simple search form. |
static java.lang.String |
end_javascript()
Retuns end HTML comment and end script tag. |
static java.lang.String |
getCurrentPage(javax.servlet.http.HttpServletRequest r)
Returns current page filename, no request parameters or path. |
static java.lang.String |
getCurrentTime()
Returns current time in string. parameter "currentTime". |
static java.lang.String |
getCurrentTimeAsHidden()
Returns current time as a hidden control to ensure cache-free functionality. |
java.lang.String |
getH(java.lang.String text)
Returns page's main headline. |
java.lang.String |
getH(java.lang.String text,
int level)
Returns page's headline of given level. |
static java.lang.String |
getHidden(java.lang.String name,
int value)
Returns hidden component for html form |
static java.lang.String |
getHidden(java.lang.String name,
java.lang.String value)
Returns hidden component for html form |
java.lang.String |
getJsButton(java.lang.String name,
java.lang.String value,
java.lang.String onClick)
Returns javascript code for printing a submit button. translated. |
static java.lang.String |
getLabel(java.lang.String text)
Returns NON-TRANSLATED text with label style (used in html forms). |
static java.lang.String |
getLink(java.lang.String title,
java.lang.String value)
Returns HTML code for a link. |
static java.lang.String |
getLink(java.lang.String title,
java.lang.String value,
java.lang.String defaultTitle)
Returns HTML code for a link. |
static java.lang.String |
getSubmit(java.lang.String name,
java.lang.String value)
Returns submit component for html form |
User |
getUser()
Getter method for user |
java.io.PrintWriter |
getWriter()
Getter for property writer. |
java.lang.String |
makeCheckBox(java.lang.String name,
RS2 rs,
java.lang.String valueField,
java.lang.String textField,
java.lang.String checked)
Creates a group of Checkbox |
static java.lang.String |
makeRadioGroup(java.lang.String name,
java.util.ArrayList rs,
java.lang.String checked,
boolean dobreak)
Creates a group of HTML Radiobuttons based on ArrayList with StringPairs |
java.lang.String |
makeRadioGroup(java.lang.String name,
RS2 rs,
java.lang.String valueField,
java.lang.String textField,
java.lang.String checked)
Creates a group of HTML Radiobuttons |
java.lang.String |
makeRadioGroup(java.lang.String name,
RS2 rs,
java.lang.String valueField,
java.lang.String textField,
java.lang.String checked,
java.lang.String nullString)
Creates a group of HTML Radiobuttons |
static java.lang.String |
makeSelectList(java.lang.String name,
RS2 rs,
java.lang.String valueField,
java.lang.String textField,
java.lang.String selected)
Creates a new HTML Select list |
static java.lang.String |
makeSelectList(java.lang.String name,
RS2 rs,
java.lang.String valueField,
java.lang.String textField,
java.lang.String selected,
int size,
boolean multiple)
Creates a new HTML Select list with size |
static java.lang.String |
makeSelectList(java.lang.String name,
RS2 rs,
java.lang.String valueField,
java.lang.String textField,
java.lang.String selected,
java.lang.String nullString)
Creates a new HTML Select list |
void |
printHtmlTable(HtmlTable h)
Prints a HtmlTable component on current writer |
void |
printOptionValues(java.util.Hashtable translations,
java.lang.String selected)
Taken from portal/pageAddUser. |
void |
printSelectList(java.lang.String name,
java.util.Hashtable values,
java.lang.String selected,
java.lang.String nullString)
Creates a new HTML Select list based on hashtable. hashtable values are not translated! |
void |
printSubmit(java.lang.String name,
java.lang.String value)
Prints translated submit button to current writer |
void |
setUser(User user)
Setter method for user |
void |
setWriter(java.io.Writer writer)
Setter for property writer. |
java.lang.String |
translate(java.lang.String s)
Translates given string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public User user
Constructor Detail |
public HtmlBean()
Method Detail |
public java.io.PrintWriter getWriter()
public void setWriter(java.io.Writer writer)
writer
- New value of property writer.public void setUser(User user)
user
- current userpublic User getUser()
public java.lang.String translate(java.lang.String s)
s
- String that is being translated
public static java.lang.String makeSelectList(java.lang.String name, RS2 rs, java.lang.String valueField, java.lang.String textField, java.lang.String selected) throws java.lang.Exception
name
- The name of HTML Select list.rs
- ResultSetvalueField
- The name of SQL field that contains the id valuestextField
- The name of SQL field that contains the text values.selected
- Id that is selected.
java.lang.Exception
- if problems with RS2public static java.lang.String makeSelectList(java.lang.String name, RS2 rs, java.lang.String valueField, java.lang.String textField, java.lang.String selected, java.lang.String nullString) throws java.lang.Exception
name
- The name of HTML Select list.rs
- ResultSetvalueField
- The name of SQL field that contains the id valuestextField
- The name of SQL field that contains the text values.selected
- Id that is selected.nullString
- nullstring is added in the beginning with value 0 (if nullString==null, nothing is added)
java.lang.Exception
- If problems with RS2public java.lang.String makeRadioGroup(java.lang.String name, RS2 rs, java.lang.String valueField, java.lang.String textField, java.lang.String checked) throws java.lang.Exception
name
- The name of HTML radiobuttons.rs
- ResultSetvalueField
- The name of SQL field that contains the id valuestextField
- The name of SQL field that contains the text values.checked
- Which radio button is selected by default.
java.lang.Exception
- if problems with rspublic java.lang.String makeRadioGroup(java.lang.String name, RS2 rs, java.lang.String valueField, java.lang.String textField, java.lang.String checked, java.lang.String nullString) throws java.lang.Exception
name
- The name of HTML radiobuttons.rs
- RS2 where data is retrievedvalueField
- The name of SQL field that contains the id valuestextField
- The name of SQL field that contains the text values.checked
- Which radio button is selected by default.nullString
- nullstring is added in the beginning with value 0 (if nullString==null, nothing is added)
java.lang.Exception
- if problems with rspublic static java.lang.String makeRadioGroup(java.lang.String name, java.util.ArrayList rs, java.lang.String checked, boolean dobreak)
name
- The name of HTML radiobuttons.rs
- arraylist containing (key,value) StringPairschecked
- Which radio button is selected by default.dobreak
- if true, a br
tag is appended to the end
StringPair
public java.lang.String makeCheckBox(java.lang.String name, RS2 rs, java.lang.String valueField, java.lang.String textField, java.lang.String checked) throws java.lang.Exception
name
- The name of HTML checkboxesrs
- RS2 where data is retrievedvalueField
- The name of SQL field that contains the id valuestextField
- The name of SQL field that contains the text values.checked
- id for checked box
java.lang.Exception
- if problems with RS2public static java.lang.String makeSelectList(java.lang.String name, RS2 rs, java.lang.String valueField, java.lang.String textField, java.lang.String selected, int size, boolean multiple) throws java.lang.Exception
name
- The name of HTML Select list.rs
- ResultSetvalueField
- The name of SQL field that contains the id valuestextField
- The name of SQL field that contains the text values.selected
- Id that is selected.size
- Select list sizemultiple
- if true, multiple values can be selected
java.lang.Exception
- If problems with RS2public static java.lang.String createSearchForm(java.lang.String targetPage, java.lang.String editName, java.lang.String editContent)
targetPage
- action pageeditName
- name for edit boxeditContent
- default text for edit box
public static java.lang.String createSearchForm(java.lang.String targetPage, java.lang.String editName, java.lang.String editContent, boolean closeForm)
targetPage
- action pageeditName
- name for edit boxeditContent
- default text for edit boxcloseForm
- if true, form is closed
public static java.lang.String bottomNavigator()
public static java.lang.String getHidden(java.lang.String name, java.lang.String value)
name
- Name of the HTML hidden component.value
- Value of the HTML hidden component.
public static java.lang.String getHidden(java.lang.String name, int value)
name
- Name of the HTML hidden component.value
- Value of the HTML hidden component.
public static java.lang.String getSubmit(java.lang.String name, java.lang.String value)
name
- Name of the HTML submit component.value
- Value of the HTML submit component.
public void printSubmit(java.lang.String name, java.lang.String value)
name
- button component namevalue
- text on buttonpublic static java.lang.String getLabel(java.lang.String text)
text
- content text
public java.lang.String getH(java.lang.String text)
text
- content text
public java.lang.String getH(java.lang.String text, int level)
text
- content textlevel
- content level
public static java.lang.String begin_javascript()
end_javascript()
public static java.lang.String end_javascript()
begin_javascript()
public static java.lang.String begin_table()
table
tag with parameters, standard formatting
public java.lang.String getJsButton(java.lang.String name, java.lang.String value, java.lang.String onClick)
name
- component namevalue
- component valueonClick
- javascript code to execute on click
public static java.lang.String getCurrentPage(javax.servlet.http.HttpServletRequest r) throws java.net.MalformedURLException
r
- request from JSP page
MalformedURLException
- if URI is not validpublic static java.lang.String getCurrentTime()
public void printOptionValues(java.util.Hashtable translations, java.lang.String selected)
translations
- Translation values in a hash table (key id)selected
- Selected valuepublic void printSelectList(java.lang.String name, java.util.Hashtable values, java.lang.String selected, java.lang.String nullString)
name
- The name of HTML Select list.values
- Values to be printed (keys are ids)selected
- Id that is selected.nullString
- nullstring is added in the beginning with value 0 (if nullString==null, nothing is added)public void printHtmlTable(HtmlTable h)
h
- HtmlTable componentHtmlTable
public static java.lang.String getCurrentTimeAsHidden()
public static java.lang.String getLink(java.lang.String title, java.lang.String value, java.lang.String defaultTitle)
title
- Visible text in linkvalue
- value appended to base textdefaultTitle
- visible text if title is empty
public static java.lang.String getLink(java.lang.String title, java.lang.String value)
title
- Visible text in linkvalue
- value appended to base text
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |