Create an empty client to server RPC implementation for ComboBox. Change-Id: I348208fefb267765814383559e55866bc0933e4bfeature/combobox-communication
@@ -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; |
@@ -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); | |||
} |
@@ -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 { | |||
} |