aboutsummaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2015-12-11 15:22:10 +0200
committerHenri Sara <hesara@vaadin.com>2015-12-11 15:22:10 +0200
commit8a6a6add180523c3b79137283e7cc752305ec0cf (patch)
tree6864463e125a06fa7e0a0d2deef3dcea0a8f7951 /client/src
parent2382af0edf29a1e7e120fa196220c353ef6e6ec1 (diff)
downloadvaadin-framework-8a6a6add180523c3b79137283e7cc752305ec0cf.tar.gz
vaadin-framework-8a6a6add180523c3b79137283e7cc752305ec0cf.zip
Enable using custom overlay in VMenuBar (#19368)
This helps resolve context menu add-on issue #3 and reduce code duplication. Change-Id: I2a9b583d045e1654577f5a6ee3f55d8c4ab30582
Diffstat (limited to 'client/src')
-rw-r--r--client/src/com/vaadin/client/ui/VMenuBar.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/VMenuBar.java b/client/src/com/vaadin/client/ui/VMenuBar.java
index fb8ba013f7..b2b40c12f7 100644
--- a/client/src/com/vaadin/client/ui/VMenuBar.java
+++ b/client/src/com/vaadin/client/ui/VMenuBar.java
@@ -569,7 +569,7 @@ public class VMenuBar extends SimpleFocusablePanel implements
protected void showChildMenuAt(CustomMenuItem item, int top, int left) {
final int shadowSpace = 10;
- popup = new VOverlay(true, false, true);
+ popup = createOverlay();
popup.setOwner(this);
/*
@@ -633,6 +633,18 @@ public class VMenuBar extends SimpleFocusablePanel implements
}
+ /**
+ * Create an overlay for the menu bar.
+ *
+ * This method can be overridden to use a custom overlay.
+ *
+ * @since 7.6
+ * @return overlay to use
+ */
+ protected VOverlay createOverlay() {
+ return new VOverlay(true, false, true);
+ }
+
private int adjustPopupHeight(int top, final int shadowSpace) {
// Check that the popup will fit the screen
int availableHeight = RootPanel.getBodyElement().getOffsetHeight()