1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package info.magnolia.ui.vaadin.gwt.client.tabsheet.event;
35
36 import info.magnolia.ui.vaadin.gwt.client.tabsheet.tab.widget.MagnoliaTabWidget;
37
38 import com.google.gwt.event.shared.EventHandler;
39 import com.google.gwt.event.shared.GwtEvent;
40 import com.google.gwt.event.shared.HandlerRegistration;
41
42
43
44
45
46
47 @Deprecated
48 public class ActiveTabChangedEvent extends GwtEvent<ActiveTabChangedEvent.Handler> {
49
50 public final static Type<ActiveTabChangedEvent.Handler> TYPE = new Type<ActiveTabChangedEvent.Handler>();
51
52
53
54
55 public interface Handler extends EventHandler {
56 void onActiveTabChanged(ActiveTabChangedEvent event);
57 }
58
59
60
61
62 public interface HasActiveTabChangeHandlers {
63 HandlerRegistration addActiveTabChangedHandler(Handler handler);
64 }
65
66 private final MagnoliaTabWidget tab;
67
68 private boolean isShowingAllTabs = false;
69
70 private boolean notifyServer = true;
71
72 public ActiveTabChangedEvent(final MagnoliaTabWidget tab) {
73 this.tab = tab;
74 }
75
76 public ActiveTabChangedEvent(final MagnoliaTabWidget tab, boolean notifyServer) {
77 this.tab = tab;
78 this.notifyServer = notifyServer;
79 }
80
81 public ActiveTabChangedEvent(boolean isShowingAll, boolean notifyServer) {
82 this.tab = null;
83 this.isShowingAllTabs = isShowingAll;
84 this.notifyServer = notifyServer;
85 }
86
87 public boolean isShowingAllTabs() {
88 return isShowingAllTabs;
89 }
90
91 public boolean isNotifyServer() {
92 return notifyServer;
93 }
94
95 public MagnoliaTabWidget getTab() {
96 return tab;
97 }
98
99 @Override
100 protected void dispatch(ActiveTabChangedEvent.Handler handler) {
101 handler.onActiveTabChanged(this);
102 }
103
104 @Override
105 public GwtEvent.Type<ActiveTabChangedEvent.Handler> getAssociatedType() {
106 return TYPE;
107 }
108 }