|
|
@@ -67,9 +67,7 @@ import com.google.gwt.user.client.ui.TextBox; |
|
|
|
import com.google.gwt.user.client.ui.Widget; |
|
|
|
import com.vaadin.client.ApplicationConnection; |
|
|
|
import com.vaadin.client.BrowserInfo; |
|
|
|
import com.vaadin.client.ComponentConnector; |
|
|
|
import com.vaadin.client.ComputedStyle; |
|
|
|
import com.vaadin.client.ConnectorMap; |
|
|
|
import com.vaadin.client.DeferredWorker; |
|
|
|
import com.vaadin.client.Focusable; |
|
|
|
import com.vaadin.client.UIDL; |
|
|
@@ -79,6 +77,7 @@ import com.vaadin.client.ui.aria.AriaHelper; |
|
|
|
import com.vaadin.client.ui.aria.HandlesAriaCaption; |
|
|
|
import com.vaadin.client.ui.aria.HandlesAriaInvalid; |
|
|
|
import com.vaadin.client.ui.aria.HandlesAriaRequired; |
|
|
|
import com.vaadin.client.ui.combobox.ComboBoxConnector; |
|
|
|
import com.vaadin.client.ui.menubar.MenuBar; |
|
|
|
import com.vaadin.client.ui.menubar.MenuItem; |
|
|
|
import com.vaadin.shared.AbstractComponentState; |
|
|
@@ -133,6 +132,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
@Override |
|
|
|
public String getDisplayString() { |
|
|
|
final StringBuffer sb = new StringBuffer(); |
|
|
|
ApplicationConnection client = connector.getConnection(); |
|
|
|
final Icon icon = client.getIcon(client |
|
|
|
.translateVaadinUri(untranslatedIconUri)); |
|
|
|
if (icon != null) { |
|
|
@@ -174,6 +174,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public String getIconUri() { |
|
|
|
ApplicationConnection client = connector.getConnection(); |
|
|
|
return client.translateVaadinUri(untranslatedIconUri); |
|
|
|
} |
|
|
|
|
|
|
@@ -1143,10 +1144,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
} |
|
|
|
// null is not visible on pages != 0, and not visible when |
|
|
|
// filtering: handle separately |
|
|
|
client.updateVariable(paintableId, "filter", "", false); |
|
|
|
client.updateVariable(paintableId, "page", 0, false); |
|
|
|
client.updateVariable(paintableId, "selected", new String[] {}, |
|
|
|
immediate); |
|
|
|
connector.requestFirstPage(); |
|
|
|
afterUpdateClientVariables(); |
|
|
|
|
|
|
|
suggestionPopup.hide(); |
|
|
@@ -1195,8 +1193,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
* Store last sent new item string to avoid double sends |
|
|
|
*/ |
|
|
|
lastNewItemString = enteredItemValue; |
|
|
|
client.updateVariable(paintableId, "newitem", |
|
|
|
enteredItemValue, immediate); |
|
|
|
connector.sendNewItem(enteredItemValue); |
|
|
|
afterUpdateClientVariables(); |
|
|
|
} |
|
|
|
} else if (item != null |
|
|
@@ -1454,7 +1451,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
private IconWidget selectedItemIcon; |
|
|
|
|
|
|
|
/** For internal use only. May be removed or replaced in the future. */ |
|
|
|
public ApplicationConnection client; |
|
|
|
public ComboBoxConnector connector; |
|
|
|
|
|
|
|
/** For internal use only. May be removed or replaced in the future. */ |
|
|
|
public String paintableId; |
|
|
@@ -1470,9 +1467,6 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
*/ |
|
|
|
public final List<FilterSelectSuggestion> currentSuggestions = new ArrayList<FilterSelectSuggestion>(); |
|
|
|
|
|
|
|
/** For internal use only. May be removed or replaced in the future. */ |
|
|
|
public boolean immediate; |
|
|
|
|
|
|
|
/** For internal use only. May be removed or replaced in the future. */ |
|
|
|
public String selectedOptionKey; |
|
|
|
|
|
|
@@ -1743,8 +1737,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
} |
|
|
|
|
|
|
|
waitingForFilteringResponse = true; |
|
|
|
client.updateVariable(paintableId, "filter", filter, false); |
|
|
|
client.updateVariable(paintableId, "page", page, immediate); |
|
|
|
connector.requestPage(filter, page); |
|
|
|
afterUpdateClientVariables(); |
|
|
|
|
|
|
|
lastFilter = filter; |
|
|
@@ -1865,8 +1858,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
|
|
|
|
if (!(newKey.equals(selectedOptionKey) || ("".equals(newKey) && selectedOptionKey == null))) { |
|
|
|
selectedOptionKey = newKey; |
|
|
|
client.updateVariable(paintableId, "selected", |
|
|
|
new String[] { selectedOptionKey }, immediate); |
|
|
|
connector.sendSelection(new String[] { selectedOptionKey }); |
|
|
|
afterUpdateClientVariables(); |
|
|
|
|
|
|
|
// currentPage = -1; // forget the page |
|
|
@@ -1878,8 +1870,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
// hard to interpret that new clause added here :-( |
|
|
|
selectedOptionKey = newKey; |
|
|
|
explicitSelectedCaption = null; |
|
|
|
client.updateVariable(paintableId, "selected", |
|
|
|
new String[] { selectedOptionKey }, immediate); |
|
|
|
connector.sendSelection(new String[] { selectedOptionKey }); |
|
|
|
afterUpdateClientVariables(); |
|
|
|
} |
|
|
|
|
|
|
@@ -1905,7 +1896,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
if (selectedItemIcon != null) { |
|
|
|
panel.remove(selectedItemIcon); |
|
|
|
} |
|
|
|
selectedItemIcon = new IconWidget(client.getIcon(iconUri)); |
|
|
|
selectedItemIcon = new IconWidget(connector.getConnection() |
|
|
|
.getIcon(iconUri)); |
|
|
|
// Older IE versions don't scale icon correctly if DOM |
|
|
|
// contains height and width attributes. |
|
|
|
selectedItemIcon.getElement().removeAttribute("height"); |
|
|
@@ -2225,6 +2217,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
// If a focus event is not going to be sent, send the options |
|
|
|
// request immediately; otherwise queue in the same burst as the |
|
|
|
// focus event. Fixes #8321. |
|
|
|
ApplicationConnection client = connector.getConnection(); |
|
|
|
boolean immediate = focused |
|
|
|
|| !client.hasEventListeners(this, EventId.FOCUS); |
|
|
|
filterOptions(-1, "", immediate); |
|
|
@@ -2321,13 +2314,12 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
} |
|
|
|
addStyleDependentName("focus"); |
|
|
|
|
|
|
|
ApplicationConnection client = connector.getConnection(); |
|
|
|
if (client.hasEventListeners(this, EventId.FOCUS)) { |
|
|
|
client.updateVariable(paintableId, EventId.FOCUS, "", true); |
|
|
|
afterUpdateClientVariables(); |
|
|
|
} |
|
|
|
|
|
|
|
ComponentConnector connector = ConnectorMap.get(client).getConnector( |
|
|
|
this); |
|
|
|
client.getVTooltip().showAssistive( |
|
|
|
connector.getTooltipInfo(getElement())); |
|
|
|
} |
|
|
@@ -2391,6 +2383,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
} |
|
|
|
removeStyleDependentName("focus"); |
|
|
|
|
|
|
|
ApplicationConnection client = connector.getConnection(); |
|
|
|
if (client.hasEventListeners(this, EventId.BLUR)) { |
|
|
|
client.updateVariable(paintableId, EventId.BLUR, "", true); |
|
|
|
afterUpdateClientVariables(); |
|
|
@@ -2420,10 +2413,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, |
|
|
|
* For internal use only. May be removed or replaced in the future. |
|
|
|
*/ |
|
|
|
public void updateRootWidth() { |
|
|
|
ComponentConnector paintable = ConnectorMap.get(client).getConnector( |
|
|
|
this); |
|
|
|
|
|
|
|
if (paintable.isUndefinedWidth()) { |
|
|
|
if (connector.isUndefinedWidth()) { |
|
|
|
|
|
|
|
/* |
|
|
|
* When the select has a undefined with we need to check that we are |