Esri Geoportal Server
1.0

com.esri.gpt.framework.request
Class SortOption

java.lang.Object
  extended by com.esri.gpt.framework.request.SortOption
All Implemented Interfaces:
Serializable

public class SortOption
extends Object
implements Serializable

Defines the option for sorting results.

See Also:
Serialized Form

Nested Class Summary
static class SortOption.SortDirection
          An enumeration describing a the sort direction.
 
Constructor Summary
SortOption()
          Default constructor.
 
Method Summary
 String getColumnKey()
          Gets the column key for the sort.
 SortOption.SortDirection getDirection()
          Gets the sort direction.
 String getStyleClass(String columnKey)
          Gets the style class for a column key.
 SortOptionStyleMap getStyleMap()
          Gets the style map.
 void setColumnKey(String key)
          Sets the column key for the sort.
 void setColumnKey(String key, boolean toggleDirection, String defaultToggleDirection)
          Sets the column key for the sort with toggling options.
 void setDirection(SortOption.SortDirection direction)
          Sets the sort direction.
 void setDirection(String direction)
          Sets the sort direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortOption

public SortOption()
Default constructor.

Method Detail

getColumnKey

public String getColumnKey()
Gets the column key for the sort.

Returns:
the column key

setColumnKey

public void setColumnKey(String key)
Sets the column key for the sort.

Parameters:
key - the column key

setColumnKey

public void setColumnKey(String key,
                         boolean toggleDirection,
                         String defaultToggleDirection)
Sets the column key for the sort with toggling options.

Parameters:
key - the column key
toggleDirection - if true toggle the direction if the new column key matches the current column key
defaultToggleDirection - the direction to use when toggling if the new column key does not match the current column key

getDirection

public SortOption.SortDirection getDirection()
Gets the sort direction.

Returns:
the sort direction.

setDirection

public void setDirection(SortOption.SortDirection direction)
Sets the sort direction.

Parameters:
direction - the sort direction

setDirection

public void setDirection(String direction)
Sets the sort direction.

Parameters:
direction - the sort direction

getStyleMap

public SortOptionStyleMap getStyleMap()
Gets the style map.

Returns:
the style map

getStyleClass

public String getStyleClass(String columnKey)
Gets the style class for a column key.
"ascending" is returned if the sort direction is ascending and the supplied column key matches the active column key
"descending" is returned if the sort direction is descending and the supplied column key matches the active column key
"" is returned if the the supplied column key does not match the active column key

Parameters:
columnKey - the subject column key
Returns:
the style class for the column key

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.