public class IndexHelpTopic extends HelpTopic
If a preamble is provided to the constructor, that text will be displayed before the first item in the index.
Modifier and Type | Field | Description |
---|---|---|
protected java.util.Collection<HelpTopic> |
allTopics |
|
protected java.lang.String |
permission |
|
protected java.lang.String |
preamble |
amendedPermission, fullText, name, shortText
Constructor | Description |
---|---|
IndexHelpTopic(java.lang.String name,
java.lang.String shortText,
java.lang.String permission,
java.util.Collection<HelpTopic> topics) |
|
IndexHelpTopic(java.lang.String name,
java.lang.String shortText,
java.lang.String permission,
java.util.Collection<HelpTopic> topics,
java.lang.String preamble) |
Modifier and Type | Method | Description |
---|---|---|
void |
amendCanSee(java.lang.String amendedPermission) |
Allows the server administrator to override the permission required to
see a help topic.
|
protected java.lang.String |
buildIndexLine(CommandSender sender,
HelpTopic topic) |
Builds individual lines in the index topic.
|
protected java.lang.String |
buildPreamble(CommandSender sender) |
Builds the topic preamble.
|
boolean |
canSee(CommandSender sender) |
Determines if a
Player is allowed to see this help topic. |
java.lang.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(java.util.Collection<HelpTopic> topics) |
Sets the contents of the internal allTopics collection.
|
amendTopic, applyAmendment, getName, getShortText
protected java.lang.String permission
protected java.lang.String preamble
protected java.util.Collection<HelpTopic> allTopics
public IndexHelpTopic(java.lang.String name, java.lang.String shortText, java.lang.String permission, java.util.Collection<HelpTopic> topics)
public IndexHelpTopic(java.lang.String name, java.lang.String shortText, java.lang.String permission, java.util.Collection<HelpTopic> topics, java.lang.String preamble)
protected void setTopicsCollection(java.util.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.
public void amendCanSee(java.lang.String amendedPermission)
HelpTopic
HelpTopic implementations should take this into account when
determining topic visibility on the 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 java.lang.String getFullText(CommandSender sender)
HelpTopic
The result will be paginated to properly fit the user's client.
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 java.lang.String buildPreamble(CommandSender sender)
sender
- The command sender requesting the preamble.protected java.lang.String buildIndexLine(CommandSender sender, HelpTopic topic)
sender
- The command sender requesting the index line.topic
- The topic to render into an index line.Copyright © 2018. All rights reserved.