Revision: 6962 Author: j...@google.com Date: Tue Nov 17 11:51:29 2009 Log: Updated patch for issue 3527 (getDisabled() -> isDisabled() on Select and OptGroup elements. Review: http://gwt-code-reviews.appspot.com/97803 http://code.google.com/p/google-web-toolkit/source/detail?r=6962
Modified: /trunk/user/src/com/google/gwt/dom/client/OptGroupElement.java /trunk/user/src/com/google/gwt/dom/client/SelectElement.java /trunk/user/test/com/google/gwt/dom/client/ElementTest.java ======================================= --- /trunk/user/src/com/google/gwt/dom/client/OptGroupElement.java Fri Jul 11 13:35:23 2008 +++ /trunk/user/src/com/google/gwt/dom/client/OptGroupElement.java Tue Nov 17 11:51:29 2009 @@ -41,6 +41,7 @@ * The control is unavailable in this context. * * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-disabled">W3C HTML Specification</a> + * @deprecated use {...@link #isDisabled()} instead. */ public final native String getDisabled() /*-{ return this.disabled; @@ -55,6 +56,24 @@ return this.label; }-*/; + /** + * The control is unavailable in this context. + * + * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-disabled">W3C HTML Specification</a> + */ + public final native boolean isDisabled() /*-{ + return !!this.disabled; + }-*/; + + /** + * The control is unavailable in this context. + * + * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-disabled">W3C HTML Specification</a> + */ + public final native void setDisabled(boolean disabled) /*-{ + this.disabled = disabled; + }-*/; + /** * The control is unavailable in this context. * ======================================= --- /trunk/user/src/com/google/gwt/dom/client/SelectElement.java Fri May 15 13:11:37 2009 +++ /trunk/user/src/com/google/gwt/dom/client/SelectElement.java Tue Nov 17 11:51:29 2009 @@ -80,6 +80,7 @@ * The control is unavailable in this context. * * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-disabled">W3C HTML Specification</a> + * @deprecated use {...@link #isDisabled()} instead. */ public final native String getDisabled() /*-{ return this.disabled; @@ -160,6 +161,15 @@ return this.value; }-*/; + /** + * The control is unavailable in this context. + * + * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-disabled">W3C HTML Specification</a> + */ + public final native boolean isDisabled() /*-{ + return !!this.disabled; + }-*/; + /** * If true, multiple OPTION elements may be selected in this SELECT. * @@ -178,6 +188,15 @@ public final void remove(int index) { DOMImpl.impl.selectRemoveOption(this, index); } + + /** + * The control is unavailable in this context. + * + * @see <a href="http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-disabled">W3C HTML Specification</a> + */ + public final native void setDisabled(boolean disabled) /*-{ + this.disabled = disabled; + }-*/; /** * The control is unavailable in this context. ======================================= --- /trunk/user/test/com/google/gwt/dom/client/ElementTest.java Mon Oct 26 18:35:41 2009 +++ /trunk/user/test/com/google/gwt/dom/client/ElementTest.java Tue Nov 17 11:51:29 2009 @@ -84,6 +84,16 @@ assertFalse(input.isDisabled()); input.setDisabled(true); assertTrue(input.isDisabled()); + + SelectElement select = Document.get().createSelectElement(); + assertFalse(select.isDisabled()); + select.setDisabled(true); + assertTrue(select.isDisabled()); + + OptGroupElement optgroup = Document.get().createOptGroupElement(); + assertFalse(optgroup.isDisabled()); + optgroup.setDisabled(true); + assertTrue(optgroup.isDisabled()); } /** -- http://groups.google.com/group/Google-Web-Toolkit-Contributors