1 14 package org.wings; 15 16 import org.wings.plaf.AnchorCG; 17 18 import java.net.URL ; 19 20 28 public class SAnchor extends SContainer { 29 30 33 protected SimpleURL url; 34 35 38 protected String target; 39 40 43 public SAnchor() { 44 this((SimpleURL) null, null); 45 } 46 47 52 public SAnchor(String url) { 53 this(url, null); 54 } 55 56 63 public SAnchor(String url, String target) { 64 setURL(url); 65 setTarget(target); 66 } 67 68 75 public SAnchor(SimpleURL url, String target) { 76 setURL(url); 77 setTarget(target); 78 } 79 80 85 public void setURL(URL ref) { 86 if (ref != null) { 87 setURL(ref.toString()); 88 } else { 89 setURL((SimpleURL) null); 90 } 91 } 92 93 98 public void setURL(SimpleURL r) { 99 SimpleURL oldURL = url; 100 url = r; 101 if (url == null && oldURL != null 102 || (url != null && !url.equals(oldURL))) { 103 reload(); 104 } 105 } 106 107 112 public void setURL(String url) { 113 setURL(new SimpleURL(url)); 114 } 115 116 119 public void setTarget(String t) { 120 target = t; 121 } 122 123 126 public String getTarget() { 127 return target; 128 } 129 130 public SimpleURL getURL() { 131 return url; 132 } 133 134 public void setCG(AnchorCG cg) { 135 super.setCG(cg); 136 } 137 } 138 139 140 | Popular Tags |