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.components
Class URLComponent

java.lang.Object
  extended by com.ibm.hats.transform.components.Component
      extended by com.ibm.hats.transform.components.URLComponent
All Implemented Interfaces:
IContextDependent, ICustomPropertySupplier

public class URLComponent
extends Component
implements IContextDependent

The URL component is used for recognizing URLs (strings beginning with "http://", "https://", or "ftp://") in a specified region of a host screen.

A recognized URL can be rendered by the following widgets:

The recognize() methods of this component return ComponentElement objects of type: The following settings can be configured for this component:

PropertyDescriptionTypeDefault Value
urlStartIndicatorSets of strings that indicate the start of a URL - can contain multiple ORed (pipe separated) values.Stringhttps|http|ftp


Field Summary
static String CLASS_NAME
           
static Properties defaults
          Properties object of default settings for this component class
static String PROPERTY_URL_START_INDICATOR
          URL start indicator setting (urlStartIndicator)
 
Fields inherited from class com.ibm.hats.transform.components.Component
contextAttributes, flag, hostScreen
 
Fields inherited from interface com.ibm.hats.common.ICustomPropertySupplier
CLASSNAME
 
Constructor Summary
URLComponent(HsrScreen hostScreen)
          Constructs a new URLComponent object.
 
Method Summary
protected  String addLineBreaks(String value, int startCol, int numCols)
          Adds a line break character (line.separator) at the end of each row (except for the last row) based on the column where the URL starts and the number of columns on the screen.
 Vector getCustomProperties(int iPageNumber, Properties properties, ResourceBundle bundle)
          Returns a list of this object's custom properties.
 Properties getDefaultValues(int iPageNumber)
          Returns this object's default property values.
 int getPropertyPageCount()
          Returns the number of property pages associated with this object.
 boolean isAllowed(ContextAttributes contextAttributes)
          Gets whether or not this object should be visible in the studio given some context attributes.
 boolean isPropertyAllowed(String name, ContextAttributes contextAttributes)
          Gets whether or not the specified property should be visible in the component or widget settings.
 ComponentElement[] recognize(BlockScreenRegion region, Properties settings)
          Returns an array of URLComponentElement objects, each representing a URL found in the specified region using the specified settings.
 ComponentElement[] recognize(com.ibm.hats.transform.regions.LinearScreenRegion region, Properties settings)
          Not currently implemented.
 
Methods inherited from class com.ibm.hats.transform.components.Component
convertPosToCol, convertPosToRow, convertRowColToPos, findFirstDelimiterIndex, findFirstIndexOf, findFirstIndexOf, findFirstIndexOf, findFirstNonWhitespaceIndex, findFirstNonWhitespaceIndex, findFirstNonWhitespaceIndex, getContextAttribute, getContextAttributes, getCustomComposite, getHostScreen, getTrailingSpaceCount, newInstance, recognize, setContextAttribute, setContextAttributes, setHostScreen
 
Methods inherited from class java.lang.Object
clone, 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

PROPERTY_URL_START_INDICATOR

public static final String PROPERTY_URL_START_INDICATOR
URL start indicator setting (urlStartIndicator)

See Also:
Constant Field Values

defaults

public static Properties defaults
Properties object of default settings for this component class

Constructor Detail

URLComponent

public URLComponent(HsrScreen hostScreen)
Constructs a new URLComponent object.

Parameters:
hostScreen -
Method Detail

recognize

public ComponentElement[] recognize(BlockScreenRegion region,
                                    Properties settings)
Returns an array of URLComponentElement objects, each representing a URL found in the specified region using the specified settings.

Specified by:
recognize in class Component
Parameters:
region - region to search for URLs in
settings - settings to use (see table above)
Returns:
an array of ComponentElement objects.

addLineBreaks

protected String addLineBreaks(String value,
                               int startCol,
                               int numCols)
Adds a line break character (line.separator) at the end of each row (except for the last row) based on the column where the URL starts and the number of columns on the screen.

Parameters:
value - The URL.
startCol - The starting column.
numCols - The number of columns.
Returns:
The modified URL.

recognize

public ComponentElement[] recognize(com.ibm.hats.transform.regions.LinearScreenRegion region,
                                    Properties settings)
Not currently implemented.

Specified by:
recognize in class Component

getPropertyPageCount

public int getPropertyPageCount()
Description copied from interface: ICustomPropertySupplier
Returns the number of property pages associated with this object.

Note: Currently only 0 or 1 pages are supported.

Specified by:
getPropertyPageCount in interface ICustomPropertySupplier
Overrides:
getPropertyPageCount in class Component
Returns:
the number of defined property pages used to configure this object, or 0 if there are none

getCustomProperties

public Vector getCustomProperties(int iPageNumber,
                                  Properties properties,
                                  ResourceBundle bundle)
Description copied from interface: ICustomPropertySupplier
Returns a list of this object's custom properties. Items must be of type com.ibm.hats.common.HCustomProperty.

Specified by:
getCustomProperties in interface ICustomPropertySupplier
Overrides:
getCustomProperties in class Component
Parameters:
iPageNumber - page number containing desired properties
properties - existing values for properties defined here
bundle - ResourceBundle containing NLS descriptions for the properties
Returns:
Vector containing all the custom properties for this object, or null if there are none
See Also:
HCustomProperty

getDefaultValues

public Properties getDefaultValues(int iPageNumber)
Description copied from interface: ICustomPropertySupplier
Returns this object's default property values.

Specified by:
getDefaultValues in interface ICustomPropertySupplier
Overrides:
getDefaultValues in class Component
Parameters:
iPageNumber - page for which to retrieve default properties
Returns:
object's default properties

isAllowed

public boolean isAllowed(ContextAttributes contextAttributes)
Description copied from interface: IContextDependent
Gets whether or not this object should be visible in the studio given some context attributes. The context attributes may contain the Component name when this is called on a Widget, or whether or not we are presenting this Component/Widget choice while configuring Default Rendering.

Specified by:
isAllowed in interface IContextDependent
Returns:
whether or not this Component or Widget is allowed in the specified context

isPropertyAllowed

public boolean isPropertyAllowed(String name,
                                 ContextAttributes contextAttributes)
Description copied from interface: IContextDependent
Gets whether or not the specified property should be visible in the component or widget settings. The context attributes may contain the Component name when this is called on a Widget, or whether or not we are presenting this Component/Widget choice while configuring Default Rendering.

Specified by:
isPropertyAllowed in interface IContextDependent
Parameters:
name - property name
Returns:
whether or not this property is allowed in the specified context

HATS 7.5.1 (201005110649)