示例#1
0
 /** Opens the trash in Thunar. */
 @Override
 public void open() {
   try {
     ProcessRunner.execute(REVEAL_TRASH_COMMAND).waitFor();
   } catch (Exception e) { // IOException, InterruptedException
     LOGGER.debug("Caught an exception running command \"" + REVEAL_TRASH_COMMAND + "\"", e);
   }
 }
示例#2
0
 @Override
 public void performAction() {
   AbstractFile currentFolder = mainFrame.getActiveTable().getFileTableModel().getCurrentFolder();
   String cmd = getConsoleCommand(currentFolder);
   try {
     ProcessRunner.execute(cmd);
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
示例#3
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);
  }