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 void removeTab(String key) {
93  		panel.removeTab(key);
94  		
95  	}
96  
97  	@Override
98  	public void removeTabCustomCallbacks(String key) {
99  		panel.removeTabCustomCallbacks(key);
100 		
101 	}
102 
103 	@Override
104 	public void selectTab(String key) {
105 		panel.selectTab(key);
106 		
107 	}
108 
109 	@Override
110 	public void addStyleName(String style) {
111 		panel.addStyleName(style);
112 		
113 	}
114 
115 	@Override
116 	public int getTabCount() {
117 		return panel.getTabCount();
118 	}
119 
120 	@Override
121 	public boolean hasTabKey(String key) {
122 		return panel.hasTabKey(key);
123 	}
124 
125 	@Override
126 	public void setTabPanelStyle(TabPanelStyle style) {
127 		panel.setTabPanelStyle(style);
128 	}
129 
130 }