com.sas.commands.dataselectors
Class SortCommand

com.sas.commands.dataselectors.SortCommand
All Implemented Interfaces:
CommandStatusInterface, CommandSupportedInterface, CancelInterface, ContentsChangedInterface, DataSelectorCommandInterface, DynamicAttributeCommandInterface, PendingCommandInterface, BaseEntityInterface, BaseEntityValueInterface, EntityKeyInterface, com.sas.lang.StringDataInterface, com.sas.PublicClonable, com.sas.util.Command, com.sas.util.SimpleCommand, java.lang.Cloneable, java.rmi.Remote

public class SortCommand
implements CommandSupportedInterface, CommandStatusInterface

This class handles the sorting of data items.

The command processes actions, via the Action Provider Framework, as they are initiated by the visual in response to user input. Actions include show, process, commit, and cancel. Each action causes a corresponding method on this command to be invoked.

The show action creates an instance of SortSelectorInterface to provide to the visual so that the Sort Selector can be displayed to the user.

The commit action is invoked when the user leaves the selector visual by pressing the OK button. Depending on the selected options, sorts are applied to the data model.

The cancel action is invoked when the user leaves the selector visual by pressing the Cancel button. There is no specific processing by this command for the cancel action.

The process action is not used by this command.

Since:
3.1.4

Field Summary
static java.lang.String SORT_SELECTOR_COMMAND_COMMITTED
          String added to the fired contentsChangesEvent to let the listener know the SortCommand was committed.
 
Fields inherited from class com.sas.commands.dataselectors.BaseSelectorCommand
actionClass, CANCEL_MODE, COMMIT_MODE, complete, contentsChanged, eventInfo, eventSource, modal, mode, model, PROCESS_MODE, selector, selectorModel, SHOW_MODE
 
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(java.lang.String name)
          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.
 
Method Summary
 void cancel()
          Cancels the command.
protected  void commit(java.lang.Object o)
           
 int getCommandStatus(ActionSupportFilter actionFilter)
          Returns a status value indicating whether the command is enabled for a specific area as described by various filter attributes.
 java.lang.String getSortByChoiceBox()
          Returns the value of the first item to sort by.
 java.lang.String getSortByRadioBox()
          Returns the direction of the first sort item.
 java.lang.String[] getThenByChoiceBox()
          Returns the values of the then by items to sort by.
 java.lang.String[] getThenByRadioBox()
          Returns the directions of the then by sort items.
 boolean isSupported(ActionSupportFilter actionFilter)
           Returns a boolean indicating whether the command is supported for the given area as specified by the current area information encapsulated in the ActionSupportFilter.
 void setSortByChoiceBox(java.lang.String value)
          Sets the value of the first item to sort by.
 void setSortByRadioBox(java.lang.String value)
          Sets the direction value of the first item to sort by.
 void setThenByChoiceBox(java.lang.String[] values)
          Sets the values of the then by items to sort by.
 void setThenByRadioBox(java.lang.String[] values)
          Sets the direction values of the then by items to sort by.
protected  void show(java.lang.Object o)
           
 
Methods inherited from class com.sas.commands.dataselectors.BaseSelectorCommand
cancel, closeSelector, execute, getEventInfo, getEventSource, getMode, getModel, getSelector, getSelectorModel, isComplete, isContentsChanged, isModal, process, setComplete, setModal, setMode, setModel, setSelector, setSelectorModel
 
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

SORT_SELECTOR_COMMAND_COMMITTED

public static final java.lang.String SORT_SELECTOR_COMMAND_COMMITTED
String added to the fired contentsChangesEvent to let the listener know the SortCommand was committed.

See Also:
Constant Field Values
Constructor Detail

SortCommand

public SortCommand()
Default Constructor.


SortCommand

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

Parameters:
name - The 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 command name.
actionClass - The action class type.
Method Detail

show

protected void show(java.lang.Object o)
Overrides:
show in class BaseSelectorCommand

commit

protected void commit(java.lang.Object o)
               throws java.io.IOException
Overrides:
commit in class BaseSelectorCommand
Throws:
java.io.IOException

getCommandStatus

public int getCommandStatus(ActionSupportFilter actionFilter)
Description copied from interface: CommandStatusInterface
Returns a status value indicating whether the command is enabled for a specific area as described by various filter attributes.

If enabled, the value is: CommandStatusInterface.ENABLED

If disabled, the value may be one of the following values which indicate why the command is disabled.

Specified by:
getCommandStatus in interface CommandStatusInterface
Parameters:
actionFilter - - the object that describes the current area.
Returns:
a indicating the status of the command.
See Also:
BaseAction.setReturnStatus(int)

cancel

public void cancel()
Description copied from interface: CancelInterface
Cancels the command.

Common things done in this method:

Specified by:
cancel in interface CancelInterface
Overrides:
cancel in class BaseSelectorCommand

isSupported

public boolean isSupported(ActionSupportFilter actionFilter)
Description copied from interface: CommandSupportedInterface

Returns a boolean indicating whether the command is supported for the given area as specified by the current area information encapsulated in the ActionSupportFilter.

Specified by:
isSupported in interface CommandSupportedInterface
Parameters:
actionFilter - The ActionSupportFilter that encapsulates all the necessary information to describe the current area.
Returns:
a boolean indicating whether the command is supported
See Also:
BaseAction.setReturnStatus(int)

setSortByChoiceBox

public void setSortByChoiceBox(java.lang.String value)
Sets the value of the first item to sort by.

Parameters:
value - The value that indicates the first item to sort by.

getSortByChoiceBox

public java.lang.String getSortByChoiceBox()
Returns the value of the first item to sort by.

Returns:
String The value that indicates the first item to sort by.

setSortByRadioBox

public void setSortByRadioBox(java.lang.String value)
Sets the direction value of the first item to sort by.

Parameters:
value - The direction to sort the first item.

getSortByRadioBox

public java.lang.String getSortByRadioBox()
Returns the direction of the first sort item.

Returns:
String The direction of the first sort item.

setThenByChoiceBox

public void setThenByChoiceBox(java.lang.String[] values)
Sets the values of the then by items to sort by.

Parameters:
values - The values that indicates the then by items to sort by.

getThenByChoiceBox

public java.lang.String[] getThenByChoiceBox()
Returns the values of the then by items to sort by.

Returns:
String[] The values that indicate the then by items to sort by.

setThenByRadioBox

public void setThenByRadioBox(java.lang.String[] values)
Sets the direction values of the then by items to sort by.

Parameters:
values - The directions to sort the then by items.

getThenByRadioBox

public java.lang.String[] getThenByRadioBox()
Returns the directions of the then by sort items.

Returns:
String[] The directions of the then by sort items.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.