From 600d5b436d7ca33840b1b697082d140a5040bdf3 Mon Sep 17 00:00:00 2001 From: Patrik Lindström Date: Mon, 25 Aug 2014 14:44:12 +0300 Subject: Add keyboard sorting controls (#13334) Change-Id: Icb0ef5d70b5469cd87bdd079fe16f31b8cf769f1 --- .../com/vaadin/shared/ui/grid/SortDirection.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'shared') diff --git a/shared/src/com/vaadin/shared/ui/grid/SortDirection.java b/shared/src/com/vaadin/shared/ui/grid/SortDirection.java index 0b4eafc37f..9aed268d01 100644 --- a/shared/src/com/vaadin/shared/ui/grid/SortDirection.java +++ b/shared/src/com/vaadin/shared/ui/grid/SortDirection.java @@ -28,10 +28,27 @@ public enum SortDirection implements Serializable { /** * Ascending (e.g. A-Z, 1..9) sort order */ - ASCENDING, + ASCENDING { + @Override + public SortDirection getOpposite() { + return DESCENDING; + } + }, /** * Descending (e.g. Z-A, 9..1) sort order */ - DESCENDING + 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