Matthew Dempsky has submitted this change and it was merged.
Change subject: Add SafeUri overloads for setting properties used for
navigation
......................................................................
Add SafeUri overloads for setting properties used for navigation
Change-Id: I8ab7a472b0c0c4470f00f7178de216f7c7e4e415
---
M tools/api-checker/config/gwt25_26userApi.conf
M user/src/com/google/gwt/dom/builder/client/DomAnchorBuilder.java
M user/src/com/google/gwt/dom/builder/client/DomFormBuilder.java
M user/src/com/google/gwt/dom/builder/client/DomFrameBuilder.java
M user/src/com/google/gwt/dom/builder/client/DomIFrameBuilder.java
M user/src/com/google/gwt/dom/builder/client/DomModBuilder.java
M user/src/com/google/gwt/dom/builder/client/DomQuoteBuilder.java
M user/src/com/google/gwt/dom/builder/shared/AnchorBuilder.java
M user/src/com/google/gwt/dom/builder/shared/FormBuilder.java
M user/src/com/google/gwt/dom/builder/shared/FrameBuilder.java
M user/src/com/google/gwt/dom/builder/shared/HtmlAnchorBuilder.java
M user/src/com/google/gwt/dom/builder/shared/HtmlFormBuilder.java
M user/src/com/google/gwt/dom/builder/shared/HtmlFrameBuilder.java
M user/src/com/google/gwt/dom/builder/shared/HtmlIFrameBuilder.java
M user/src/com/google/gwt/dom/builder/shared/HtmlQuoteBuilder.java
M user/src/com/google/gwt/dom/builder/shared/IFrameBuilder.java
M user/src/com/google/gwt/dom/builder/shared/ModBuilder.java
M user/src/com/google/gwt/dom/builder/shared/QuoteBuilder.java
M user/src/com/google/gwt/dom/client/AnchorElement.java
M user/src/com/google/gwt/dom/client/FormElement.java
M user/src/com/google/gwt/dom/client/FrameElement.java
M user/src/com/google/gwt/dom/client/IFrameElement.java
M user/src/com/google/gwt/dom/client/ModElement.java
M user/src/com/google/gwt/dom/client/ObjectElement.java
M user/src/com/google/gwt/dom/client/QuoteElement.java
M user/src/com/google/gwt/user/client/ui/Anchor.java
M user/src/com/google/gwt/user/client/ui/FormPanel.java
M user/src/com/google/gwt/user/client/ui/Frame.java
28 files changed, 329 insertions(+), 24 deletions(-)
Approvals:
Matthew Dempsky: Looks good to me, approved
Leeroy Jenkins: Verified
Thomas Broyer: Looks good to me, but someone else must approve
diff --git a/tools/api-checker/config/gwt25_26userApi.conf
b/tools/api-checker/config/gwt25_26userApi.conf
index ce95c2e..c2e5f4f 100644
--- a/tools/api-checker/config/gwt25_26userApi.conf
+++ b/tools/api-checker/config/gwt25_26userApi.conf
@@ -154,3 +154,15 @@
# Split BaseListenerWrapper
com.google.gwt.user.client.BaseListenerWrapper::getSource(Lcom/google/gwt/event/shared/GwtEvent;)
MISSING
com.google.gwt.user.client.BaseListenerWrapper::setSource(Lcom/google/gwt/user/client/ui/Widget;)
MISSING
+
+# Add SafeUri variants of some existing String methods that
+# are used for navigation purposes.
+com.google.gwt.dom.client.AnchorElement::setHref(Ljava/lang/String;)
OVERLOADED_METHOD_CALL
+com.google.gwt.dom.client.FormElement::setAction(Ljava/lang/String;)
OVERLOADED_METHOD_CALL
+com.google.gwt.dom.client.FrameElement::setLongDesc(Ljava/lang/String;)
OVERLOADED_METHOD_CALL
+com.google.gwt.dom.client.FrameElement::setSrc(Ljava/lang/String;)
OVERLOADED_METHOD_CALL
+com.google.gwt.dom.client.IFrameElement::setSrc(Ljava/lang/String;)
OVERLOADED_METHOD_CALL
+com.google.gwt.dom.client.ModElement::setCite(Ljava/lang/String;)
OVERLOADED_METHOD_CALL
+com.google.gwt.dom.client.ObjectElement::setData(Ljava/lang/String;)
OVERLOADED_METHOD_CALL
+com.google.gwt.dom.client.QuoteElement::setCite(Ljava/lang/String;)
OVERLOADED_METHOD_CALL
+com.google.gwt.user.client.ui.Anchor::setHref(Ljava/lang/String;)
OVERLOADED_METHOD_CALL
diff --git
a/user/src/com/google/gwt/dom/builder/client/DomAnchorBuilder.java
b/user/src/com/google/gwt/dom/builder/client/DomAnchorBuilder.java
index b290670..70a24fd 100644
--- a/user/src/com/google/gwt/dom/builder/client/DomAnchorBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/client/DomAnchorBuilder.java
@@ -17,6 +17,7 @@
import com.google.gwt.dom.builder.shared.AnchorBuilder;
import com.google.gwt.dom.client.AnchorElement;
+import com.google.gwt.safehtml.shared.SafeUri;
/**
* DOM-based implementation of {@link AnchorBuilder}.
@@ -35,6 +36,12 @@
}
@Override
+ public AnchorBuilder href(SafeUri href) {
+ assertCanAddAttribute().setHref(href);
+ return this;
+ }
+
+ @Override
public AnchorBuilder href(String href) {
assertCanAddAttribute().setHref(href);
return this;
diff --git a/user/src/com/google/gwt/dom/builder/client/DomFormBuilder.java
b/user/src/com/google/gwt/dom/builder/client/DomFormBuilder.java
index 60f461a..491e6e4 100644
--- a/user/src/com/google/gwt/dom/builder/client/DomFormBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/client/DomFormBuilder.java
@@ -17,6 +17,7 @@
import com.google.gwt.dom.builder.shared.FormBuilder;
import com.google.gwt.dom.client.FormElement;
+import com.google.gwt.safehtml.shared.SafeUri;
/**
* DOM-based implementation of {@link FormBuilder}.
@@ -35,6 +36,12 @@
}
@Override
+ public FormBuilder action(SafeUri action) {
+ assertCanAddAttribute().setAction(action);
+ return this;
+ }
+
+ @Override
public FormBuilder action(String action) {
assertCanAddAttribute().setAction(action);
return this;
diff --git
a/user/src/com/google/gwt/dom/builder/client/DomFrameBuilder.java
b/user/src/com/google/gwt/dom/builder/client/DomFrameBuilder.java
index 0f7022f..87818a6 100644
--- a/user/src/com/google/gwt/dom/builder/client/DomFrameBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/client/DomFrameBuilder.java
@@ -17,6 +17,7 @@
import com.google.gwt.dom.builder.shared.FrameBuilder;
import com.google.gwt.dom.client.FrameElement;
+import com.google.gwt.safehtml.shared.SafeUri;
/**
* DOM-based implementation of {@link FrameBuilder}.
@@ -31,6 +32,12 @@
@Override
public FrameBuilder frameBorder(int frameBorder) {
assertCanAddAttribute().setFrameBorder(frameBorder);
+ return this;
+ }
+
+ @Override
+ public FrameBuilder longDesc(SafeUri longDesc) {
+ assertCanAddAttribute().setLongDesc(longDesc);
return this;
}
@@ -71,6 +78,12 @@
}
@Override
+ public FrameBuilder src(SafeUri src) {
+ assertCanAddAttribute().setSrc(src);
+ return this;
+ }
+
+ @Override
public FrameBuilder src(String src) {
assertCanAddAttribute().setSrc(src);
return this;
diff --git
a/user/src/com/google/gwt/dom/builder/client/DomIFrameBuilder.java
b/user/src/com/google/gwt/dom/builder/client/DomIFrameBuilder.java
index 64493a4..e987b49 100644
--- a/user/src/com/google/gwt/dom/builder/client/DomIFrameBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/client/DomIFrameBuilder.java
@@ -19,6 +19,7 @@
import com.google.gwt.dom.builder.shared.IFrameBuilder;
import com.google.gwt.dom.client.IFrameElement;
import com.google.gwt.safehtml.shared.SafeHtml;
+import com.google.gwt.safehtml.shared.SafeUri;
/**
* DOM-based implementation of {@link IFrameBuilder}.
@@ -77,6 +78,12 @@
}
@Override
+ public IFrameBuilder src(SafeUri src) {
+ assertCanAddAttribute().setSrc(src);
+ return this;
+ }
+
+ @Override
public IFrameBuilder src(String src) {
assertCanAddAttribute().setSrc(src);
return this;
diff --git a/user/src/com/google/gwt/dom/builder/client/DomModBuilder.java
b/user/src/com/google/gwt/dom/builder/client/DomModBuilder.java
index 24ca18e..c8c6323 100644
--- a/user/src/com/google/gwt/dom/builder/client/DomModBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/client/DomModBuilder.java
@@ -17,6 +17,7 @@
import com.google.gwt.dom.builder.shared.ModBuilder;
import com.google.gwt.dom.client.ModElement;
+import com.google.gwt.safehtml.shared.SafeUri;
/**
* DOM-based implementation of {@link ModBuilder}.
@@ -28,6 +29,12 @@
}
@Override
+ public ModBuilder cite(SafeUri cite) {
+ assertCanAddAttribute().setCite(cite);
+ return this;
+ }
+
+ @Override
public ModBuilder cite(String cite) {
assertCanAddAttribute().setCite(cite);
return this;
diff --git
a/user/src/com/google/gwt/dom/builder/client/DomQuoteBuilder.java
b/user/src/com/google/gwt/dom/builder/client/DomQuoteBuilder.java
index 8c72073..a696ae5 100644
--- a/user/src/com/google/gwt/dom/builder/client/DomQuoteBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/client/DomQuoteBuilder.java
@@ -17,6 +17,7 @@
import com.google.gwt.dom.builder.shared.QuoteBuilder;
import com.google.gwt.dom.client.QuoteElement;
+import com.google.gwt.safehtml.shared.SafeUri;
/**
* DOM-based implementation of {@link QuoteBuilder}.
@@ -29,6 +30,12 @@
}
@Override
+ public QuoteBuilder cite(SafeUri cite) {
+ assertCanAddAttribute().setCite(cite);
+ return this;
+ }
+
+ @Override
public QuoteBuilder cite(String cite) {
assertCanAddAttribute().setCite(cite);
return this;
diff --git a/user/src/com/google/gwt/dom/builder/shared/AnchorBuilder.java
b/user/src/com/google/gwt/dom/builder/shared/AnchorBuilder.java
index f26ad97..6108bde 100644
--- a/user/src/com/google/gwt/dom/builder/shared/AnchorBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/shared/AnchorBuilder.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.builder.shared;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* Builds an anchor element.
*/
@@ -31,7 +33,16 @@
/**
* The absolute URI of the linked resource.
- *
+ *
+ * @see <a
+ *
href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#adef-href">W3C
+ * HTML Specification</a>
+ */
+ AnchorBuilder href(SafeUri href);
+
+ /**
+ * The absolute URI of the linked resource.
+ *
* @see <a
*
href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#adef-href">W3C
* HTML Specification</a>
diff --git a/user/src/com/google/gwt/dom/builder/shared/FormBuilder.java
b/user/src/com/google/gwt/dom/builder/shared/FormBuilder.java
index cb815f3..b2cdd1a 100644
--- a/user/src/com/google/gwt/dom/builder/shared/FormBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/shared/FormBuilder.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.builder.shared;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* Builds an form element.
*/
@@ -31,7 +33,16 @@
/**
* Server-side form handler.
- *
+ *
+ * @see <a
+ *
href="http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-action">W3C
+ * HTML Specification</a>
+ */
+ FormBuilder action(SafeUri action);
+
+ /**
+ * Server-side form handler.
+ *
* @see <a
*
href="http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-action">W3C
* HTML Specification</a>
diff --git a/user/src/com/google/gwt/dom/builder/shared/FrameBuilder.java
b/user/src/com/google/gwt/dom/builder/shared/FrameBuilder.java
index dacd0b0..dd471b5 100644
--- a/user/src/com/google/gwt/dom/builder/shared/FrameBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/shared/FrameBuilder.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.builder.shared;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* Builds an frame element.
*/
@@ -31,7 +33,16 @@
/**
* URI designating a long description of this image or frame.
- *
+ *
+ * @see <a
+ *
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-longdesc-FRAME">W3C
+ * HTML Specification</a>
+ */
+ FrameBuilder longDesc(SafeUri longDesc);
+
+ /**
+ * URI designating a long description of this image or frame.
+ *
* @see <a
*
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-longdesc-FRAME">W3C
* HTML Specification</a>
@@ -85,7 +96,16 @@
/**
* A URI designating the initial frame contents.
- *
+ *
+ * @see <a
+ *
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-src-FRAME">W3C
+ * HTML Specification</a>
+ */
+ FrameBuilder src(SafeUri src);
+
+ /**
+ * A URI designating the initial frame contents.
+ *
* @see <a
*
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-src-FRAME">W3C
* HTML Specification</a>
diff --git
a/user/src/com/google/gwt/dom/builder/shared/HtmlAnchorBuilder.java
b/user/src/com/google/gwt/dom/builder/shared/HtmlAnchorBuilder.java
index bc5dc7b..759cec4 100644
--- a/user/src/com/google/gwt/dom/builder/shared/HtmlAnchorBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/shared/HtmlAnchorBuilder.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.builder.shared;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* HTML-based implementation of {@link AnchorBuilder}.
*/
@@ -31,6 +33,11 @@
}
@Override
+ public AnchorBuilder href(SafeUri href) {
+ return href(href.asString());
+ }
+
+ @Override
public AnchorBuilder href(String href) {
return trustedAttribute("href", href);
}
diff --git
a/user/src/com/google/gwt/dom/builder/shared/HtmlFormBuilder.java
b/user/src/com/google/gwt/dom/builder/shared/HtmlFormBuilder.java
index 83b2bf5..f59cdd3 100644
--- a/user/src/com/google/gwt/dom/builder/shared/HtmlFormBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/shared/HtmlFormBuilder.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.builder.shared;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* HTML-based implementation of {@link FormBuilder}.
*/
@@ -30,6 +32,11 @@
}
@Override
+ public FormBuilder action(SafeUri action) {
+ return action(action.asString());
+ }
+
+ @Override
public FormBuilder action(String action) {
return trustedAttribute("action", action);
}
diff --git
a/user/src/com/google/gwt/dom/builder/shared/HtmlFrameBuilder.java
b/user/src/com/google/gwt/dom/builder/shared/HtmlFrameBuilder.java
index b81a127..5a43e1d 100644
--- a/user/src/com/google/gwt/dom/builder/shared/HtmlFrameBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/shared/HtmlFrameBuilder.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.builder.shared;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* HTML-based implementation of {@link FrameBuilder}.
*/
@@ -27,6 +29,11 @@
@Override
public FrameBuilder frameBorder(int frameBorder) {
return trustedAttribute("frameBorder", frameBorder);
+ }
+
+ @Override
+ public FrameBuilder longDesc(SafeUri longDesc) {
+ return longDesc(longDesc.asString());
}
@Override
@@ -60,6 +67,11 @@
}
@Override
+ public FrameBuilder src(SafeUri src) {
+ return src(src.asString());
+ }
+
+ @Override
public FrameBuilder src(String src) {
return trustedAttribute("src", src);
}
diff --git
a/user/src/com/google/gwt/dom/builder/shared/HtmlIFrameBuilder.java
b/user/src/com/google/gwt/dom/builder/shared/HtmlIFrameBuilder.java
index 22e1823..e8c1ed8 100644
--- a/user/src/com/google/gwt/dom/builder/shared/HtmlIFrameBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/shared/HtmlIFrameBuilder.java
@@ -16,6 +16,7 @@
package com.google.gwt.dom.builder.shared;
import com.google.gwt.safehtml.shared.SafeHtml;
+import com.google.gwt.safehtml.shared.SafeUri;
/**
* HTML-based implementation of {@link IFrameBuilder}.
@@ -68,6 +69,11 @@
}
@Override
+ public IFrameBuilder src(SafeUri src) {
+ return src(src.asString());
+ }
+
+ @Override
public IFrameBuilder src(String src) {
return trustedAttribute("src", src);
}
diff --git
a/user/src/com/google/gwt/dom/builder/shared/HtmlQuoteBuilder.java
b/user/src/com/google/gwt/dom/builder/shared/HtmlQuoteBuilder.java
index 1681a46..35e873f 100644
--- a/user/src/com/google/gwt/dom/builder/shared/HtmlQuoteBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/shared/HtmlQuoteBuilder.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.builder.shared;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* HTML-based implementation of {@link QuoteBuilder}.
*/
@@ -25,6 +27,11 @@
}
@Override
+ public QuoteBuilder cite(SafeUri cite) {
+ return cite(cite.asString());
+ }
+
+ @Override
public QuoteBuilder cite(String cite) {
return trustedAttribute("cite", cite);
}
diff --git a/user/src/com/google/gwt/dom/builder/shared/IFrameBuilder.java
b/user/src/com/google/gwt/dom/builder/shared/IFrameBuilder.java
index 77835e3..cee2403 100644
--- a/user/src/com/google/gwt/dom/builder/shared/IFrameBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/shared/IFrameBuilder.java
@@ -16,6 +16,7 @@
package com.google.gwt.dom.builder.shared;
import com.google.gwt.safehtml.shared.SafeHtml;
+import com.google.gwt.safehtml.shared.SafeUri;
/**
* Builds an iframe element.
@@ -92,7 +93,16 @@
/**
* A URI designating the initial frame contents.
- *
+ *
+ * @see <a
+ *
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-src-FRAME">W3C
+ * HTML Specification</a>
+ */
+ IFrameBuilder src(SafeUri src);
+
+ /**
+ * A URI designating the initial frame contents.
+ *
* @see <a
*
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-src-FRAME">W3C
* HTML Specification</a>
diff --git a/user/src/com/google/gwt/dom/builder/shared/ModBuilder.java
b/user/src/com/google/gwt/dom/builder/shared/ModBuilder.java
index 070b306..efdbdf6 100644
--- a/user/src/com/google/gwt/dom/builder/shared/ModBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/shared/ModBuilder.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.builder.shared;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* Builds an mod element.
*/
@@ -22,7 +24,14 @@
/**
* A URI designating a document that describes the reason for the change.
- *
+ *
+ * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/">W3C
HTML Specification</a>
+ */
+ ModBuilder cite(SafeUri cite);
+
+ /**
+ * A URI designating a document that describes the reason for the change.
+ *
* @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/">W3C
HTML Specification</a>
*/
ModBuilder cite(String cite);
diff --git a/user/src/com/google/gwt/dom/builder/shared/QuoteBuilder.java
b/user/src/com/google/gwt/dom/builder/shared/QuoteBuilder.java
index a533e1a..ee8c1c0 100644
--- a/user/src/com/google/gwt/dom/builder/shared/QuoteBuilder.java
+++ b/user/src/com/google/gwt/dom/builder/shared/QuoteBuilder.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.builder.shared;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* Builds an quote element.
*/
@@ -22,7 +24,16 @@
/**
* A URI designating a source document or message.
- *
+ *
+ * @see <a
+ *
href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/text.html#adef-cite-Q">W3C
+ * HTML Specification</a>
+ */
+ QuoteBuilder cite(SafeUri cite);
+
+ /**
+ * A URI designating a source document or message.
+ *
* @see <a
*
href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/text.html#adef-cite-Q">W3C
* HTML Specification</a>
diff --git a/user/src/com/google/gwt/dom/client/AnchorElement.java
b/user/src/com/google/gwt/dom/client/AnchorElement.java
index 747b44c..82eeb23 100644
--- a/user/src/com/google/gwt/dom/client/AnchorElement.java
+++ b/user/src/com/google/gwt/dom/client/AnchorElement.java
@@ -113,21 +113,21 @@
/**
* The absolute URI of the linked resource.
- *
+ *
* @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#adef-href">W3C
HTML Specification</a>
*/
- public final native void setHref(String href) /*-{
- this.href = href;
- }-*/;
+ public final void setHref(SafeUri href) {
+ setHref(href.asString());
+ }
/**
* The absolute URI of the linked resource.
*
* @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#adef-href">W3C
HTML Specification</a>
*/
- public final void setSafeHref(SafeUri href) {
- setHref(href.asString());
- }
+ public final native void setHref(String href) /*-{
+ this.href = href;
+ }-*/;
/**
* Language code of the linked resource.
diff --git a/user/src/com/google/gwt/dom/client/FormElement.java
b/user/src/com/google/gwt/dom/client/FormElement.java
index 4784490..f179292 100644
--- a/user/src/com/google/gwt/dom/client/FormElement.java
+++ b/user/src/com/google/gwt/dom/client/FormElement.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.client;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* The FORM element encompasses behavior similar to a collection and an
element.
* It provides direct access to the contained form controls as well as the
@@ -122,7 +124,16 @@
/**
* Server-side form handler.
- *
+ *
+ * @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-action">W3C
HTML Specification</a>
+ */
+ public final void setAction(SafeUri action) {
+ setAction(action.asString());
+ }
+
+ /**
+ * Server-side form handler.
+ *
* @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-action">W3C
HTML Specification</a>
*/
public final native void setAction(String action) /*-{
diff --git a/user/src/com/google/gwt/dom/client/FrameElement.java
b/user/src/com/google/gwt/dom/client/FrameElement.java
index d8662ce..f8e1558 100644
--- a/user/src/com/google/gwt/dom/client/FrameElement.java
+++ b/user/src/com/google/gwt/dom/client/FrameElement.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.client;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* Create a frame.
*
@@ -129,7 +131,16 @@
/**
* URI designating a long description of this image or frame.
- *
+ *
+ * @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-longdesc-FRAME">W3C
HTML Specification</a>
+ */
+ public final void setLongDesc(SafeUri longDesc) {
+ setLongDesc(longDesc.asString());
+ }
+
+ /**
+ * URI designating a long description of this image or frame.
+ *
* @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-longdesc-FRAME">W3C
HTML Specification</a>
*/
public final native void setLongDesc(String longDesc) /*-{
@@ -183,7 +194,16 @@
/**
* A URI designating the initial frame contents.
- *
+ *
+ * @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-src-FRAME">W3C
HTML Specification</a>
+ */
+ public final void setSrc(SafeUri src) {
+ setSrc(src.asString());
+ }
+
+ /**
+ * A URI designating the initial frame contents.
+ *
* @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-src-FRAME">W3C
HTML Specification</a>
*/
public final native void setSrc(String src) /*-{
diff --git a/user/src/com/google/gwt/dom/client/IFrameElement.java
b/user/src/com/google/gwt/dom/client/IFrameElement.java
index 8581e43..0b7def9 100644
--- a/user/src/com/google/gwt/dom/client/IFrameElement.java
+++ b/user/src/com/google/gwt/dom/client/IFrameElement.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.client;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* Inline subwindows.
*
@@ -165,7 +167,16 @@
/**
* A URI designating the initial frame contents.
- *
+ *
+ * @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-src-FRAME">W3C
HTML Specification</a>
+ */
+ public final void setSrc(SafeUri src) {
+ setSrc(src.asString());
+ }
+
+ /**
+ * A URI designating the initial frame contents.
+ *
* @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/present/frames.html#adef-src-FRAME">W3C
HTML Specification</a>
*/
public final native void setSrc(String src) /*-{
diff --git a/user/src/com/google/gwt/dom/client/ModElement.java
b/user/src/com/google/gwt/dom/client/ModElement.java
index f2d7d21..99ba586 100644
--- a/user/src/com/google/gwt/dom/client/ModElement.java
+++ b/user/src/com/google/gwt/dom/client/ModElement.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.client;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* Notice of modification to part of a document.
*
@@ -60,7 +62,16 @@
/**
* A URI designating a document that describes the reason for the change.
- *
+ *
+ * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/">W3C
HTML Specification</a>
+ */
+ public final void setCite(SafeUri cite) {
+ setCite(cite.asString());
+ }
+
+ /**
+ * A URI designating a document that describes the reason for the change.
+ *
* @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/">W3C
HTML Specification</a>
*/
public final native void setCite(String cite) /*-{
diff --git a/user/src/com/google/gwt/dom/client/ObjectElement.java
b/user/src/com/google/gwt/dom/client/ObjectElement.java
index 6494639..7db7afc 100644
--- a/user/src/com/google/gwt/dom/client/ObjectElement.java
+++ b/user/src/com/google/gwt/dom/client/ObjectElement.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.client;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* Generic embedded object.
*
@@ -118,7 +120,16 @@
/**
* A URI specifying the location of the object's data.
- *
+ *
+ * @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html#adef-data">W3C
HTML Specification</a>
+ */
+ public final void setData(SafeUri data) {
+ setData(data.asString());
+ }
+
+ /**
+ * A URI specifying the location of the object's data.
+ *
* @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html#adef-data">W3C
HTML Specification</a>
*/
public final native void setData(String data) /*-{
diff --git a/user/src/com/google/gwt/dom/client/QuoteElement.java
b/user/src/com/google/gwt/dom/client/QuoteElement.java
index 26f87bb..8e0deb5 100644
--- a/user/src/com/google/gwt/dom/client/QuoteElement.java
+++ b/user/src/com/google/gwt/dom/client/QuoteElement.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.client;
+import com.google.gwt.safehtml.shared.SafeUri;
+
/**
* For the Q and BLOCKQUOTE elements.
*
@@ -50,7 +52,16 @@
/**
* A URI designating a source document or message.
- *
+ *
+ * @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/text.html#adef-cite-Q">W3C
HTML Specification</a>
+ */
+ public final void setCite(SafeUri cite) {
+ setCite(cite.asString());
+ }
+
+ /**
+ * A URI designating a source document or message.
+ *
* @see <a
href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/text.html#adef-cite-Q">W3C
HTML Specification</a>
*/
public final native void setCite(String cite) /*-{
diff --git a/user/src/com/google/gwt/user/client/ui/Anchor.java
b/user/src/com/google/gwt/user/client/ui/Anchor.java
index 41816df..95c91fa 100644
--- a/user/src/com/google/gwt/user/client/ui/Anchor.java
+++ b/user/src/com/google/gwt/user/client/ui/Anchor.java
@@ -24,6 +24,7 @@
import com.google.gwt.i18n.shared.DirectionEstimator;
import com.google.gwt.i18n.shared.HasDirectionEstimator;
import com.google.gwt.safehtml.shared.SafeHtml;
+import com.google.gwt.safehtml.shared.SafeUri;
/**
* A widget that represents a simple <a> element.
@@ -224,6 +225,16 @@
}
/**
+ * Creates an anchor with its html and href (target URL) specified.
+ *
+ * @param html the anchor's html
+ * @param href the url to which it will link
+ */
+ public Anchor(SafeHtml html, SafeUri href) {
+ this(html.asString(), true, href.asString());
+ }
+
+ /**
* Creates an anchor with its html and href (target URL) specified.
*
* @param html the anchor's html
@@ -238,6 +249,17 @@
* Creates an anchor with its html and href (target URL) specified.
*
* @param html the anchor's html
+ * @param dir the html's direction
+ * @param href the url to which it will link
+ */
+ public Anchor(SafeHtml html, Direction dir, SafeUri href) {
+ this(html.asString(), true, dir, href.asString());
+ }
+
+ /**
+ * Creates an anchor with its html and href (target URL) specified.
+ *
+ * @param html the anchor's html
* @param directionEstimator A DirectionEstimator object used for
automatic
* direction adjustment. For convenience,
* {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used.
@@ -246,6 +268,20 @@
public Anchor(SafeHtml html, DirectionEstimator directionEstimator,
String href) {
this(html.asString(), true, directionEstimator, href);
+ }
+
+ /**
+ * Creates an anchor with its html and href (target URL) specified.
+ *
+ * @param html the anchor's html
+ * @param directionEstimator A DirectionEstimator object used for
automatic
+ * direction adjustment. For convenience,
+ * {@link #DEFAULT_DIRECTION_ESTIMATOR} can be used.
+ * @param href the url to which it will link
+ */
+ public Anchor(SafeHtml html, DirectionEstimator directionEstimator,
+ SafeUri href) {
+ this(html.asString(), true, directionEstimator, href.asString());
}
/**
@@ -308,6 +344,20 @@
*/
public Anchor(SafeHtml html, String href, String target) {
this(html.asString(), true, href, target);
+ }
+
+ /**
+ * Creates a source anchor (link to URI).
+ *
+ * That is, an anchor with an href attribute specifying the destination
URI.
+ *
+ * @param html the anchor's html
+ * @param href the url to which it will link
+ * @param target the target frame (e.g. "_blank" to open the link in a
new
+ * window)
+ */
+ public Anchor(SafeHtml html, SafeUri href, String target) {
+ this(html.asString(), true, href.asString(), target);
}
/**
@@ -503,7 +553,16 @@
/**
* Sets the anchor's href (the url to which it links).
- *
+ *
+ * @param href the anchor's href
+ */
+ public void setHref(SafeUri href) {
+ getAnchorElement().setHref(href);
+ }
+
+ /**
+ * Sets the anchor's href (the url to which it links).
+ *
* @param href the anchor's href
*/
public void setHref(String href) {
diff --git a/user/src/com/google/gwt/user/client/ui/FormPanel.java
b/user/src/com/google/gwt/user/client/ui/FormPanel.java
index e2667ab..fb14040 100644
--- a/user/src/com/google/gwt/user/client/ui/FormPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/FormPanel.java
@@ -528,7 +528,7 @@
* @param url the form's action
*/
public void setAction(SafeUri url) {
- setAction(url.asString());
+ getFormElement().setAction(url);
}
/**
diff --git a/user/src/com/google/gwt/user/client/ui/Frame.java
b/user/src/com/google/gwt/user/client/ui/Frame.java
index 0e1005c..ae62497 100644
--- a/user/src/com/google/gwt/user/client/ui/Frame.java
+++ b/user/src/com/google/gwt/user/client/ui/Frame.java
@@ -132,7 +132,7 @@
* @param url the frame's new URL
*/
public void setUrl(SafeUri url) {
- setUrl(url.asString());
+ getFrameElement().setSrc(url);
}
private FrameElement getFrameElement() {
--
To view, visit https://gwt-review.googlesource.com/2663
To unsubscribe, visit https://gwt-review.googlesource.com/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8ab7a472b0c0c4470f00f7178de216f7c7e4e415
Gerrit-PatchSet: 4
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Matthew Dempsky <[email protected]>
Gerrit-Reviewer: Brian Slesinsky <[email protected]>
Gerrit-Reviewer: Guillaume Ryder <[email protected]>
Gerrit-Reviewer: Leeroy Jenkins <[email protected]>
Gerrit-Reviewer: Matthew Dempsky <[email protected]>
Gerrit-Reviewer: Thomas Broyer <[email protected]>
--
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
---
You received this message because you are subscribed to the Google Groups "Google Web Toolkit Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.