001 /** 002 * Copyright 2010 The Kuali Foundation Licensed under the 003 * Educational Community License, Version 2.0 (the "License"); you may 004 * not use this file except in compliance with the License. You may 005 * obtain a copy of the License at 006 * 007 * http://www.osedu.org/licenses/ECL-2.0 008 * 009 * Unless required by applicable law or agreed to in writing, 010 * software distributed under the License is distributed on an "AS IS" 011 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 012 * or implied. See the License for the specific language governing 013 * permissions and limitations under the License. 014 */ 015 016 package org.kuali.student.common.ui.client.widgets.tabs; 017 018 import org.kuali.student.common.ui.client.mvc.Callback; 019 import org.kuali.student.common.ui.client.widgets.tabs.impl.KSTabPanelImpl; 020 021 import com.google.gwt.core.client.GWT; 022 import com.google.gwt.user.client.ui.Image; 023 import com.google.gwt.user.client.ui.Widget; 024 025 public class KSTabPanel extends KSTabPanelAbstract { 026 027 public static enum TabPosition{LEFT, RIGHT}; 028 public static enum TabPanelStyle{FULL_PAGE, SMALL} 029 030 private KSTabPanelAbstract panel = GWT.create(KSTabPanelImpl.class); 031 032 public KSTabPanel(){ 033 this.initWidget(panel); 034 } 035 036 public KSTabPanel(TabPanelStyle style){ 037 panel.setTabPanelStyle(style); 038 this.initWidget(panel); 039 } 040 041 @Override 042 public void addTab(String key, Widget tabWidget, Widget content, 043 TabPosition position) { 044 panel.addTab(key, tabWidget, content, position); 045 046 } 047 048 @Override 049 public void addTab(String key, String label, Widget content, 050 TabPosition position) { 051 panel.addTab(key, label, content, position); 052 053 } 054 055 @Override 056 public void addTab(String key, String label, Image image, Widget content, 057 TabPosition position) { 058 panel.addTab(key, label, image, content, position); 059 060 } 061 062 @Override 063 public void addTab(String key, String label, Image image, Widget content) { 064 panel.addTab(key, label, image, content); 065 066 } 067 068 @Override 069 public void addTab(String key, String label, Widget content) { 070 panel.addTab(key, label, content); 071 072 } 073 074 @Override 075 public void addTab(String key, Widget tabWidget, Widget content) { 076 panel.addTab(key, tabWidget, content); 077 078 } 079 080 @Override 081 public void addTabCustomCallback(String key, Callback<String> callback) { 082 panel.addTabCustomCallback(key, callback); 083 084 } 085 086 @Override 087 public String getSelectedTabKey() { 088 return panel.getSelectedTabKey(); 089 } 090 091 @Override 092 public void removeTab(String key) { 093 panel.removeTab(key); 094 095 } 096 097 @Override 098 public void removeTabCustomCallbacks(String key) { 099 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 }