borland Packages Class Hierarchy internetbeans Package
java.lang.Object +----com.borland.internetbeans.IxComponent +----com.borland.internetbeans.AbstractIxDataWidget +----com.borland.internetbeans.IxTable +----com.borland.internetbeans.IxTableCell +----com.borland.internetbeans.IxTableRow
Variables Properties Methods
Implements Renderable, Serializable, Cloneable
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.)
protected Map combinedAttributesThe current combined map of attributes, with the custom attributes set in the component taking precedence over the source attributes.
protected Map customAttributesTag attributes set in the component.
protected IxComponent firstInstanceFor clones, tracks the original instance.
protected Map sourceAttributesTag attributes read from the source template markup.
protected TupleModel tupleModel
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.
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.
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.
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.
public int getFeatures()Returns the feature bits for the component, which indicate certain special abilities or requirements of the component.
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.
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.
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.
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.
public TupleModel getTupleModel() public void setTupleModel(TupleModel newTupleModel)Data model for current page context.
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.
outWrap
nameAndValue
protected abstract void assembleElementBody(OutputWrapper outWrap)Adds element body, if any, to the output.
outWrap
protected void assembleEndTag(OutputWrapper outWrap)Adds end tag to assembly buffer.
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.
outWrap
protected void assembleStartTag(OutputWrapper outWrap)Renders start tag of element, which is the entire element if the element is an empty element.
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
.
outWrap
protected Object clone()Clones, and keeps track of original instance.
Returns shallow clone of object.
protected IxComponent cloneForTupleModel(TupleModel tupleModel)Makes a shallow clone of the component tied to the specified data model.
tupleModel
Returns clone of component, with tupleModel
property set to new model.
protected void finishAssemblingTag(OutputWrapper outWrap)Finishes assembly of start tag of element. Empty elements use XML termination.
outWrap
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.
name
Returns value of attribute as a string; null if there is no such attribute in either the source markup or set in the component.
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.
protected abstract String getElementType()Returns name of element type represented by class, e.g. INPUT, SPAN, TABLE.
protected int getIntAttribute(String name, int defaultValue)Convenience method for returning numeric attributes.
name
defaultValue
Returns value of attribute; defaultValue if there is no such attribute in either the source markup or set in the component.
protected Length getLengthAttribute(String name)Convenience method for setting Length attributes.
name
Returns value of attribute; null if there is no such attribute in either the source markup or set in the component.
protected abstract boolean isElementEmpty()Determines whether to use empty element termination in tag, or to expect an element body.
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.
units
beginIndex
endIndex
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
tagName
attributes
empty
protected static String minimizedAttribute(String name)Convenience method creates XHTML-required name="name" pair for minimized attributes such as CHECKED and ISMAP.
name
protected static String pairAttribute(String name, int value)Convenience method creates name="value" pair for integer values.
name
value
protected static String pairAttribute(String name, String value)Creates name="value" pair. Double quotes in the value are rendered with the quote entity.
name
value
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.
name
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.
name
value
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.
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
.