Re: elemental2: Document.createEvent ?

2019-08-14 Thread Vassilis Virvilis
Jens,

Thanks for reminding me. I have totally forgot this section.

I believe that the document was written before Js.cast and Js.unchecked cast.

Maybe some use cases and some examples would be helpful.

Thanks again.

On Wed, Aug 14, 2019 at 9:58 AM Jens  wrote:
>
>
>> It would be great if there was some documentation that could compare
>> and spell the differences between
>> standard cast (), Js.cast(), Js.uncheckedCast() in various use cases
>> so we could have a list of dos and donts.
>
>
> There is a whole section about instanceof/cast in 
> https://docs.google.com/document/d/10fmlEYIHcyead_4R1S5wKGs1t2I7Fnp_PaNaa7XTEk0/edit#heading=h.kog1ji9nzq7y
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit/e89fdeec-6bfd-48d3-973a-a98f4287d83b%40googlegroups.com.



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEw9BXbT4qZH60aBeder4NbbFeShdwSyhQEtE9tu%3DKpuxg%40mail.gmail.com.


Re: elemental2: Document.createEvent ?

2019-08-13 Thread Jens


> It would be great if there was some documentation that could compare 
> and spell the differences between 
> standard cast (), Js.cast(), Js.uncheckedCast() in various use cases 
> so we could have a list of dos and donts. 
>

There is a whole section about instanceof/cast 
in 
https://docs.google.com/document/d/10fmlEYIHcyead_4R1S5wKGs1t2I7Fnp_PaNaa7XTEk0/edit#heading=h.kog1ji9nzq7y

-- J.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/e89fdeec-6bfd-48d3-973a-a98f4287d83b%40googlegroups.com.


Re: elemental2: Document.createEvent ?

2019-08-13 Thread Vassilis Virvilis
It would be great if there was some documentation that could compare
and spell the differences between
standard cast (), Js.cast(), Js.uncheckedCast() in various use cases
so we could have a list of dos and donts.

   Vassilis

On Mon, Aug 12, 2019 at 4:27 PM Jens  wrote:
>
>
>> final MyHTMLDocument doc = Js.cast(DomGlobal.document);  <-- this crashes
>> final MyHTMLDocument doc = Js.uncheckedCast(DomGlobal.document);  <-- this 
>> works
>
>
> Because the native browser document isn't a MyHTMLDocument? You can only 
> treat it like a MyHTMLDocument by doing a nasty unchecked cast so you can 
> call that method you need.
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit/de0c434d-6ed6-4205-b674-0aaf697110a0%40googlegroups.com.



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEwMz8Fre-FGZP%2BiJTqFdAcrAuDtbF9kzwuG2VsaKBa%2B6w%40mail.gmail.com.


Re: elemental2: Document.createEvent ?

2019-08-12 Thread Jens


> final MyHTMLDocument doc = Js.cast(DomGlobal.document);  <-- this crashes 
> final MyHTMLDocument doc = Js.uncheckedCast(DomGlobal.document);  <-- this 
> works 
>

Because the native browser document isn't a MyHTMLDocument? You can only 
treat it like a MyHTMLDocument by doing a nasty unchecked cast so you can 
call that method you need.

-- J.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/de0c434d-6ed6-4205-b674-0aaf697110a0%40googlegroups.com.


Re: elemental2: Document.createEvent ?

2019-08-12 Thread Vassilis Virvilis
Hi again,

I did create a class MyHTMLDocument that extends HTMLDocument.

However

final MyHTMLDocument doc = Js.cast(DomGlobal.document);  <-- this crashes
final MyHTMLDocument doc = Js.uncheckedCast(DomGlobal.document);  <-- this works

any idea why uncheckedCast is required?

  Thanks

Vassilis Virvilis




On Sun, Aug 11, 2019 at 10:25 AM Vassilis Virvilis  wrote:
>
> Hi Peter,
>
> Thanks for replying and for pointing me to the github issue.
>
> I am thinking the following strategy.
>
> Create a MyHTMLDocument that extends HTMLDocument and it has the
> execCommand but without the @Override annotations.
>
> That way when HTMLDocument gets execDocument implemented I will get a
> warning and at that point I will be able to remove the MyHTMLDocument
> class and use the official one. Aargh now I see that is already
> mentioned in the comments of the original execCommand issue at
> https://github.com/google/elemental2/issues/43 by vegegoku.
>
> Thanks again.
>
>Vassilis
>
> On Sun, Aug 11, 2019 at 8:31 AM Peter Donald  wrote:
> >
> > execCommand is not yet part of elemental2. There is no reason why it should 
> > not be other than the externs need cleaning up. It is on my list of things 
> > to do some time but we don't use it so I haven't got off my kaboose to do 
> > the work. The issue that is tracking this (among other things) is 
> > https://github.com/google/elemental2/issues/86
> >
> > Until that is completed you will have to use jsinterop to do it yourself.
> >
> > On Sat, Aug 10, 2019 at 12:54 AM Vassilis Virvilis  
> > wrote:
> >>
> >> What about Document.execCommand() ?
> >>
> >>
> >> On Fri, Aug 9, 2019 at 5:20 PM Vassilis Virvilis  wrote:
> >> >
> >> > Hi,
> >> >
> >> > I am looking for  Document.createEvent and I can see that createEvent
> >> > is defined in DocumentEvent which is an interface but Document itself
> >> > does not inherit/implement this interface.
> >> >
> >> > I suppose I can cast Document it to DocumentEvent with Js.cast() but
> >> > that's ugly.
> >> >
> >> > So what's going on?
> >> >
> >> > I am using elemental2 2.25 as published by Peter Donald.
> >> >
> >> > --
> >> > Vassilis Virvilis
> >>
> >>
> >>
> >> --
> >> Vassilis Virvilis
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups 
> >> "GWT Users" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an 
> >> email to google-web-toolkit+unsubscr...@googlegroups.com.
> >> To view this discussion on the web visit 
> >> https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEx4%2B3TZuMJf2%3DBiCW6d57o-OLoMiBjqjSi%3DMjPny%2B%2B_ug%40mail.gmail.com.
> >
> >
> >
> > --
> > Cheers,
> >
> > Peter Donald
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "GWT Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to google-web-toolkit+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc4frwwFenqaAGPN3nBxgsYHJ_gO_86QbOPQpBT02eySsg%40mail.gmail.com.
>
>
>
> --
> Vassilis Virvilis



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEwQ-JWEk94wTrrvC52FewYqdt_bmOA2EauxkKhF0sEWpw%40mail.gmail.com.


Re: elemental2: Document.createEvent ?

2019-08-11 Thread Vassilis Virvilis
Hi Peter,

Thanks for replying and for pointing me to the github issue.

I am thinking the following strategy.

Create a MyHTMLDocument that extends HTMLDocument and it has the
execCommand but without the @Override annotations.

That way when HTMLDocument gets execDocument implemented I will get a
warning and at that point I will be able to remove the MyHTMLDocument
class and use the official one. Aargh now I see that is already
mentioned in the comments of the original execCommand issue at
https://github.com/google/elemental2/issues/43 by vegegoku.

Thanks again.

   Vassilis

On Sun, Aug 11, 2019 at 8:31 AM Peter Donald  wrote:
>
> execCommand is not yet part of elemental2. There is no reason why it should 
> not be other than the externs need cleaning up. It is on my list of things to 
> do some time but we don't use it so I haven't got off my kaboose to do the 
> work. The issue that is tracking this (among other things) is 
> https://github.com/google/elemental2/issues/86
>
> Until that is completed you will have to use jsinterop to do it yourself.
>
> On Sat, Aug 10, 2019 at 12:54 AM Vassilis Virvilis  wrote:
>>
>> What about Document.execCommand() ?
>>
>>
>> On Fri, Aug 9, 2019 at 5:20 PM Vassilis Virvilis  wrote:
>> >
>> > Hi,
>> >
>> > I am looking for  Document.createEvent and I can see that createEvent
>> > is defined in DocumentEvent which is an interface but Document itself
>> > does not inherit/implement this interface.
>> >
>> > I suppose I can cast Document it to DocumentEvent with Js.cast() but
>> > that's ugly.
>> >
>> > So what's going on?
>> >
>> > I am using elemental2 2.25 as published by Peter Donald.
>> >
>> > --
>> > Vassilis Virvilis
>>
>>
>>
>> --
>> Vassilis Virvilis
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEx4%2B3TZuMJf2%3DBiCW6d57o-OLoMiBjqjSi%3DMjPny%2B%2B_ug%40mail.gmail.com.
>
>
>
> --
> Cheers,
>
> Peter Donald
>
> --
> You received this message because you are subscribed to the Google Groups 
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc4frwwFenqaAGPN3nBxgsYHJ_gO_86QbOPQpBT02eySsg%40mail.gmail.com.



-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEwSH1dTm4UP7zOEGMBs7YtHwo_cOV8i65cS8Mq8G9xxWQ%40mail.gmail.com.


Re: elemental2: Document.createEvent ?

2019-08-10 Thread Peter Donald
execCommand is not yet part of elemental2. There is no reason why it should
not be other than the externs need cleaning up. It is on my list of things
to do some time but we don't use it so I haven't got off my kaboose to do
the work. The issue that is tracking this (among other things) is
https://github.com/google/elemental2/issues/86

Until that is completed you will have to use jsinterop to do it yourself.

On Sat, Aug 10, 2019 at 12:54 AM Vassilis Virvilis 
wrote:

> What about Document.execCommand() ?
>
>
> On Fri, Aug 9, 2019 at 5:20 PM Vassilis Virvilis 
> wrote:
> >
> > Hi,
> >
> > I am looking for  Document.createEvent and I can see that createEvent
> > is defined in DocumentEvent which is an interface but Document itself
> > does not inherit/implement this interface.
> >
> > I suppose I can cast Document it to DocumentEvent with Js.cast() but
> > that's ugly.
> >
> > So what's going on?
> >
> > I am using elemental2 2.25 as published by Peter Donald.
> >
> > --
> > Vassilis Virvilis
>
>
>
> --
> Vassilis Virvilis
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEx4%2B3TZuMJf2%3DBiCW6d57o-OLoMiBjqjSi%3DMjPny%2B%2B_ug%40mail.gmail.com
> .
>


-- 
Cheers,

Peter Donald

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CACiKNc4frwwFenqaAGPN3nBxgsYHJ_gO_86QbOPQpBT02eySsg%40mail.gmail.com.


Re: elemental2: Document.createEvent ?

2019-08-09 Thread Vassilis Virvilis
What about Document.execCommand() ?


On Fri, Aug 9, 2019 at 5:20 PM Vassilis Virvilis  wrote:
>
> Hi,
>
> I am looking for  Document.createEvent and I can see that createEvent
> is defined in DocumentEvent which is an interface but Document itself
> does not inherit/implement this interface.
>
> I suppose I can cast Document it to DocumentEvent with Js.cast() but
> that's ugly.
>
> So what's going on?
>
> I am using elemental2 2.25 as published by Peter Donald.
>
> --
> Vassilis Virvilis



--
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjEx4%2B3TZuMJf2%3DBiCW6d57o-OLoMiBjqjSi%3DMjPny%2B%2B_ug%40mail.gmail.com.


elemental2: Document.createEvent ?

2019-08-09 Thread Vassilis Virvilis
Hi,

I am looking for  Document.createEvent and I can see that createEvent
is defined in DocumentEvent which is an interface but Document itself
does not inherit/implement this interface.

I suppose I can cast Document it to DocumentEvent with Js.cast() but
that's ugly.

So what's going on?

I am using elemental2 2.25 as published by Peter Donald.

-- 
Vassilis Virvilis

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/CAKbOjExNRyhiL67mb8JKan8DEW0xcUupHpQuq6PnchwCSHYxTA%40mail.gmail.com.