summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2016-09-08 21:28:07 +0300
committerVaadin Code Review <review@vaadin.com>2016-09-12 08:49:01 +0000
commitcef3e1ca64302cfa40e7eb3e287cd65785662d1c (patch)
tree14dea0d395f17c3b690f3a024a4d253badd4c5b9 /client
parent712f8ad610ad3854d6a5f52f3c5e7725ebee1785 (diff)
downloadvaadin-framework-cef3e1ca64302cfa40e7eb3e287cd65785662d1c.tar.gz
vaadin-framework-cef3e1ca64302cfa40e7eb3e287cd65785662d1c.zip
Remove unused SingleSelection
Change-Id: I33afc94a581d77984f459b0cbd0ff7fe49df8e79
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/connectors/selection/SingleSelectionConnector.java92
1 files changed, 0 insertions, 92 deletions
diff --git a/client/src/main/java/com/vaadin/client/connectors/selection/SingleSelectionConnector.java b/client/src/main/java/com/vaadin/client/connectors/selection/SingleSelectionConnector.java
deleted file mode 100644
index 875a70412c..0000000000
--- a/client/src/main/java/com/vaadin/client/connectors/selection/SingleSelectionConnector.java
+++ /dev/null
@@ -1,92 +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.client.connectors.selection;
-
-import java.util.Optional;
-
-import com.vaadin.client.ServerConnector;
-import com.vaadin.client.connectors.AbstractListingConnector;
-import com.vaadin.shared.data.selection.SelectionModel;
-import com.vaadin.shared.data.selection.SelectionServerRpc;
-import com.vaadin.shared.ui.Connect;
-
-import elemental.json.JsonObject;
-
-/**
- * A connector for single selection extensions.
- *
- * @author Vaadin Ltd.
- */
-@Connect(com.vaadin.data.selection.SingleSelection.class)
-public class SingleSelectionConnector extends
- AbstractSelectionConnector<SelectionModel.Single<JsonObject>> {
-
- private static class SingleSelection
- implements SelectionModel.Single<JsonObject> {
-
- private SelectionServerRpc rpc;
-
- SingleSelection(SelectionServerRpc rpc) {
- this.rpc = rpc;
- }
-
- @Override
- public void select(JsonObject item) {
- if (!isSelected(item)) {
- rpc.select(getKey(item));
- }
- }
-
- @Override
- public void deselect(JsonObject item) {
- if (isSelected(item)) {
- rpc.deselect(getKey(item));
- }
- }
-
- @Override
- public boolean isSelected(JsonObject item) {
- return isItemSelected(item);
- }
-
- @Override
- public Optional<JsonObject> getSelectedItem() {
- throw new UnsupportedOperationException(
- "A client-side selection model does not know the full selection");
- }
- }
-
- private AbstractListingConnector<?> parent;
-
- @Override
- public void onUnregister() {
- super.onUnregister();
- if (parent.getSelectionModel() == getSelectionModel()) {
- parent.setSelectionModel(null);
- }
- }
-
- @Override
- protected void extend(ServerConnector target) {
- super.extend(target);
- parent = getParent();
- }
-
- @Override
- protected SingleSelection createSelectionModel() {
- return new SingleSelection(getRpcProxy(SelectionServerRpc.class));
- }
-}