]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remove UIDL references in VFilterSelect (#19929)
authorHenri Sara <hesara@vaadin.com>
Mon, 9 Nov 2015 13:00:50 +0000 (15:00 +0200)
committerTeemu Suo-Anttila <teemusa@vaadin.com>
Thu, 21 Jul 2016 14:44:40 +0000 (14:44 +0000)
Change-Id: I403ca3a62e04c03594608fd5d75a97991f7dda3d

client/src/main/java/com/vaadin/client/ui/VFilterSelect.java
client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java

index efca4c58dccc5c11e7ab66758f641c03fd8c6ac6..ec23bb7e5828be138bcac70fb9a2350a92f34b6e 100644 (file)
@@ -70,7 +70,6 @@ import com.vaadin.client.BrowserInfo;
 import com.vaadin.client.ComputedStyle;
 import com.vaadin.client.DeferredWorker;
 import com.vaadin.client.Focusable;
-import com.vaadin.client.UIDL;
 import com.vaadin.client.VConsole;
 import com.vaadin.client.WidgetUtil;
 import com.vaadin.client.ui.aria.AriaHelper;
@@ -110,17 +109,22 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
         /**
          * Constructor
          * 
-         * @param uidl
-         *            The UIDL recieved from the server
+         * @param key
+         *            item key, empty string for a special null item not in
+         *            container
+         * @param caption
+         *            item caption
+         * @param style
+         *            item style name, can be empty string
+         * @param untranslatedIconUri
+         *            icon URI or null
          */
-        public FilterSelectSuggestion(UIDL uidl) {
-            key = uidl.getStringAttribute("key");
-            caption = uidl.getStringAttribute("caption");
-            style = uidl.getStringAttribute("style");
-
-            if (uidl.hasAttribute("icon")) {
-                untranslatedIconUri = uidl.getStringAttribute("icon");
-            }
+        public FilterSelectSuggestion(String key, String caption, String style,
+                String untranslatedIconUri) {
+            this.key = key;
+            this.caption = caption;
+            this.style = style;
+            this.untranslatedIconUri = untranslatedIconUri;
         }
 
         /**
@@ -994,13 +998,10 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
         /**
          * Updates style names in suggestion popup to help theme building.
          * 
-         * @param uidl
-         *            UIDL for the whole combo box
          * @param componentState
          *            shared state of the combo box
          */
-        public void updateStyleNames(UIDL uidl,
-                AbstractComponentState componentState) {
+        public void updateStyleNames(AbstractComponentState componentState) {
             debug("VFS.SP: updateStyleNames()");
             setStyleName(VFilterSelect.this.getStylePrimaryName()
                     + "-suggestpopup");
index 9132764a587a8e2002d0d7c72fea5925cef7db67..60db7d15a3d7f832f618d9e3cdfa685049ea5a46 100644 (file)
@@ -115,7 +115,7 @@ public class ComboBoxConnector extends AbstractFieldConnector implements
             getWidget().suggestionPopupWidth = null;
         }
 
-        getWidget().suggestionPopup.updateStyleNames(uidl, getState());
+        getWidget().suggestionPopup.updateStyleNames(getState());
 
         getWidget().allowNewItem = uidl.hasAttribute("allownewitem");
         getWidget().lastNewItemString = null;
@@ -131,8 +131,17 @@ public class ComboBoxConnector extends AbstractFieldConnector implements
 
         for (final Iterator<?> i = options.getChildIterator(); i.hasNext();) {
             final UIDL optionUidl = (UIDL) i.next();
+            String key = optionUidl.getStringAttribute("key");
+            String caption = optionUidl.getStringAttribute("caption");
+            String style = optionUidl.getStringAttribute("style");
+
+            String untranslatedIconUri = null;
+            if (optionUidl.hasAttribute("icon")) {
+                untranslatedIconUri = optionUidl.getStringAttribute("icon");
+            }
+
             final FilterSelectSuggestion suggestion = getWidget().new FilterSelectSuggestion(
-                    optionUidl);
+                    key, caption, style, untranslatedIconUri);
             newSuggestions.add(suggestion);
         }