Package org.eclipse.birt.report.model.api

# Class ActionHandle

java.lang.Object
org.eclipse.birt.report.model.api.ElementDetailHandle
org.eclipse.birt.report.model.api.ValueHandle
org.eclipse.birt.report.model.api.StructureHandle
org.eclipse.birt.report.model.api.ActionHandle

public class ActionHandle extends StructureHandle
Represents an "action" (hyperlink) attached to an element. Obtain an instance of this class by calling the `getActionHandle` method on the handle of an element that defines an action.

The link type of an Action can be only one of hyperlink, bookmark Link or drill-through.

- The hyperlink property returns a standard web-style link with "http:" or "mailto:" prefix.
- The bookmark link simply identifies a bookmark identified within this report.
- The drill-though link runs and/or views another report. A drill-through action can include parameters (used when the hyperlink is used to run a report), search keys (an optional list of search criteria) and a bookmark destination within the target report.

See Also:
  - `DataItemHandle.getActionHandle()`
  - `ImageHandle.getActionHandle()`
  - `LabelHandle.getActionHandle()`
  - `Action`

## Field Summary

### Fields inherited from class org.eclipse.birt.report.model.api.StructureHandle

`structContext`

### Fields inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle

`elementHandle`

## Constructor Summary

Constructors
Constructor
Description
`ActionHandle(DesignElementHandle element, org.eclipse.birt.report.model.core.MemberRef ref)`
Deprecated.
`ActionHandle(DesignElementHandle element, org.eclipse.birt.report.model.core.StructureContext context)`
Construct an handle to deal with the action structure.
`ActionHandle(SimpleValueHandle valueHandle, int index)`
Constructs the handle of action.

## Method Summary

Modifier and Type
Method
Description
`void`
`addParamBinding(ParamBinding paramBinding)`
Add a new parameter binding to the action.
`void`
`addSearch(SearchKey key)`
Add a new search key to the action.
`String`
`getBookmarkLink()`
Deprecated.
use `getTargetBookmark()`instead.
`String`
`getDrillThroughReportName()`
Deprecated.
use `getReportName()`instead.
`String`
`getFormatType()`
Gets the format type of the action.
`String`
`getHyperlink()`
Deprecated.
use `getURI()`instead.
`String`
`getLinkType()`
Gets the link type of the action.
`MemberHandle`
`getParamBindings()`
Get a handle to deal with the parameter binding list member if the link type is `ACTION_LINK_TYPE_DRILLTHROUGH`.
`String`
`getReportName()`
Gets the name of the target report document if the link type is `ACTION_LINK_TYPE_DRILLTHROUGH`.
`MemberHandle`
`getSearch()`
Get a handle to deal with the search key list member if the link type is `ACTION_LINK_TYPE_DRILLTHROUGH`.
`String`
`getTargetBookmark()`
Gets the bookmark link if the link type is `ACTION_LINK_TYPE_BOOKMARK_LINK`.
`String`
`getTargetBookmarkType()`
Gets target bookmark type for a drill-through or bookmark-link action.
`String`
`getTargetFileType()`
Gets target report file type for a drill-through action.
`String`
`getTargetWindow()`
Gets the name of the target browser window for the link.
`String`
`getToolTip()`
Gets the value of tool tip.
`String`
`getURI()`
Gets the identifier of the hyperlink if the link type is `ACTION_LINK_TYPE_HYPERLINK`.
`Iterator`
`paramBindingsIterator()`
Gets the parameter binding list of a drill-through action if the link type is `ACTION_LINK_TYPE_DRILLTHROUGH`.
`Iterator`
`searchIterator()`
Gets the search key list for a drill-through action if the link type is `ACTION_LINK_TYPE_DRILLTHROUGH` and the drill through type is `DRILL_THROUGH_LINK_TYPE_SEARCH`.
`void`
`setBookmarkLink(String bookmark)`
Deprecated.
use `setTargetBookmark(String)`instead.
`void`
`setDrillThroughBookmarkLink(String bookmark)`
Deprecated.
use `setTargetBookmark(String)`instead.
`void`
`setDrillThroughReportName(String reportName)`
Deprecated.
use `setReportName(String)`instead.
`void`
`setDrillThroughTargetBookmark(String bookmark)`
Deprecated.
use `setTargetBookmark(String)`instead.
`void`
`setFormatType(String type)`
Sets the format type of the action.
`void`
`setHyperlink(String hyperlink)`
Deprecated.
`setURI(String)`
`void`
`setLinkType(String type)`
Sets the link type of the action.
`void`
`setReportName(String reportName)`
Sets target report name for a drill-though link.
`void`
`setTargetBookmark(String bookmark)`
Sets the target bookmark defined within this same report, or another report for a drill-though link.
`void`
`setTargetBookmarkType(String targetBookmarkType)`
Sets target bookmark type for a drill-through or bookmark-link action.
`void`
`setTargetFileType(String targetFileType)`
Sets target report file type for a drill-through action.
`void`
`setTargetWindow(String window)`
Sets the target window of the action.
`void`
`setToolTip(String toolTip)`
Sets the value of the tool tip.
`void`
`setURI(String uri)`
Sets the hyperlink of this action.

### Methods inherited from class org.eclipse.birt.report.model.api.StructureHandle

`drop, getContext, getDefn, getExpressionProperty, getExternalizedValue, getExternalizedValue, getIntProperty, getMember, getProperty, getPropertyDefn, getStringProperty, getStructure, isDesignTime, isLocal, iterator, setDesignTime, setExpressionProperty, setProperty, setPropertySilently`

### Methods inherited from class org.eclipse.birt.report.model.api.ValueHandle

`getReference`

### Methods inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle

`getDesign, getElement, getElementHandle, getModule`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ActionHandle

public ActionHandle(DesignElementHandle element, org.eclipse.birt.report.model.core.StructureContext context)
Construct an handle to deal with the action structure.

Parameters:
  `element` - the element that defined the action.
  `context` - reference to the action property.

### ActionHandle

public ActionHandle(SimpleValueHandle valueHandle, int index)
Constructs the handle of action.

Parameters:
  `valueHandle` - the value handle for action list of one property
  `index` - the position of this action in the list

### ActionHandle

@Deprecated public ActionHandle(DesignElementHandle element, org.eclipse.birt.report.model.core.MemberRef ref)
Deprecated.
Construct an handle to deal with the action structure.

Parameters:
  `element` - the element that defined the action.
  `ref` - reference to the action property.

## Method Details

### getHyperlink

@Deprecated public String getHyperlink()
Deprecated.
use `getURI()`instead.
Gets the hyperlink if the link type is `ACTION_LINK_TYPE_HYPERLINK`. Otherwise, return null.

Returns:
  the link expression in a string

### getURI

public String getURI()
Gets the identifier of the hyperlink if the link type is `ACTION_LINK_TYPE_HYPERLINK`. Otherwise, return null.

Returns:
  the URI link expression in a string

### getTargetWindow

public String getTargetWindow()
Gets the name of the target browser window for the link. (Optional.) Used only for the Hyperlink and Drill Through options. Otherwise, return null.

Returns:
  the window name

### getLinkType

public String getLinkType()
Gets the link type of the action. The link type are defined in DesignChoiceConstants and can be one of the following:

- `ACTION_LINK_TYPE_NONE`
- `ACTION_LINK_TYPE_HYPERLINK`
- `ACTION_LINK_TYPE_DRILLTHROUGH`
- `ACTION_LINK_TYPE_BOOKMARK_LINK`

Returns:
  the string value of the link type
See Also:
  - `DesignChoiceConstants`

### setLinkType

public void setLinkType(String type) throws SemanticException
Sets the link type of the action. The link type are defined in DesignChoiceConstants and can be one of the following:

- `ACTION_LINK_TYPE_NONE`
- `ACTION_LINK_TYPE_HYPERLINK`
- `ACTION_LINK_TYPE_DRILLTHROUGH`
- `ACTION_LINK_TYPE_BOOKMARK_LINK`

Parameters:
  `type` - type of the action.
Throws:
  `SemanticException` - if the `type` is not one of the above.

### setFormatType

public void setFormatType(String type) throws SemanticException
Sets the format type of the action. The format type for action are defined in DesignChoiceConstants and can be one of the following:

- `ACTION_FORMAT_TYPE_HTML`
- `ACTION_FORMAT_TYPE_PDF`

Or, it may be one format that defined by users.

Parameters:
  `type` - the type of the action
Throws:
  `SemanticException`

### getFormatType

public String getFormatType()
Gets the format type of the action. The format type for action are defined in DesignChoiceConstants and can be one of the following: *

- `ACTION_FORMAT_TYPE_HTML`
- `ACTION_FORMAT_TYPE_PDF`

Or, it may be one format that defined by users.

Returns:
  the format type of the action

### getToolTip

public String getToolTip()
Gets the value of tool tip.

Returns:
  the value of tool tip.

### setToolTip

public void setToolTip(String toolTip) throws SemanticException
Sets the value of the tool tip.

Parameters:
  `toolTip` - the value of tool tip.
Throws:
  `SemanticException`

### getParamBindings

public MemberHandle getParamBindings()
Get a handle to deal with the parameter binding list member if the link type is `ACTION_LINK_TYPE_DRILLTHROUGH`. Otherwise, return null.

Returns:
  a handle to deal with the parameter binding list member

### addParamBinding

public void addParamBinding(ParamBinding paramBinding) throws SemanticException
Add a new parameter binding to the action.

Parameters:
  `paramBinding` - a new parameter binding to be added.
Throws:
  `SemanticException` - if the parameter binding is not valid

### getSearch

public MemberHandle getSearch()
Get a handle to deal with the search key list member if the link type is `ACTION_LINK_TYPE_DRILLTHROUGH`. Otherwise, return null.

Returns:
  a handle to deal with the search key list member

### addSearch

public void addSearch(SearchKey key) throws SemanticException
Add a new search key to the action.

Parameters:
  `key` - a new search key to be added.
Throws:
  `SemanticException` - if the value is not valid.

### setTargetWindow

public void setTargetWindow(String window) throws SemanticException
Sets the target window of the action.

Parameters:
  `window` - the target window name
Throws:
  `SemanticException` - if this property is locked.

### setHyperlink

@Deprecated public void setHyperlink(String hyperlink) throws SemanticException
Deprecated.
`setURI(String)`
Sets the hyperlink of this action. The link type will be changed to `ACTION_LINK_TYPE_HYPERLINK`.

Parameters:
  `hyperlink` - the hyperlink to set
Throws:
  `SemanticException` - if the property is locked.
See Also:
  - `getHyperlink()`

### setURI

public void setURI(String uri) throws SemanticException
Sets the hyperlink of this action. The link type will be changed to `ACTION_LINK_TYPE_HYPERLINK`.

Parameters:
  `uri` - the hyperlink to set
Throws:
  `SemanticException` - if the property is locked.

### getDrillThroughReportName

@Deprecated public String getDrillThroughReportName()
Deprecated.
use `getReportName()`instead.
Gets the name of the target report document if the link type is `ACTION_LINK_TYPE_DRILLTHROUGH`. Otherwise, return null.

Returns:
  the name of the target report document
See Also:
  - `setDrillThroughReportName(String)`

### getReportName

public String getReportName()
Gets the name of the target report document if the link type is `ACTION_LINK_TYPE_DRILLTHROUGH`. Otherwise, return null.

Returns:
  the name of the target report document
See Also:
  - `setReportName(String)`

### setDrillThroughReportName

@Deprecated public void setDrillThroughReportName(String reportName) throws SemanticException
Deprecated.
use `setReportName(String)`instead.
Sets target report name for a drill-though link. The link type willl be changed to `ACTION_LINK_TYPE_DRILLTHROUGH`. The report name can include relative or absolute names. If the suffix is omitted, it is computed on the server by looking for a matching report. BIRT reports are searched in the following order: 1) a BIRT report document or 2) a BIRT report design.

Parameters:
  `reportName` - the name of the target report
Throws:
  `SemanticException` - if the property is locked.
See Also:
  - `getDrillThroughReportName()`

### setReportName

public void setReportName(String reportName) throws SemanticException
Sets target report name for a drill-though link. The link type will be changed to `ACTION_LINK_TYPE_DRILLTHROUGH`. The report name can include relative or absolute names. If the suffix is omitted, it is computed on the server by looking for a matching report. BIRT reports are searched in the following order: 1) a BIRT report document or 2) a BIRT report design.

Parameters:
  `reportName` - the name of the target report
Throws:
  `SemanticException` - if the property is locked.
See Also:
  - `getReportName()`

### setDrillThroughBookmarkLink

@Deprecated public void setDrillThroughBookmarkLink(String bookmark) throws SemanticException
Deprecated.
use `setTargetBookmark(String)`instead.
Sets the drill-through bookmark. The link type will be changed to `ACTION_LINK_TYPE_DRILLTHROUGH`, and drill-through type will be changed to `DRILL_THROUGH_LINK_TYPE_BOOKMARK_LINK`.

Parameters:
  `bookmark` - the bookmark to set.
Throws:
  `SemanticException` - if the property is locked.
See Also:
  - `getBookmarkLink()`

### getBookmarkLink

@Deprecated public String getBookmarkLink()
Deprecated.
use `getTargetBookmark()`instead.
Gets the bookmark link if the link type is `ACTION_LINK_TYPE_BOOKMARK_LINK`. Otherwise, return null.

Returns:
  the bookmark link

### getTargetBookmark

public String getTargetBookmark()
Gets the bookmark link if the link type is `ACTION_LINK_TYPE_BOOKMARK_LINK`. Otherwise, return null.

Returns:
  the bookmark link

### setTargetBookmark

public void setTargetBookmark(String bookmark) throws SemanticException
Sets the target bookmark defined within this same report, or another report for a drill-though link. Call `setLinkType(String)`to do the link type change, it can either be `ACTION_LINK_TYPE_DRILLTHROUGH` or `ACTION_LINK_TYPE_BOOKMARK_LINK`.

Parameters:
  `bookmark` - the bookmark value.
Throws:
  `SemanticException` - if the property is locked.
See Also:
  - `getTargetBookmark()`

### setDrillThroughTargetBookmark

@Deprecated public void setDrillThroughTargetBookmark(String bookmark) throws SemanticException
Deprecated.
use `setTargetBookmark(String)`instead.
Sets the drill-through bookmark. The link type will be changed to `ACTION_LINK_TYPE_DRILLTHROUGH`.

Parameters:
  `bookmark` - the bookmark to set.
Throws:
  `SemanticException` - if the property is locked.
See Also:
  - `getTargetBookmark()`

### setBookmarkLink

@Deprecated public void setBookmarkLink(String bookmark) throws SemanticException
Deprecated.
use `setTargetBookmark(String)`instead.
Sets the bookmark link of this action. The link type will be changed to `ACTION_LINK_TYPE_BOOKMARK_LINK`.

Parameters:
  `bookmark` - the expression value.
Throws:
  `SemanticException` - if the property is locked.
See Also:
  - `getBookmarkLink()`

### paramBindingsIterator

public Iterator paramBindingsIterator()
Gets the parameter binding list of a drill-through action if the link type is `ACTION_LINK_TYPE_DRILLTHROUGH`. Each one is the instance of `ParameBindingHandle`

Action binds a data value in the report to a report parameter defined in the target report.

Note that this is a parameter binding, not a parameter definition. The report makes no attempt to check that the parameters listed here are accurate in name or type for the target report. Also, it is legal to bind the same parameter multiple times; the meaning depends on the semantics of the target report.

Returns:
  the iterator over parameters of a drill-through action.

### searchIterator

public Iterator searchIterator()
Gets the search key list for a drill-through action if the link type is `ACTION_LINK_TYPE_DRILLTHROUGH` and the drill through type is `DRILL_THROUGH_LINK_TYPE_SEARCH`. Each one is the instance of `SearchKeyHandle`

The search key list identifies search criteria in the target report and is used for drill-though links. The search is assumed to be quality. That is, identify a column defined in the target report and a data value defined in this report. The link will then search for this value.

Returns:
  the iterator over search keys of a drill-through action.

### setTargetFileType

public void setTargetFileType(String targetFileType) throws SemanticException
Sets target report file type for a drill-through action. The format type for action are defined in DesignChoiceConstants and can be one of the following: *

- `ACTION_TARGET_FILE_TYPE_REPORT_DESIGN`
- `ACTION_TARGET_FILE_TYPE_REPORT_DOCUMENT`

Parameters:
  `targetFileType` - the type of the target report file
Throws:
  `SemanticException` - if type of the target report file is not in the choice list.
See Also:
  - `getTargetFileType()`

### getTargetFileType

public String getTargetFileType()
Gets target report file type for a drill-through action. The format type for action are defined in DesignChoiceConstants and can be one of the following: *

- `ACTION_TARGET_FILE_TYPE_REPORT_DESIGN`
- `ACTION_TARGET_FILE_TYPE_REPORT_DOCUMENT`

Returns:
  target report file type for a drill-through action

### setTargetBookmarkType

public void setTargetBookmarkType(String targetBookmarkType) throws SemanticException
Sets target bookmark type for a drill-through or bookmark-link action. The bookmark type for action are defined in DesignChoiceConstants and can be one of the following:

- `ACTION_BOOKMARK_TYPE_BOOKMARK`
- `ACTION_BOOKMARK_TYPE_TOC`

Parameters:
  `targetBookmarkType` - the type of the target bookmark
Throws:
  `SemanticException` - if type of the target bookmark is not in the choice list.
See Also:
  - `getTargetBookmarkType()`

### getTargetBookmarkType

public String getTargetBookmarkType()
Gets target bookmark type for a drill-through or bookmark-link action. The bookmark type for action are defined in DesignChoiceConstants and can be one of the following:

- `ACTION_BOOKMARK_TYPE_BOOKMARK`
- `ACTION_BOOKMARK_TYPE_TOC`

Returns:
  target bookmark type for a drill-through or bookmark-link action