HATS 7.5.1 Web API Reference

Publicly accessible methods not documented here are for IBM internal use only and may change in a future release of the product.

com.ibm.hats.transform.elements
Class ComponentElement

java.lang.Object
  extended by com.ibm.hats.transform.elements.ComponentElement
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
ComponentElementList, EnptuiScrollbarComponentElement, FieldComponentElement, FunctionKeyComponentElement, ListItemComponentElement, PatternMatchComponentElement, TableCellComponentElement, TableComponentElement, TextComponentElement, URLComponentElement

public abstract class ComponentElement
extends Object
implements Cloneable

The ComponentElement class represents a logical element recognized by a component class.


Field Summary
static String CLASS_NAME
           
protected  ScreenRegion consumedRegion
          Region consumed by this component element.
 
Constructor Summary
ComponentElement()
           
 
Method Summary
 Object clone()
           
abstract  void doTextReplacement(TextReplacementPair pair, ContextAttributes contextAttributes)
          Method to perform text replacement on this component element.
 ScreenRegion getConsumedRegion()
          Returns the screen region (block or linear) consumed by this component element.
abstract  String getPreviewText()
          Returns some form of descriptive text about the component element.
 int getScreenId()
           
 boolean isConsumer()
          Returns a boolean specifying whether the specified component element consumes the presentation space after rendering what is in it.
 boolean isMatch(ComponentElement ce)
          Returns a boolean specifying whether the specified component element "matches" this component element.
protected static boolean isTruncateToPreserveLength(ContextAttributes contextAttributes)
           
 void setConsumedRegion(ScreenRegion region)
          Set the screen region (block or linear) consumed by this component element.
 void setScreenId(int id)
           
 int type()
          Returns the type for a specific instance of a component element as an integer value.
static int type(String classname)
          Returns the type of a component element class as an integer value.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

public static final String CLASS_NAME
See Also:
Constant Field Values

consumedRegion

protected ScreenRegion consumedRegion
Region consumed by this component element.

Constructor Detail

ComponentElement

public ComponentElement()
Method Detail

type

public static final int type(String classname)
Returns the type of a component element class as an integer value. Note that the integer value is not fixed, and comparisons of component elements must be performed such as in the following example:
  componentElement.type() == ComponentElement.type(FunctionKeyComponentElement.CLASS_NAME)
where "componentElement" is an instance of a ComponentElement.

Parameters:
classname - - fully qualified name of the component element
Returns:
- a non-fixed integer value representing the type of a component element class

type

public final int type()
Returns the type for a specific instance of a component element as an integer value. Note that the integer value is not fixed, and comparisons of component elements must be performed such as in the following example:
  componentElement.type() == ComponentElement.type(FunctionKeyComponentElement.CLASS_NAME)
where "componentElement" is an instance of a ComponentElement.

Returns:
A non-fixed integer value representing the type for a specific instance of a component element.

getConsumedRegion

public ScreenRegion getConsumedRegion()
Returns the screen region (block or linear) consumed by this component element.


setConsumedRegion

public void setConsumedRegion(ScreenRegion region)
Set the screen region (block or linear) consumed by this component element.


getPreviewText

public abstract String getPreviewText()
Returns some form of descriptive text about the component element.


doTextReplacement

public abstract void doTextReplacement(TextReplacementPair pair,
                                       ContextAttributes contextAttributes)
Method to perform text replacement on this component element.

Parameters:
pair - TextReplacementPair to base replacement on
contextAttributes - context attributes

isMatch

public boolean isMatch(ComponentElement ce)
Returns a boolean specifying whether the specified component element "matches" this component element.

Currently only implemented by the PatternComponentElement, other classes return false.

Parameters:
ce - The ComponentElement object for the comparison.
Returns:
A boolean specifying whether the specified component element "matches" this component element.

isConsumer

public boolean isConsumer()
Returns a boolean specifying whether the specified component element consumes the presentation space after rendering what is in it.

Returns:
boolean

clone

public Object clone()
Overrides:
clone in class Object

setScreenId

public void setScreenId(int id)

getScreenId

public int getScreenId()

isTruncateToPreserveLength

protected static boolean isTruncateToPreserveLength(ContextAttributes contextAttributes)

HATS 7.5.1 (201005110649)