diff options
author | Henri Sara <hesara@vaadin.com> | 2015-11-09 15:00:50 +0200 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2016-01-15 14:42:57 +0200 |
commit | 305edacb2799a9ef574912456b1f61840a839981 (patch) | |
tree | c351df9ecf7b9f471bb5cc14dc2e3b260e6a839c | |
parent | eb264da6892a6f382725095eca5b951fbdd89fe1 (diff) | |
download | vaadin-framework-305edacb2799a9ef574912456b1f61840a839981.tar.gz vaadin-framework-305edacb2799a9ef574912456b1f61840a839981.zip |
Remove UIDL references in VFilterSelect (#19929)
Change-Id: I403ca3a62e04c03594608fd5d75a97991f7dda3d
-rw-r--r-- | client/src/com/vaadin/client/ui/VFilterSelect.java | 31 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java | 13 |
2 files changed, 27 insertions, 17 deletions
diff --git a/client/src/com/vaadin/client/ui/VFilterSelect.java b/client/src/com/vaadin/client/ui/VFilterSelect.java index a783b957bc..c6c63a95f8 100644 --- a/client/src/com/vaadin/client/ui/VFilterSelect.java +++ b/client/src/com/vaadin/client/ui/VFilterSelect.java @@ -67,7 +67,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; @@ -107,17 +106,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; } /** @@ -796,13 +800,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"); diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java index 87f24845ab..303bb7a8ea 100644 --- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -112,7 +112,7 @@ public class ComboBoxConnector extends AbstractFieldConnector implements getWidget().pageLength = uidl.getIntAttribute("pagelength"); } - getWidget().suggestionPopup.updateStyleNames(uidl, getState()); + getWidget().suggestionPopup.updateStyleNames(getState()); getWidget().allowNewItem = uidl.hasAttribute("allownewitem"); getWidget().lastNewItemString = null; @@ -128,8 +128,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); } |