001: /*
002: * $Id: TabbedPanelPage.java 460265 2006-04-16 13:36:52Z jdonnerstag $ $Revision:
003: * 4909 $ $Date: 2006-04-16 15:36:52 +0200 (Sun, 16 Apr 2006) $
004: *
005: * ==============================================================================
006: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
007: * use this file except in compliance with the License. You may obtain a copy of
008: * the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
014: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
015: * License for the specific language governing permissions and limitations under
016: * the License.
017: */
018: package wicket.examples.ajax.builtin;
019:
020: import java.util.ArrayList;
021: import java.util.List;
022:
023: import wicket.extensions.ajax.markup.html.tabs.AjaxTabbedPanel;
024: import wicket.extensions.markup.html.tabs.AbstractTab;
025: import wicket.markup.html.panel.Panel;
026: import wicket.model.Model;
027:
028: /**
029: * Tabbed panel demo.
030: *
031: * @author ivaynberg
032: */
033: public class TabbedPanelPage extends BasePage {
034: /**
035: * Constructor
036: */
037: public TabbedPanelPage() {
038: // create a list of ITab objects used to feed the tabbed panel
039: List tabs = new ArrayList();
040: tabs.add(new AbstractTab(new Model("first tab")) {
041: public Panel getPanel(String panelId) {
042: return new TabPanel1(panelId);
043: }
044: });
045:
046: tabs.add(new AbstractTab(new Model("second tab")) {
047: public Panel getPanel(String panelId) {
048: return new TabPanel2(panelId);
049: }
050: });
051:
052: tabs.add(new AbstractTab(new Model("third tab")) {
053: public Panel getPanel(String panelId) {
054: return new TabPanel3(panelId);
055: }
056: });
057:
058: add(new AjaxTabbedPanel("tabs", tabs));
059: }
060:
061: /**
062: * Panel representing the content panel for the first tab.
063: */
064: private static class TabPanel1 extends Panel {
065: /**
066: * Constructor
067: *
068: * @param id
069: * component id
070: */
071: public TabPanel1(String id) {
072: super (id);
073: }
074: };
075:
076: /**
077: * Panel representing the content panel for the second tab.
078: */
079: private static class TabPanel2 extends Panel {
080: /**
081: * Constructor
082: *
083: * @param id
084: * component id
085: */
086: public TabPanel2(String id) {
087: super (id);
088: }
089: };
090:
091: /**
092: * Panel representing the content panel for the third tab.
093: */
094: private static class TabPanel3 extends Panel {
095: /**
096: * Constructor
097: *
098: * @param id
099: * component id
100: */
101: public TabPanel3(String id) {
102: super(id);
103: }
104: };
105: }
|