First create a subclass of Widget to wrap your graphical object as a GWT
Widget. Assumed that your graphical object requires a DIV element, where
it's created on, do the following in your Widget's constructor:

DivElement element = Document.get().createDiv();
makeMyGraphicalObject(element);
setElement(element);

The above code creates a DIV element initializes your graphical object on
that element and makes the element the DOM node of your Widget. Panels will
call getElement() on your object, to attach it.
makeMyGraphicalObject method can look like this:

private native void makeMyGraphicalObject(DivElement element) /*-{
$wnd.makeMyGraphicalObjectJavaScriptMethod(element);
}-*/;

If your graphical object requires, that the DIV is already attached to the
DOM, it will be more complicated. Widget class has some methods like
onLoad() (starting with on), which are called before and after attaching or
detaching. Override them to handle this special case.

Regards
Jan Ehrhardt

2010/3/18 yann menesguen <yann.menesg...@gmail.com>

> Hello,
>
> I've a problem : I've got a .js graphical object (coverflow) that I
> would like to integrate into a GWT project.
> How is it possible with JSNI ? How can I add it into a container to
> show it on my browser ?
>
> I'm sorry I'm a new adept of GWT and I don't have all the technical
> experience...
>
> Thanks for your help !
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to