net.xoetrope.html
Class XPassword

java.lang.Object
  extended by net.xoetrope.html.XHtmlWidget
      extended by net.xoetrope.html.XPassword
All Implemented Interfaces:
XTextHolder

public class XPassword
extends XHtmlWidget
implements XTextHolder

A wrapper for the Swing JFormattedTextField class

Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt


Field Summary
protected  netscape.javascript.JSObject obj
           
 
Fields inherited from class net.xoetrope.html.XHtmlWidget
currentProject, divElement, htmlDoc, imageElement, inputElement, labelElement, metaElement, olElement, selectElement, tableElement, textareaElement, ulElement
 
Constructor Summary
XPassword()
          Creates a new XPassword
XPassword(org.w3c.dom.html.HTMLInputElement inputElement)
          Create a new XPassword based on an existing HTML password field.
XPassword(java.lang.String id)
          Create a new Xpassword with an id.
 
Method Summary
 void blur()
          Lose focus on the current password field.
 void focus()
          Focus on the current password field.
 java.lang.String getAlign()
          Get the align attribute of the XPassword.
 java.lang.String getAlternativeName()
          Get the alt attribute of the XPassword.
 java.lang.String getAttribute(java.lang.String attribName)
          Get an attribute value
 java.lang.String getBackgroundColor()
          Get the background color of the XPassword.
 java.lang.String getDefaultValue()
          Get the default value of the XPassword.
 java.lang.String getFontColor()
          Get the font color of the XPassword's elements.
 int getFontSize()
          Get the size of the XPassword's text.
 org.w3c.dom.html.HTMLFormElement getForm()
          Get the form this XPassword belongs to.
 org.w3c.dom.html.HTMLInputElement getHTMLElement()
          Get the HTML element at which refers the XPassword.
 int getMaxLength()
          Get the max number of characters the password field can handle.
 java.lang.String getSize()
          Get the size of the password field.
 java.lang.String getText()
          Get the text content of the current password field.
 java.lang.Object getValue()
          Get the Object value of the text field
 void select()
          Select the content of the password field.
 void setAlign(java.lang.String align)
          Set the align attribute of the XPassword
 void setAlternativeName(java.lang.String name)
          Set the alt attribute of the XPassword.
 void setAttribute(java.lang.String attribName, java.lang.Object attribValue)
          Set one or more attributes of the component.
 void setBackgroundColor(java.lang.String hexColor)
          Set the background color of the XPassword.
 void setDefaultValue(java.lang.String value)
          Set the default value of the XPassword.
 void setEnabled(boolean enabled)
          Set the XPassword enabled or disabled.
 void setFontColor(java.lang.String hexColor)
          Set the font color of the XPassword's elements.
 void setFontSize(int fontsize)
          Set the size of the XPassword's text.
 void setMaxLength(int maxLength)
          Set the maximum number of characters the password field can handle.
 void setSize(int width)
          Set the size of the password field.
 void setText(java.lang.String text)
          Set the text content of the current password field.
 void setValue(java.lang.Object value)
          Set the Object value for the text field
 void setVisible(boolean visible)
          Set the XPassword visible or invisible.
 
Methods inherited from class net.xoetrope.html.XHtmlWidget
addEvent, setObject, setObject, setObject, setObject, setObject, setObject, setObject, setObject, setObject, setObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

obj

protected netscape.javascript.JSObject obj
Constructor Detail

XPassword

public XPassword()
Creates a new XPassword


XPassword

public XPassword(java.lang.String id)
Create a new Xpassword with an id.

Parameters:
id - the id of the password field

XPassword

public XPassword(org.w3c.dom.html.HTMLInputElement inputElement)
Create a new XPassword based on an existing HTML password field.

Parameters:
inputElement - the HTML input tag the XPassword refers to
Method Detail

blur

public void blur()
Lose focus on the current password field.


focus

public void focus()
Focus on the current password field.


select

public void select()
Select the content of the password field.


setDefaultValue

public void setDefaultValue(java.lang.String value)
Set the default value of the XPassword.

Parameters:
value - the default value

getDefaultValue

public java.lang.String getDefaultValue()
Get the default value of the XPassword.

Returns:
the default value

getText

public java.lang.String getText()
Get the text content of the current password field.

Specified by:
getText in interface XTextHolder
Returns:
the current text value of the password field

setText

public void setText(java.lang.String text)
Set the text content of the current password field.

Specified by:
setText in interface XTextHolder
Parameters:
text - the new text value of the password field

getValue

public java.lang.Object getValue()
Get the Object value of the text field

Returns:
the Object value for this field

setValue

public void setValue(java.lang.Object value)
Set the Object value for the text field

Parameters:
value - the new object value

setVisible

public void setVisible(boolean visible)
Set the XPassword visible or invisible.

Parameters:
visible - true if visible, false otherwise

setEnabled

public void setEnabled(boolean enabled)
Set the XPassword enabled or disabled.

Parameters:
enabled - true if enabled, false otherwise

setAttribute

public void setAttribute(java.lang.String attribName,
                         java.lang.Object attribValue)
Set one or more attributes of the component.

Parameters:
attribName - the name of the attribute
attribValue - the value of the attribute

getAttribute

public java.lang.String getAttribute(java.lang.String attribName)
Get an attribute value

Parameters:
attribName - the attribute which value is requested
Returns:
the value of this attribute

setAlign

public void setAlign(java.lang.String align)
Set the align attribute of the XPassword

Parameters:
align - the alignment of the XPassword (left, right, center, justified)

getAlign

public java.lang.String getAlign()
Get the align attribute of the XPassword.

Returns:
the alignment of this XPassword

setAlternativeName

public void setAlternativeName(java.lang.String name)
Set the alt attribute of the XPassword.

Parameters:
name - the alternative name to be displayed

getAlternativeName

public java.lang.String getAlternativeName()
Get the alt attribute of the XPassword.

Returns:
the alternative name for this XPassword

getForm

public org.w3c.dom.html.HTMLFormElement getForm()
Get the form this XPassword belongs to.

Returns:
the HTML Form element

setMaxLength

public void setMaxLength(int maxLength)
Set the maximum number of characters the password field can handle.

Parameters:
maxLength - the maximum length

getMaxLength

public int getMaxLength()
Get the max number of characters the password field can handle.

Returns:
the maximum length

setSize

public void setSize(int width)
Set the size of the password field.

Parameters:
width - the size of the password field

getSize

public java.lang.String getSize()
Get the size of the password field.

Returns:
the size of the password field

getFontSize

public int getFontSize()
Get the size of the XPassword's text.

Returns:
the int value of the font size

setFontSize

public void setFontSize(int fontsize)
Set the size of the XPassword's text.

Parameters:
fontsize - the int value of the font size

getBackgroundColor

public java.lang.String getBackgroundColor()
Get the background color of the XPassword.

Returns:
the hexadecimal value of the background color

setBackgroundColor

public void setBackgroundColor(java.lang.String hexColor)
Set the background color of the XPassword.

Parameters:
hexColor - the hexadecimal value of the background color

getFontColor

public java.lang.String getFontColor()
Get the font color of the XPassword's elements.

Returns:
the hexadecimal value of the font color

setFontColor

public void setFontColor(java.lang.String hexColor)
Set the font color of the XPassword's elements.

Parameters:
hexColor - the hexadecimal value of the font color

getHTMLElement

public org.w3c.dom.html.HTMLInputElement getHTMLElement()
Get the HTML element at which refers the XPassword.

Returns:
the HTML element.