1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.common.ui.client.widgets.impl;
17
18 import org.kuali.student.common.ui.client.widgets.KSTabPanelAbstract;
19
20 import com.google.gwt.event.logical.shared.SelectionHandler;
21 import com.google.gwt.user.client.ui.DecoratedTabPanel;
22 import com.google.gwt.user.client.ui.TabBar;
23 import com.google.gwt.user.client.ui.Widget;
24
25 public class KSTabPanelImpl extends KSTabPanelAbstract {
26
27 private final DecoratedTabPanel panel = new DecoratedTabPanel();
28
29 public KSTabPanelImpl() {
30 super();
31 panel.addStyleName("KS-Tab-Panel");
32 TabBar tabBar = panel.getTabBar();
33 tabBar.addStyleName("KS-Tab-Panel-BarItem");
34 initWidget(panel);
35 }
36
37 @Override
38 public void addTab(Widget w, String tabText){
39 panel.add(w, tabText);
40 }
41
42 @Override
43 public void addTab(Widget w, Widget tab){
44 panel.add(w, tab);
45 }
46
47 @Override
48 public boolean removeTab(int index) {
49 return panel.remove(index);
50 }
51
52 @Override
53 public void removeTab(Widget widget) {
54 panel.remove(widget);
55 }
56
57 @Override
58 public void selectTab(int index) {
59 panel.selectTab(index);
60 }
61
62 @Override
63 public int getTabCount() {
64 return panel.getWidgetCount();
65 }
66
67 @Override
68 public void addStyleName(String style) {
69 panel.addStyleName(style);
70 }
71
72
73 @Override
74 public void addSelectionHandler(SelectionHandler<Integer> handler) {
75 panel.addSelectionHandler(handler);
76 }
77
78 @Override
79 public int getWidgetIndex(Widget widget) {
80 return panel.getWidgetIndex(widget);
81 }
82 }