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 /** 19 * A panel that imposes an explicit ordering on its children. 20 */ 21 public interface IndexedPanel { 22 23 /** 24 * Gets the child widget at the specified index. 25 * 26 * @param index the child widget's index 27 * @return the child widget 28 */ 29 Widget getWidget(int index); 30 31 /** 32 * Gets the number of child widgets in this panel. 33 * 34 * @return the number of children 35 */ 36 int getWidgetCount(); 37 38 /** 39 * Gets the index of the specified child widget. 40 * 41 * @param child the widget to be found 42 * @return the widget's index, or <code>-1</code> if it is not a child of 43 * this panel 44 */ 45 int getWidgetIndex(Widget child); 46 47 /** 48 * Removes the widget at the specified index. 49 * 50 * @param index the index of the widget to be removed 51 * @return <code>false</code> if the widget is not present 52 */ 53 boolean remove(int index); 54 } 55