|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.taursys.xml.Component com.taursys.xml.Parameter com.taursys.xml.AbstractField
A Component which receives input and/or renders value to a Document. It responds to InputEvents and holds the given value. By default, this component uses a VariantTextModel. You can change this by overriding the createDefaultModel method or explicitly setting the model property.
This component can render its value to an xml Document (thru the DocumentAdapter). The id property indicates which element to render in the Document. The attributeName property is only used with an AttributeTextFieldRenderer to indicate which attribute to store the value in. Subclasses must override the processRenderEvent method and should delegate the work to a rendering subcomponent.
Constructor Summary | |
AbstractField()
Constructs a new AbstractField with a default model. |
|
AbstractField(int javaDataType)
Creates a new AbstractField with a DefaultTextModel and VariantValueHolder of the given type. |
Method Summary | |
void |
addAttribute(Attribute attribute)
Add the given Attribute to this Element. |
void |
addNotify()
Registers this component with dispatcher to be notified of ParameterEvents This method invokes the lazyAddNotify method to perform the work |
void |
addTextNode(TextNode t)
Add the given TextNode to this Element. |
Attribute |
createAttribute(java.lang.String attributeName)
Creates and binds an Attribute with the given name to this Element. |
Attribute |
createAttribute(java.lang.String attributeName,
int dataType)
Creates and binds an Attribute of the given type with the given name to this Element. |
Attribute |
createAttribute(java.lang.String attributeName,
java.lang.String propertyName,
ValueHolder holder)
Creates and binds an Attribute with the given name to this Element. |
Attribute |
createBoundAttribute(java.lang.String attributeName,
java.lang.String propertyName)
Creates and binds an Attribute with the given name to this Element. |
TextNode |
createBoundTextNode(java.lang.String propertyName)
Creates and binds a TextNode with the given name to this Element. |
TextNode |
createTextNode()
Creates and binds a TextNode to this Element. |
TextNode |
createTextNode(int dataType)
Creates and binds a TextNode of the given type to this Element. |
TextNode |
createTextNode(java.lang.String propertyName,
ValueHolder holder)
Creates and binds a TextNode with the given name to this Element. |
Attribute |
getAttribute(java.lang.String attributeName)
Gets an Attribute by name or null if it does not exist |
java.lang.String |
getAttributeName()
Returns the name of the Element's attribute where the value should be rendered. |
java.lang.String |
getAttributeText(java.lang.String attributeName)
Gets an Attribute's text value by name or null if it does not exist |
java.lang.Object |
getAttributeValue(java.lang.String attributeName)
Gets an Attribute's Object value by name or null if it does not exist |
ElementDelegate |
getElementDelegate()
Get the ElementDelegate for this component. |
java.lang.String |
getId()
Returns the id of the Element this component is bound to. |
TextNode |
getTextNode()
Gets the TextNode or null if it does not exist |
java.lang.String |
getTextNodeText()
Gets the TextNode's text value or null if it does not exist |
java.lang.Object |
getTextNodeValue()
Gets the TextNode's Object value or null if it does not exist |
boolean |
isEarlyInputNotify()
Get flag for early input notification. |
protected void |
processInputEvent(InputEvent e)
Store value and fires input event if event has correct input name. |
abstract void |
processRenderEvent(RenderEvent e)
Responds to a render event for this component. |
void |
removeAttribute(Attribute attribute)
Removes the given Attribute from this Element and sets its parent to null. |
void |
removeAttribute(java.lang.String attributeName)
Removes the Attribute with the given name from this Container if found. |
void |
removeNotify()
Un-Registers this component with dispatcher. |
void |
removeTextNode()
Removes the TextNode from this Container if exists. |
void |
removeTextNode(TextNode t)
Removes the given TextNode from this Element and sets its parent to null. |
void |
setAttributeName(java.lang.String newAttributeName)
Sets the name of the Element's attribute where the value should be rendered. |
void |
setAttributeText(java.lang.String attributeName,
java.lang.String value)
Sets an Attribute's text value by name or does nothing if it does not exist. |
void |
setAttributeValue(java.lang.String attributeName,
java.lang.Object value)
Sets an Attribute's Object value by name or does nothing if it does not exist. |
void |
setEarlyInputNotify(boolean earlyInputNotify)
Set flag for early input notification. |
void |
setId(java.lang.String newId)
Sets the id of the Element this component is bound to. |
void |
setTextNodeText(java.lang.String value)
Sets the TextNode's text value or does nothing if it does not exist. |
void |
setTextNodeValue(java.lang.Object value)
Sets the TextNode's Object value or does nothing if it does not exist. |
void |
setValueHolder(ValueHolder newValueHolder)
Sets the valueHolder for the model. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class com.taursys.xml.Parameter |
createDefaultModel, createDefaultModel, getDefaultValue, getFormat, getFormatPattern, getModel, getParameter, getPropertyName, getText, getValue, getValueHolder, processParameterEvent, setDefaultValue, setFormat, setFormatPattern, setModel, setParameter, setPropertyName, setText, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AbstractField()
public AbstractField(int javaDataType)
Method Detail |
protected void processInputEvent(InputEvent e) throws java.lang.Exception
processInputEvent
in class Component
java.lang.Exception
public abstract void processRenderEvent(RenderEvent e) throws RenderException
processRenderEvent
in class Component
e
- the RenderEvent to process
RenderException
- for any problems during renderingpublic void setEarlyInputNotify(boolean earlyInputNotify)
earlyInputNotify
- flag for early input notification.public boolean isEarlyInputNotify()
public void setId(java.lang.String newId)
setId
in interface DocumentComponent
public java.lang.String getId()
getId
in interface DocumentComponent
public void setAttributeName(java.lang.String newAttributeName)
public java.lang.String getAttributeName()
public ElementDelegate getElementDelegate()
public java.lang.String toString()
toString
in class Parameter
public void addAttribute(Attribute attribute)
Element
addAttribute
in interface Element
attribute
- the Attribute to addpublic void removeAttribute(Attribute attribute)
Element
removeAttribute
in interface Element
attribute
- the Attribute to removepublic Attribute createAttribute(java.lang.String attributeName)
Element
createAttribute
in interface Element
attributeName
- name of the new Attribute
public Attribute createAttribute(java.lang.String attributeName, int dataType)
Element
createAttribute
in interface Element
attributeName
- name of the new AttributedataType
- the data type for the new Attribute
DataTypes
public Attribute createBoundAttribute(java.lang.String attributeName, java.lang.String propertyName)
Element
createBoundAttribute
in interface Element
attributeName
- name of the new AttributepropertyName
- for the new Attribute
public Attribute createAttribute(java.lang.String attributeName, java.lang.String propertyName, ValueHolder holder)
Element
createAttribute
in interface Element
attributeName
- name of the new AttributepropertyName
- for the new Attributeholder
- ValueHolder for the new Attribute
public Attribute getAttribute(java.lang.String attributeName)
Element
getAttribute
in interface Element
attributeName
- the name of the Attribute
public java.lang.String getAttributeText(java.lang.String attributeName) throws ModelException
Element
getAttributeText
in interface Element
attributeName
- the name of the Attribute
ModelException
public java.lang.Object getAttributeValue(java.lang.String attributeName) throws ModelException
Element
getAttributeValue
in interface Element
attributeName
-
ModelException
public void removeAttribute(java.lang.String attributeName)
Element
removeAttribute
in interface Element
attributeName
- to removepublic void setAttributeText(java.lang.String attributeName, java.lang.String value) throws ModelException
Element
setAttributeText
in interface Element
attributeName
- the name of the Attributevalue
- the new String value for the Attribute
ModelException
public void setAttributeValue(java.lang.String attributeName, java.lang.Object value) throws ModelException
Element
setAttributeValue
in interface Element
attributeName
- value
-
ModelException
public void addTextNode(TextNode t)
Element
addTextNode
in interface Element
public TextNode createBoundTextNode(java.lang.String propertyName)
Element
createBoundTextNode
in interface Element
propertyName
- for the new TextNode
public TextNode createTextNode()
Element
createTextNode
in interface Element
public TextNode createTextNode(int dataType)
Element
createTextNode
in interface Element
dataType
- the data type for the new TextNode
DataTypes
public TextNode createTextNode(java.lang.String propertyName, ValueHolder holder)
Element
createTextNode
in interface Element
propertyName
- for the new TextNodeholder
- ValueHolder for the new TextNode
public TextNode getTextNode()
Element
getTextNode
in interface Element
public java.lang.String getTextNodeText() throws ModelException
Element
getTextNodeText
in interface Element
ModelException
public java.lang.Object getTextNodeValue() throws ModelException
Element
getTextNodeValue
in interface Element
ModelException
public void removeTextNode()
Element
removeTextNode
in interface Element
public void removeTextNode(TextNode t)
Element
removeTextNode
in interface Element
public void setTextNodeText(java.lang.String value) throws ModelException
Element
setTextNodeText
in interface Element
value
- the new String value for the TextNode
ModelException
public void setTextNodeValue(java.lang.Object value) throws ModelException
Element
setTextNodeValue
in interface Element
value
- the new Object value for the TextNode
ModelException
public void addNotify()
Component
addNotify
in class Component
public void removeNotify()
Component
removeNotify
in class Component
public void setValueHolder(ValueHolder newValueHolder)
Parameter
setValueHolder
in class Parameter
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |