com.zion.jbuddy.bots
Class BotMenu

java.lang.Object
  extended by com.zion.jbuddy.bots.BotTarget
      extended by com.zion.jbuddy.bots.BotMenu
All Implemented Interfaces:
BotCall

public class BotMenu
extends BotTarget

Organizes targets (and other menus) into a hierarchy.

When a user opens a menu (usually via a command), its available targets and sub-menus, along with short descriptions of each (their titles), are presented to the user.


Constructor Summary
BotMenu()
          Creates a menu.
 
Method Summary
 Object clone()
          Returns an exact copy of this menu.
 BotCallSet getCalls()
          Throws an UnsupportedOperationException, as menus may not execute calls.
 RichContent getDescription()
          Returns this menu's description.
 BotEventHandlerSet getEventHandlers()
          Returns this menu's local event handlers.
 BotTargetSet getTargets()
          Returns this menu's targets.
 boolean isShowBack()
          Returns whether the back command is shown as a selection in this menu when a previously viewed menu exists in the user's menu history.
 boolean isShowCommands()
          Returns whether this menu's available commands are presented to the user.
 boolean isShowTitle()
          Returns whether this menu's title is shown when a user views this menu.
 void setDescription(RichContent description)
          Sets this menu's description.
 void setShowBack(boolean showBack)
          Sets whether the back command is shown as a selection in this menu when a previously viewed menu exists in the user's menu history.
 void setShowCommands(boolean isShowCommands)
          Sets whether this menu's available commands are presented to the user.
 void setShowTitle(boolean isShowTitle)
          Sets whether this menu's title is shown when a user views this menu.
 
Methods inherited from class com.zion.jbuddy.bots.BotTarget
getCommand, getFilters, getID, getRoutes, getTitle, isDefault, setCommand, setDefault, setID, setTitle
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BotMenu

public BotMenu()
Creates a menu.

Method Detail

getDescription

public RichContent getDescription()
Returns this menu's description.


setDescription

public void setDescription(RichContent description)
Sets this menu's description.

The description is displayed before the menu's contents when the menu is opened.


isShowBack

public boolean isShowBack()
Returns whether the back command is shown as a selection in this menu when a previously viewed menu exists in the user's menu history.


setShowBack

public void setShowBack(boolean showBack)
Sets whether the back command is shown as a selection in this menu when a previously viewed menu exists in the user's menu history.

The default value is true.


isShowCommands

public boolean isShowCommands()
Returns whether this menu's available commands are presented to the user.


setShowCommands

public void setShowCommands(boolean isShowCommands)
Sets whether this menu's available commands are presented to the user. This can be set to false to hide the commands/titles and show only the menu description (which could be used to display the available options in another manner).

The default value is true.


isShowTitle

public boolean isShowTitle()
Returns whether this menu's title is shown when a user views this menu.


setShowTitle

public void setShowTitle(boolean isShowTitle)
Sets whether this menu's title is shown when a user views this menu.

The default value is true.


getTargets

public BotTargetSet getTargets()
Returns this menu's targets.

These targets may only be triggered if the user is viewing this menu.


getEventHandlers

public BotEventHandlerSet getEventHandlers()
Returns this menu's local event handlers.

These event handlers can only be triggered if the user is viewing this menu.


getCalls

public BotCallSet getCalls()
                    throws UnsupportedOperationException
Throws an UnsupportedOperationException, as menus may not execute calls.

Overrides:
getCalls in class BotTarget
Throws:
UnsupportedOperationException

clone

public Object clone()
Returns an exact copy of this menu.

Overrides:
clone in class BotTarget


JBuddy is a trademark of Zion Software, LLC in the US and other countries.
Copyright 2000-2008 Zion Software, LLC All Rights Reserved.