DOMImpl for iPhone: How to do ?

69 views
Skip to first unread message

fvisticot

unread,
Dec 30, 2009, 5:23:18 PM12/30/09
to Google Web Toolkit
I would like to manage the iPhone touchstart touchmove... events with
a clean solution.
It seems that i need to create my own DOMImpl for the iPhone and link
this new DOMImpl to the iPhone userAgent.

Do i need to recompile the GWT sources for that ?
It seems that i can not override the DOMImplSafari...so it seems that
a re-compilation is required...

I there a document/tuto with the differents mandatory steps to create
a new DOMImpl ?
Is there a list of class to implement when adding a new DOMImpl ?
(DOMImpl, UserAgent.gwt.xml, Creating new DomEvent...)

Is there allready a DOMImplIphone implementation (GoogleWave is
available on the iPhone....pearhaps are they using a dedicated
implementation) ??

Fred.

DaveC

unread,
Dec 30, 2009, 7:28:00 PM12/30/09
to Google Web Toolkit
It seems I'm trying to do the same thing
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/e1c6bd5a5d196ecf...
and have come up against the same barriers.

If I find the answer I'll let you know.

Cheers,
Dave

fvisticot

unread,
Dec 30, 2009, 8:15:34 PM12/30/09
to Google Web Toolkit
Hello,
I have worked on the pb and i have made some progress !!!

1. I have overloaded the DOMImpl class. The new overloaded class must
be in a package named com.google.gwt.user.client.impl
2. I have created dedicated events (extending DomEvent)
3. I have created dedicated handlers (extending EventHandler)
4. I have created dedicated HasHandlers
5. In my module file i have added:

<replace-with class="com.google.gwt.user.client.impl.MyDomImpl">
<when-type-is class="com.google.gwt.user.client.impl.DOMImpl"/>
<when-property-is name="user.agent" value="safari"/>
</replace-with>

6. I have created a new Widget implementing the
public HandlerRegistration add<Your>Handler(<Your>Handler handler) {
return addDomHandler(handler, <Your>Event.getType());
}
7. My application create the new widget and call the
add<Your>Handler...

... and it works perfectly...


Hope it can help...

On 31 déc, 01:28, DaveC <david.andrew.chap...@googlemail.com> wrote:
> It seems I'm trying to do the same thinghttp://groups.google.com/group/google-web-toolkit/browse_thread/threa......

DaveC

unread,
Dec 31, 2009, 4:26:20 AM12/31/09
to Google Web Toolkit
Ah, cool thanks - I've done all that just didn't put the MyDomImpl in
com.google.gwt.user.client.impl...

Cheers,
Dave

DaveC

unread,
Dec 31, 2009, 8:45:44 AM12/31/09
to Google Web Toolkit
Tried to rename the package, but I get an error and a warning:

Error: Method 'eventGetTypeInt(String)' in type
'com.applegreen.gwt.html5.dom.DOMImplMozillaHtml5' is native. Running
the modified program will cause UnsatisfiedLinkError.
Warn: Package 'com.google.gwt.user.client.impl' already exists in this
project in a folder....

I guess if I downloaded the GWT source doing this would be straight
forward but I can't do that for this project... I need to stick with
the (2.0) release.

Any other suggestions?

DaveC

unread,
Dec 31, 2009, 9:16:29 AM12/31/09
to Google Web Toolkit
Ignored those warnings/errors and renamed anyway it it compiled/runs
in hosted mode fine...

The only problem is that the events aren't being captured (or the
handlers aren't being added correctly)... would you be able to post
one of your Event classes?

Cheers,
DaveC

DaveC

unread,
Dec 31, 2009, 9:20:37 AM12/31/09
to Google Web Toolkit
..also I override the eventGetTypeInt(String) method in order to add
the html5 drag and drop events, is this what you did?

Cheers,
Dave

gail...@audemat.com

unread,
Dec 31, 2009, 11:19:07 AM12/31/09
to Google Web Toolkit
Maybe you could have a look at Sasha Maps : http://www.maryanovsky.com/sasha/maps/
There is some code for IPhone
Reply all
Reply to author
Forward
0 new messages