Ejemplo n.º 1
0
  @Override
  public void execute(AbstractFile file) throws IOException {
    Command command;

    // Attemps to find a command that matches the specified target.
    if ((command = CommandManager.getCommandForFile(file, allowDefault)) == null)
      throw new UnsupportedOperationException();

    // If found, executes it.
    ProcessRunner.execute(command.getTokens(file), file);
  }
Ejemplo n.º 2
0
  @Override
  public boolean canExecute(AbstractFile file) {
    if (allowDefault) return true;

    return CommandManager.getCommandForFile(file, false) != null;
  }