From 9b839ca728bca6dd27ba418875007435fe76f2a6 Mon Sep 17 00:00:00 2001 From: Automerge Date: Wed, 14 Mar 2012 14:07:38 +0000 Subject: [merge from 6.7] #7607 Removed obsolete Firefox workaround that caused problems with a WebKit workaround (#3875) svn changeset:23241/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index c8a2be3576..e4e8663e63 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -2015,15 +2015,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, isNewBody = false; if (firstvisible > 0) { - // Deferred due some Firefox oddities. IE & Safari could survive - // without - Scheduler.get().scheduleDeferred(new Command() { - public void execute() { - scrollBodyPanel - .setScrollPosition(measureRowHeightOffset(firstvisible)); - firstRowInViewPort = firstvisible; - } - }); + scrollBodyPanel + .setScrollPosition(measureRowHeightOffset(firstvisible)); + firstRowInViewPort = firstvisible; } if (enabled) { -- cgit v1.2.3 From 608bac4d2d3f8ddf7e72fe01de3a76070015fab3 Mon Sep 17 00:00:00 2001 From: Automerge Date: Wed, 14 Mar 2012 14:07:45 +0000 Subject: [merge from 6.7] #7607 Make Table scroll to the very bottom when needed svn changeset:23242/svn branch:6.8 --- src/com/vaadin/ui/Table.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index 79adc2c38f..88961e610a 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -971,7 +971,9 @@ public class Table extends AbstractSelect implements Action.Container, } if (index > maxIndex) { - setCurrentPageFirstItemIndex(maxIndex); + // Note that we pass index, not maxIndex, letting + // setCurrentPageFirstItemIndex handle the situation. + setCurrentPageFirstItemIndex(index); return; } @@ -1259,9 +1261,11 @@ public class Table extends AbstractSelect implements Action.Container, maxIndex = 0; } - // Ensures that the new value is valid + // Assume that we want to scroll to the very bottom (so that the bottom + // row is completely visible even if (table height) / (row height) is + // not an integer.) if (newIndex > maxIndex) { - newIndex = maxIndex; + newIndex = maxIndex + 1; } // Refresh first item id -- cgit v1.2.3 From 77a4f28b7e59895946e6335fe43af3c72cd77796 Mon Sep 17 00:00:00 2001 From: Automerge Date: Wed, 14 Mar 2012 14:07:51 +0000 Subject: [merge from 6.7] Test for #7607 svn changeset:23243/svn branch:6.8 --- .../table/SetCurrentPageFirstItemId.html | 62 ++++++++++++++++++++++ .../table/SetCurrentPageFirstItemId.java | 55 +++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html create mode 100644 tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java diff --git a/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html new file mode 100644 index 0000000000..8881c0d2f5 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html @@ -0,0 +1,62 @@ + + + + + + +SetCurrentPageFirstItemId + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SetCurrentPageFirstItemId
open/run/SetCurrentPageFirstItemId?restartApplication
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
pause300
assertTextvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[24]/domChild[0]/domChild[0]24
screenCapturescrolled-to-bottom
+ + diff --git a/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java new file mode 100644 index 0000000000..536348a393 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java @@ -0,0 +1,55 @@ +package com.vaadin.tests.components.table; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Table; +import com.vaadin.ui.VerticalLayout; + +public class SetCurrentPageFirstItemId extends TestBase { + int index = 0; + + private final Table table = new Table(); + + @Override + public void setup() { + + VerticalLayout mainLayout = new VerticalLayout(); + mainLayout.setHeight("100%"); + mainLayout.setMargin(true); + + getMainWindow().setContent(mainLayout); + + mainLayout.addComponent(table); + table.setSizeFull(); + table.addContainerProperty("rowID", Integer.class, null); + for (int i = 0; i < 20; i++) { + addRow(); + } + + Button addrowButton = new Button("Add row"); + addrowButton.addListener(new ClickListener() { + public void buttonClick(ClickEvent pEvent) { + Object id = addRow(); + table.setCurrentPageFirstItemId(id); + } + }); + + mainLayout.addComponent(addrowButton); + } + + private Object addRow() { + return table.addItem(new Object[] { index++ }, null); + } + + @Override + protected String getDescription() { + return "Table.setCurrentPageFirstItemId doesn't always work with full sized Table"; + } + + @Override + protected Integer getTicketNumber() { + return 7607; + } +} \ No newline at end of file -- cgit v1.2.3 From 48a69b4d2d98110e1dc3fb88747b37444f605fdf Mon Sep 17 00:00:00 2001 From: Automerge Date: Fri, 16 Mar 2012 14:07:31 +0000 Subject: [merge from 6.7] Documented that GridLayout coordinates are zero-based. Also cleaned up the GridLayout Javadocs generally. Fixes #8531. svn changeset:23256/svn branch:6.8 --- src/com/vaadin/ui/GridLayout.java | 256 +++++++++++++++++++++----------------- 1 file changed, 145 insertions(+), 111 deletions(-) diff --git a/src/com/vaadin/ui/GridLayout.java b/src/com/vaadin/ui/GridLayout.java index 24a57d462b..90122cddf9 100644 --- a/src/com/vaadin/ui/GridLayout.java +++ b/src/com/vaadin/ui/GridLayout.java @@ -21,18 +21,24 @@ import com.vaadin.terminal.gwt.client.EventId; import com.vaadin.terminal.gwt.client.ui.VGridLayout; /** + * A layout where the components are laid out on a grid using cell coordinates. + * + *

+ * The GridLayout also maintains a cursor for adding components in + * left-to-right, top-to-bottom order. + *

+ * *

- * A container that consists of components with certain coordinates (cell - * position) on a grid. It also maintains cursor for adding component in left to - * right, top to bottom order. + * Each component in a GridLayout uses a defined + * {@link GridLayout.Area area} (column1,row1,column2,row2) from the grid. The + * components may not overlap with the existing components - if you try to do so + * you will get an {@link OverlapsException}. Adding a component with cursor + * automatically extends the grid by increasing the grid height. *

* *

- * Each component in a GridLayout uses a certain - * {@link GridLayout.Area area} (column1,row1,column2,row2) from the grid. One - * should not add components that would overlap with the existing components - * because in such case an {@link OverlapsException} is thrown. Adding component - * with cursor automatically extends the grid by increasing the grid height. + * The grid coordinates, which are specified by a row and column index, always + * start from 0 for the topmost row and the leftmost column. *

* * @author Vaadin Ltd. @@ -102,9 +108,10 @@ public class GridLayout extends AbstractLayout implements private Map rowExpandRatio = new HashMap(); /** - * Constructor for grid of given size (number of cells). Note that grid's - * final size depends on the items that are added into the grid. Grid grows - * if you add components outside the grid's area. + * Constructor for a grid of given size (number of columns and rows). + * + * The grid may grow or shrink later. Grid grows automatically if you add + * components outside its area. * * @param columns * Number of columns in the grid. @@ -117,7 +124,7 @@ public class GridLayout extends AbstractLayout implements } /** - * Constructs an empty grid layout that is extended as needed. + * Constructs an empty (1x1) grid layout that is extended as needed. */ public GridLayout() { this(1, 1); @@ -125,25 +132,25 @@ public class GridLayout extends AbstractLayout implements /** *

- * Adds a component with a specified area to the grid. The area the new - * component should take is defined by specifying the upper left corner - * (column1, row1) and the lower right corner (column2, row2) of the area. + * Adds a component to the grid in the specified area. The area is defined + * by specifying the upper left corner (column1, row1) and the lower right + * corner (column2, row2) of the area. The coordinates are zero-based. *

* *

- * If the new component overlaps with any of the existing components already - * present in the grid the operation will fail and an - * {@link OverlapsException} is thrown. + * If the area overlaps with any of the existing components already present + * in the grid, the operation will fail and an {@link OverlapsException} is + * thrown. *

* - * @param c + * @param component * the component to be added. * @param column1 * the column of the upper left corner of the area c - * is supposed to occupy. + * is supposed to occupy. The leftmost column has index 0. * @param row1 * the row of the upper left corner of the area c is - * supposed to occupy. + * supposed to occupy. The topmost row has index 0. * @param column2 * the column of the lower right corner of the area * c is supposed to occupy. @@ -254,31 +261,39 @@ public class GridLayout extends AbstractLayout implements } /** - * Adds the component into this container to cells column1,row1 (NortWest - * corner of the area.) End coordinates (SouthEast corner of the area) are - * the same as column1,row1. Component width and height is 1. + * Adds the component to the grid in cells column1,row1 (NortWest corner of + * the area.) End coordinates (SouthEast corner of the area) are the same as + * column1,row1. The coordinates are zero-based. Component width and height + * is 1. * - * @param c + * @param component * the component to be added. * @param column - * the column index. + * the column index, starting from 0. * @param row - * the row index. + * the row index, starting from 0. * @throws OverlapsException * if the new component overlaps with any of the components * already in the grid. * @throws OutOfBoundsException * if the cell is outside the grid area. */ - public void addComponent(Component c, int column, int row) + public void addComponent(Component component, int column, int row) throws OverlapsException, OutOfBoundsException { - this.addComponent(c, column, row, column, row); + this.addComponent(component, column, row, column, row); } /** - * Force the next component to be added to the beginning of the next line. - * By calling this function user can ensure that no more components are - * added to the right of the previous component. + * Forces the next component to be added at the beginning of the next line. + * + *

+ * Sets the cursor column to 0 and increments the cursor row by one. + *

+ * + *

+ * By calling this function you can ensure that no more components are added + * right of the previous component. + *

* * @see #space() */ @@ -288,8 +303,8 @@ public class GridLayout extends AbstractLayout implements } /** - * Moves the cursor forwards by one. If the cursor goes out of the right - * grid border, move it to next line. + * Moves the cursor forward by one. If the cursor goes out of the right grid + * border, it is moved to the first column of the next row. * * @see #newLine() */ @@ -307,7 +322,7 @@ public class GridLayout extends AbstractLayout implements * free position. If the cursor goes out from the bottom of the grid, the * grid is automatically extended. * - * @param c + * @param component * the component to be added. */ @Override @@ -334,9 +349,9 @@ public class GridLayout extends AbstractLayout implements } /** - * Removes the given component from this container. + * Removes the specified component from the layout. * - * @param c + * @param component * the component to be removed. */ @Override @@ -369,12 +384,12 @@ public class GridLayout extends AbstractLayout implements } /** - * Removes the component specified with it's cell index. + * Removes the component specified by its cell coordinates. * * @param column - * the Component's column. + * the component's column, starting from 0. * @param row - * the Component's row. + * the component's row, starting from 0. */ public void removeComponent(int column, int row) { @@ -389,18 +404,18 @@ public class GridLayout extends AbstractLayout implements } /** - * Gets an Iterator to the component container contents. Using the Iterator - * it's possible to step through the contents of the container. + * Gets an Iterator for the components contained in the layout. By using the + * Iterator it is possible to step through the contents of the layout. * - * @return the Iterator of the components inside the container. + * @return the Iterator of the components inside the layout. */ public Iterator getComponentIterator() { return Collections.unmodifiableCollection(components).iterator(); } /** - * Gets the number of contained components. Consistent with the iterator - * returned by {@link #getComponentIterator()}. + * Gets the number of components contained in the layout. Consistent with + * the iterator returned by {@link #getComponentIterator()}. * * @return the number of contained components */ @@ -662,9 +677,17 @@ public class GridLayout extends AbstractLayout implements } /** - * This class defines an area on a grid. An Area is defined by the cells of - * its upper left corner (column1,row1) and lower right corner - * (column2,row2). + * Defines a rectangular area of cells in a GridLayout. + * + *

+ * Also maintains a reference to the component contained in the area. + *

+ * + *

+ * The area is specified by the cell coordinates of its upper left corner + * (column1,row1) and lower right corner (column2,row2). As otherwise with + * GridLayout, the column and row coordinates start from zero. + *

* * @author Vaadin Ltd. * @version @@ -694,7 +717,7 @@ public class GridLayout extends AbstractLayout implements private int row2; /** - * Component painted on the area. + * Component painted in the area. */ private Component component; @@ -706,20 +729,17 @@ public class GridLayout extends AbstractLayout implements * @param component * the component connected to the area. * @param column1 - * The column of the upper left corner cell of the area - * c is supposed to occupy. + * The column of the upper left corner cell of the area. The + * leftmost column has index 0. * @param row1 - * The row of the upper left corner cell of the area - * c is supposed to occupy. + * The row of the upper left corner cell of the area. The + * topmost row has index 0. * @param column2 - * The column of the lower right corner cell of the area - * c is supposed to occupy. + * The column of the lower right corner cell of the area. The + * leftmost column has index 0. * @param row2 - * The row of the lower right corner cell of the area - * c is supposed to occupy. - * @throws OverlapsException - * if the new component overlaps with any of the components - * already in the grid + * The row of the lower right corner cell of the area. The + * topmost row has index 0. */ public Area(Component component, int column1, int row1, int column2, int row2) { @@ -731,13 +751,13 @@ public class GridLayout extends AbstractLayout implements } /** - * Tests if the given Area overlaps with an another Area. + * Tests if this Area overlaps with another Area. * * @param other - * the Another Area that's to be tested for overlap with this - * area. - * @return true if other overlaps with this - * area, false if it doesn't. + * the other Area that is to be tested for overlap with this + * area + * @return true if other area overlaps with + * this on, false if it does not. */ public boolean overlaps(Area other) { return column1 <= other.getColumn2() && row1 <= other.getRow2() @@ -758,7 +778,7 @@ public class GridLayout extends AbstractLayout implements * Sets the component connected to the area. * *

- * This function only sets the value in the datastructure and does not + * This function only sets the value in the data structure and does not * send any events or set parents. *

* @@ -770,9 +790,7 @@ public class GridLayout extends AbstractLayout implements } /** - * @deprecated Use getColumn1() instead. - * - * @see com.vaadin.ui.GridLayout#getColumn1() + * @deprecated Use {@link #getColumn1()} instead. */ @Deprecated public int getX1() { @@ -789,9 +807,7 @@ public class GridLayout extends AbstractLayout implements } /** - * @deprecated Use getColumn2() instead. - * - * @see com.vaadin.ui.GridLayout#getColumn2() + * @deprecated Use {@link #getColumn2()} instead. */ @Deprecated public int getX2() { @@ -808,9 +824,7 @@ public class GridLayout extends AbstractLayout implements } /** - * @deprecated Use getRow1() instead. - * - * @see com.vaadin.ui.GridLayout#getRow1() + * @deprecated Use {@link #getRow1()} instead. */ @Deprecated public int getY1() { @@ -827,9 +841,7 @@ public class GridLayout extends AbstractLayout implements } /** - * @deprecated Use getRow2() instead. - * - * @see com.vaadin.ui.GridLayout#getRow2() + * @deprecated Use {@link #getRow2()} instead. */ @Deprecated public int getY2() { @@ -1028,12 +1040,16 @@ public class GridLayout extends AbstractLayout implements } /** - * Gets the current cursor x-position. The cursor position points the - * position for the next component that is added without specifying its - * coordinates (grid cell). When the cursor position is occupied, the next - * component will be added to first free position after the cursor. + * Gets the current x-position (column) of the cursor. * - * @return the grid column the Cursor is on. + *

+ * The cursor position points the position for the next component that is + * added without specifying its coordinates (grid cell). When the cursor + * position is occupied, the next component will be added to first free + * position after the cursor. + *

+ * + * @return the grid column the cursor is on, starting from 0. */ public int getCursorX() { return cursorX; @@ -1050,10 +1066,14 @@ public class GridLayout extends AbstractLayout implements } /** - * Gets the current cursor y-position. The cursor position points the - * position for the next component that is added without specifying its - * coordinates (grid cell). When the cursor position is occupied, the next - * component will be added to first free position after the cursor. + * Gets the current y-position (row) of the cursor. + * + *

+ * The cursor position points the position for the next component that is + * added without specifying its coordinates (grid cell). When the cursor + * position is occupied, the next component will be added to the first free + * position after the cursor. + *

* * @return the grid row the Cursor is on. */ @@ -1062,10 +1082,11 @@ public class GridLayout extends AbstractLayout implements } /** - * Sets the current cursor y-position. This is usually handled automatically - * by GridLayout. + * Sets the current y-coordinate (row) of the cursor. This is usually + * handled automatically by GridLayout. * * @param cursorY + * the row number, starting from 0 for the topmost row. */ public void setCursorY(int cursorY) { this.cursorY = cursorY; @@ -1164,10 +1185,11 @@ public class GridLayout extends AbstractLayout implements } /** - * Inserts an empty row at the chosen position in the grid. + * Inserts an empty row at the specified position in the grid. * * @param row - * Number of the row the new row will be inserted before + * Index of the row before which the new row will be inserted. + * The leftmost row has index 0. */ public void insertRow(int row) { if (row > rows) { @@ -1199,9 +1221,13 @@ public class GridLayout extends AbstractLayout implements } /** - * Removes row and all components in the row. Components which span over - * several rows are removed if the selected row is the component's first - * row. + * Removes a row and all the components in the row. + * + *

+ * Components which span over several rows are removed if the selected row + * is on the first row of such a component. + *

+ * *

* If the last row is removed then all remaining components will be removed * and the grid will be reduced to one row. The cursor will be moved to the @@ -1209,7 +1235,7 @@ public class GridLayout extends AbstractLayout implements *

* * @param row - * The row number to remove + * Index of the row to remove. The leftmost row has index 0. */ public void removeRow(int row) { if (row >= rows) { @@ -1255,15 +1281,18 @@ public class GridLayout extends AbstractLayout implements } /** - * Sets the expand ratio of given column. Expand ratio defines how excess - * space is distributed among columns. Excess space means the space not - * consumed by non relatively sized components. + * Sets the expand ratio of given column. * *

- * By default excess space is distributed evenly. + * The expand ratio defines how excess space is distributed among columns. + * Excess space means space that is left over from components that are not + * sized relatively. By default, the excess space is distributed evenly. + *

* *

- * Note, that width needs to be defined for this method to have any effect. + * Note that the component width of the GridLayout must be defined (fixed or + * relative, as opposed to undefined) for this method to have any effect. + *

* * @see #setWidth(float, int) * @@ -1289,19 +1318,23 @@ public class GridLayout extends AbstractLayout implements } /** - * Sets the expand ratio of given row. Expand ratio defines how excess space - * is distributed among rows. Excess space means the space not consumed by - * non relatively sized components. + * Sets the expand ratio of given row. * *

- * By default excess space is distributed evenly. + * Expand ratio defines how excess space is distributed among rows. Excess + * space means the space left over from components that are not sized + * relatively. By default, the excess space is distributed evenly. + *

* *

- * Note, that height needs to be defined for this method to have any effect. + * Note, that height needs to be defined (fixed or relative, as opposed to + * undefined height) for this method to have any effect. + *

* * @see #setHeight(float, int) * * @param rowIndex + * The row index, starting from 0 for the topmost row. * @param ratio */ public void setRowExpandRatio(int rowIndex, float ratio) { @@ -1315,6 +1348,7 @@ public class GridLayout extends AbstractLayout implements * @see #setRowExpandRatio(int, float) * * @param rowIndex + * The row index, starting from 0 for the topmost row. * @return the expand ratio, 0.0f by default */ public float getRowExpandRatio(int rowIndex) { @@ -1326,9 +1360,9 @@ public class GridLayout extends AbstractLayout implements * Gets the Component at given index. * * @param x - * x-index + * The column index, starting from 0 for the leftmost column. * @param y - * y-index + * The row index, starting from 0 for the topmost row. * @return Component in given cell or null if empty */ public Component getComponent(int x, int y) { @@ -1344,13 +1378,13 @@ public class GridLayout extends AbstractLayout implements } /** - * Returns information about the area where given component is layed in the + * Returns information about the area where given component is laid in the * GridLayout. * * @param component * the component whose area information is requested. - * @return an Area object that contains information how component is layed - * in the grid + * @return an Area object that contains information how component is laid in + * the grid */ public Area getComponentArea(Component component) { for (final Iterator iterator = areas.iterator(); iterator @@ -1364,7 +1398,7 @@ public class GridLayout extends AbstractLayout implements } /** - * Sets the component alignment using a short hand string notation. + * Sets the component alignment using a shorthand string notation. * * @deprecated Replaced by * {@link #setComponentAlignment(Component, Alignment)} -- cgit v1.2.3 From 87751a5e21d3749c770b026a71777b6f9d87ed09 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 19 Mar 2012 10:17:04 +0000 Subject: Test for #5100 svn changeset:23257/svn branch:6.8 --- .../components/tabsheet/TabKeyboardNavigation.html | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html b/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html new file mode 100644 index 0000000000..d7876ba646 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.html @@ -0,0 +1,97 @@ + + + + + + +TabKeyboardNavigation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TabKeyboardNavigation
open/run/TabKeyboardNavigation?restartApplication
mouseClickvaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]9,8
pressSpecialKeyvaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]right
assertTextPresentTab 2
screenCapturetab2
pressSpecialKeyvaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]right
pressSpecialKeyvaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]right
assertTextPresentTab 5
screenCaptureskip-disabled-to-tab5
pressSpecialKeyvaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[4]right
assertTextPresentTab 1wraparound-to-tab1
clickvaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]
mouseClickvaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]14,9
pressSpecialKeyvaadin=runTabKeyboardNavigation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]left
assertTextPresentTab 6
screenCapturemoved-left-to-tab6
+ + -- cgit v1.2.3 From 07afa1749ea437a32884a9729dde9bc1f9683de1 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 19 Mar 2012 10:18:24 +0000 Subject: #5100 some cleanup svn changeset:23259/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java | 15 +++++++++++---- 1 file 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; /** -- cgit v1.2.3 From 8da6b1a0c3293c7de05ebc3d451a2f2e272a13b8 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 19 Mar 2012 10:23:52 +0000 Subject: #5100 Removed unnecessary setTabulatorIndex() call svn changeset:23260/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java index 5e0a380376..b77203532f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java @@ -403,7 +403,6 @@ public class VTabsheet extends VTabsheetBase implements Focusable, if (tabIndex == 0) { // Set the "first" style t.setStyleNames(false, true); - t.setTabulatorIndex(-1); } t.addClickHandler(this); -- cgit v1.2.3