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");
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 Summary
ConstructorsConstructorDescriptionConstructs a new instance of UrlDisplayComponent.UrlDisplayComponent(String label) Constructs UrlDisplayComponent using suppliedlabel.UrlDisplayComponent(String label, String link) Constructs UrlDisplayComponent using suppliedlabel,link.UrlDisplayComponent(String label, String labelForLink, String link) Constructs UrlDisplayComponent using suppliedlabel,labelForLink,link.UrlDisplayComponent(String label, String labelForLink, String theLink, String theImage) Constructs UrlDisplayComponent using suppliedlabel,labelForLink,link,theImage. -
Method Summary
Modifier and TypeMethodDescriptionGet the formatted label for the link.getImage()Get the image for this UrlDisplayComponent.Get the label for the link of URLDisplayComponent.getLink()Get the link value of UrlDisplayComponent.Get the tooltip of the UrlDisplayComponent.voidsetLabelForTheLink(String linkLabel) Set label for the link of URLDisplayComponent.voidSet the link value for UrlDisplayComponent.voidsetNonPureHTMLLink(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: truevoidSet the map to be used to create query string parameters of the URL.voidSet the target attribute for UrlDisplayComponent.
The target attribute specifies where to open the link.voidsetToolTip(String tt) Set the tooltip for the UrlDisplayComponent.voidsetTruncationLength(int truncationLength) Set the truncationLength for the labelForTheLink.Methods inherited from class com.ptc.core.components.rendering.AbstractGuiComponent
setColumnName, setEnabled, setId, setLabel, setMultiValued, setName
-
Constructor Details
-
UrlDisplayComponent
public UrlDisplayComponent()Constructs a new instance of UrlDisplayComponent.
Supported API: true -
UrlDisplayComponent
Constructs UrlDisplayComponent using suppliedlabel.
Supported API: true- Parameters:
label- label for the component.
-
UrlDisplayComponent
Constructs UrlDisplayComponent using suppliedlabel,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
Constructs UrlDisplayComponent using suppliedlabel,labelForLink,link.
Supported API: true- Parameters:
label- label for the component.labelForLink- label for the Link.link- link value.
-
UrlDisplayComponent
Constructs UrlDisplayComponent using suppliedlabel,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
Get the link value of UrlDisplayComponent.
Supported API: true- Returns:
- link value for this UrlDisplayComponent.
-
getImage
Get the image for this UrlDisplayComponent.
Supported API: true- Returns:
- the image for this UrlDisplayComponent.
-
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
Get the label for the link of URLDisplayComponent.
Supported API: true- Returns:
- the label for the link.
-
setLabelForTheLink
Set label for the link of URLDisplayComponent.
Supported API: true- Parameters:
linkLabel- label for link.
-
setLink
Set the link value for UrlDisplayComponent.
Supported API: true- Parameters:
theLink- Link value.
-
setParams
Set the map to be used to create query string parameters of the URL.
Supported API: true- Parameters:
paramMap- The Hashmap of Parameters
-
getToolTip
Get the tooltip of the UrlDisplayComponent.
Supported API: true- Returns:
- the tooltip
-
setToolTip
Set the tooltip for the UrlDisplayComponent.
Supported API: true- Parameters:
tt- The tt(tooltip) to set for the UrlDisplayComponent.
-
setTarget
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-
-