Package ru.tehkode.permissions.commands.exceptions

Examples of ru.tehkode.permissions.commands.exceptions.AutoCompleteChoicesException


    try {
      selectedBinding.call(this.plugin, sender, selectedBinding.getParams());
    } catch (InvocationTargetException e) {
      if (e.getTargetException() instanceof AutoCompleteChoicesException) {
        AutoCompleteChoicesException autocomplete = (AutoCompleteChoicesException) e.getTargetException();
        sender.sendMessage("Autocomplete for <" + autocomplete.getArgName() + ">:");
        sender.sendMessage("    " + StringUtils.implode(autocomplete.getChoices(), "   "));
      } else {
        throw new RuntimeException(e.getTargetException());
      }
    } catch (Exception e) {
      plugin.getLogger().severe("There is bogus command handler for " + command.getName() + " command. (Is appropriate plugin is update?)");
View Full Code Here


        }
      }
    }

    if (players.size() > 1) {
      throw new AutoCompleteChoicesException(players.toArray(new String[0]), argName);
    } else if (players.size() == 1) {
      return players.get(0);
    }

    // Nothing found
View Full Code Here

        groups.add(group);
      }
    }

    if (groups.size() > 1) { // Found several choices
      throw new AutoCompleteChoicesException(groups.toArray(new String[0]), argName);
    } else if (groups.size() == 1) { // Found one name
      return groups.get(0);
    }

    // Nothing found
View Full Code Here

        worlds.add(world.getName());
      }
    }

    if (worlds.size() > 1) { // Found several choices
      throw new AutoCompleteChoicesException(worlds.toArray(new String[0]), argName);
    } else if (worlds.size() == 1) { // Found one name
      return worlds.get(0);
    }

    return worldName;
View Full Code Here

      if (permissionArray.length == 1) {
        return permissionArray[0];
      }

      throw new AutoCompleteChoicesException(permissionArray, argName);
    }

    return permission;
  }
View Full Code Here

TOP

Related Classes of ru.tehkode.permissions.commands.exceptions.AutoCompleteChoicesException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.