Package quadbase.common.param
Class CssHtmlParameterPageWriter
java.lang.Object
java.io.Writer
java.io.PrintWriter
quadbase.common.param.ParameterPageWriter
quadbase.common.param.HtmlParameterPageWriter
quadbase.common.param.CssHtmlParameterPageWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
Writer that writes ParameterPage in HTML format with Cascading Style Sheet Objects and Styles
embedded. In all cases, an external css style sheet has to be present and will be used for
setting the styles of the parameter page. To set the path to the external css style sheet to use,
use the method setCssFile(String cssFile).
The styles of each sub-component of a parameter page can be defined using CSS styles. Each sub-component is referenced by a CSS class name as described below
The following is an outline for the parameter page generated including CSS class names:
<head> // generated through the writeHead() method
<link> // points to the location of the style sheet
</head>
<body> // generated through the writeBody() method
<div class="paramTableTitle">
// generated through the writeTableTitle() method
</div>
<form> // generated through the writeBodyBody() method in the superclass
<table class="paramTable">
<td class="paramTableCategory">
// display parameter titles,
</td>
<td class="paramTableValues">
<div class="paramValue_X">
<select class="paramValue">
// display parameter values or inputbox,
// X represents the index of the parameter
</select>
</div>
</td>
// ... Repeat for each parameter
</table>
<input class="submitButton">
// button to submit the form
<input class="resetButton">
// button to reset the form
</form>
</body>
- See Also:
-
Field Summary
Fields inherited from class quadbase.common.param.HtmlParameterPageWriter
DEFAULT_DATE_FORMAT, DEFAULT_TIMESTAMP_FORMAT, serverName, servletDirectory, servletName, servletRunnerPortFields inherited from class quadbase.common.param.ParameterPageWriter
alignment, backgroundColor, backgroundImage, dateParameterCalendar, dateParameterCalendarDatepicker, dateParameterSelection, dateVariable, dateVariableDatepicker, dbInfo, docTitle, extraFormContent, footer, format, header, page, paramDateFormat, paramNameArr, paramPageExportFormats, paramPageLayout, paramPageResetEnabled, paramValueArr, securityLevel, tableBackgroundColor, tableBorderColor, tableBorderThickness, tableOuterBorderOnly, targetLoc, textColor, textFont, textSize, textStyle, titleText, titleTextColor, titleTextFont, titleTextSize, titleTextStyleFields inherited from class java.io.PrintWriter
out -
Constructor Summary
ConstructorsConstructorDescriptionCssHtmlParameterPageWriter(ParameterPage page, Writer out) Allocates a CssHtmlParameterPageWriterCssHtmlParameterPageWriter(ParameterPage page, Writer out, boolean isEspressMobile) -
Method Summary
Modifier and TypeMethodDescriptionGets the path to the css file in use.voidsetCssFile(String cssFile) Sets the path to the css file to use.voidWrites the content between the <body> and </body> tags (writes tags as well) of the html parameter page and centers it on the page.protected voidWrites the conclusion/footer component (the String footer that is set using ParameterPage.setFooter()) of the contents inside the <body> and </body> tags of the HTML parameter page.protected voidWrites the preface/header component (the String header that is set using ParameterPage.setHeader()) of the contents inside the <body> and </body> tags of the HTML parameter page.protected voidWrites the form buttons (submit and reset).voidWrites only the content between the <head> and </head> tags of the parameter page.protected voidwriteParamTableCategory(String paramName, String tdAttributes) Writes a parameter table category component inside the parameter table enclosed in <TD> and </TD> tags.protected voidWrites the <TABLE> tag for the parameter table.protected voidwriteParamTableValue(String name, String value, String tdAttributes) Writes a parameter table value component inside the parameter table enclosed in <TD> and </TD> tags.protected voidwriteParamTableValues(String name, String selectAttributes, Vector values, String paramValue, String tdAttributes) Writes a parameter table values component inside the parameter table enclosed in <TD> and </TD> tags.protected voidwriteParamValue(String name, String value) Writes a parameter value component.protected voidwriteParamValueDate(String name, String value, Param param) Writes the parameter value component.protected voidwriteParamValues(String name, String attributes, Vector values, String paramValue) Writes a parameter values component.protected voidWrites the reset button.protected voidWrites the submit button.voidWrites the title of the parameter tableMethods inherited from class quadbase.common.param.HtmlParameterPageWriter
getHiddenParameters, getHtmlWriter, getParamDisplayNames, getServletName, printCalendarJavascript, printDateVariableJavascript, setHiddenParameters, setHiddenParameterValues, setJavaScriptLibPath, setParamDisplayNames, writeBodyBody, writeHeadJavascript, writeHiddenParamValue, writePage, writePageExportFormats, writeParamName, writeParamTable, writeParamTable, writeParamTableCloseTag, writeParamTableMain, writeParamTableValue, writeParamValue, writeParamValuesOptions, writeParamValuesOptionsYUIMethods inherited from class quadbase.common.param.ParameterPageWriter
refreshMethods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, writeMethods inherited from class java.io.Writer
nullWriter
-
Constructor Details
-
CssHtmlParameterPageWriter
Allocates a CssHtmlParameterPageWriter- Parameters:
page- the ParameterPage to writeout- the output to write to
-
CssHtmlParameterPageWriter
-
-
Method Details
-
setCssFile
Sets the path to the css file to use. Can be relative or absolute. This method must be called to set the correct external css file to use for this page. There is no internal style defined for any CSS classes- Parameters:
cssFile- the path to the external css style sheet
-
getCssFile
Gets the path to the css file in use. Can be relative or absolute. -
writeHead
public void writeHead()Writes only the content between the <head> and </head> tags of the parameter page. This will include the link tag which points to the css file.- Overrides:
writeHeadin classHtmlParameterPageWriter
-
writeBody
public void writeBody()Writes the content between the <body> and </body> tags (writes tags as well) of the html parameter page and centers it on the page. This includes the table title, form, parameter table and form buttonsCSS Tags used include:
<table class="paramTable"invalid input: '>'
<td class="paramTableCategory">
<td class="paramTableValues">
<div class="paramValue_X"> // X represents the index of the parameter
<select class="paramValue_X_input"> // X represents the index of the parameter
<input class="submitButton">
<input class="resetButton">- Overrides:
writeBodyin classHtmlParameterPageWriter
-
writeTableTitle
public void writeTableTitle()Writes the title of the parameter table- Overrides:
writeTableTitlein classHtmlParameterPageWriter
-
writeBodyHeader
protected void writeBodyHeader()Description copied from class:HtmlParameterPageWriterWrites the preface/header component (the String header that is set using ParameterPage.setHeader()) of the contents inside the <body> and </body> tags of the HTML parameter page.- Overrides:
writeBodyHeaderin classHtmlParameterPageWriter
-
writeParamTableOpenTag
protected void writeParamTableOpenTag()Description copied from class:HtmlParameterPageWriterWrites the <TABLE> tag for the parameter table.- Overrides:
writeParamTableOpenTagin classHtmlParameterPageWriter
-
writeParamTableCategory
Description copied from class:HtmlParameterPageWriterWrites a parameter table category component inside the parameter table enclosed in <TD> and </TD> tags. A parameter table category is a generalized component for all parameter names.- Overrides:
writeParamTableCategoryin classHtmlParameterPageWriter- Parameters:
paramName- the name of the parametertdAttributes- the attributes for the <TD> tag
-
writeParamTableValues
protected void writeParamTableValues(String name, String selectAttributes, Vector values, String paramValue, String tdAttributes) Description copied from class:HtmlParameterPageWriterWrites a parameter table values component inside the parameter table enclosed in <TD> and </TD> tags. A parameter table values component is a generalized component for all parameter values components.- Overrides:
writeParamTableValuesin classHtmlParameterPageWriter- Parameters:
name- the name of the INPUT elementselectAttributes- the attributes for the selection listvalues- the list of possible values that the parameter can takeparamValue- the selected parameter valuetdAttributes- the attributes for the <TD> tag
-
writeParamTableValue
Description copied from class:HtmlParameterPageWriterWrites a parameter table value component inside the parameter table enclosed in <TD> and </TD> tags. A parameter table value component is a generalized component for all parameter value components.- Overrides:
writeParamTableValuein classHtmlParameterPageWriter- Parameters:
name- the name of the INPUT elementvalue- the default value of the text boxtdAttributes- the attributes for the <TD> tag
-
writeParamValue
Description copied from class:HtmlParameterPageWriterWrites a parameter value component. A parameter value component is an input text box for inputting a parameter value for a parameter.- Overrides:
writeParamValuein classHtmlParameterPageWriter- Parameters:
name- the name of the INPUT elementvalue- the default value of the text box
-
writeParamValueDate
Description copied from class:HtmlParameterPageWriterWrites the parameter value component. If it is a date and date parameter selection is OFF and date parameter calendar is ON, prints the calendar javascript image and function call.- Overrides:
writeParamValueDatein classHtmlParameterPageWriter- Parameters:
name- the name of the INPUT elementvalue- the default value of the text boxparam- the parameter that holds information about custom date format if applicable.
-
writeParamValues
Description copied from class:HtmlParameterPageWriterWrites a parameter values component. A parameter values component is a select list for choosing the parameter value for a parameter.- Overrides:
writeParamValuesin classHtmlParameterPageWriter- Parameters:
name- the name of the SELECT elementattributes- the String of attributes to be included in the SELECT element (ex. <SELECT attributes></SELECT>values- a vector of values to be included in the options of the select listparamValue- the value to be selected, if it exists in the VALUES argument
-
writeFormButtons
protected void writeFormButtons()Description copied from class:HtmlParameterPageWriterWrites the form buttons (submit and reset).- Overrides:
writeFormButtonsin classHtmlParameterPageWriter
-
writeSubmitButton
protected void writeSubmitButton()Description copied from class:HtmlParameterPageWriterWrites the submit button.- Overrides:
writeSubmitButtonin classHtmlParameterPageWriter
-
writeResetButton
protected void writeResetButton()Description copied from class:HtmlParameterPageWriterWrites the reset button.- Overrides:
writeResetButtonin classHtmlParameterPageWriter
-