diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-05-27 11:07:00 +0300 |
---|---|---|
committer | Mika Murtojarvi <mika@vaadin.com> | 2015-05-28 18:07:47 +0300 |
commit | 5d33446d05972f3aea18675a346ad50edf289194 (patch) | |
tree | 0bceb00189bb09a7026e7694f3191e9cfebd3026 | |
parent | 7081849cb4c8f6c08a008bbc4f13815e992bf345 (diff) | |
download | vaadin-framework-5d33446d05972f3aea18675a346ad50edf289194.tar.gz vaadin-framework-5d33446d05972f3aea18675a346ad50edf289194.zip |
Add class name for not editable editor cells (#18021)
Change-Id: I6d5ef1a125ae1739b0e3de49eac2f68ba66afb05
-rw-r--r-- | client/src/com/vaadin/client/widgets/Grid.java | 3 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 4a80e24b53..4af02e989a 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -1050,6 +1050,7 @@ public class Grid<T> extends ResizeComposite implements public static final int KEYCODE_HIDE = KeyCodes.KEY_ESCAPE; private static final String ERROR_CLASS_NAME = "error"; + private static final String NOT_EDITABLE_CLASS_NAME = "not-editable"; protected enum State { INACTIVE, ACTIVATING, BINDING, ACTIVE, SAVING @@ -1433,6 +1434,8 @@ public class Grid<T> extends ResizeComposite implements columnToWidget.put(column, editor); attachWidget(editor, cell); } + } else { + cell.addClassName(NOT_EDITABLE_CLASS_NAME); } } diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java index 2d9d4018e6..5f42bd66d3 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridEditorTest.java @@ -298,8 +298,16 @@ public class GridEditorTest extends GridBasicFeaturesTest { selectMenuPath(EDIT_ITEM_5); assertEditorOpen(); + GridEditorElement editor = getGridElement().getEditor(); assertFalse("Uneditable column should not have an editor widget", - getGridElement().getEditor().isEditable(3)); + editor.isEditable(3)); + assertEquals( + "Not editable cell did not contain correct classname", + "not-editable", + editor.findElement(By.className("v-grid-editor-cells")) + .findElements(By.xpath("./div")).get(3) + .getAttribute("class")); + } private WebElement getSaveButton() { |