diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-07-24 15:04:49 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2012-07-24 15:04:49 +0300 |
commit | 52d8abf71b94fdc717d55bfdf2e2fa0fc29760a2 (patch) | |
tree | 43db695d51811c9205fefc4a14c3afa7ded87641 /src/com/vaadin/terminal/gwt/client/ui | |
parent | 0bac9d1a5616a181806a7cfa34ed2dadbba92fa9 (diff) | |
parent | b6ea64e917b69a80bd61c0541947fee8faf0e46c (diff) | |
download | vaadin-framework-52d8abf71b94fdc717d55bfdf2e2fa0fc29760a2.tar.gz vaadin-framework-52d8abf71b94fdc717d55bfdf2e2fa0fc29760a2.zip |
Merge branch '6.8'
Conflicts:
WebContent/VAADIN/themes/base/treetable/treetable.css
WebContent/release-notes.html
src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java
src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java
Diffstat (limited to 'src/com/vaadin/terminal/gwt/client/ui')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java | 7 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/treetable/VTreeTable.java | 44 |
2 files changed, 35 insertions, 16 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java index 4050f1bafc..c8bebc2c66 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java @@ -301,7 +301,7 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, if (!prompting && newText != null && !newText.equals(valueBeforeEdit)) { sendValueChange = immediate; - client.updateVariable(paintableId, "text", getText(), false); + client.updateVariable(paintableId, "text", newText, false); valueBeforeEdit = newText; valueBeforeEditIsSynced = true; } @@ -366,6 +366,11 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, @Override public void onBlur(BlurEvent event) { + // this is called twice on Chrome when e.g. changing tab while prompting + // field focused - do not change settings on the second time + if (focusedTextField != this) { + return; + } removeStyleDependentName(CLASSNAME_FOCUS); focusedTextField = null; String text = getText(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/treetable/VTreeTable.java b/src/com/vaadin/terminal/gwt/client/ui/treetable/VTreeTable.java index 91e1fe2a3d..c03dff9507 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/treetable/VTreeTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/treetable/VTreeTable.java @@ -97,7 +97,7 @@ public class VTreeTable extends VScrollTable { } class VTreeTableScrollBody extends VScrollTable.VScrollTableBody { - private int identWidth = -1; + private int indentWidth = -1; VTreeTableScrollBody() { super(); @@ -165,7 +165,7 @@ public class VTreeTable extends VScrollTable { container.insertFirst(treeSpacer); depth = rowUidl.hasAttribute("depth") ? rowUidl .getIntAttribute("depth") : 0; - setIdent(); + setIndent(); isTreeCellAdded = true; return true; } @@ -202,18 +202,19 @@ public class VTreeTable extends VScrollTable { } - private void setIdent() { - if (getIdentWidth() > 0 && depth != 0) { - treeSpacer.getStyle().setWidth( - (depth + 1) * getIdentWidth(), Unit.PX); + private void setIndent() { + if (getIndentWidth() > 0) { + treeSpacer.getParentElement().getStyle() + .setPaddingLeft(getIndent(), Unit.PX); + treeSpacer.getStyle().setWidth(getIndent(), Unit.PX); } } @Override protected void onAttach() { super.onAttach(); - if (getIdentWidth() < 0) { - detectIdent(this); + if (getIndentWidth() < 0) { + detectIndent(this); } } @@ -227,6 +228,19 @@ public class VTreeTable extends VScrollTable { return consumedSpace; } + @Override + protected void setCellWidth(int cellIx, int width) { + if (cellIx == colIndexOfHierarchy + (showRowHeaders ? 1 : 0)) { + // take indentation padding into account if this is the + // hierarchy column + width = Math.max(width - getIndent(), 0); + } + super.setCellWidth(cellIx, width); + } + + private int getIndent() { + return (depth + 1) * getIndentWidth(); + } } protected class VTreeTableGeneratedRow extends VTreeTableRow { @@ -354,20 +368,20 @@ public class VTreeTable extends VScrollTable { } } - private int getIdentWidth() { - return identWidth; + private int getIndentWidth() { + return indentWidth; } - private void detectIdent(VTreeTableRow vTreeTableRow) { - identWidth = vTreeTableRow.treeSpacer.getOffsetWidth(); - if (identWidth == 0) { - identWidth = -1; + private void detectIndent(VTreeTableRow vTreeTableRow) { + indentWidth = vTreeTableRow.treeSpacer.getOffsetWidth(); + if (indentWidth == 0) { + indentWidth = -1; return; } Iterator<Widget> iterator = iterator(); while (iterator.hasNext()) { VTreeTableRow next = (VTreeTableRow) iterator.next(); - next.setIdent(); + next.setIndent(); } } |