summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebContent/VAADIN/themes/base/styles.css7
-rw-r--r--WebContent/VAADIN/themes/base/tree/tree.css3
-rw-r--r--WebContent/VAADIN/themes/liferay/styles.css7
-rw-r--r--WebContent/VAADIN/themes/reindeer/styles.css7
-rw-r--r--WebContent/VAADIN/themes/runo/styles.css7
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTree.java45
-rw-r--r--tests/src/com/vaadin/tests/components/tree/TreeScrollingOnSelection.java1
7 files changed, 50 insertions, 27 deletions
diff --git a/WebContent/VAADIN/themes/base/styles.css b/WebContent/VAADIN/themes/base/styles.css
index 875df0b097..aba8b88745 100644
--- a/WebContent/VAADIN/themes/base/styles.css
+++ b/WebContent/VAADIN/themes/base/styles.css
@@ -1,5 +1,5 @@
-.v-theme-version:after {content:"6_5_4_dev-20110324";}
-.v-theme-version-6_5_4_dev-20110324 {display: none;}
+.v-theme-version:after {content:"6_5_5_dev-20110406";}
+.v-theme-version-6_5_5_dev-20110406 {display: none;}
/* Automatically compiled css file from subdirectories. */
.v-absolutelayout-wrapper {
@@ -1972,6 +1972,9 @@ textarea.v-textarea-readonly:focus {
background: transparent url(common/img/sprites.png) no-repeat 5px -37px;
padding: 1px 0;
}
+.v-tree-node:focus {
+ outline: none;
+}
.v-tree-node-expanded {
background-position: -5px -10px;
}
diff --git a/WebContent/VAADIN/themes/base/tree/tree.css b/WebContent/VAADIN/themes/base/tree/tree.css
index f549d1961d..aa01cf7770 100644
--- a/WebContent/VAADIN/themes/base/tree/tree.css
+++ b/WebContent/VAADIN/themes/base/tree/tree.css
@@ -8,6 +8,9 @@
background: transparent url(../common/img/sprites.png) no-repeat 5px -37px;
padding: 1px 0;
}
+.v-tree-node:focus {
+ outline: none;
+}
.v-tree-node-expanded {
background-position: -5px -10px;
}
diff --git a/WebContent/VAADIN/themes/liferay/styles.css b/WebContent/VAADIN/themes/liferay/styles.css
index 4dbf9aafff..8b248ae320 100644
--- a/WebContent/VAADIN/themes/liferay/styles.css
+++ b/WebContent/VAADIN/themes/liferay/styles.css
@@ -1,5 +1,5 @@
-.v-theme-version:after {content:"6_5_4_dev-20110324";}
-.v-theme-version-6_5_4_dev-20110324 {display: none;}
+.v-theme-version:after {content:"6_5_5_dev-20110406";}
+.v-theme-version-6_5_5_dev-20110406 {display: none;}
/* Automatically compiled css file from subdirectories. */
.v-absolutelayout-wrapper {
@@ -1972,6 +1972,9 @@ textarea.v-textarea-readonly:focus {
background: transparent url(../base/common/img/sprites.png) no-repeat 5px -37px;
padding: 1px 0;
}
+.v-tree-node:focus {
+ outline: none;
+}
.v-tree-node-expanded {
background-position: -5px -10px;
}
diff --git a/WebContent/VAADIN/themes/reindeer/styles.css b/WebContent/VAADIN/themes/reindeer/styles.css
index e960a6abea..baabdf46dd 100644
--- a/WebContent/VAADIN/themes/reindeer/styles.css
+++ b/WebContent/VAADIN/themes/reindeer/styles.css
@@ -1,5 +1,5 @@
-.v-theme-version:after {content:"6_5_4_dev-20110324";}
-.v-theme-version-6_5_4_dev-20110324 {display: none;}
+.v-theme-version:after {content:"6_5_5_dev-20110406";}
+.v-theme-version-6_5_5_dev-20110406 {display: none;}
/* Automatically compiled css file from subdirectories. */
.v-absolutelayout-wrapper {
@@ -1972,6 +1972,9 @@ textarea.v-textarea-readonly:focus {
background: transparent url(../base/common/img/sprites.png) no-repeat 5px -37px;
padding: 1px 0;
}
+.v-tree-node:focus {
+ outline: none;
+}
.v-tree-node-expanded {
background-position: -5px -10px;
}
diff --git a/WebContent/VAADIN/themes/runo/styles.css b/WebContent/VAADIN/themes/runo/styles.css
index 326f0525cf..c641a8c5f0 100644
--- a/WebContent/VAADIN/themes/runo/styles.css
+++ b/WebContent/VAADIN/themes/runo/styles.css
@@ -1,5 +1,5 @@
-.v-theme-version:after {content:"6_5_4_dev-20110324";}
-.v-theme-version-6_5_4_dev-20110324 {display: none;}
+.v-theme-version:after {content:"6_5_5_dev-20110406";}
+.v-theme-version-6_5_5_dev-20110406 {display: none;}
/* Automatically compiled css file from subdirectories. */
.v-absolutelayout-wrapper {
@@ -1972,6 +1972,9 @@ textarea.v-textarea-readonly:focus {
background: transparent url(../base/common/img/sprites.png) no-repeat 5px -37px;
padding: 1px 0;
}
+.v-tree-node:focus {
+ outline: none;
+}
.v-tree-node-expanded {
background-position: -5px -10px;
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
index ddc5c174ca..a007f27136 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
@@ -628,15 +628,14 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
* Also ensure that the Tree itself is also gains focus (TreeNodes
* focus is kind of faked).
*/
- if (BrowserInfo.get().isOpera()) {
- /*
- * focusing the tree in Opera would scroll long trees up on
- * clicks
- */
- getElement().focus();
- } else if (!BrowserInfo.get().isIE()) {
- focus();
- } // else if IE: NOP, IE will give the focus to Tree anyways
+ // if (BrowserInfo.get().isOpera()) {
+ /*
+ * focusing the tree in Opera would scroll long trees up on clicks
+ */
+ // getElement().focus();
+ // } else if (!BrowserInfo.get().isIE()) {
+ // focus();
+ // } // else if IE: NOP, IE will give the focus to Tree anyways
ScheduledCommand command = new ScheduledCommand() {
public void execute() {
@@ -787,7 +786,12 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
* previously modified field may contain dirty variables.
*/
if (!treeHasFocus) {
- focus();
+ if (focusedNode == null) {
+ getNodeByKey(key).setFocused(true);
+ } else {
+ focusedNode.setFocused(true);
+ }
+ // focus();
}
final MouseEventDetails details = new MouseEventDetails(evt);
ScheduledCommand command = new ScheduledCommand() {
@@ -832,15 +836,15 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
DOM.appendChild(getElement(), ie6compatnode);
DOM.sinkEvents(ie6compatnode, Event.ONCLICK);
- } else if (BrowserInfo.get().isOpera()) {
- /*
- * We need to focus the TreeNode itself to get keyboard
- * navigation to work in opera at some level. Actually focusing
- * individual TreeNodes would most likely be better option for
- * all browsers, I don't dare to to this at bugfix release. MT.
- */
- getElement().setTabIndex(-1);
- }
+ } // else if (BrowserInfo.get().isOpera()) {
+ /*
+ * We need to focus the TreeNode itself to get keyboard navigation
+ * to work in opera at some level. Actually focusing individual
+ * TreeNodes would most likely be better option for all browsers, I
+ * don't dare to to this at bugfix release. MT.
+ */
+ getElement().setTabIndex(-1);
+ // }
nodeCaptionDiv = DOM.createDiv();
DOM.setElementProperty(nodeCaptionDiv, "className", CLASSNAME
@@ -1142,12 +1146,15 @@ public class VTree extends SimpleFocusablePanel implements Paintable,
ie6compatnode.addClassName(CLASSNAME_FOCUSED);
}
this.focused = focused;
+ getElement().focus();
+ treeHasFocus = true;
} else if (this.focused && !focused) {
nodeCaptionDiv.removeClassName(CLASSNAME_FOCUSED);
if (BrowserInfo.get().isIE6()) {
ie6compatnode.removeClassName(CLASSNAME_FOCUSED);
}
this.focused = focused;
+ treeHasFocus = false;
}
}
diff --git a/tests/src/com/vaadin/tests/components/tree/TreeScrollingOnSelection.java b/tests/src/com/vaadin/tests/components/tree/TreeScrollingOnSelection.java
index 0f06f23fe0..42c9087fc3 100644
--- a/tests/src/com/vaadin/tests/components/tree/TreeScrollingOnSelection.java
+++ b/tests/src/com/vaadin/tests/components/tree/TreeScrollingOnSelection.java
@@ -33,6 +33,7 @@ public class TreeScrollingOnSelection extends TestBase {
charLabel.setValue(event.getItemId().toString());
}
});
+ tree.setImmediate(true);
Panel panel = new Panel();
panel.setScrollable(true);