View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.common.ui.client.widgets.tabs;
17  
18  import org.kuali.student.common.ui.client.mvc.Callback;
19  import org.kuali.student.common.ui.client.widgets.tabs.impl.KSTabPanelImpl;
20  
21  import com.google.gwt.core.client.GWT;
22  import com.google.gwt.user.client.ui.Image;
23  import com.google.gwt.user.client.ui.Widget;
24  
25  public class KSTabPanel extends KSTabPanelAbstract {
26  	
27  	public static enum TabPosition{LEFT, RIGHT};
28  	public static enum TabPanelStyle{FULL_PAGE, SMALL}
29  
30      private KSTabPanelAbstract panel = GWT.create(KSTabPanelImpl.class);
31  
32      public KSTabPanel(){
33      	this.initWidget(panel);
34      }
35      
36      public KSTabPanel(TabPanelStyle style){
37      	panel.setTabPanelStyle(style);
38      	this.initWidget(panel);
39      }
40  
41  	@Override
42  	public void addTab(String key, Widget tabWidget, Widget content,
43  			TabPosition position) {
44  		panel.addTab(key, tabWidget, content, position);
45  		
46  	}
47  
48  	@Override
49  	public void addTab(String key, String label, Widget content,
50  			TabPosition position) {
51  		panel.addTab(key, label, content, position);
52  		
53  	}
54  
55  	@Override
56  	public void addTab(String key, String label, Image image, Widget content,
57  			TabPosition position) {
58  		panel.addTab(key, label, image, content, position);
59  		
60  	}
61  
62  	@Override
63  	public void addTab(String key, String label, Image image, Widget content) {
64  		panel.addTab(key, label, image, content);
65  		
66  	}
67  
68  	@Override
69  	public void addTab(String key, String label, Widget content) {
70  		panel.addTab(key, label, content);
71  		
72  	}
73  
74  	@Override
75  	public void addTab(String key, Widget tabWidget, Widget content) {
76  		panel.addTab(key, tabWidget, content);
77  		
78  	}
79  
80  	@Override
81  	public void addTabCustomCallback(String key, Callback<String> callback) {
82  		panel.addTabCustomCallback(key, callback);
83  		
84  	}
85  
86  	@Override
87  	public String getSelectedTabKey() {
88  		return panel.getSelectedTabKey();
89  	}
90  	
91  	@Override
92      public Widget getSelectedTab() {
93          return panel.getSelectedTab();
94      }
95  	
96  	@Override
97      public String getSelectedTabName() {
98          return panel.getSelectedTabName();
99      }
100 
101 	@Override
102 	public void removeTab(String key) {
103 		panel.removeTab(key);
104 		
105 	}
106 
107 	@Override
108 	public void removeTabCustomCallbacks(String key) {
109 		panel.removeTabCustomCallbacks(key);
110 		
111 	}
112 
113 	@Override
114 	public void selectTab(String key) {
115 		panel.selectTab(key);
116 		
117 	}
118 
119 	@Override
120 	public void addStyleName(String style) {
121 		panel.addStyleName(style);
122 		
123 	}
124 
125 	@Override
126 	public int getTabCount() {
127 		return panel.getTabCount();
128 	}
129 
130 	@Override
131 	public boolean hasTabKey(String key) {
132 		return panel.hasTabKey(key);
133 	}
134 
135 	@Override
136 	public void setTabPanelStyle(TabPanelStyle style) {
137 		panel.setTabPanelStyle(style);
138 	}
139 
140 }