2 * Copyright 2000-2021 Vaadin Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
16 package com.vaadin.v7.client.widget.grid.selection;
18 import com.vaadin.client.data.DataSource.RowHandle;
21 * An abstract class that adds a consistent API for common methods that's needed
22 * by Vaadin's server-based selection models to work.
24 * <em>Note:</em> This should be an interface instead of an abstract class, if
25 * only we could define protected methods in an interface.
32 public abstract class AbstractRowHandleSelectionModel<T>
33 implements SelectionModel<T> {
35 * Select a row, based on its
36 * {@link com.vaadin.client.data.DataSource.RowHandle RowHandle}.
38 * <em>Note:</em> this method may not fire selection change events.
41 * the handle to select by
42 * @return <code>true</code> if the selection state was changed by this
44 * @throws UnsupportedOperationException
45 * if the selection model does not support either handles or
48 protected abstract boolean selectByHandle(RowHandle<T> handle);
51 * Deselect a row, based on its
52 * {@link com.vaadin.client.data.DataSource.RowHandle RowHandle}.
54 * <em>Note:</em> this method may not fire selection change events.
57 * the handle to deselect by
58 * @return <code>true</code> if the selection state was changed by this
60 * @throws UnsupportedOperationException
61 * if the selection model does not support either handles or
64 protected abstract boolean deselectByHandle(RowHandle<T> handle)
65 throws UnsupportedOperationException;