aboutsummaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJohn Alhroos <john.ahlroos@itmill.com>2010-08-13 11:35:38 +0000
committerJohn Alhroos <john.ahlroos@itmill.com>2010-08-13 11:35:38 +0000
commit2bb497caf0aff75a63c1c7683482303511a09c1a (patch)
treefc5d161edb4d578ba572d73da98d05d50f32d2c8 /src/com
parente59b84de64f7bd5acf02e468f9d43a0e72362d11 (diff)
downloadvaadin-framework-2bb497caf0aff75a63c1c7683482303511a09c1a.tar.gz
vaadin-framework-2bb497caf0aff75a63c1c7683482303511a09c1a.zip
Fix for #5258
svn changeset:14487/svn branch:6.4
Diffstat (limited to 'src/com')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTextField.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java
index 187bd9463f..ba2b86b663 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java
@@ -4,6 +4,7 @@
package com.vaadin.terminal.gwt.client.ui;
+import com.google.gwt.dom.client.Style.Cursor;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ChangeEvent;
@@ -61,6 +62,7 @@ public class VTextField extends TextBoxBase implements Paintable, Field,
private String inputPrompt = null;
private boolean prompting = false;
private int lastCursorPos = -1;
+ private int lastTabIndex = 0;
public VTextField() {
this(DOM.createInputText());
@@ -89,6 +91,24 @@ public class VTextField extends TextBoxBase implements Paintable, Field,
}
}
+ @Override
+ public void setReadOnly(boolean readOnly) {
+ super.setReadOnly(readOnly);
+ if (readOnly) {
+ setTabIndex(-1);
+ getElement().getStyle().setCursor(Cursor.DEFAULT);
+ } else {
+ setTabIndex(lastTabIndex);
+ getElement().getStyle().setCursor(Cursor.TEXT);
+ }
+ }
+
+ @Override
+ public void setTabIndex(int index) {
+ lastTabIndex = getTabIndex();
+ super.setTabIndex(index);
+ }
+
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
this.client = client;
id = uidl.getId();