borland Packages  Class Hierarchy  internetbeans Package 

IxComponent class (abstract)

java.lang.Object
   +----com.borland.internetbeans.IxComponent
           +----com.borland.internetbeans.AbstractIxDataWidget
           +----com.borland.internetbeans.IxTable
           +----com.borland.internetbeans.IxTableCell
           +----com.borland.internetbeans.IxTableRow

About the IxComponent class

Variables  Properties  Methods  

Implements Renderable, Serializable, Cloneable

Note: This package is a feature of JBuilder Professional and Enterprise.

Root class representing replaceable content, probably an input control, table, table cell, <DIV> or <SPAN>. Does not include non-IDable content such as SCRIPT or STYLE elements. That content is an element; the element can be a single empty tag, or a start tag, element body (which can be empty), and an end tag.

(Although tag and attribute names are described using uppercase for clarity, the actual implementations, being XHTML-compliant, always use lowercase, converting the source markup if necessary.)


IxComponent variables

Variables implemented in this class

IxComponent properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

IxComponent methods

Methods implemented in this class

Methods implemented in java.lang.Object


IxComponent variables

combinedAttributes

  protected Map combinedAttributes
The current combined map of attributes, with the custom attributes set in the component taking precedence over the source attributes.

customAttributes

  protected Map customAttributes
Tag attributes set in the component.

firstInstance

  protected IxComponent firstInstance
For clones, tracks the original instance.

sourceAttributes

  protected Map sourceAttributes
Tag attributes read from the source template markup.

tupleModel

  protected TupleModel tupleModel

IxComponent properties

binder

 public Binder getBinder()
 public void setBinder(Binder newBinder)
The Binder is like a container; it binds all the components that are associated with a single page context. PageProducer implements Binder, so when the component is used with a PageProducer, this property and the pageProducer property refer to the same object.

content

 public String getContent()
Dynamically generates the represented element, returning it as a string. This method is not session-aware, so it not suitable for use in a servlet.

See also: Render

cssClass

 public String getCssClass()
 public void setCssClass(String styleId)
Value of CLASS attribute. Partly because CLASS is an implied HTML attribute, it is never null. At worst it is an empty string.

elementId

 public String getElementId()
 public void setElementId(String newId)
Value of ID attribute. Partly because ID is an implied HTML attribute, it is never null. At worst it is an empty string.

Modifying this value will update the associated PageProducer, if one is specified.

features

 public int getFeatures()
Returns the feature bits for the component, which indicate certain special abilities or requirements of the component.

identifier

 public String getIdentifier()
Identifier for component. It is matched against the source document (to be replaced by dynamic content generated by the component), and when posting values in the HTTP POST/GET. Note that it is the list of components that is checked for a match; for example, the same component may match more than one element with the same identifier (the case with HTML radiobuttons).

In IxComponent the identifier is simply the ID attribute, but this method may be overridden by subclasses for elements that don't have an ID attribute, but do have some other identifier, such as control name. Any generated identifiers must not conflict with possible valid ID values; one way to guarantee this is to include characters that are not valid in IDs, such as an &. The identifiers returned by this method are used internally and never emitted.

pageProducer

 public PageProducer getPageProducer()
 public void setPageProducer(PageProducer newPageProducer)
PageProducer -- and through it, the source markup -- with which the component is associated. Whenever the propery changes, the component is removed from the old PageProducer, if any.

renderDelegate

 public IxComponent getRenderDelegate()
Called after object is merged with source, to provide the opportunity to do final setup and/or delegate. In this base class, no delegation is performed; the component itself is returned.

Do not call directly.

Returns object to add to content-generation list.

requestParameterValue

 public void setRequestParameterValue(String value)
Gives components the opportunity to react to parameters in the request (GET or POST). Parameters names are matched via getIdentifier. Does nothing by default.

Parameters:

value
String value of parameter

tupleModel

 public TupleModel getTupleModel()
 public void setTupleModel(TupleModel newTupleModel)
Data model for current page context.

IxComponent methods

appendTagAttribute(outWrap, java.lang.String)

  protected void appendTagAttribute(OutputWrapper outWrap, String nameAndValue)
Adds attribute to output by appending a space, then the attribute. If attribute is empty (or contains just spaces), nothing happens.

Parameters:

outWrap
The stream-like output into which the content goes
nameAndValue
The assembled name/value pair, suitable for output

assembleElementBody(outWrap)

  protected abstract void assembleElementBody(OutputWrapper outWrap)
Adds element body, if any, to the output.

Parameters:

outWrap
The stream-like output into which the content goes

assembleEndTag(outWrap)

  protected void assembleEndTag(OutputWrapper outWrap)
Adds end tag to assembly buffer.

Parameters:

outWrap
The stream-like output into which the content goes

assembleMergedAttributes(outWrap)

  protected void assembleMergedAttributes(OutputWrapper outWrap)
Add any remaining attributes from source that were not merged as object properties, plus any custom attributes set on the object. Custom attributes take precedence over source attributes.

Parameters:

outWrap
The stream-like output into which the content goes

assembleStartTag(outWrap)

  protected void assembleStartTag(OutputWrapper outWrap)
Renders start tag of element, which is the entire element if the element is an empty element.

Parameters:

outWrap
The stream-like output into which the content goes

assembleTagAttributes(outWrap)

  protected abstract void assembleTagAttributes(OutputWrapper outWrap)
Adds required tag attributes, e.g. TYPE="TEXT" NAME="FNAME" VALUE="Bob", to the output. Optional attributes are handled by assembleMergedAttributes.

Parameters:

outWrap
The stream-like output into which the content goes
See also: appendTagAttribute

clone()

  protected Object clone()
Clones, and keeps track of original instance.

Returns shallow clone of object.

Overrides: java.lang.Object.clone()

cloneForTupleModel(tupleModel)

  protected IxComponent cloneForTupleModel(TupleModel tupleModel)
Makes a shallow clone of the component tied to the specified data model.

Parameters:

tupleModel
Data model for other page context

Returns clone of component, with tupleModel property set to new model.

finishAssemblingTag(outWrap)

  protected void finishAssemblingTag(OutputWrapper outWrap)
Finishes assembly of start tag of element. Empty elements use XML termination.

Parameters:

outWrap
The stream-like output into which the content goes

getAttribute(java.lang.String)

  public String getAttribute(String name)
Returns the current value of a given attribute. Values set in the component take precedence over values read from the source markup.

Parameters:

name
Attribute name, case sensitive. HTML attribute names are converted to lowercase during HTML parsing.

Returns value of attribute as a string; null if there is no such attribute in either the source markup or set in the component.

See also: setAttribute

getClosureTags()

  protected abstract String[] getClosureTags()
Returns the tags names that would indicate the end of the element. For example, an INPUT is an empty element, so it would return an empty array. But a TEXTAREA requires an end-TEXTAREA. A TD can be closed by a TD (start or end), TR, THEAD, TBODY, TFOOT, or end-TABLE.

getElementType()

  protected abstract String getElementType()
Returns name of element type represented by class, e.g. INPUT, SPAN, TABLE.

getIntAttribute(java.lang.String, int)

  protected int getIntAttribute(String name, int defaultValue)
Convenience method for returning numeric attributes.

Parameters:

name
Attribute name, case sensitive. HTML attribute names are converted to lowercase during HTML parsing.
defaultValue
Value to return if attribute not found

Returns value of attribute; defaultValue if there is no such attribute in either the source markup or set in the component.

getLengthAttribute(java.lang.String)

  protected Length getLengthAttribute(String name)
Convenience method for setting Length attributes.

Parameters:

name
Attribute name, case sensitive. HTML attribute names are converted to lowercase during HTML parsing.

Returns value of attribute; null if there is no such attribute in either the source markup or set in the component.

See also: setAttribute

isElementEmpty()

  protected abstract boolean isElementEmpty()
Determines whether to use empty element termination in tag, or to expect an element body.

mergeBody(units, int, int)

  public void mergeBody(ParseUnit[] units, int beginIndex, int endIndex)
Called after mergeTag by PageProducer, override this method to pick up the element body, which is skipped over when generating the content list. If the object does not generate its own body, the contents that are in the page may be needed. This method will be called if there is nothing between the start and end tags, but will not be called if the tag is an empty tag. (Note that the end tag in this case may not be an actual end, but may be any closure tag.)

Do not call this method directly.

Parameters:

units
Array of ParseUnit objects that the PageProducer is currently working its way through
beginIndex
Index into units array that points to element after start tag. If the element body is empty, it points to the end tag.
endIndex
Index into units array that points to element after last unit that comprises body. If the element body is empty, it is the same as beginIndex and points to the end tag.

mergeTag(java.lang.String, java.util.Map, boolean)

  public void mergeTag(String tagName, Map attributes, boolean empty)
Called every time object is matched to start tag by PageProducer, use this method to pick up any attribute settings that are not overridden by the object; such attributes should be set as object properties and removed from the map. Override to handle known attributes, then call super.

Do not call this method directly.

In IxComponent

the methods removes the ID and CLASS attributes.

Parameters:

tagName
Name of the matching tag, e.g. INPUT, SELECT
attributes
Map of attribute values
empty
Whether the source tag was empty

minimizedAttribute(java.lang.String)

  protected static String minimizedAttribute(String name)
Convenience method creates XHTML-required name="name" pair for minimized attributes such as CHECKED and ISMAP.

Parameters:

name
Attribute name

Returns name/value pair.

pairAttribute(java.lang.String, int)

  protected static String pairAttribute(String name, int value)
Convenience method creates name="value" pair for integer values.

Parameters:

name
Attribute name
value
Integer attribute value

Returns name/value pair.

pairAttribute(java.lang.String, java.lang.String)

  protected static String pairAttribute(String name, String value)
Creates name="value" pair. Double quotes in the value are rendered with the quote entity.

Parameters:

name
Attribute name. Should not be null.
value
Attribute value as string. May be null (renders as "null")

Returns name/value pair.

removeAttribute(java.lang.String)

  public void removeAttribute(String name)
Removes the value setting for a given attribute from the component. If the matching element in the source markup had the attribute, its value is used.

Parameters:

name
Attribute name, case sensitive. HTML attribute names are converted to lowercase during HTML parsing.

setAttribute(java.lang.String, java.lang.String)

  public void setAttribute(String name, String value)
Sets the current value of a given attribute. Values set in the component take precedence over values read from the source markup.

Parameters:

name
Attribute name, case sensitive. HTML attribute names are converted to lowercase during HTML parsing.
value
Attribute value, should not be null.
See also: getAttribute
removeAttribute

startAssemblingTag(outWrap)

  protected void startAssemblingTag(OutputWrapper outWrap)
Used in conjunction with appendTagAttribute and finishAssemblingTag to assemble the start tag for this element. The tag contents are assembled in a "single pass" through these methods.

Note that the XHTML spec uses lowercase for element and attribute names; that is recommended but not enforced by these methods.

updatePageProducer()

  protected void updatePageProducer()
Called whenever the PageProducer or identifier changes to update the component map. Verifies that the object is now identifiable before assigning it to the PageProducer.