/** * Programmatically selects the specified tab. Use index -1 to specify that no * tab should be selected. * * @param index the index of the tab to be selected * @param fireEvents true to fire events, false not to * @return <code>true</code> if successful, <code>false</code> if the change * is denied by the {@link BeforeSelectionHandler}. */ public boolean selectTab(int index, boolean fireEvents) { checkTabIndex(index); if (fireEvents) { BeforeSelectionEvent<?> event = BeforeSelectionEvent.fire(this, index); if (event != null && event.isCanceled()) { return false; } } // Check for -1. setSelectionStyle(selectedTab, false); if (index == -1) { selectedTab = null; return true; } selectedTab = panel.getWidget(index + 1); setSelectionStyle(selectedTab, true); if (fireEvents) { SelectionEvent.fire(this, index); } return true; }
/** * Programmatically selects the specified tab. Use index -1 to specify that no * tab should be selected. * * @param index the index of the tab to be selected * @param fireEvents true to fire events, false not to * @return <code>true</code> if successful, <code>false</code> if the change * is denied by the {@link BeforeSelectionHandler}. */ public boolean selectTab(int index, boolean fireEvents) { checkTabIndex(index); if (fireEvents) { BeforeSelectionEvent<?> event = BeforeSelectionEvent.fire(this, index); if (event != null && event.isCanceled()) { return false; } } // Check for -1. setSelectionStyle(selectedTab, false); if (index == -1) { selectedTab = null; return true; } selectedTab = panel.getWidget(index + 1); setSelectionStyle(selectedTab, true); if (fireEvents) { SelectionEvent.fire(this, index); } return true; }
/** * Programmatically selects the specified tab. Use index -1 to specify that no * tab should be selected. * * @param index the index of the tab to be selected * @param fireEvents true to fire events, false not to * @return <code>true</code> if successful, <code>false</code> if the change * is denied by the {@link BeforeSelectionHandler}. */ public boolean selectTab(int index, boolean fireEvents) { checkTabIndex(index); if (fireEvents) { BeforeSelectionEvent<?> event = BeforeSelectionEvent.fire(this, index); if (event != null && event.isCanceled()) { return false; } } // Check for -1. setSelectionStyle(selectedTab, false); if (index == -1) { selectedTab = null; return true; } selectedTab = panel.getWidget(index + 1); setSelectionStyle(selectedTab, true); if (fireEvents) { SelectionEvent.fire(this, index); } return true; }