com.sas.commands.relational
Class SortCommand

com.sas.commands.relational.SortCommand
All Implemented Interfaces:
CommandStatusInterface, CommandSupportedInterface, DynamicAttributeCommandInterface, BaseEntityInterface, BaseEntityValueInterface, EntityKeyInterface, com.sas.lang.StringDataInterface, com.sas.PublicClonable, com.sas.util.Command, com.sas.util.SimpleCommand, com.sas.util.SortDirectionInterface, java.lang.Cloneable, java.rmi.Remote
Direct Known Subclasses:
SortFoldersFirstCommand, SortFoldersFirstCommand

public class SortCommand
implements CommandSupportedInterface, com.sas.util.SortDirectionInterface, CommandStatusInterface

The abstract class for sorting commands.


Field Summary
static java.lang.String RB_KEY
           
 
Fields inherited from interface com.sas.util.SortDirectionInterface
ASCENDING, DESCENDING, NOT_SORTED
 
Fields inherited from interface com.sas.actionprovider.CommandStatusInterface
DISABLED, ENABLED, IS_CURRENT_STATE_DISABLED, MODEL_MEMBER_DISABLED, MODEL_STATE_DISABLED, MODEL_TYPE_DISABLED
 
Fields inherited from interface com.sas.commands.DynamicAttributeCommandInterface
COMMAND_NAME_PREFIX
 
Constructor Summary
SortCommand()
          Default constructor
SortCommand(int direction)
          Default constructor
SortCommand(java.lang.String name)
          Constructor that accepts a command name
SortCommand(java.lang.String name, int direction)
          Constructor that accepts a command name
SortCommand(java.lang.String name, int direction, boolean multipleColumnSorting)
          Constructor that accepts a command name
SortCommand(java.lang.String name, int direction, int maxSortableColumns)
          Constructor that accepts a command name
SortCommand(java.lang.String name, int direction, int maxSortableColumns, boolean multipleColumnSorting)
          Constructor that accepts a command name
SortCommand(java.lang.String name, java.lang.String actionClass)
          Constructor that accepts a command name and an action class type
SortCommand(java.lang.String name, java.lang.String actionClass, int direction, int maxSortableColumns, boolean multipleColumnSorting)
          Constructor that accepts a command name and an action class type
 
Method Summary
 void execute(java.lang.Object o)
          This method implements the execute method on the CommandInterface, which is not implemented by the abstract BaseSortCommand class
 int getColumn()
           
 int getCommandStatus(ActionSupportFilter filter)
          Returns a int value indicating whether the command is enabled for the given area as specified by the current area information encapsulate in the ActionSupportFilter.
 int getDirection()
           
 int getMaxSortableColumns()
           
 com.sas.table.SortableInterface getModel()
           
protected  boolean isColumnSortable(int column, com.sas.table.SortableInterface model)
          Determines if the given column is allowed to be sorted.
protected  boolean isColumnSorted(int column, int direction, com.sas.table.SortableInterface model)
          Determines if the given column is allowed to be sorted.
protected  boolean isColumnSorted(int column, com.sas.table.SortableInterface model)
          Determines if the given column is allowed to be sorted.
 boolean isDisabledIfCurrentState()
           
 boolean isMultipleColumnSortingEnabled()
           
 boolean isSupported(ActionSupportFilter actionFilter)
          Returns a boolean indicating whether the command is supported for the area specified on the ActionSupportFilter argument.
 void setColumn(int column)
           
 void setDirection(int direction)
           
 void setDisabledIfCurrentState(boolean disabledIfCurrentState)
           
 void setMaxSortableColumns(int maxSortableColumns)
           
 void setModel(com.sas.table.SortableInterface model)
           
 void setMultipleColumnSortingEnabled(boolean mulitpleColumnSorting)
           
 
Methods inherited from class com.sas.commands.BaseCommand
getLocale, getName, getNextCommandName, getText, isExecutable, isUndoable, setLocale, setName, setText, undo
 
Methods inherited from class com.sas.entities.BaseEntity
clone, containsAttributeNamed, equals, equals, getAttribute, getAttribute, getAttributeCount, getAttributes, getEntityKey, getPropertyDescriptors, getStringAttribute, listAttributeNames, removeAllAttributes, removeAttribute, reset, sameEntity, setAttribute, setAttributes, setEntityKey, toString
 
Methods inherited from interface com.sas.entities.BaseEntityValueInterface
getAttribute, setAttribute
 
Methods inherited from interface com.sas.util.Command
clone
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values
Constructor Detail

SortCommand

public SortCommand()
Default constructor


SortCommand

public SortCommand(int direction)
Default constructor


SortCommand

public SortCommand(java.lang.String name)
Constructor that accepts a command name


SortCommand

public SortCommand(java.lang.String name,
                   int direction)
Constructor that accepts a command name


SortCommand

public SortCommand(java.lang.String name,
                   int direction,
                   int maxSortableColumns)
Constructor that accepts a command name


SortCommand

public SortCommand(java.lang.String name,
                   int direction,
                   boolean multipleColumnSorting)
Constructor that accepts a command name


SortCommand

public SortCommand(java.lang.String name,
                   int direction,
                   int maxSortableColumns,
                   boolean multipleColumnSorting)
Constructor that accepts a command name


SortCommand

public SortCommand(java.lang.String name,
                   java.lang.String actionClass)
Constructor that accepts a command name and an action class type

Parameters:
name - the name of this command
actionClass - the name of the action class for this command

SortCommand

public SortCommand(java.lang.String name,
                   java.lang.String actionClass,
                   int direction,
                   int maxSortableColumns,
                   boolean multipleColumnSorting)
Constructor that accepts a command name and an action class type

Parameters:
name - the name of this command
actionClass - the name of the action class for this command
Method Detail

setModel

public void setModel(com.sas.table.SortableInterface model)

getModel

public com.sas.table.SortableInterface getModel()

setColumn

public void setColumn(int column)

getColumn

public int getColumn()

setDirection

public void setDirection(int direction)

getDirection

public int getDirection()

setMaxSortableColumns

public void setMaxSortableColumns(int maxSortableColumns)

getMaxSortableColumns

public int getMaxSortableColumns()

setMultipleColumnSortingEnabled

public void setMultipleColumnSortingEnabled(boolean mulitpleColumnSorting)

isMultipleColumnSortingEnabled

public boolean isMultipleColumnSortingEnabled()

setDisabledIfCurrentState

public void setDisabledIfCurrentState(boolean disabledIfCurrentState)

isDisabledIfCurrentState

public boolean isDisabledIfCurrentState()

execute

public void execute(java.lang.Object o)
This method implements the execute method on the CommandInterface, which is not implemented by the abstract BaseSortCommand class

Specified by:
execute in interface com.sas.util.SimpleCommand
Specified by:
execute in class BaseCommand
Parameters:
o - The output stream to which the results of this command should be written.

isSupported

public boolean isSupported(ActionSupportFilter actionFilter)
Returns a boolean indicating whether the command is supported for the area specified on the ActionSupportFilter argument.

Specified by:
isSupported in interface CommandSupportedInterface
Parameters:
actionFilter - The object that describes the current area.
Returns:
a boolean indicating whether the command is supported.
See Also:
BaseAction.setReturnStatus(int)

isColumnSortable

protected boolean isColumnSortable(int column,
                                   com.sas.table.SortableInterface model)
Determines if the given column is allowed to be sorted.

Returns:
true if the given column is allowed to be sorted.

isColumnSorted

protected boolean isColumnSorted(int column,
                                 int direction,
                                 com.sas.table.SortableInterface model)
Determines if the given column is allowed to be sorted.

Returns:
true if the given column is allowed to be sorted.

isColumnSorted

protected boolean isColumnSorted(int column,
                                 com.sas.table.SortableInterface model)
Determines if the given column is allowed to be sorted.

Returns:
true if the given column is allowed to be sorted.

getCommandStatus

public int getCommandStatus(ActionSupportFilter filter)
Returns a int value indicating whether the command is enabled for the given area as specified by the current area information encapsulate in the ActionSupportFilter. If not enabled, the key indicates a reason why the command is not enabled.

Specified by:
getCommandStatus in interface CommandStatusInterface
Parameters:
filter - The ActionSupportFilter that encapsulates all the necessary information to describe the current area.
Returns:
an int value indicating whether the command is enabled and, if not, why.
See Also:
BaseAction.setReturnStatus(int)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.