diff options
author | Automerge <automerge@vaadin.com> | 2012-02-15 02:18:50 +0000 |
---|---|---|
committer | Automerge <automerge@vaadin.com> | 2012-02-15 02:18:50 +0000 |
commit | aa13b3432bab77bb2dfca0db9b437b222517813f (patch) | |
tree | 66e3f7a7e8289d8267dcbe2843ebf693cd24649f | |
parent | 5b2e12623424e3603a5983895d122ba333db5b18 (diff) | |
download | vaadin-framework-aa13b3432bab77bb2dfca0db9b437b222517813f.tar.gz vaadin-framework-aa13b3432bab77bb2dfca0db9b437b222517813f.zip |
[merge from 6.7] #8114 - Fixed TabSheet rendering of first tab when another tab is selected
svn changeset:23014/svn branch:6.8
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java | 7 | ||||
-rw-r--r-- | tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetSelectionStyles.html | 67 |
2 files changed, 72 insertions, 2 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java index d30d999d16..39b3779682 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java @@ -52,7 +52,7 @@ public class VTabsheet extends VTabsheetBase { /** * Representation of a single "tab" shown in the TabBar - * + * */ private static class Tab extends SimplePanel { private static final String TD_CLASSNAME = CLASSNAME + "-tabitemcell"; @@ -341,13 +341,16 @@ public class VTabsheet extends VTabsheetBase { } public Tab addTab() { + // Must check this before insert as insert updates the tab count + boolean firstTab = (getTabCount() == 0); + Tab t = new Tab(this); // Logical attach int spacerIndex = getTabCount(); insert(t, tr, spacerIndex, true); - if (getTabCount() == 0) { + if (firstTab) { // Set the "first" style t.setStyleNames(false, true); } diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetSelectionStyles.html b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetSelectionStyles.html new file mode 100644 index 0000000000..e046cfacb4 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetSelectionStyles.html @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> +<link rel="selenium.base" href="" /> +<title>New Test</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<thead> +<tr><td rowspan="1" colspan="3">New Test</td></tr> +</thead><tbody> +<tr> + <td>open</td> + <td>/run/TabSheetIndexOperations?restartApplication</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>tab1-selected</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runTabSheetIndexOperations::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td> + <td>21,8</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>tab2-selected</td> +</tr> +<tr> + <td>open</td> + <td>/run/TabSheetIndexOperations</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>tab2-selected</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runTabSheetIndexOperations::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> + <td>14,5</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>tab1-selected</td> +</tr> +<tr> + <td>open</td> + <td>/run/TabSheetIndexOperations</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>tab1-selected</td> +</tr> + +</tbody></table> +</body> +</html> |