objectivehtml.htmlwidget
Class HtmlText

java.lang.Object
  |
  +--objectivehtml.oms.OMSObject
        |
        +--objectivehtml.htmlwidget.HtmlElement
              |
              +--objectivehtml.htmlwidget.HtmlWidget
                    |
                    +--objectivehtml.htmlwidget.HtmlText
Direct Known Subclasses:
HtmlSpan

public class HtmlText
extends HtmlWidget

This class provides the developer with a generic way of inserting plain text or html text into the form.

Unlike the other widgets, this object doesn't really represent any specific html element. There are generally 2 purposes this object can be used for. The first purpose is simply to use the object to get plain text into the form. The second purpose is when you need to include specific html code in the form.

If auto-escape is turned on (default) then the text will be escaped (using HtmlUtils.htmlSpecialChars(String)) before being written out. This should generally be turned on if your text is just plain text, if you have html to write then auto-escape should be turned off.

See Also:
HtmlUtils.htmlSpecialChars(String)

Fields inherited from class objectivehtml.htmlwidget.HtmlWidget
m_bDestroyed, m_bVisible, m_objHtmlForm, m_objParentWidget
 
Fields inherited from class objectivehtml.htmlwidget.HtmlElement
m_hmAttributes, m_sEndTag, m_sQuoteType, m_sStartTag
 
Constructor Summary
HtmlText(HtmlContainerWidget objParent)
          The constructs an instance of HtmlText with parent objParent.
 
Method Summary
 void destroy()
          Overrides the default implementation to make this method public.
 java.lang.String getText()
          Returns the text for this object.
 boolean isAutoEscape()
          Returns whether the auto-escape feature is on or not.
 void printHtml(javax.servlet.jsp.JspWriter objWriter, int nOutputType)
          Prints the html that represents this object to the output stream.
 void printHtml(java.io.PrintWriter objWriter, int nOutputType)
          Prints the html that represents this object to the output stream.
 void setAutoEscape(boolean bAutoEscape)
          Sets the auto-escape feature to be either on (default) or off.
 void setText(java.lang.String sText)
          Sets the text for this object.
 void setVisible(boolean bVisible)
          Sets the visibility of this object.
 
Methods inherited from class objectivehtml.htmlwidget.HtmlWidget
changeParent, changeParent, getClassAttribute, getHtmlForm, getID, getOnClick, getOnDblClick, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getParent, getStyle, isDestroyed, isVisible, setClassAttribute, setID, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setStyle
 
Methods inherited from class objectivehtml.htmlwidget.HtmlElement
genEndTag, genStartTag, genStartTag, getAttribute, getAttributes, getBooleanAttribute, getQuoteType, printHtml, printHtml, printHtml, printHtml, printHtml, printHtml, setAttribute, setBooleanAttribute, setQuoteType, toString, toString
 
Methods inherited from class objectivehtml.oms.OMSObject
compareClasses, connect, disconnect, emit, isAlive, setAlive, signal, slot, slot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HtmlText

public HtmlText(HtmlContainerWidget objParent)
         throws InvalidParentWidgetException,
                InvalidChildWidgetException
The constructs an instance of HtmlText with parent objParent.
Parameters:
objParent - the parent object of this table
Throws:
InvalidParentWidgetException - if the specified parent widget is not valid
InvalidChildWidgetException - if the parent widget does not accept this widget as a child
Method Detail

setVisible

public void setVisible(boolean bVisible)
Sets the visibility of this object. Overrides protected method to be public.
Overrides:
setVisible in class HtmlWidget
Parameters:
bVisible - true if visible, false otherwise

setText

public void setText(java.lang.String sText)
Sets the text for this object.
Parameters:
sText - plain text/html text

getText

public java.lang.String getText()
Returns the text for this object.
Returns:
the plain text/html text

setAutoEscape

public void setAutoEscape(boolean bAutoEscape)
Sets the auto-escape feature to be either on (default) or off. If auto-escape is set as true then the text part of this object will have any html entity characters escaped with the HtmlUtils.htmlSpecialChars(String) method.
Parameters:
bAutoEscape - true if you want auto-escape on (default), false otherwise
See Also:
HtmlUtils.htmlSpecialChars(String), isAutoEscape()

isAutoEscape

public boolean isAutoEscape()
Returns whether the auto-escape feature is on or not.
Returns:
true if auto-escape is on, false otherwise
See Also:
setAutoEscape(boolean)

destroy

public void destroy()
Overrides the default implementation to make this method public.
Overrides:
destroy in class HtmlWidget
Following copied from class: objectivehtml.htmlwidget.HtmlWidget
See Also:
HtmlWidget.isDestroyed()

printHtml

public void printHtml(java.io.PrintWriter objWriter,
                      int nOutputType)
               throws java.io.IOException
Prints the html that represents this object to the output stream.
Overrides:
printHtml in class HtmlElement
Parameters:
objWriter - the output stream for a Servlet object
nOutputType - the output type

printHtml

public void printHtml(javax.servlet.jsp.JspWriter objWriter,
                      int nOutputType)
               throws java.io.IOException
Prints the html that represents this object to the output stream.
Overrides:
printHtml in class HtmlElement
Parameters:
objWriter - the output stream for a Jsp page
nOutputType - the output type