• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package autotest.common.ui;
2 
3 import com.google.gwt.dom.client.Element;
4 import com.google.gwt.user.client.DOM;
5 import com.google.gwt.user.client.ui.Widget;
6 
7 public class RealHyperlink extends Widget {
8     private Element link;
9 
RealHyperlink(String text)10     public RealHyperlink(String text) {
11         link = DOM.createAnchor();
12         link.setInnerText(text);
13         setElement(link);
14     }
15 
setOpensNewWindow(boolean opensNewWindow)16     public void setOpensNewWindow(boolean opensNewWindow) {
17         if (opensNewWindow) {
18             link.setAttribute("target", "_blank");
19         } else {
20             link.removeAttribute("target");
21         }
22     }
23 
setHref(String href)24     public void setHref(String href) {
25         link.setAttribute("href", href);
26     }
27 }
28