List of usage examples for com.google.gwt.user.client.ui TabBar getTab
public final Tab getTab(int index)
From source file:com.google.gerrit.client.change.RelatedChanges.java
License:Apache License
private void initTabBar() { TabBar tabBar = getTabBar(); tabBar.addSelectionHandler(new SelectionHandler<Integer>() { @Override// ww w . j a va 2s . co m 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); }
From source file:edu.caltech.ipac.firefly.ui.panels.Toolbar.java
private int indexOf(TabBar bar, TabBar.Tab tab) { if (bar != null) { for (int i = 0; i < bar.getTabCount(); i++) { if (bar.getTab(i).equals(tab)) { return i; }/*from w w w . j a v a2 s.c om*/ } } return -1; }
From source file:edu.caltech.ipac.firefly.ui.panels.Toolbar.java
private TabHolder findTab(int idx, TabBar tb) { TabBar.Tab tab = tb.getTab(idx); if (tab != null) { for (TabHolder th : tabs.values()) { if (th.tab.equals(tab)) { return th; }//from w w w . ja va 2s . co m } } return null; }