Ambiguity on javadoc (HTMLPanel - addAndReplaceElement() )

51 views
Skip to first unread message

regnoult axel

unread,
Sep 12, 2012, 11:17:51 AM9/12/12
to google-we...@googlegroups.com

Hi,


I do not understand if addAndReplaceElement() is deprecated or not...because it seems that the alternative of the deprecated function is the same. Can you confirm ? (the link in the javadoc refers to eactly the same function). I just want to know if I should use this function or not...

Thanks you,


addAndReplaceElement

@Deprecated
public void addAndReplaceElement(Widget widget,
                                            Element toReplace)
Deprecated. use addAndReplaceElement(Widget, Element)

Adds a child widget to the panel, replacing the HTML element.

Parameters:
widget - the widget to be added
toReplace - the element to be replaced by the widget

Paul Robinson

unread,
Sep 12, 2012, 11:44:04 AM9/12/12
to google-we...@googlegroups.com
If you look carefully at the source code, you'll see that there are two methods called addAndReplaceElement(Widget, Element), it's just that one of them uses com.google.gwt.dom.client.Element and the other uses com.google.gwt.user.client.Element

It's the com.google.gwt.user.client.Element version that's marked as deprecated.

In the generated javadoc, click on the link from the deprecated method and it takes you to the same deprecated method. But the source code indicates the overloaded method instead. It looks like the generated javadoc doesn't accurately reflect the source code.

Paul
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/6MdGZwhcYWEJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

regnoult axel

unread,
Sep 12, 2012, 1:53:53 PM9/12/12
to google-we...@googlegroups.com
Ok, Thanks you Paul

Reply all
Reply to author
Forward
0 new messages