Stephen Haberman has posted comments on this change.
Change subject: Add interfaces for widgets.
......................................................................
Patch Set 6:
(9 comments)
....................................................
File user/src/com/google/gwt/dom/client/HasStyle.java
Line 29: void setStyleName(String styleName);
Done
....................................................
File user/src/com/google/gwt/dom/client/IsElement.java
Line 61: void appendChild(IsElement element);
The reason only getChild/removeFromParent are included is simply that those
are the only methods I'd needed so far, and I've built all of these
interfaces lazily/as needed over the last few years.
I agree that if some of these methods are going to be here, then they all
should.
I won't do that just yet, but will after the patch is
in/very-close-to-being-2+'d.
....................................................
File user/src/com/google/gwt/dom/client/Style.java
Line 31: public class Style extends JavaScriptObject implements IsStyle {
True, but that is fine--IsStyle is not a characteristic interface, which
would need to be implemented by many other classes.
That said, I did make a HasStyle, which is a characteristic interface that
both Element (a JSO) and Widget (a regular object/non-JSO) implement.
But that is also kosher, and I wouldn't anticipate other JSOs wanting to
implement it. (As Element should already be a base class of any element-ish
JSO that wanted to implement it.)
....................................................
File user/src/com/google/gwt/user/client/ui/IndexedPanel.java
Line 34: * Extends this interface with convenience methods to handle
{@link IsWidget}.
Done
....................................................
File user/src/com/google/gwt/user/client/ui/IsImage.java
Line 34: void setUrl(String url);
Personally, I think the point of these interfaces (and what makes them
handy) is that they expose the widget's API exactly as it is, so that your
code can do anything it would to a real widget, but via the faked interface.
So, in that regard, I don't think the interface itself is the place to
start enforcing SafeUri--instead, I think we would deprecate-then-remove
the non-SafeUris methods in both the interface & widget at the same time.
....................................................
File user/src/com/google/gwt/user/client/ui/IsUIObject.java
Line 27: IsElement getIsElement();
Done
Line 27: IsElement getIsElement();
Colin, I believe Thomas's suggestion is fine because, as he said, the API
of UIObject stays Element, no breaking changes.
But since Element implements IsElement, it still fulfills the "IsElement
getElement" contract of IsUIObject.
....................................................
File user/src/com/google/gwt/user/client/ui/IsWidget2.java
Line 28: public interface IsWidget2 extends IsWidget, IsUIObject,
EventListener, HasHandlers,
Np--although feel free to follow up on the mailing list if the thread gets
too long...
RE IsWidget vs. IsWidget2, yes, the "IsWidget2" is for mocking. Although,
AFAIK, this is the same purpose as the original IsWidget, or at least that
is what its javadoc insinuates.
The "2" was just an ugly name that means "the same thing as the original,
but with more methods, except we can't really add them to the original,
because it would break backwards compatibility". E.g. it's just for
versioning the interface.
I've since renamed "IsWidget2" to "IsWidget.Extended", an inner-interface,
which is more like how the existing GWT interfaces, like IndexedPanel, were
extended for the original IsWidget.
....................................................
File user/src/com/google/gwt/user/client/ui/Panel.java
Line 118: return new IsWidgetIteratorAdaptor(iterator());
Ah, yes, another great catch--I believe that I had to do this in Tessell
since I couldn't change Widget itself.
But now, you're right, the adaptor isn't needed, and the cast seems to work
just fine.
--
To view, visit https://gwt-review.googlesource.com/3231
To unsubscribe, visit https://gwt-review.googlesource.com/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibd17162d37e367720829bcdaf9a350e446c833b9
Gerrit-PatchSet: 6
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Stephen Haberman <stephen.haber...@gmail.com>
Gerrit-Reviewer: Colin Alworth <niloc...@gmail.com>
Gerrit-Reviewer: Daniel Kurka <danku...@google.com>
Gerrit-Reviewer: Goktug Gokdogan <gok...@google.com>
Gerrit-Reviewer: Leeroy Jenkins <jenk...@gwtproject.org>
Gerrit-Reviewer: Stephen Haberman <stephen.haber...@gmail.com>
Gerrit-Reviewer: Thomas Broyer <t.bro...@gmail.com>
Gerrit-HasComments: Yes
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
---
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.