|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.help.HelpTopic org.bukkit.help.IndexHelpTopic
public class IndexHelpTopic
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.
Field Summary | |
---|---|
protected Collection<HelpTopic> |
allTopics
|
protected String |
permission
|
protected String |
preamble
|
Fields inherited from class org.bukkit.help.HelpTopic |
---|
amendedPermission, fullText, name, shortText |
Constructor Summary | |
---|---|
IndexHelpTopic(String name,
String shortText,
String permission,
Collection<HelpTopic> topics)
|
|
IndexHelpTopic(String name,
String shortText,
String permission,
Collection<HelpTopic> topics,
String preamble)
|
Method Summary | |
---|---|
void |
amendCanSee(String amendedPermission)
Allows the server administrator to override the permission required to see a help topic. |
protected String |
buildIndexLine(CommandSender sender,
HelpTopic topic)
Builds individual lines in the index topic. |
protected String |
buildPreamble(CommandSender sender)
Builds the topic preamble. |
boolean |
canSee(CommandSender sender)
Determines if a Player is allowed to see this help topic. |
String |
getFullText(CommandSender sender)
Returns the full description of this help topic that is displayed when the user requests this topic's details. |
protected void |
setTopicsCollection(Collection<HelpTopic> topics)
Sets the contents of the internal allTopics collection. |
Methods inherited from class org.bukkit.help.HelpTopic |
---|
amendTopic, applyAmendment, getName, getShortText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String permission
protected String preamble
protected Collection<HelpTopic> allTopics
Constructor Detail |
---|
public IndexHelpTopic(String name, String shortText, String permission, Collection<HelpTopic> topics)
public IndexHelpTopic(String name, String shortText, String permission, Collection<HelpTopic> topics, String preamble)
Method Detail |
---|
protected void setTopicsCollection(Collection<HelpTopic> topics)
topics
- The topics to set.public boolean canSee(CommandSender sender)
HelpTopic
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.
canSee
in class HelpTopic
sender
- The Player in question.
public void amendCanSee(String amendedPermission)
HelpTopic
HelpTopic.canSee(org.bukkit.command.CommandSender)
function.
amendCanSee
in class HelpTopic
amendedPermission
- The permission node the server administrator wishes to apply to this topic.public String getFullText(CommandSender sender)
HelpTopic
getFullText
in class HelpTopic
sender
- The player or console requesting the full text. Useful for further security trimming
the command's full text based on sub-permissions in custom implementations.
protected String buildPreamble(CommandSender sender)
sender
- The command sender requesting the preamble.
protected String buildIndexLine(CommandSender sender, HelpTopic topic)
sender
- The command sender requesting the index line.topic
- The topic to render into an index line.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |