com.plumtree.xpshared.htmlelements
Class HTMLSelect

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

public class HTMLSelect
extends HTMLGenericInputElement
implements TabableHTMLElement

This class can be used to obtain a String describing an HTML SELECT element.

Spec

This class extends HTMLGeneralInputElement. This means that objects of this class can be used to set name/value pairs within an HTML 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
 
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
HTMLSelect(java.lang.String sTagName, java.lang.String sTagID)
           
 
Method Summary
 void AddInnerHTMLElement(HTMLElement e)
          HTMLElement.addInnerHTMLElement rewritten.
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.
 boolean GetDoSort()
          Call this method to determine whether or not this select sorts its contents immediately before display.
 java.lang.String GetSize()
           
 java.lang.String GetTabIndex()
          Call this method to get the value of the tabindex attribute.
protected  boolean ProvidesClosingTag()
          Indicates whether or not this HTML element provides a closing tag.
 void SetDoSort(boolean b)
          Call this method to specify whether or not this select will sort its nested options before each display.
protected  void SetHTMLElementReadOnly(boolean bReadOnly)
          This method sets the element to read only and prepares for display, if bReadOnly is true.
 void SetMultiple(boolean bIsMultiple)
          Call this method to set the multiple attribute.
 void SetSize(int i)
          Call this method to set the size attribute value.
 void SetSize(java.lang.String s)
          Call this method to set the size attribute value.
 void SetTabIndex(java.lang.String s)
          Call this method to set the value of the tabindex attribute.
 void SetValue(java.lang.String s)
          Call this method to set the value attribute value.
 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
 
Methods inherited from class com.plumtree.xpshared.htmlelements.HTMLElement
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, GetOnClick, GetOnKeyDown, 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, SetID, SetImgBaseUrl, SetInner, SetIsNetscape, SetLangGlobal, SetLangLocal, SetLastChildFullyRendered, SetOnClick, SetOnKeyDown, 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
 

Constructor Detail

HTMLSelect

public HTMLSelect(java.lang.String sTagName,
                  java.lang.String sTagID)
Parameters:
sTagName - Pass the name of this select.
sTagID - Pass the id of this select.
Throws:
HTMLException
Method Detail

SetHTMLElementReadOnly

protected void SetHTMLElementReadOnly(boolean bReadOnly)
This method sets the element to read only and prepares for display, if bReadOnly is true.

Overrides:
SetHTMLElementReadOnly in class HTMLElement

SetDoSort

public void SetDoSort(boolean b)
Call this method to specify whether or not this select will sort its nested options before each display.

Parameters:
b - boolean To sort or not

GetDoSort

public boolean GetDoSort()
Call this method to determine whether or not this select sorts its contents immediately before display.

Returns:
boolean to sort or not

GetSize

public java.lang.String GetSize()
Returns:

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:

SetMultiple

public void SetMultiple(boolean bIsMultiple)
Call this method to set the multiple attribute.

Parameters:
bIsMultiple - boolean value

SetSize

public void SetSize(int i)
Call this method to set the size attribute value.

Parameters:
i - int size.

SetSize

public void SetSize(java.lang.String s)
Call this method to set the size attribute value.

Parameters:
s - size

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 -

SetValue

public void SetValue(java.lang.String s)
Call this method to set the value attribute value. The nested option having this value will be set selected. If no nested option has this value, an exception will be thrown.

Overrides:
SetValue in class HTMLGenericInputElement
Parameters:
s - String value
Throws:
HTMLException - This method throws an exception if there is no nested HTMLOption object having the specified value, or if this element is read only.

AddInnerHTMLElement

public void AddInnerHTMLElement(HTMLElement e)
HTMLElement.addInnerHTMLElement rewritten.

Overrides:
AddInnerHTMLElement in class HTMLElement
Parameters:
e - Pass an HTMLOption object or an HTMLElementCollection object. If this HTMLSelect sorts its nested children, then each nested HTMLElementCollection will be independantly sorted. These HTMLElementCollection objects must contain exclusively HTMLOption objects. HTMLOption objects nested directly will not be sorted under any circumstances.
Throws:
HTMLException - This method throws an exception if you don't pass an HTMLOption object or a collection of HTMLOptions.

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 true.



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