Class LabelHandle

All Implemented Interfaces:
IReportItemMethodContext, org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel, org.eclipse.birt.report.model.elements.interfaces.IInternalReportItemModel, org.eclipse.birt.report.model.elements.interfaces.ILabelModel, org.eclipse.birt.report.model.elements.interfaces.IStyledElementModel

public class LabelHandle extends ReportItemHandle implements org.eclipse.birt.report.model.elements.interfaces.ILabelModel
Represents a label report item. A label shows a static piece of text displayed in the report. The label has the following properties:
  • An optional hyperlink ( action ) for this label.
  • An help text for the label.
  • An static text message to display.
  • Constructor Details

    • LabelHandle

      public LabelHandle(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
      Constructs a label handle with the given design and the element. The application generally does not create handles directly. Instead, it uses one of the navigation methods available on other element handles.
      Parameters:
      module - the module
      element - the model representation of the element
  • Method Details

    • getText

      public String getText()
      Returns the static text for the label.
      Returns:
      the static text to display
    • getDisplayText

      public String getDisplayText()
      Returns the localized text for the label. If the localized text for the text resource key is found, it will be returned. Otherwise, the static text will be returned.
      Returns:
      the localized text for the label
    • setText

      public void setText(String text) throws SemanticException
      Sets the text of the label. Sets the static text itself. If the label is to be externalized, then set the text ID separately.
      Parameters:
      text - the new text for the label
      Throws:
      SemanticException - if the property is locked.
    • getTextKey

      public String getTextKey()
      Returns the resource key of the static text of the label.
      Returns:
      the resource key of the static text
    • setTextKey

      public void setTextKey(String resourceKey) throws SemanticException
      Sets the resource key of the static text of the label.
      Parameters:
      resourceKey - the resource key of the static text
      Throws:
      SemanticException - if the resource key property is locked.
    • getActionHandle

      public ActionHandle getActionHandle()
      Returns a handle to work with the action property, action is a structure that defines a hyperlink.
      Returns:
      a handle to the action property, return null if the action has not been set on the label.
      See Also:
    • setAction

      public ActionHandle setAction(Action action) throws SemanticException
      Set an action on the image.
      Parameters:
      action - new action to be set on the image, it represents a bookmark link, hyperlink, and drill through etc.
      Returns:
      a handle to the action property, return null if the action has not been set on the image.
      Throws:
      SemanticException - if member of the action is not valid.
    • actionsIterator

      public Iterator<ActionHandle> actionsIterator()
      Returns the iterator for action defined on this label item.
      Returns:
      the iterator for Action structure list defined on this label item
    • getHelpText

      public String getHelpText()
      Returns the help text of this label item.
      Returns:
      the help text
    • setHelpText

      public void setHelpText(String text) throws SemanticException
      Sets the help text of this label item.
      Parameters:
      text - the help text
      Throws:
      SemanticException - if the resource key property is locked.
    • getHelpTextKey

      public String getHelpTextKey()
      Returns the help text key of this label item.
      Returns:
      the help text key
    • setHelpTextKey

      public void setHelpTextKey(String resourceKey) throws SemanticException
      Sets the help text key of this label item.
      Parameters:
      resourceKey - the help text key
      Throws:
      SemanticException - if the resource key property of the help text is locked.