1 /* 2 * Copyright 2006 Google Inc. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 5 * use this file except in compliance with the License. You may obtain a copy of 6 * the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations under 14 * the License. 15 */ 16 package com.google.gwt.user.client.ui; 17 18 import java.util.EventListener; 19 20 /** 21 * Event listener interface for tab events, used primarily by 22 * {@link com.google.gwt.user.client.ui.TabBar} and 23 * {@link com.google.gwt.user.client.ui.TabPanel}. 24 */ 25 public interface TabListener extends EventListener { 26 27 /** 28 * Fired just before a tab is selected. 29 * 30 * @param sender the {@link TabBar} or {@link TabPanel} whose tab was 31 * selected. 32 * @param tabIndex the index of the tab about to be selected 33 * @return <code>false</code> to disallow the selection. If any listener 34 * returns false, then the selection will be disallowed. 35 */ 36 boolean onBeforeTabSelected(SourcesTabEvents sender, int tabIndex); 37 38 /** 39 * Fired when a tab is selected. 40 * 41 * @param sender the {@link TabBar} or {@link TabPanel} whose tab was selected 42 * @param tabIndex the index of the tab that was selected 43 */ 44 void onTabSelected(SourcesTabEvents sender, int tabIndex); 45 } 46