org.nakedobjects.viewer.classic.event.popup
Class MenuOption

java.lang.Object
  extended byorg.nakedobjects.viewer.classic.event.popup.MenuOption
Direct Known Subclasses:
ClassOption, DebugClassOption, DebugOption, DeleteAttributeOption, DeleteElementOption, DestroyInstanceOption, DestroyObjectInAttributeOption, DestroyObjectInCollectionOption, DestroyObjectOption, ExplorationOption, FindOption, FirstPageOption, LastPageOption, MakePersistentOption, MaximiseAllOption, MinimiseAllOption, NewCollectionInspectorOpt, NewDeleteOption, NewObjectInspectorOption, NextElementOption, ObjectOption, PreviousElementOption

public abstract class MenuOption
extends java.lang.Object

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.

See Also:
getName( )

Field Summary
static boolean ALLOW
          Specified option is presently allowed to be executed.
static int COMPONENT
          Indicates a MenuOption for a visual component.
static int EXPLORATION
          Indicates a MenuOption for a developer or debugging.
static int OBJECT
          Indicates a MenuOption for an NakedInterface.
static boolean VETO
          Specified option is to be disallowed - might be offered but is not presently allowed.
static int VIEW
          Indicates a MenuOption for a View.
 
Constructor Summary
MenuOption()
          Constructs a default menu option with no name and the type set to VIEW.
MenuOption(java.lang.String name, int type)
          Constructs a menu option with specified name and types.
 
Method Summary
abstract  void action(MenuOptionTarget componentAction, java.awt.Point at)
           
 java.lang.String getName()
           
 int getType()
          returns the type of the menu option.
 void runAction(MenuOptionTarget target, java.awt.Point at)
           
 void setName(java.lang.String name)
           
 java.lang.String toString()
           
 boolean veto(MenuOptionTarget componentAction)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPONENT

public static final int COMPONENT
Indicates a MenuOption for a visual component.

See Also:
Constant Field Values

VIEW

public static final int VIEW
Indicates a MenuOption for a View.

See Also:
Constant Field Values

OBJECT

public static final int OBJECT
Indicates a MenuOption for an NakedInterface.

See Also:
Constant Field Values

EXPLORATION

public static final int EXPLORATION
Indicates a MenuOption for a developer or debugging.

See Also:
Constant Field Values

VETO

public static final boolean VETO
Specified option is to be disallowed - might be offered but is not presently allowed.

See Also:
Constant Field Values

ALLOW

public static final boolean ALLOW
Specified option is presently allowed to be executed.

See Also:
Constant Field Values
Constructor Detail

MenuOption

public MenuOption()
Constructs a default menu option with no name and the type set to VIEW.


MenuOption

public MenuOption(java.lang.String name,
                  int type)
Constructs a menu option with specified name and types.

Method Detail

action

public abstract void action(MenuOptionTarget componentAction,
                            java.awt.Point at)

getName

public java.lang.String getName()

getType

public int getType()
returns the type of the menu option.


runAction

public void runAction(MenuOptionTarget target,
                      java.awt.Point at)

setName

public void setName(java.lang.String name)

toString

public java.lang.String toString()

veto

public boolean veto(MenuOptionTarget componentAction)