Lior Vernia has uploaded a new change for review.

Change subject: webadmin: Added vertical scrolling to BaseListModelSuggestBox
......................................................................

webadmin: Added vertical scrolling to BaseListModelSuggestBox

All suggest boxes in the system could probably use a height limitation
for their suggestion list, with a vertical scrollbar when the content
is too big.

Also took the chance to move the logic fitting the height of the
suggestion list to that of the content from ListModelTypeAheadListBox
to BaseListModelSuggestBox, as ListModelSuggestBox could also use it.

Change-Id: I9c662e3e8d1062e654f10ce275019c28b62f2666
Bug-Url: https://bugzilla.redhat.com/1008523
Signed-off-by: Lior Vernia <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/BaseListModelSuggestBox.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/ListModelTypeAheadListBox.ui.xml
2 files changed, 15 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/91/19791/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/BaseListModelSuggestBox.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/BaseListModelSuggestBox.java
index f7fd9c6..3cd3135 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/BaseListModelSuggestBox.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/BaseListModelSuggestBox.java
@@ -1,5 +1,8 @@
 package org.ovirt.engine.ui.common.widget.editor;
 
+import com.google.gwt.dom.client.Style;
+import com.google.gwt.dom.client.Style.Overflow;
+import com.google.gwt.dom.client.Style.Unit;
 import com.google.gwt.event.dom.client.KeyDownHandler;
 import com.google.gwt.event.dom.client.KeyPressHandler;
 import com.google.gwt.event.dom.client.KeyUpHandler;
@@ -29,9 +32,14 @@
 
     private SuggestBox suggestBox;
 
-    private ListModelSuggestionDisplay suggestionDisplay = new 
ListModelSuggestionDisplay();
+    private ListModelSuggestionDisplay suggestionDisplay;
 
     public BaseListModelSuggestBox(MultiWordSuggestOracle suggestOracle) {
+        this(suggestOracle, 120);
+    }
+
+    public BaseListModelSuggestBox(MultiWordSuggestOracle suggestOracle, int 
maxSuggestionPanelHeightInPx) {
+        suggestionDisplay = new 
ListModelSuggestionDisplay(maxSuggestionPanelHeightInPx);
         suggestBox = new SuggestBox(suggestOracle, new TextBox(), 
suggestionDisplay);
 
         suggestBox.removeStyleName("gwt-SuggestBox"); //$NON-NLS-1$
@@ -172,9 +180,14 @@
 
         private Widget suggestionMenu;
 
-        public ListModelSuggestionDisplay() {
+        public ListModelSuggestionDisplay(int maxSuggestionPanelHeightInPx) {
             // not be hidden under the panel
             getPopupPanel().getElement().getStyle().setZIndex(1);
+
+            Style suggestPopupContentStyle = 
getPopupPanel().getWidget().getElement().getParentElement().getStyle();
+            suggestPopupContentStyle.setHeight(100, Unit.PCT);
+            suggestPopupContentStyle.setPropertyPx("maxHeight", 
maxSuggestionPanelHeightInPx); //$NON-NLS-1$
+            suggestPopupContentStyle.setOverflowX(Overflow.HIDDEN);
         }
 
         // just to make it public
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/ListModelTypeAheadListBox.ui.xml
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/ListModelTypeAheadListBox.ui.xml
index d09f421..b408a6e 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/ListModelTypeAheadListBox.ui.xml
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/ListModelTypeAheadListBox.ui.xml
@@ -5,12 +5,6 @@
        <ui:with field='resources' 
type='org.ovirt.engine.ui.common.CommonApplicationResources' />
 
        <ui:style 
type="org.ovirt.engine.ui.common.widget.editor.ListModelTypeAheadListBox.Style">
-        @external gwt-SuggestBoxPopup .suggestPopupMiddleCenterInner;
-
-        .gwt-SuggestBoxPopup .suggestPopupMiddleCenterInner {
-            height: 100%;
-        }
-
                .mainStyle,.enabledMainPanel,.disabledMainPanel {
                        display: inline-block;
                        height: 17px;


-- 
To view, visit http://gerrit.ovirt.org/19791
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c662e3e8d1062e654f10ce275019c28b62f2666
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to