Example usage for com.google.gwt.user.client.ui TabPanel add

List of usage examples for com.google.gwt.user.client.ui TabPanel add

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui TabPanel add.

Prototype

public void add(Widget w) 

Source Link

Usage

From source file:com.gwtext.sample.charts.client.Charts.java

License:Open Source License

private Panel createWestPanel() {
    Panel westPanel = new Panel();
    westPanel.setId("side-nav");
    westPanel.setTitle("Showcase Explorer");
    westPanel.setLayout(new FitLayout());
    westPanel.setWidth(210);//from   w  w  w . j av  a 2 s. c  om
    westPanel.setCollapsible(true);

    Toolbar toolbar = new Toolbar();
    toolbar.addFill();
    toolbar.addItem(new ToolbarTextItem("Select Theme "));
    toolbar.addSpacer();
    toolbar.addField(new ThemeChanger());
    westPanel.setTopToolbar(toolbar);

    TabPanel tabPanel = new TabPanel();
    tabPanel.setActiveTab(0);
    tabPanel.setDeferredRender(true);
    tabPanel.setTabPosition(Position.BOTTOM);
    TreePanel treePanel = screenManager.getTreeNav();

    tabPanel.add(treePanel);

    westPanel.add(tabPanel);

    return westPanel;
}

From source file:com.gwtext.sample.showcase2.client.Showcase2.java

License:Open Source License

private Panel createWestPanel() {
    Panel westPanel = new Panel();
    westPanel.setId("side-nav");
    westPanel.setTitle("Showcase Explorer");
    westPanel.setLayout(new FitLayout());
    westPanel.setWidth(210);//  w  w  w. j  a  va 2s .c  o  m
    westPanel.setCollapsible(true);

    Toolbar toolbar = new Toolbar();

    if (Ext.isFirebug()) {
        ToolbarButton button = new ToolbarButton();
        button.setIconCls("bug-icon");
        QuickTipsConfig qtipsConfig = new QuickTipsConfig();
        qtipsConfig.setText("Firebug can make the demo run slow.");
        qtipsConfig.setWidth(100);
        qtipsConfig.setMaxWidth(100);
        button.setTooltip(qtipsConfig);
        button.addListener(new ButtonListenerAdapter() {
            public void onClick(Button button, EventObject e) {
                Panel fb = new Panel();
                fb.setAutoScroll(true);
                fb.setAutoLoad("firebug.html");
                final Window window = new Window("Firebug");
                window.setIconCls("bug-icon");
                window.setWidth(550);
                window.setHeight(260);
                window.add(fb);
                window.setCloseAction(Window.CLOSE);
                window.show(button.getElement());

            }
        });
        toolbar.addButton(button);
    }
    toolbar.addFill();
    toolbar.addItem(new ToolbarTextItem("Select Theme "));
    toolbar.addSpacer();
    toolbar.addField(new ThemeChanger());
    westPanel.setTopToolbar(toolbar);

    TabPanel tabPanel = new TabPanel();
    tabPanel.setActiveTab(0);
    tabPanel.setDeferredRender(true);
    tabPanel.setTabPosition(Position.BOTTOM);
    TreePanel treePanel = screenManager.getTreeNav();

    tabPanel.add(treePanel);
    tabPanel.add(screenManager.getAccordionNav());
    westPanel.add(tabPanel);

    return westPanel;
}

From source file:com.gwtextux.sample.showcase2.client.Showcase2.java

License:Open Source License

private Panel createWestPanel() {
    Panel westPanel = new Panel();
    westPanel.setId("side-nav");
    westPanel.setTitle("Showcase Explorer");
    westPanel.setLayout(new FitLayout());
    westPanel.setWidth(210);//  w  w  w .  j a v  a  2  s .c  o  m
    westPanel.setCollapsible(true);

    Toolbar toolbar = new Toolbar();
    toolbar.addFill();
    toolbar.addItem(new ToolbarTextItem("Select Theme "));
    toolbar.addSpacer();
    toolbar.addField(new ThemeChanger());
    westPanel.setTopToolbar(toolbar);

    TabPanel tabPanel = new TabPanel();
    tabPanel.setActiveTab(0);
    tabPanel.setDeferredRender(true);
    tabPanel.setTabPosition(Position.BOTTOM);
    TreePanel treePanel = screenManager.getTreeNav();

    tabPanel.add(treePanel);
    tabPanel.add(screenManager.getAccordionNav());
    westPanel.add(tabPanel);

    return westPanel;
}

From source file:org.grouter.presentation.gwt.client.MainApp.java

License:Apache License

private void createAndAddCenterPanel(Panel borderPanel) {
    Panel centerPanel = new Panel();
    centerPanel.setBorder(false);/*w w w  .ja  va 2s.  c  o m*/
    centerPanel.setPaddings(0);

    FormPanel formPanel = new FormPanel();
    formPanel.setLabelAlign(Position.TOP);
    //formPanel.setTitle("Tabs");
    formPanel.setPaddings(0);
    formPanel.setWidth(600);

    Panel topPanel = new Panel();
    topPanel.setLayout(new ColumnLayout());
    topPanel.setBorder(false);

    Button button7 = new Button("Show Me", new ButtonListenerAdapter() {
        public void onClick(Button button, EventObject e) {
            GWTRemoteService.App.getInstance().getMessages(1, callbackFromCalculatorService);
        }
    });
    topPanel.add(button7);

    Panel firstColumn = new Panel();
    firstColumn.setLayout(new FormLayout());
    firstColumn.setBorder(false);

    firstColumn.add(new TextField("Messages", "first"), new AnchorLayoutData("95%"));
    firstColumn.add(new TextField("Company", "company"), new AnchorLayoutData("95%"));
    topPanel.add(firstColumn, new ColumnLayoutData(0.5));

    Panel secondColumn = new Panel();
    secondColumn.setLayout(new FormLayout());
    secondColumn.setBorder(false);

    secondColumn.add(new TextField("Last Name", "last"), new AnchorLayoutData("95%"));
    secondColumn.add(new TextField("Email", "email"), new AnchorLayoutData("95%"));
    topPanel.add(secondColumn, new ColumnLayoutData(0.5));

    formPanel.add(topPanel);

    TabPanel tabPanel = new TabPanel();
    tabPanel.setPlain(true);
    tabPanel.setActiveTab(0);
    tabPanel.setHeight(235);

    Panel firstTab = new Panel();
    firstTab.setTitle("Messages");
    firstTab.setLayout(new FormLayout());
    firstTab.setPaddings(10);

    firstTab.add(new TextField("First Name", "first", 230, "James"));

    tabPanel.add(firstTab);

    Panel secondTab = new Panel();
    secondTab.setTitle("Phone Numbers");
    secondTab.setLayout(new FormLayout());
    secondTab.setPaddings(10);

    secondTab.add(new TextField("Home", "home", 230, "(888) 555-2222"));
    secondTab.add(new TextField("Business", "business", 230));
    secondTab.add(new TextField("Mobile", "mobile", 230));
    secondTab.add(new TextField("Fax", "fax", 230));
    tabPanel.add(secondTab);

    formPanel.add(tabPanel);
    formPanel.addButton(new Button("Save"));
    formPanel.addButton(new Button("Cancel"));

    centerPanel.add(formPanel);

    //   RootPanel.get().add(centerPanel);

    borderPanel.add(centerPanel, new BorderLayoutData(RegionPosition.CENTER));
}

From source file:org.grouter.presentation.gwt.client.MainApp.java

License:Apache License

private Panel addTab(final TabPanel tabPanel, int index) {
    Panel tab = new Panel();
    tab.setAutoScroll(true);/*from w w w . j  a  v  a  2  s  .  co  m*/
    tab.setTitle("New Tab " + (++index));
    tab.setIconCls("tab-icon");
    tab.setHtml("Tab Body " + index + "<br/><br/>");
    tab.setClosable(true);

    tabPanel.add(tab);

    return tab;
}