From b08392ecae421e6778cac9671908768e6495c759 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 17 Dec 2014 10:37:10 +0200 Subject: Move SortDirection from grid package to data package (#13334) Change-Id: Id8fecbee0171b783a62d747433667267f530a6a7 --- .../com/vaadin/shared/data/sort/SortDirection.java | 54 ++++++++++++++++++++++ .../com/vaadin/shared/ui/grid/GridServerRpc.java | 1 + .../src/com/vaadin/shared/ui/grid/GridState.java | 1 + .../com/vaadin/shared/ui/grid/SortDirection.java | 54 ---------------------- 4 files changed, 56 insertions(+), 54 deletions(-) create mode 100644 shared/src/com/vaadin/shared/data/sort/SortDirection.java delete mode 100644 shared/src/com/vaadin/shared/ui/grid/SortDirection.java (limited to 'shared') diff --git a/shared/src/com/vaadin/shared/data/sort/SortDirection.java b/shared/src/com/vaadin/shared/data/sort/SortDirection.java new file mode 100644 index 0000000000..043b363226 --- /dev/null +++ b/shared/src/com/vaadin/shared/data/sort/SortDirection.java @@ -0,0 +1,54 @@ +/* + * 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.data.sort; + +import java.io.Serializable; + +/** + * Describes sorting direction. + * + * @since + * @author Vaadin Ltd + */ +public enum SortDirection implements Serializable { + + /** + * Ascending (e.g. A-Z, 1..9) sort order + */ + ASCENDING { + @Override + public SortDirection getOpposite() { + return DESCENDING; + } + }, + + /** + * Descending (e.g. Z-A, 9..1) sort order + */ + DESCENDING { + @Override + public SortDirection getOpposite() { + return ASCENDING; + } + }; + + /** + * Get the sort direction that is the direct opposite to this one. + * + * @return a sort direction value + */ + public abstract SortDirection getOpposite(); +} diff --git a/shared/src/com/vaadin/shared/ui/grid/GridServerRpc.java b/shared/src/com/vaadin/shared/ui/grid/GridServerRpc.java index 28149010be..141b1ed9ca 100644 --- a/shared/src/com/vaadin/shared/ui/grid/GridServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/grid/GridServerRpc.java @@ -18,6 +18,7 @@ package com.vaadin.shared.ui.grid; import java.util.List; import com.vaadin.shared.communication.ServerRpc; +import com.vaadin.shared.data.sort.SortDirection; /** * Client-to-server RPC interface for the Grid component diff --git a/shared/src/com/vaadin/shared/ui/grid/GridState.java b/shared/src/com/vaadin/shared/ui/grid/GridState.java index f26b5cb344..4cf834c4f0 100644 --- a/shared/src/com/vaadin/shared/ui/grid/GridState.java +++ b/shared/src/com/vaadin/shared/ui/grid/GridState.java @@ -21,6 +21,7 @@ import java.util.List; import com.vaadin.shared.AbstractComponentState; import com.vaadin.shared.annotations.DelegateToWidget; +import com.vaadin.shared.data.sort.SortDirection; /** * The shared state for the {@link com.vaadin.ui.components.grid.Grid} component diff --git a/shared/src/com/vaadin/shared/ui/grid/SortDirection.java b/shared/src/com/vaadin/shared/ui/grid/SortDirection.java deleted file mode 100644 index 9aed268d01..0000000000 --- a/shared/src/com/vaadin/shared/ui/grid/SortDirection.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.grid; - -import java.io.Serializable; - -/** - * Describes sorting direction for a Grid column - * - * @since - * @author Vaadin Ltd - */ -public enum SortDirection implements Serializable { - - /** - * Ascending (e.g. A-Z, 1..9) sort order - */ - ASCENDING { - @Override - public SortDirection getOpposite() { - return DESCENDING; - } - }, - - /** - * Descending (e.g. Z-A, 9..1) sort order - */ - DESCENDING { - @Override - public SortDirection getOpposite() { - return ASCENDING; - } - }; - - /** - * Get the sort direction that is the direct opposite to this one. - * - * @return a sort direction value - */ - public abstract SortDirection getOpposite(); -} -- cgit v1.2.3