Class 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
    • Constructor Detail

      • 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 Detail

      • getHyperlink

        @Deprecated
        public java.lang.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 java.lang.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 java.lang.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 java.lang.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​(java.lang.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​(java.lang.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 java.lang.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 java.lang.String getToolTip()
        Gets the value of tool tip.
        Returns:
        the value of tool tip.
      • setToolTip

        public void setToolTip​(java.lang.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​(java.lang.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​(java.lang.String hyperlink)
                          throws SemanticException
        Deprecated.
        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​(java.lang.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 java.lang.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 java.lang.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​(java.lang.String reportName)
                                       throws SemanticException
        Deprecated.
        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​(java.lang.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​(java.lang.String bookmark)
                                         throws SemanticException
        Deprecated.
        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 java.lang.String getBookmarkLink()
        Deprecated.
        Gets the bookmark link if the link type is ACTION_LINK_TYPE_BOOKMARK_LINK. Otherwise, return null.
        Returns:
        the bookmark link
      • getTargetBookmark

        public java.lang.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​(java.lang.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​(java.lang.String bookmark)
                                           throws SemanticException
        Deprecated.
        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​(java.lang.String bookmark)
                             throws SemanticException
        Deprecated.
        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 java.util.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 java.util.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​(java.lang.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 java.lang.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​(java.lang.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 java.lang.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