/** * Registers this command to a CommandMap. * Once called it only allows changes the registered CommandMap * * @param commandMap the CommandMap to register this command to * @return true if the registration was successful (the current registered * CommandMap was the passed CommandMap or null) false otherwise */ public boolean register(CommandMap commandMap) { if (allowChangesFrom(commandMap)) { this.commandMap = commandMap; return true; } return false; }
/** * Unregisters this command from the passed CommandMap applying any * outstanding changes * * @param commandMap the CommandMap to unregister * @return true if the unregistration was successfull (the current * registered CommandMap was the passed CommandMap or null) false * otherwise */ public boolean unregister(CommandMap commandMap) { if (allowChangesFrom(commandMap)) { this.commandMap = null; this.activeAliases = new ArrayList<String>(this.aliases); this.label = this.nextLabel; return true; } return false; }
/** * Registers this command to a CommandMap. * Once called it only allows changes the registered CommandMap * * @param commandMap the CommandMap to register this command to * @return true if the registration was successful (the current registered * CommandMap was the passed CommandMap or null) false otherwise */ public boolean register(CommandMap commandMap) { if (allowChangesFrom(commandMap)) { this.commandMap = commandMap; return true; } return false; }
/** * Unregisters this command from the passed CommandMap applying any * outstanding changes * * @param commandMap the CommandMap to unregister * @return true if the unregistration was successfull (the current * registered CommandMap was the passed CommandMap or null) false * otherwise */ public boolean unregister(CommandMap commandMap) { if (allowChangesFrom(commandMap)) { this.commandMap = null; this.activeAliases = new ArrayList<String>(this.aliases); this.label = this.nextLabel; return true; } return false; }