Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.help.IndexHelpTopic Class Reference

This help topic generates a list of other help topics. More...

+ Inheritance diagram for org.bukkit.help.IndexHelpTopic:
+ Collaboration diagram for org.bukkit.help.IndexHelpTopic:

Public Member Functions

 IndexHelpTopic (String name, String shortText, String permission, Collection< HelpTopic > topics)
 
 IndexHelpTopic (String name, String shortText, String permission, Collection< HelpTopic > topics, String preamble)
 
boolean canSee (CommandSender sender)
 Determines if a Player is allowed to see this help topic.
 
void amendCanSee (String amendedPermission)
 
String getFullText (CommandSender sender)
 
- Public Member Functions inherited from org.bukkit.help.HelpTopic
void amendCanSee (String amendedPermission)
 Allows the server administrator to override the permission required to see a help topic.
 
String getName ()
 Returns the name of this help topic.
 
String getShortText ()
 Returns a brief description that will be displayed in the topic index.
 
String getFullText (CommandSender forWho)
 Returns the full description of this help topic that is displayed when the user requests this topic's details.
 
void amendTopic (String amendedShortText, String amendedFullText)
 Allows the server admin (or another plugin) to add or replace the contents of a help topic.
 

Protected Member Functions

void setTopicsCollection (Collection< HelpTopic > topics)
 Sets the contents of the internal allTopics collection.
 
String buildPreamble (CommandSender sender)
 Builds the topic preamble.
 
String buildIndexLine (CommandSender sender, HelpTopic topic)
 Builds individual lines in the index topic.
 
- Protected Member Functions inherited from org.bukkit.help.HelpTopic
String applyAmendment (String baseText, String amendment)
 Developers implementing their own custom HelpTopic implementations can use this utility method to ensure their implementations comply with the expected behavior of the HelpTopic#amendTopic(String, String) method.
 

Protected Attributes

String permission
 
String preamble
 
Collection< HelpTopicallTopics
 
- Protected Attributes inherited from org.bukkit.help.HelpTopic
String name
 
String shortText
 
String fullText
 
String amendedPermission
 

Detailed Description

This help topic generates a list of other help topics.

This class is useful for adding your own index help topics. To enforce a particular order, use a sorted collection.

If a preamble is provided to the constructor, that text will be displayed before the first item in the index.

Definition at line 18 of file IndexHelpTopic.java.

Constructor & Destructor Documentation

org.bukkit.help.IndexHelpTopic.IndexHelpTopic ( String  name,
String  shortText,
String  permission,
Collection< HelpTopic topics 
)
org.bukkit.help.IndexHelpTopic.IndexHelpTopic ( String  name,
String  shortText,
String  permission,
Collection< HelpTopic topics,
String  preamble 
)

Member Function Documentation

void org.bukkit.help.IndexHelpTopic.amendCanSee ( String  amendedPermission)
String org.bukkit.help.IndexHelpTopic.buildIndexLine ( CommandSender  sender,
HelpTopic  topic 
)
protected

Builds individual lines in the index topic.

Override this method to change how index lines are rendered.

Parameters
senderThe command sender requesting the index line.
topicThe topic to render into an index line.
Returns
The rendered index line.

Definition at line 100 of file IndexHelpTopic.java.

References org.bukkit.help.HelpTopic.getName(), org.bukkit.help.HelpTopic.getShortText(), org.bukkit.ChatColor.GOLD, and org.bukkit.ChatColor.WHITE.

Referenced by org.bukkit.help.IndexHelpTopic.getFullText().

String org.bukkit.help.IndexHelpTopic.buildPreamble ( CommandSender  sender)
protected

Builds the topic preamble.

Override this method to change how the index preamble looks.

Parameters
senderThe command sender requesting the preamble.
Returns
The topic preamble.

Definition at line 89 of file IndexHelpTopic.java.

References org.bukkit.ChatColor.GRAY, and org.bukkit.help.IndexHelpTopic.preamble.

Referenced by org.bukkit.help.IndexHelpTopic.getFullText().

boolean org.bukkit.help.IndexHelpTopic.canSee ( CommandSender  player)
virtual

Determines if a Player is allowed to see this help topic.

HelpTopic implementations should take server administrator wishes into account as set by the HelpTopic#amendCanSee(String) function.

Parameters
playerThe Player in question.
Returns
True of the Player can see this help topic, false otherwise.

Implements org.bukkit.help.HelpTopic.

Definition at line 45 of file IndexHelpTopic.java.

References org.bukkit.permissions.Permissible.hasPermission(), and org.bukkit.help.IndexHelpTopic.permission.

void org.bukkit.help.IndexHelpTopic.setTopicsCollection ( Collection< HelpTopic topics)
protected

Sets the contents of the internal allTopics collection.

Parameters
topicsThe topics to set.

Definition at line 41 of file IndexHelpTopic.java.

References org.bukkit.help.IndexHelpTopic.allTopics.

Referenced by org.bukkit.help.IndexHelpTopic.IndexHelpTopic().

Member Data Documentation

Collection<HelpTopic> org.bukkit.help.IndexHelpTopic.allTopics
protected
String org.bukkit.help.IndexHelpTopic.permission
protected
String org.bukkit.help.IndexHelpTopic.preamble
protected

The documentation for this class was generated from the following file: