1 18 package org.apache.beehive.netui.databinding.datagrid.runtime.config; 19 20 import org.apache.beehive.netui.databinding.datagrid.api.sort.SortDirection; 21 import org.apache.beehive.netui.databinding.datagrid.api.sort.SortStrategy; 22 import org.apache.beehive.netui.util.Bundle; 23 24 31 class DefaultSortStrategy 32 extends SortStrategy { 33 34 37 DefaultSortStrategy() { 38 } 39 40 44 public SortDirection getDefaultDirection() { 45 return SortDirection.ASCENDING; 46 } 47 48 59 public SortDirection nextDirection(SortDirection direction) { 60 if(direction == SortDirection.NONE) 61 return SortDirection.ASCENDING; 62 else if(direction == SortDirection.ASCENDING) 63 return SortDirection.DESCENDING; 64 else if(direction == SortDirection.DESCENDING) 65 return SortDirection.NONE; 66 else throw new IllegalStateException (Bundle.getErrorString("SortStrategy_InvalidSortDirection", new Object []{direction})); 67 } 68 } 69 | Popular Tags |