diff options
author | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-03-19 10:18:24 +0000 |
---|---|---|
committer | Johannes Dahlström <johannes.dahlstrom@vaadin.com> | 2012-03-19 10:18:24 +0000 |
commit | 07afa1749ea437a32884a9729dde9bc1f9683de1 (patch) | |
tree | fe0d545f88a48a863d63c1f6f59cea228fa3145b /src/com/vaadin | |
parent | 87751a5e21d3749c770b026a71777b6f9d87ed09 (diff) | |
download | vaadin-framework-07afa1749ea437a32884a9729dde9bc1f9683de1.tar.gz vaadin-framework-07afa1749ea437a32884a9729dde9bc1f9683de1.zip |
#5100 some cleanup
svn changeset:23259/svn branch:6.8
Diffstat (limited to 'src/com/vaadin')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java index dea664b765..5e0a380376 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java @@ -159,16 +159,16 @@ public class VTabsheet extends VTabsheetBase implements Focusable, * true if the Tab is the first visible Tab */ public void setStyleNames(boolean selected, boolean first) { - // TODO #5100 doesn't belong here - focusImpl.setTabIndex(td, selected ? getTabsheet().tabulatorIndex - : -1); - setStyleName(td, TD_FIRST_CLASSNAME, first); setStyleName(td, TD_SELECTED_CLASSNAME, selected); setStyleName(td, TD_SELECTED_FIRST_CLASSNAME, selected && first); setStyleName(div, DIV_SELECTED_CLASSNAME, selected); } + public void setTabulatorIndex(int tabIndex) { + focusImpl.setTabIndex(td, tabIndex); + } + public boolean isClosable() { return tabCaption.isClosable(); } @@ -403,6 +403,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, if (tabIndex == 0) { // Set the "first" style t.setStyleNames(false, true); + t.setTabulatorIndex(-1); } t.addClickHandler(this); @@ -433,10 +434,12 @@ public class VTabsheet extends VTabsheetBase implements Focusable, final Tab oldSelected = selected; newSelected.setStyleNames(true, isFirstVisibleTab(index)); + newSelected.setTabulatorIndex(getTabsheet().tabulatorIndex); if (oldSelected != null && oldSelected != newSelected) { oldSelected.setStyleNames(false, isFirstVisibleTab(getWidgetIndex(oldSelected))); + oldSelected.setTabulatorIndex(-1); } // Update the field holding the currently selected tab @@ -555,6 +558,10 @@ public class VTabsheet extends VTabsheetBase implements Focusable, private Tab focusedTab; + /** + * The tabindex property (position in the browser's focus cycle.) Named like + * this to avoid confusion with activeTabIndex. + */ private int tabulatorIndex = 0; /** |