com.sas.util
Class MenuSeparatorCommand

com.sas.util.MenuSeparatorCommand
All Implemented Interfaces:
com.sas.lang.StringDataInterface, com.sas.PublicClonable, com.sas.util.Command, CommandsInterface, MenuCommand, com.sas.util.SimpleCommand, java.lang.Cloneable

public final class MenuSeparatorCommand
implements MenuCommand

Provides a command to serve as a separator in a list of commands.

Since separators are just place-holders without any state of their own, i.e one separator is exactly the same as another, this class is implemented using the Singleton Design Pattern. This means that there will be at most one instance of this class created, and that access to the instance must be through a special method called instance() rather than through the standard constructor.


Method Summary
 java.lang.Object clone()
          Returns super.clone().
 void execute(java.lang.Object arg)
          Does nothing.
 com.sas.util.Command[] getCommands()
          Returns a zero-length array.
 java.lang.String getText()
          Returns the empty string.
static MenuSeparatorCommand instance()
          Returns an instance of this class.
 boolean isExecutable()
          Returns false.
 boolean isSeparator()
          Returns true.
 boolean isUndoable()
          Returns false.
 void setText(java.lang.String newValue)
          Does nothing.
 void undo()
          Does nothing.
 

Method Detail

instance

public static MenuSeparatorCommand instance()
Returns an instance of this class.


isSeparator

public boolean isSeparator()
Returns true.

Specified by:
isSeparator in interface MenuCommand
Returns:
true if the command is a separator, false otherwise

isExecutable

public boolean isExecutable()
Returns false.

Specified by:
isExecutable in interface com.sas.util.Command

isUndoable

public boolean isUndoable()
Returns false.

Specified by:
isUndoable in interface com.sas.util.Command

undo

public void undo()
Does nothing.

Specified by:
undo in interface com.sas.util.Command

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns super.clone().

Specified by:
clone in interface com.sas.PublicClonable
Specified by:
clone in interface com.sas.util.Command
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException - Propagated from super.clone().

getCommands

public com.sas.util.Command[] getCommands()
Returns a zero-length array.

Specified by:
getCommands in interface CommandsInterface
Returns:
An array of commands.

execute

public void execute(java.lang.Object arg)
Does nothing.

Specified by:
execute in interface com.sas.util.SimpleCommand

getText

public java.lang.String getText()
Returns the empty string.

Specified by:
getText in interface com.sas.lang.StringDataInterface

setText

public void setText(java.lang.String newValue)
Does nothing.

Specified by:
setText in interface com.sas.lang.StringDataInterface



Copyright © 2009 SAS Institute Inc. All Rights Reserved.