diff options
author | Henri Sara <hesara@vaadin.com> | 2015-11-05 11:16:55 +0200 |
---|---|---|
committer | Henri Sara <hesara@vaadin.com> | 2016-01-15 14:42:56 +0200 |
commit | 675684c2c28a138b22f39f1cb17a69640c22bfdc (patch) | |
tree | d9d759b860f0ae68224cc436dba5866d134e1947 | |
parent | b214cb8ca3fe07515483f986169c51f127bf66be (diff) | |
download | vaadin-framework-675684c2c28a138b22f39f1cb17a69640c22bfdc.tar.gz vaadin-framework-675684c2c28a138b22f39f1cb17a69640c22bfdc.zip |
Create ComboBoxServerRpc stub (#19229)
Create an empty client to server RPC implementation for ComboBox.
Change-Id: I348208fefb267765814383559e55866bc0933e4b
3 files changed, 46 insertions, 6 deletions
diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java index 961fc3cec1..4dbaf6e004 100644 --- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -25,12 +25,14 @@ import com.vaadin.client.ApplicationConnection; import com.vaadin.client.Paintable; import com.vaadin.client.Profiler; import com.vaadin.client.UIDL; +import com.vaadin.client.communication.RpcProxy; import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractFieldConnector; import com.vaadin.client.ui.SimpleManagedLayout; import com.vaadin.client.ui.VFilterSelect; import com.vaadin.client.ui.VFilterSelect.FilterSelectSuggestion; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.combobox.ComboBoxServerRpc; import com.vaadin.shared.ui.combobox.ComboBoxState; import com.vaadin.shared.ui.combobox.FilteringMode; import com.vaadin.ui.ComboBox; @@ -39,6 +41,9 @@ import com.vaadin.ui.ComboBox; public class ComboBoxConnector extends AbstractFieldConnector implements Paintable, SimpleManagedLayout { + protected ComboBoxServerRpc rpc = RpcProxy.create(ComboBoxServerRpc.class, + this); + // oldSuggestionTextMatchTheOldSelection is used to detect when it's safe to // update textbox text by a changed item caption. private boolean oldSuggestionTextMatchTheOldSelection; diff --git a/server/src/com/vaadin/ui/ComboBox.java b/server/src/com/vaadin/ui/ComboBox.java index ee52f2fe77..c66aee0b34 100644 --- a/server/src/com/vaadin/ui/ComboBox.java +++ b/server/src/com/vaadin/ui/ComboBox.java @@ -34,6 +34,7 @@ import com.vaadin.event.FieldEvents.FocusListener; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; import com.vaadin.server.Resource; +import com.vaadin.shared.ui.combobox.ComboBoxServerRpc; import com.vaadin.shared.ui.combobox.ComboBoxState; import com.vaadin.shared.ui.combobox.FilteringMode; @@ -74,6 +75,10 @@ public class ComboBox extends AbstractSelect implements public String getStyle(ComboBox source, Object itemId); } + private ComboBoxServerRpc rpc = new ComboBoxServerRpc() { + + }; + /** * Holds value of property pageLength. 0 disables paging. */ @@ -121,28 +126,31 @@ public class ComboBox extends AbstractSelect implements private ItemStyleGenerator itemStyleGenerator = null; public ComboBox() { - initDefaults(); + init(); } public ComboBox(String caption, Collection<?> options) { super(caption, options); - initDefaults(); + init(); } public ComboBox(String caption, Container dataSource) { super(caption, dataSource); - initDefaults(); + init(); } public ComboBox(String caption) { super(caption); - initDefaults(); + init(); } /** - * Initialize the ComboBox with default settings + * Initialize the ComboBox with default settings and register client to + * server RPC implementation. */ - private void initDefaults() { + private void init() { + registerRpc(rpc); + setNewItemsAllowed(false); setImmediate(true); } diff --git a/shared/src/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java b/shared/src/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java new file mode 100644 index 0000000000..d140e7da6e --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java @@ -0,0 +1,27 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.shared.ui.combobox; + +import com.vaadin.shared.communication.ServerRpc; + +/** + * Client to server RPC interface for ComboBox. + * + * @since + */ +public interface ComboBoxServerRpc extends ServerRpc { + +} |