From 4aac5294bba6eff216cddaa826b7739494376ff7 Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Tue, 13 Sep 2016 13:29:00 +0300 Subject: Use state for ComboBox selection Change-Id: I612376b4030a750c987ba2d8016a4dc44bc02d41 --- .../shared/ui/combobox/ComboBoxClientRpc.java | 36 ---------------------- .../shared/ui/combobox/ComboBoxServerRpc.java | 8 ----- .../vaadin/shared/ui/combobox/ComboBoxState.java | 6 ++++ 3 files changed, 6 insertions(+), 44 deletions(-) delete mode 100644 shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxClientRpc.java (limited to 'shared') diff --git a/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxClientRpc.java b/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxClientRpc.java deleted file mode 100644 index 1e8273c05e..0000000000 --- a/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxClientRpc.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2000-2016 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.ClientRpc; - -/** - * Server to client RPC interface for ComboBox. - * - * @since - */ -public interface ComboBoxClientRpc extends ClientRpc { - /** - * Set the current selection. - * - * @param selectedKey - * the id of a single item or null to deselect the current value - * @param selectedCaption - * the caption of the selected item (used in case selection is - * outside the lazy loaded range) - */ - public void setSelectedItem(String selectedKey, String selectedCaption); -} diff --git a/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java b/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java index 9d6ba6d8a4..16b33b2cd4 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxServerRpc.java @@ -32,14 +32,6 @@ public interface ComboBoxServerRpc extends ServerRpc { */ public void createNewItem(String itemValue); - /** - * Set the current selection. - * - * @param item - * the id of a single item or null to deselect the current value - */ - public void setSelectedItem(String item); - /** * Sets the filter to use. * diff --git a/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxState.java b/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxState.java index e68d606e67..feb77722b7 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxState.java +++ b/shared/src/main/java/com/vaadin/shared/ui/combobox/ComboBoxState.java @@ -82,4 +82,10 @@ public class ComboBoxState extends AbstractSingleSelectState { */ public boolean scrollToSelectedItem = false; + /** + * The caption of the currently selected item or {@code null} if no item is + * selected. + */ + public String selectedItemCaption; + } -- cgit v1.2.3