Search in sources :

Example 1 with Composite

use of com.google.gwt.user.client.ui.Composite in project gerrit by GerritCodeReview.

the class RelatedChanges method initTabBar.

private void initTabBar() {
    TabBar tabBar = getTabBar();
    tabBar.addSelectionHandler(new SelectionHandler<Integer>() {

        @Override
        public void onSelection(SelectionEvent<Integer> event) {
            if (selectedTab >= 0) {
                tabs.get(selectedTab).registerKeys(false);
            }
            selectedTab = event.getSelectedItem();
            tabs.get(selectedTab).registerKeys(true);
        }
    });
    for (Tab tabInfo : Tab.values()) {
        RelatedChangesTab panel = new RelatedChangesTab(tabInfo);
        add(panel, tabInfo.defaultTitle);
        tabs.add(panel);
        TabBar.Tab tab = tabBar.getTab(tabInfo.ordinal());
        tab.setWordWrap(false);
        ((Composite) tab).setTitle(tabInfo.tooltip);
        setTabEnabled(tabInfo, false);
    }
    getTab(Tab.RELATED_CHANGES).setShowIndirectAncestors(true);
    getTab(Tab.CHERRY_PICKS).setShowBranches(true);
    getTab(Tab.SAME_TOPIC).setShowBranches(true);
    getTab(Tab.SAME_TOPIC).setShowProjects(true);
    getTab(Tab.SAME_TOPIC).setShowSubmittable(true);
    getTab(Tab.SUBMITTED_TOGETHER).setShowBranches(true);
    getTab(Tab.SUBMITTED_TOGETHER).setShowProjects(true);
    getTab(Tab.SUBMITTED_TOGETHER).setShowSubmittable(true);
}
Also used : Composite(com.google.gwt.user.client.ui.Composite) TabBar(com.google.gwt.user.client.ui.TabBar)

Aggregations

Composite (com.google.gwt.user.client.ui.Composite)1 TabBar (com.google.gwt.user.client.ui.TabBar)1