com.plumtree.xpshared.htmlelements
Class HTMLInput

java.lang.Object
  extended by com.plumtree.xpshared.htmlelements.HTMLElement
      extended by com.plumtree.xpshared.htmlelements.HTMLGenericInputElement
          extended by com.plumtree.xpshared.htmlelements.HTMLInput
All Implemented Interfaces:
TabableHTMLElement, java.lang.Cloneable

public class HTMLInput
extends HTMLGenericInputElement
implements TabableHTMLElement

This class can be used to render an html input element.

Spec

This class extends HTMLGeneralInputElement. This means that objects of this class can be used to set name/value pairs within a form.

This class also implements TabableHTMLElement. This means that this class can generate a tabindex property that helps to guide the clients browser as the client tabs through form elements.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.plumtree.xpshared.htmlelements.HTMLElement
HTMLElement.ValidationLevel
 
Field Summary
static boolean bForceTextInputSizing
          Set this to toggle whether or not input sizes are converted to netscape comparable sizes.
 
Fields inherited from class com.plumtree.xpshared.htmlelements.HTMLElement
aNewLine, bAllowEvents, bAllowSetStyleClassWithString, bCheckNestedStringForHTML, bDisplayDidPause, bEnforceMaxTableDepth, bForceFormattingOff, bForceFormattingOn, bPauseAfterDisplay, bPrintComments, bResumingAndChildFinished, bResumingAndChildInMidRender, bShowLang, iMaxTableDepth, sLangLocal, sNewLine, sTab
 
Constructor Summary
HTMLInput(HTMLInputTypes t, java.lang.String sAlt)
           
HTMLInput(HTMLInputTypes t, java.lang.String sTagName, java.lang.String alt)
           
HTMLInput(HTMLInputTypes t, java.lang.String sTagName, java.lang.String sID, java.lang.String alt)
           
HTMLInput(int iHTMLInputType, java.lang.String sTagName, java.lang.String alt)
          Call this method to create a new HTMLInput object.
HTMLInput(int iHTMLInputType, java.lang.String sTagName, java.lang.String sID, java.lang.String alt)
           
 
Method Summary
protected  void AppendBeginningOfOpeningTag(boolean bFormat, XPStringBuilder sb, IXPResponse response)
          This method generates the beginning of the opening tag.
protected  void AppendClosingTag(boolean bFormat, XPStringBuilder sb, IXPResponse response)
          This method generates the closing tag of this html element.
 void ClearTabIndex()
          Call this method to remove the tab index from this HTMLElement.
 java.lang.String GetAccessKey()
          Call this method to get the value of the accesskey attribute.
 java.lang.String GetAlign()
          Get the value of the align attribute.
 java.lang.String GetAlt()
          Get the value of the alt attribute.
 boolean GetAutoComplete()
           
 boolean GetChecked()
          Get the value of the checked attribute.
 HTMLInputTypes GetHTMLInputType()
          Returns the HTMLInputTypes object associated with this.
 java.lang.String GetMaxLength()
          Get the value of the maxlength attribute.
 java.lang.String GetOnClick()
          Get the value of the onclick attribute.
 java.lang.String GetOnKeyDown()
          Get the value of the onkeydown attribute.
 boolean GetReadOnly()
          Get the value of the readonly attribute.
 java.lang.String GetSize()
          Get the value of the size attribute.
 java.lang.String GetSrc()
          Get the value of the src attribute.
 java.lang.String GetTabIndex()
          Call this method to get the value of the tabindex attribute.
static int IESizeToNSSize(int iSize)
          Call this method to convert a size in IE to an equivalent size in Netscape.
protected  boolean ProvidesClosingTag()
          Indicates whether or not this HTML element provides a closing tag.
 void SetAccessKey(java.lang.String s)
          Call this method to set the value of the accesskey attribute.
 void SetAlign(java.lang.String s)
          Set the value of the align attribute.
 void SetAlt(java.lang.String s)
          Set the value of the alt attribute.
 void SetAutoComplete(boolean _bAutoComplete)
          Set the value of the autocomplete attribute.
 void SetChecked(boolean bInputChecked)
          Set the value of the checked attribute.
 void SetMaxLength(int i)
          Set the value of the maxlength attribute.
 void SetMaxLength(java.lang.String s)
          Set the value of the maxlength attribute.
 void SetOnClick(java.lang.String s)
          Set the value of the onclick attribute.
 void SetOnKeyDown(java.lang.String s)
          Set the value of the onkeydown attribute.
 void SetReadOnly(boolean bInputReadOnly)
          Set the value of the readonly attribute.
 void SetSize(int i)
          Set the value of the size attribute.
 void SetSize(int i, boolean bConvertIEToNS)
          Call this method to set the size on this input.
 void SetSize(java.lang.String s)
          Set the value of the size attribute.
 void SetSize(java.lang.String s, boolean bConvertIEToNS)
          Call this method to set the size on this input.
 void SetSrc(java.lang.String sUrl)
          Set the value of the src attribute.
 void SetTabIndex(java.lang.String s)
          Call this method to set the value of the tabindex attribute.
 void ValidateName(java.lang.String s)
          Check to see if a name string is valid.
 
Methods inherited from class com.plumtree.xpshared.htmlelements.HTMLGenericInputElement
GetOnBlur, GetOnChange, GetOnFocus, GetValue, SetName, SetOnBlur, SetOnChange, SetOnFocus, SetValidateName, SetValue
 
Methods inherited from class com.plumtree.xpshared.htmlelements.HTMLElement
AddInnerHTMLElement, AddInnerHTMLEncodedString, AddInnerHTMLString, AppendClosingLineBreak, CleanupHTMLSubtreeAfterRendering, ClearInnerHTMLElements, clone, Display, Display, ForceFormattingOff, GetChildInMidRender, GetClone, GetDisabled, GetDisplayDidPause, GetDisplayOptions, GetDisplayString, GetDisplayString, GetDisplayString, GetDo508Checking, GetDoFormat, GetElementName, GetForceLineBreaksAfterSafeElements, GetHTMLElementReadOnly, GetID, GetImgBaseUrl, GetInnerHTML, GetInnerHTML, GetInnerHTMLDisplayString, GetInnerHTMLElements, GetInnerHTMLElementsAsArrayList, GetIsNetscape, GetLang, GetLastChildFullyRendered, GetName, GetOnKeyPress, GetOnKeyUp, GetOnMouseOut, GetOnMouseOver, GetPauseAfterDisplay, GetPostComment, GetPreComment, GetStringBuilder, GetStyle, GetStyleClass, GetStyleClassPrefix, GetTitle, GetValidationLevel, InsertInnerHTMLElement, InternalWrite, SaveToTempFile, SaveToTempFile, SetChildInMidRender, SetDisabled, SetDisplayOptions, SetDo508Checking, SetDoFormat, SetElementName, SetFlushAfterDisplay, SetForceLineBreaksAfterSafeElements, SetHTMLElementReadOnly, SetID, SetImgBaseUrl, SetInner, SetIsNetscape, SetLangGlobal, SetLangLocal, SetLastChildFullyRendered, SetOnKeyPress, SetOnKeyUp, SetOnMouseOut, SetOnMouseOver, SetPauseAfterDisplay, SetPostComment, SetPreComment, SetStyle, SetStyleClass, SetStyleClass, SetStyleClassPrefix, SetTitle, SetValidationLevel, ToByteArray, VerifyWritability, WriteNugget, WriteNugget
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bForceTextInputSizing

public static boolean bForceTextInputSizing
Set this to toggle whether or not input sizes are converted to netscape comparable sizes. If true, the SetSize() method will look to the root of the display tree to determine whether the HTML output is intended for an IE browser or a Netscape browser.

Constructor Detail

HTMLInput

public HTMLInput(HTMLInputTypes t,
                 java.lang.String sTagName,
                 java.lang.String sID,
                 java.lang.String alt)
Parameters:
t - Pass an HTMLInputTypes object.
sTagName - Pass the name of this input element.
sID - Pass the ID of this input element
alt - Pass the alt attribute value.
Throws:
HTMLException

HTMLInput

public HTMLInput(int iHTMLInputType,
                 java.lang.String sTagName,
                 java.lang.String sID,
                 java.lang.String alt)
Parameters:
iHTMLInputType - Pass an int from the HTMLInputTypes enumeration.
sTagName - Pass the name of this input element.
sID - Pass the ID of this input element
alt - Pass the alt attribute value.
Throws:
HTMLException

HTMLInput

public HTMLInput(HTMLInputTypes t,
                 java.lang.String sAlt)
Parameters:
t - Pass an HTMLInputTypes object.
alt - Pass the alt attribute value.
Throws:
HTMLException

HTMLInput

public HTMLInput(HTMLInputTypes t,
                 java.lang.String sTagName,
                 java.lang.String alt)
Parameters:
t - Pass an HTMLInputTypes object.
sTagName - Pass the name of this input element.
alt - Pass the alt attribute value.
Throws:
HTMLException

HTMLInput

public HTMLInput(int iHTMLInputType,
                 java.lang.String sTagName,
                 java.lang.String alt)
Call this method to create a new HTMLInput object.

Parameters:
iHTMLInputType - Pass an int describing the type of this input element.
sTagName - Pass the name of this element.
alt - Pass the alt attribute of this element.
Throws:
HTMLException
See Also:
HTMLInputTypes
Method Detail

GetHTMLInputType

public HTMLInputTypes GetHTMLInputType()
Returns the HTMLInputTypes object associated with this.

Returns:
HTMLInputTypes the typ of input.

GetAlign

public java.lang.String GetAlign()
Get the value of the align attribute.

Returns:
String value

GetAlt

public java.lang.String GetAlt()
Get the value of the alt attribute.

Returns:
String value

GetChecked

public boolean GetChecked()
Get the value of the checked attribute.

Returns:
boolean value

GetOnClick

public java.lang.String GetOnClick()
Get the value of the onclick attribute.

Overrides:
GetOnClick in class HTMLElement
Returns:
String value

GetAutoComplete

public boolean GetAutoComplete()

GetOnKeyDown

public java.lang.String GetOnKeyDown()
Get the value of the onkeydown attribute.

Overrides:
GetOnKeyDown in class HTMLElement
Returns:
String value

GetReadOnly

public boolean GetReadOnly()
Get the value of the readonly attribute.

Returns:
boolean value

GetTabIndex

public java.lang.String GetTabIndex()
Description copied from interface: TabableHTMLElement
Call this method to get the value of the tabindex attribute.

Specified by:
GetTabIndex in interface TabableHTMLElement
Returns:
The String value of the tabindex attribute.

IESizeToNSSize

public static int IESizeToNSSize(int iSize)
Call this method to convert a size in IE to an equivalent size in Netscape.

Parameters:
iSize - int
Returns:
int size in Netscape units.

GetMaxLength

public java.lang.String GetMaxLength()
Get the value of the maxlength attribute.

Returns:
String value

GetSize

public java.lang.String GetSize()
Get the value of the size attribute.

Returns:
String value

GetSrc

public java.lang.String GetSrc()
Get the value of the src attribute.

Returns:
String value

SetAlign

public void SetAlign(java.lang.String s)
Set the value of the align attribute.

Parameters:
s - String value.

SetAlt

public void SetAlt(java.lang.String s)
Set the value of the alt attribute.

Parameters:
s - String value.

SetChecked

public void SetChecked(boolean bInputChecked)
Set the value of the checked attribute.

Parameters:
bInputChecked - boolean value.

SetAutoComplete

public void SetAutoComplete(boolean _bAutoComplete)
Set the value of the autocomplete attribute.

Parameters:
_bAutoComplete - boolean value (false = disable autocomplete)

SetMaxLength

public void SetMaxLength(int i)
Set the value of the maxlength attribute.

Parameters:
i - size

SetMaxLength

public void SetMaxLength(java.lang.String s)
Set the value of the maxlength attribute.

Parameters:
s - String value.

SetOnClick

public void SetOnClick(java.lang.String s)
Set the value of the onclick attribute.

Overrides:
SetOnClick in class HTMLElement
Parameters:
s - String value.

SetOnKeyDown

public void SetOnKeyDown(java.lang.String s)
Set the value of the onkeydown attribute.

Overrides:
SetOnKeyDown in class HTMLElement
Parameters:
s - String value.

SetReadOnly

public void SetReadOnly(boolean bInputReadOnly)
Set the value of the readonly attribute.

Parameters:
bInputReadOnly - value

SetSize

public void SetSize(int i)
Set the value of the size attribute.

Parameters:
i - value.

SetSize

public void SetSize(int i,
                    boolean bConvertIEToNS)
Call this method to set the size on this input. This method can be used to convert an IE size to an NS size. Using this method, you can pass a single size value, and the input resulting will look mostly the same in Netscape and IE.

Parameters:
i - Pass an int. This int should make this input appear the correct size when viewed in IE.

bConvertIEToNS - Pass a boolean indicating whether or not the first parameter should be converted to an Netscap size.

SetSize

public void SetSize(java.lang.String s)
Set the value of the size attribute.

Parameters:
s - String value.

SetSize

public void SetSize(java.lang.String s,
                    boolean bConvertIEToNS)
Call this method to set the size on this input. This method can be used to convert an IE size to an NS size. Using this method, you can pass a single size value, and the input resulting will look mostly the same in Netscape and IE.

Parameters:
s - Pass a String that is parsable to an int. This String should make this input appear the correct size when viewed in IE.

bConvertIEToNS - Pass a boolean indicating whether or not the first parameter should be converted to an Netscap size.

SetSrc

public void SetSrc(java.lang.String sUrl)
Set the value of the src attribute.

Parameters:
sUrl - String value.

SetTabIndex

public void SetTabIndex(java.lang.String s)
Description copied from interface: TabableHTMLElement
Call this method to set the value of the tabindex attribute.

Specified by:
SetTabIndex in interface TabableHTMLElement
Parameters:
s - Pass the String value.

SetAccessKey

public void SetAccessKey(java.lang.String s)
Call this method to set the value of the accesskey attribute.

Parameters:
s - Pass the String value.

GetAccessKey

public java.lang.String GetAccessKey()
Call this method to get the value of the accesskey attribute.

Returns:
The String value of the accesskey attribute.

ClearTabIndex

public void ClearTabIndex()
Description copied from interface: TabableHTMLElement
Call this method to remove the tab index from this HTMLElement.

Specified by:
ClearTabIndex in interface TabableHTMLElement

ValidateName

public void ValidateName(java.lang.String s)
Check to see if a name string is valid.

Specified by:
ValidateName in class HTMLGenericInputElement
Parameters:
s - Name string.
Throws:
HTMLException - Throws an exception if the name passed isn't valid.

AppendBeginningOfOpeningTag

protected void AppendBeginningOfOpeningTag(boolean bFormat,
                                           XPStringBuilder sb,
                                           IXPResponse response)
This method generates the beginning of the opening tag. The abstract HTMLElement superclass will provide the remainder of the opening tag, repleate with attributes common to all html elements, such as name, and id, and class.

Specified by:
AppendBeginningOfOpeningTag in class HTMLElement
Parameters:
bFormat - boolean indicating whether or not to format.
sb - XPStringBuilder
response - IXPResponse

AppendClosingTag

protected void AppendClosingTag(boolean bFormat,
                                XPStringBuilder sb,
                                IXPResponse response)
This method generates the closing tag of this html element. If the providesClosingTag method returns false, then this method will never be called.

Specified by:
AppendClosingTag in class HTMLElement
Parameters:
bFormat - boolean indicating whether or not to format.
sb - XPStringBuilder
response - IXPResponse

ProvidesClosingTag

protected boolean ProvidesClosingTag()
Indicates whether or not this HTML element provides a closing tag. Some elements only provide opening tags, such as the <br> element.

Specified by:
ProvidesClosingTag in class HTMLElement
Returns:
boolean false.



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.