mondocommand
Class FormatConfig

java.lang.Object
  extended by mondocommand.FormatConfig

public class FormatConfig
extends Object

Allow customizing response strings from MondoCommand. Creating a FormatConfig is similar to doing so for MondoCommand: use argument chaining.


Constructor Summary
FormatConfig()
           
 
Method Summary
 String getPermissionWarning()
           
 String getReplyPrefix()
           
 String getUsageHeading()
           
 void registerColorAliases()
          Register MondoCommand color aliases upon initialization of the MondoCommand.
 FormatConfig setPermissionWarning(String permissionWarning)
          Set the permission warning to be displayed when a user cannot access a command.
 FormatConfig setReplyPrefix(String replyPrefix)
          Set the prefix to be placed before all command replies.
 FormatConfig setUsageHeading(String usageHeading)
          Set the heading to be shown when displaying command usage.
 void writeUsageLine(org.bukkit.command.CommandSender sender, String commandLabel, SubCommand sub)
          Write out one entry of the usage output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatConfig

public FormatConfig()
Method Detail

getPermissionWarning

public String getPermissionWarning()

getUsageHeading

public String getUsageHeading()

getReplyPrefix

public String getReplyPrefix()

setPermissionWarning

public FormatConfig setPermissionWarning(String permissionWarning)
Set the permission warning to be displayed when a user cannot access a command.

Parameters:
permissionWarning - a String which accepts color codes.
Returns:
the same FormatConfig, for chaining.

setUsageHeading

public FormatConfig setUsageHeading(String usageHeading)
Set the heading to be shown when displaying command usage.

Parameters:
usageHeading - A string which accepts color codes.
Returns:
the same FormatConfig, for chaining.

setReplyPrefix

public FormatConfig setReplyPrefix(String replyPrefix)
Set the prefix to be placed before all command replies.

Parameters:
replyPrefix - a String which accepts color codes.
Returns:
the same FormatConfig, for chaining

registerColorAliases

public void registerColorAliases()
Register MondoCommand color aliases upon initialization of the MondoCommand. This method doesn't make much sense to be called by the user right now, it's here to support future functionality and/or user customization where colors are concerned.


writeUsageLine

public void writeUsageLine(org.bukkit.command.CommandSender sender,
                           String commandLabel,
                           SubCommand sub)
Write out one entry of the usage output.

This method exists so that users can subclass it and do their own formatting of MondoCommand's usage output. It's the responsibility of this method to also send the usage output, this way customized line wrapping, multi-line messages, etc can be implemented.

Parameters:
sender - The CommandSender requesting usage.
commandLabel - The current base command label. Will be prefixed with a / if a player command.
sub - The SubCommand we're generating a usage screen for.


Copyright © 2013. All Rights Reserved.