]> source.dussan.org Git - vaadin-framework.git/commitdiff
#5100 some cleanup
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Mon, 19 Mar 2012 10:18:24 +0000 (10:18 +0000)
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Mon, 19 Mar 2012 10:18:24 +0000 (10:18 +0000)
svn changeset:23259/svn branch:6.8

src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java

index dea664b7653a7c79ed826e19a3df7e4ca56755a5..5e0a38037603c617800de10bf564c276846cf970 100644 (file)
@@ -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;
 
     /**