Browse Source

Remove UIDL references in VFilterSelect (#19929)

Change-Id: I403ca3a62e04c03594608fd5d75a97991f7dda3d
feature/eventbus
Henri Sara 8 years ago
parent
commit
0ba528d028

+ 16
- 15
client/src/main/java/com/vaadin/client/ui/VFilterSelect.java View File

import com.vaadin.client.ComputedStyle; import com.vaadin.client.ComputedStyle;
import com.vaadin.client.DeferredWorker; import com.vaadin.client.DeferredWorker;
import com.vaadin.client.Focusable; import com.vaadin.client.Focusable;
import com.vaadin.client.UIDL;
import com.vaadin.client.VConsole; import com.vaadin.client.VConsole;
import com.vaadin.client.WidgetUtil; import com.vaadin.client.WidgetUtil;
import com.vaadin.client.ui.aria.AriaHelper; import com.vaadin.client.ui.aria.AriaHelper;
/** /**
* Constructor * 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;
} }


/** /**
/** /**
* Updates style names in suggestion popup to help theme building. * Updates style names in suggestion popup to help theme building.
* *
* @param uidl
* UIDL for the whole combo box
* @param componentState * @param componentState
* shared state of the combo box * shared state of the combo box
*/ */
public void updateStyleNames(UIDL uidl,
AbstractComponentState componentState) {
public void updateStyleNames(AbstractComponentState componentState) {
debug("VFS.SP: updateStyleNames()"); debug("VFS.SP: updateStyleNames()");
setStyleName(VFilterSelect.this.getStylePrimaryName() setStyleName(VFilterSelect.this.getStylePrimaryName()
+ "-suggestpopup"); + "-suggestpopup");

+ 11
- 2
client/src/main/java/com/vaadin/client/ui/combobox/ComboBoxConnector.java View File

getWidget().suggestionPopupWidth = null; getWidget().suggestionPopupWidth = null;
} }


getWidget().suggestionPopup.updateStyleNames(uidl, getState());
getWidget().suggestionPopup.updateStyleNames(getState());


getWidget().allowNewItem = uidl.hasAttribute("allownewitem"); getWidget().allowNewItem = uidl.hasAttribute("allownewitem");
getWidget().lastNewItemString = null; getWidget().lastNewItemString = null;


for (final Iterator<?> i = options.getChildIterator(); i.hasNext();) { for (final Iterator<?> i = options.getChildIterator(); i.hasNext();) {
final UIDL optionUidl = (UIDL) i.next(); 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( final FilterSelectSuggestion suggestion = getWidget().new FilterSelectSuggestion(
optionUidl);
key, caption, style, untranslatedIconUri);
newSuggestions.add(suggestion); newSuggestions.add(suggestion);
} }



Loading…
Cancel
Save