Class UrlDisplayComponent

java.lang.Object
com.ptc.core.components.rendering.AbstractGuiComponent
com.ptc.core.components.rendering.guicomponents.AttributeGuiComponent
com.ptc.core.components.rendering.guicomponents.UrlDisplayComponent
All Implemented Interfaces:
GuiComponent, com.ptc.core.components.rendering.guicomponents.PrintableComponent, com.ptc.netmarkets.util.misc.NmFormatable, Serializable

public class UrlDisplayComponent extends com.ptc.core.components.rendering.guicomponents.AttributeGuiComponent implements com.ptc.core.components.rendering.guicomponents.PrintableComponent
A composite GUI component to display the URL. The UrlDisplayComponent can be used to render URL.

Supported API: true

Extendable: false

Example1 :

Want to create a UrlDisplayComponent for a link with label that opens in a new window or tab
String labelForLink="Company";
String link="www.ptc.com";
UrlDisplayComponent url=new UralDisplayComponent();
url.setLabelForTheLink(labelForLink);
url.setLink(link);
url.setTarget("_blank");

Example2 :

Want to create a UrlDisplayComponent with a display label,link with label,image and tooltip shown on image that opens in a new window or tab
String componentlabel="URL";
String labelForLink="Company";
String link="www.ptc.com";
String theImage="ptc/icon.gif";
UrlDisplayComponent url=new UralDisplayComponent(componentLabel,labelForLink,link,theImage);
url.setTarget("_blank");
url.setToolTip("Click on link for Company Profile");
See Also:
  • Constructor Details

    • UrlDisplayComponent

      public UrlDisplayComponent()
      Constructs a new instance of UrlDisplayComponent.

      Supported API: true
    • UrlDisplayComponent

      public UrlDisplayComponent(String label)
      Constructs UrlDisplayComponent using supplied label.

      Supported API: true
      Parameters:
      label - label for the component.
    • UrlDisplayComponent

      public UrlDisplayComponent(String label, String link)
      Constructs UrlDisplayComponent using supplied label,link.

      Example :

      String link="www.ptc.com";
      UrlDisplayComponent url=new UralDisplayComponent("URL",link);


      Supported API: true
      Parameters:
      label - label for the component.
      link - link value.
    • UrlDisplayComponent

      public UrlDisplayComponent(String label, String labelForLink, String link)
      Constructs UrlDisplayComponent using supplied label,labelForLink,link.

      Supported API: true
      Parameters:
      label - label for the component.
      labelForLink - label for the Link.
      link - link value.
    • UrlDisplayComponent

      public UrlDisplayComponent(String label, String labelForLink, String theLink, String theImage)
      Constructs UrlDisplayComponent using supplied label,labelForLink,link,theImage.

      Supported API: true
      Parameters:
      label - label for the component.
      labelForLink - label for the Link.
      theLink - link value.
      theImage - the relative path of the image with respect to WT_HOME/codebase
  • Method Details

    • getLink

      public String getLink()
      Get the link value of UrlDisplayComponent.

      Supported API: true
      Returns:
      link value for this UrlDisplayComponent.
    • getImage

      public String getImage()
      Get the image for this UrlDisplayComponent.

      Supported API: true
      Returns:
      the image for this UrlDisplayComponent.
    • getFormattedLabelForTheLink

      public String getFormattedLabelForTheLink()
      Get the formatted label for the link.
      1.   If labelForTheLink is not set or null then it returns null.
      2.   If length of labelForTheLink is greater than truncationLength then it returns value of labelForTheLink.
      3.   If length of labelForTheLink is less than truncationLength then it returns truncated labelForTheLink.


      Supported API: true
      Returns:
      the formatted label for the link.
    • getLabelForTheLink

      public String getLabelForTheLink()
      Get the label for the link of URLDisplayComponent.

      Supported API: true
      Returns:
      the label for the link.
    • setLabelForTheLink

      public void setLabelForTheLink(String linkLabel)
      Set label for the link of URLDisplayComponent.

      Supported API: true
      Parameters:
      linkLabel - label for link.
    • setLink

      public void setLink(String theLink)
      Set the link value for UrlDisplayComponent.

      Supported API: true
      Parameters:
      theLink - Link value.
    • setParams

      public void setParams(Map<Object,Object> paramMap)
      Set the map to be used to create query string parameters of the URL.

      Supported API: true
      Parameters:
      paramMap - The Hashmap of Parameters
    • getToolTip

      public String getToolTip()
      Get the tooltip of the UrlDisplayComponent.

      Supported API: true
      Returns:
      the tooltip
    • setToolTip

      public void setToolTip(String tt)
      Set the tooltip for the UrlDisplayComponent.

      Supported API: true
      Parameters:
      tt - The tt(tooltip) to set for the UrlDisplayComponent.
    • setTarget

      public void setTarget(String target)
      Set the target attribute for UrlDisplayComponent.
      The target attribute specifies where to open the link.
      For example if target is "_blank" then opens the link in a new window or tab.

      Supported API: true
      Parameters:
      target - to set for the UrlDisplayComponent.
    • setTruncationLength

      public void setTruncationLength(int truncationLength)
      Set the truncationLength for the labelForTheLink.
      If not set then default value is Zero.


      Supported API: true
      Parameters:
      truncationLength -
    • setNonPureHTMLLink

      public void setNonPureHTMLLink(boolean nonPureHTMLLink)
      Set whether the link is pure html link or not.
      example of pure html link-www.ptc.com
      example of non pure html link- javascript:alert('Hello');
      During export of the component,non pure html links are not exported.


      Supported API: true
      Parameters:
      nonPureHTMLLink -