diff options
author | Patrik Lindström <patrik@vaadin.com> | 2014-08-25 14:44:12 +0300 |
---|---|---|
committer | Patrik Lindström <patrik@vaadin.com> | 2014-09-02 16:22:04 +0300 |
commit | 600d5b436d7ca33840b1b697082d140a5040bdf3 (patch) | |
tree | ea4c25ef2c9d6af4c3cd7b0b4bcc976cf8baa659 /shared | |
parent | 95f9cdf4e0d4f5d4a2991468bbb1b77bbb1e3ae3 (diff) | |
download | vaadin-framework-600d5b436d7ca33840b1b697082d140a5040bdf3.tar.gz vaadin-framework-600d5b436d7ca33840b1b697082d140a5040bdf3.zip |
Add keyboard sorting controls (#13334)
Change-Id: Icb0ef5d70b5469cd87bdd079fe16f31b8cf769f1
Diffstat (limited to 'shared')
-rw-r--r-- | shared/src/com/vaadin/shared/ui/grid/SortDirection.java | 21 |
1 files changed, 19 insertions, 2 deletions
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(); } |