Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to create ClickEvent from DoubleClickEvent?

    I am trying to create a ClickEvent from a DoubleClickEvent so I can pass it to my ClickHandler.

    I tried passing the source from the DoubleClickEvent to the ClickEvent, but that gives me a ClassCastException.
    Please see the attached test case.
    Attached Files

    #2
    Nevermind. I did it differently, I created an abstract class which implements both ClickHandler and DoubleClickHandler.

    Comment


      #3
      This seems unnecessarily complicated. You have some method you want to call to do something - just call it from the ClickEvent and from the DoubleClickEvent. There is no need to try to create new Event objects or to pass them around.

      Comment


        #4
        Originally posted by Isomorphic View Post
        You have some method you want to call to do something - just call it from the ClickEvent and from the DoubleClickEvent
        Agreed. That is how I ended up implementing it.
        Thanks!

        Comment

        Working...
        X