net.xoetrope.html
Class XEdit

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

public class XEdit
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
XEdit()
          Create a new XEdit
XEdit(org.w3c.dom.html.HTMLInputElement inputElement)
          Create a new XEdit based on an existing HTML edit field.
XEdit(java.lang.String value, java.lang.String id)
          Create a new XEdit with an id and a specific value.
 
Method Summary
 void blur()
          Lose focus on the current edit field.
 void focus()
          Focus on the current edit field.
 java.lang.String getAlign()
          Get the align attribute of the XEdit.
 java.lang.String getAlternativeName()
          Get the alt attribute of the XEdit.
 java.lang.String getAttribute(java.lang.String attribName)
          Get an attribute value
 java.lang.String getBackgroundColor()
          Get the background color of the XEdit.
 java.lang.String getDefaultValue()
          Get the default value of the XEdit.
 java.lang.String getFontColor()
          Get the font color of the XEdit's elements.
 int getFontSize()
          Get the size of the XEdit's text.
 org.w3c.dom.html.HTMLFormElement getForm()
          Get the form this XEdit belongs to.
 org.w3c.dom.html.HTMLInputElement getHTMLElement()
          Get the HTML element at which refers the XEdit.
 int getMaxLength()
          Get the max number of characters the edit field can handle.
 java.lang.String getSize()
          Get the size of the edit field.
 java.lang.String getText()
          Get the text content of the current edit field.
 java.lang.Object getValue()
          Get the Object value of the text field
 void select()
          Select the content of the edit field.
 void setAlign(java.lang.String align)
          Set the align attribute of the XEdit
 void setAlternativeName(java.lang.String name)
          Set the alt attribute of the XEdit.
 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 XEdit.
 void setDefaultValue(java.lang.String value)
          Set the default value of the XEdit.
 void setEnabled(boolean enabled)
          Set the XEdit enabled or disabled.
 void setFontColor(java.lang.String hexColor)
          Set the font color of the XEdit's elements.
 void setFontSize(int fontsize)
          Set the size of the XEdit's text.
 void setMaxLength(int maxLength)
          Set the maximum number of characters the edit field can handle.
 void setSize(int width)
          Set the size of the edit field.
 void setText(java.lang.String text)
          Set the text content of the current edit field.
 void setValue(java.lang.Object value)
          Set the Object value for the text field
 void setVisible(boolean visible)
          Set the XEdit 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

XEdit

public XEdit()
Create a new XEdit


XEdit

public XEdit(java.lang.String value,
             java.lang.String id)
Create a new XEdit with an id and a specific value.

Parameters:
value - the value in the edit field
id - the id of the edit field

XEdit

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

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

blur

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


focus

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


select

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


setDefaultValue

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

Parameters:
value - the default value

getDefaultValue

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

Returns:
the default value

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

getText

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

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

setText

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

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

setVisible

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

Parameters:
visible - true if visible, false otherwise

setEnabled

public void setEnabled(boolean enabled)
Set the XEdit 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 XEdit

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

getAlign

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

Returns:
the alignment of this XEdit

setAlternativeName

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

Parameters:
name - the alternative name to be displayed

getAlternativeName

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

Returns:
the alternative name for this XEdit

getForm

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

Returns:
the HTML Form element

setMaxLength

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

Parameters:
maxLength - the maximum length

getMaxLength

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

Returns:
the maximum length

setSize

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

Parameters:
width - the size of the edit field

getSize

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

Returns:
the size of the edit field

getFontSize

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

Returns:
the int value of the font size

setFontSize

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

Parameters:
fontsize - the int value of the font size

getBackgroundColor

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

Returns:
the hexadecimal value of the background color

setBackgroundColor

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

Parameters:
hexColor - the hexadecimal value of the background color

getFontColor

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

Returns:
the hexadecimal value of the font color

setFontColor

public void setFontColor(java.lang.String hexColor)
Set the font color of the XEdit'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 XEdit.

Returns:
the HTML element.