Example usage for com.google.gwt.user.client.ui TabBar addTab

List of usage examples for com.google.gwt.user.client.ui TabBar addTab

Introduction

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

Prototype

public void addTab(Widget widget) 

Source Link

Document

Adds a new tab with the specified widget.

Usage

From source file:com.allen_sauer.gwt.dnd.demo.client.ui.MultiRowTabPanel.java

License:Apache License

public void add(Widget widget, Label tabLabel, String historyToken, String pageTitle) {
    int row = tabCount / tabsPerRow;
    while (row >= rows) {
        addRow();//from www .  jav  a2  s .c om
    }
    tabCount++;
    masterDeckPanel.add(widget);
    TabBar tabBar = (TabBar) tabBarsVerticalPanel.getWidget(row);
    tabBar.addTab(tabLabel);
    historyTokenMap.add(historyToken, pageTitle);
}

From source file:com.audata.client.record.RecordPropertiesDialog.java

License:Open Source License

public RecordPropertiesDialog(UpdateListener parent, String rType, String record, String checkedOutTo) {
    this.parent = parent;
    this.recorduuid = record;
    this.recordType = rType;
    this.checkedOutTo = checkedOutTo;

    this.fields = new ArrayList();
    this.properties = new RecordProperties(this, this.checkedOutTo);
    this.revisions = new Revisions(this.recorduuid);
    this.main = new VerticalPanel();

    TabBar tabs = new TabBar();
    tabs.addTab(LANG.props_Text());
    tabs.addTab("Revisions");
    tabs.addTabListener(this);
    tabs.selectTab(0);//  w w w .ja  v  a 2 s .  c  o  m
    this.main.add(tabs);

    this.main.add(this.properties);
    this.main.add(this.revisions);
    this.revisions.setVisible(false);

    HorizontalPanel buttonPanel = new HorizontalPanel();
    buttonPanel.setSpacing(4);

    this.okButton = new Button(LANG.ok_Text());
    this.okButton.addClickListener(this);
    buttonPanel.add(this.okButton);
    this.cancelButton = new Button(LANG.cancel_Text());
    this.cancelButton.addClickListener(this);
    buttonPanel.add(this.cancelButton);
    this.main.add(buttonPanel);
    this.addFields();
    this.getFields();
    this.getRecord();
    this.setWidget(this.main);
}

From source file:com.google.gwt.examples.TabBarExample.java

License:Apache License

public void onModuleLoad() {
    // Create a tab bar with three items.
    TabBar bar = new TabBar();
    bar.addTab("foo");
    bar.addTab("bar");
    bar.addTab("baz");

    // Hook up a tab listener to do something when the user selects a tab.
    bar.addSelectionHandler(new SelectionHandler<Integer>() {
        public void onSelection(SelectionEvent<Integer> event) {
            // Let the user know what they just did.
            Window.alert("You clicked tab " + event.getSelectedItem());
        }/*from   w w  w . j av  a  2  s  .c o  m*/
    });

    // Just for fun, let's disallow selection of 'bar'.
    bar.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
        public void onBeforeSelection(BeforeSelectionEvent<Integer> event) {
            if (event.getItem().intValue() == 1) {
                event.cancel();
            }
        }
    });

    // Add it to the root panel.
    RootPanel.get().add(bar);
}

From source file:org.cloud4gl.client.AppController.java

License:Open Source License

private static TabBar makeTabBar(AppConf appConf) {
    TabBar tabbar = new TabBar();
    List<PlaceConf> places = appConf.getPlaces();
    for (PlaceConf placeConf : places) {
        tabbar.addTab(placeConf.getName());
    }/*  w ww  . j  av a 2 s. co  m*/
    return tabbar;
}

From source file:tn.spindox.client.ui.TabBarExample.java

License:Apache License

public TabBar onModuleLoad() {
    // Create a tab bar with three items.
    TabBar bar = new TabBar();
    bar.addTab("Person Management");
    bar.addTab("Technology Area Management");
    bar.addTab("Technology Management");
    bar.addTab("Competence Management");

    // Hook up a tab listener to do something when the user selects a tab.
    bar.addSelectionHandler(new SelectionHandler<Integer>() {
        public void onSelection(SelectionEvent<Integer> event) {
            // Let the user know what they just did.
            Window.alert("You clicked tab " + event.getSelectedItem());
        }//  w w w. ja v a  2s .co m
    });

    // Just for fun, let's disallow selection of 'bar'.
    bar.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
        public void onBeforeSelection(BeforeSelectionEvent<Integer> event) {
            if (event.getItem().intValue() == 1) {
                event.cancel();
            }
        }
    });

    return bar;

}