View Javadoc
1   package org.vaadin.jonatan.contexthelp.widgetset.client.ui;
2   
3   import com.google.gwt.event.shared.EventHandler;
4   import com.google.gwt.event.shared.GwtEvent;
5   
6   /**
7    * Created on 25.1.2013 10:07
8    *
9    * @author jonatan
10   */
11  public class ContextHelpEvent {
12  
13      public interface BubbleShownHandler extends EventHandler {
14          void onBubbleShown(BubbleShownEvent event);
15      }
16  
17      public static class BubbleShownEvent extends GwtEvent<BubbleShownHandler> {
18          public static GwtEvent.Type<BubbleShownHandler> TYPE = new GwtEvent.Type<BubbleShownHandler>();
19  
20          private String componentId;
21          private String helpHtml;
22  
23          @Override
24          public Type<BubbleShownHandler> getAssociatedType() {
25              return TYPE;
26          }
27  
28          @Override
29          protected void dispatch(BubbleShownHandler bubbleShownHandler) {
30              bubbleShownHandler.onBubbleShown(this);
31          }
32  
33          public BubbleShownEvent(String componentId, String helpHtml) {
34              this.componentId = componentId;
35              this.helpHtml = helpHtml;
36          }
37  
38          public String getComponentId() {
39              return componentId;
40          }
41  
42          public String getHelpHtml() {
43              return helpHtml;
44          }
45      }
46  
47      public interface BubbleHiddenHandler extends EventHandler {
48          void onBubbleHidden(BubbleHiddenEvent event);
49      }
50  
51      public static class BubbleHiddenEvent extends GwtEvent<BubbleHiddenHandler> {
52          public static GwtEvent.Type<BubbleHiddenHandler> TYPE = new GwtEvent.Type<BubbleHiddenHandler>();
53  
54          @Override
55          public Type<BubbleHiddenHandler> getAssociatedType() {
56              return TYPE;
57          }
58  
59          @Override
60          protected void dispatch(BubbleHiddenHandler bubbleShownHandler) {
61              bubbleShownHandler.onBubbleHidden(this);
62          }
63      }
64  
65      public interface BubbleMovedHandler extends EventHandler {
66          void onBubbleMoved(BubbleMovedEvent event);
67      }
68  
69      public static class BubbleMovedEvent extends GwtEvent<BubbleMovedHandler> {
70          public static GwtEvent.Type<BubbleMovedHandler> TYPE = new GwtEvent.Type<BubbleMovedHandler>();
71  
72          private String componentId;
73  
74          @Override
75          public Type<BubbleMovedHandler> getAssociatedType() {
76              return TYPE;
77          }
78  
79          @Override
80          protected void dispatch(BubbleMovedHandler bubbleShownHandler) {
81              bubbleShownHandler.onBubbleMoved(this);
82          }
83  
84          public BubbleMovedEvent(String componentId) {
85              this.componentId = componentId;
86          }
87  
88          public String getComponentId() {
89              return componentId;
90          }
91      }
92  }