org.nakedobjects.viewer.lightweight
Class MenuOption

java.lang.Object
  extended byorg.nakedobjects.viewer.lightweight.MenuOption
All Implemented Interfaces:
UserAction
Direct Known Subclasses:
AbstractClassOption, AbstractObjectOption, ClearValueOption, CloseViewOption, CopyValueOption, DefaultValueOption, PasteValueOption, PrintOption

public abstract class MenuOption
extends java.lang.Object
implements UserAction

Each option that a user is shown in an objects popup menu a MenuOption. A MenuOption details: the name of an option (in the users language);

; a way to determine whether a user can select this option on the current object.


Constructor Summary
MenuOption()
          Constructs a default menu option, with no name.
MenuOption(java.lang.String name)
           
 
Method Summary
 Permission disabled(Workspace workspace, View component, Location location)
          Indicate that this action is disabled
abstract  void execute(Workspace workspace, View view, Location at)
          Invoke this action.
 java.lang.String getName(Workspace workspace, View view, Location at)
          Returns the stored name of the menu option.
 void setName(java.lang.String name)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MenuOption

public MenuOption()
Constructs a default menu option, with no name.


MenuOption

public MenuOption(java.lang.String name)
Method Detail

execute

public abstract void execute(Workspace workspace,
                             View view,
                             Location at)
Description copied from interface: UserAction
Invoke this action.

Specified by:
execute in interface UserAction

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName(Workspace workspace,
                                View view,
                                Location at)
Returns the stored name of the menu option.

Specified by:
getName in interface UserAction

disabled

public Permission disabled(Workspace workspace,
                           View component,
                           Location location)
Description copied from interface: UserAction
Indicate that this action is disabled

Specified by:
disabled in interface UserAction

toString

public java.lang.String toString()