diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2015-08-31 22:51:19 +0300 |
---|---|---|
committer | Mika Murtojarvi <mika@vaadin.com> | 2015-09-14 15:23:17 +0300 |
commit | efdc36027dec55e8b1084c7ea94ccb843b8a7c99 (patch) | |
tree | 227398d6a3a0fd21a069075b5c4beaeae396c143 /client | |
parent | 5c74720c9e8ab73af449984ccac31400c77d9975 (diff) | |
download | vaadin-framework-efdc36027dec55e8b1084c7ea94ccb843b8a7c99.tar.gz vaadin-framework-efdc36027dec55e8b1084c7ea94ccb843b8a7c99.zip |
Disable sidebar button when grid is disabled. (#18696)
Change-Id: If334cebd85fcfe9b368b1b360181abaadd5cb4ef
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/widgets/Grid.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 4e91342091..1ef84f865d 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -3137,7 +3137,7 @@ public class Grid<T> extends ResizeComposite implements * * @since 7.5.0 */ - private static class Sidebar extends Composite { + private static class Sidebar extends Composite implements HasEnabled { private final ClickHandler openCloseButtonHandler = new ClickHandler() { @@ -3188,6 +3188,9 @@ public class Grid<T> extends ResizeComposite implements initWidget(rootContainer); openCloseButton = new Button(); + + setEnabled(grid.isEnabled()); + openCloseButton.addClickHandler(openCloseButtonHandler); rootContainer.add(openCloseButton); @@ -3409,6 +3412,20 @@ public class Grid<T> extends ResizeComposite implements } }); } + + @Override + public boolean isEnabled() { + return openCloseButton.isEnabled(); + } + + @Override + public void setEnabled(boolean enabled) { + if(!enabled && isOpen()) { + close(); + } + + openCloseButton.setEnabled(enabled); + } } /** @@ -5310,6 +5327,8 @@ public class Grid<T> extends ResizeComposite implements editor.setGridEnabled(enabled); } + sidebar.setEnabled(enabled); + getEscalator().setScrollLocked(Direction.VERTICAL, !enabled || editorOpen); getEscalator().setScrollLocked(Direction.HORIZONTAL, !enabled); |