From ce603214fb27c43c4cfd7e5bb83516b07d8748b7 Mon Sep 17 00:00:00 2001 From: Jonni Nakari Date: Fri, 14 Jul 2017 16:58:53 +0200 Subject: [PATCH] Tree setHeight* methods to workaround vaadin/framework#9629 --- .../components/TreeWithContextMenu.java | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/vaadin/vaadinfiddle/vaadinfiddleprototype/components/TreeWithContextMenu.java b/src/main/java/org/vaadin/vaadinfiddle/vaadinfiddleprototype/components/TreeWithContextMenu.java index 5156d8f..f305234 100644 --- a/src/main/java/org/vaadin/vaadinfiddle/vaadinfiddleprototype/components/TreeWithContextMenu.java +++ b/src/main/java/org/vaadin/vaadinfiddle/vaadinfiddleprototype/components/TreeWithContextMenu.java @@ -5,13 +5,29 @@ import com.vaadin.ui.TreeGrid; public class TreeWithContextMenu extends Tree { - private GridContextMenu gridContextMenu; + private GridContextMenu gridContextMenu; - public GridContextMenu getContextMenu() { - if (gridContextMenu == null) { - TreeGrid treegrid = (TreeGrid) getCompositionRoot(); - gridContextMenu = new GridContextMenu<>(treegrid); - } - return gridContextMenu; + public GridContextMenu getContextMenu() { + if (gridContextMenu == null) { + TreeGrid treegrid = (TreeGrid) getCompositionRoot(); + gridContextMenu = new GridContextMenu<>(treegrid); } - } \ No newline at end of file + return gridContextMenu; + } + + // setHeight* methods to workaround vaadin/framework#9629 + @Override + public void setHeight(float height, Unit unit) { + getCompositionRoot().setHeight(height, unit); + } + + @Override + public void setHeight(String height) { + getCompositionRoot().setHeight(height); + } + + @Override + public void setHeightUndefined() { + getCompositionRoot().setHeightUndefined(); + } +} \ No newline at end of file