Tabnine Logo
AbstractEditor
Code IndexAdd Tabnine to your IDE (free)

How to use
AbstractEditor
in
ch.cyberduck.core.editor

Best Java code snippets using ch.cyberduck.core.editor.AbstractEditor (Showing top 14 results out of 315)

origin: iterate-ch/cyberduck

@Override
protected void finalize() throws Throwable {
  try {
    this.delete();
  }
  finally {
    super.finalize();
  }
}
origin: iterate-ch/cyberduck

  @Override
  public int hashCode() {
    return editor != null ? editor.hashCode() : 0;
  }
}
origin: iterate-ch/cyberduck

@Override
public void cleanup(final Transfer upload) {
  editor.setModified(false);
}
origin: iterate-ch/cyberduck

public EditOpenWorker(final Host bookmark, final AbstractEditor editor,
           final TransferErrorCallback callback,
           final ApplicationQuitCallback quit,
           final ProgressListener listener,
           final FileWatcherListener watcher, final NotificationService notification) {
  this.editor = editor;
  this.callback = callback;
  this.quit = quit;
  this.notification = notification;
  this.download = new DownloadTransfer(bookmark, editor.getRemote(), editor.getLocal(),
      new DownloadDuplicateFilter()) {
    @Override
    public TransferAction action(final Session<?> source, final Session<?> destination, final boolean resumeRequested, final boolean reloadRequested,
                   final TransferPrompt prompt, final ListProgressListener listener) {
      return TransferAction.trash;
    }
  };
  this.listener = listener;
  this.watcher = watcher;
}
origin: iterate-ch/cyberduck

@Override
public Transfer run(final Session<?> session) throws BackgroundException {
  final Path file = editor.getRemote();
  if(log.isDebugEnabled()) {
    log.debug(String.format("Run edit action for editor %s", file));
  }
  // Delete any existing file which might be used by a watch editor already
  final TransferOptions options = new TransferOptions();
  options.quarantine = false;
  options.open = false;
  final SingleTransferWorker worker
    = new SingleTransferWorker(session, session, download, options, new TransferSpeedometer(download),
      new DisabledTransferPrompt(), callback,
    listener, new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledPasswordCallback(), notification);
  worker.run();
  if(!download.isComplete()) {
    log.warn(String.format("File size changed for %s", file));
  }
  try {
    editor.edit(quit, watcher);
  }
  catch(IOException e) {
    throw new DefaultIOExceptionMappingService().map(e);
  }
  return download;
}
origin: iterate-ch/cyberduck

@Override
public String getActivity() {
  return MessageFormat.format(LocaleFactory.localizedString("Downloading {0}", "Status"),
      editor.getRemote().getName());
}
origin: iterate-ch/cyberduck

/**
 * Watch for changes in external editor
 *
 * @param quit Callback
 */
protected void edit(final ApplicationQuitCallback quit, final FileWatcherListener listener) throws IOException {
  if(!applicationFinder.isInstalled(application)) {
    log.warn(String.format("No editor application configured for %s", local));
    if(applicationLauncher.open(local)) {
      this.watch(local, listener);
    }
    else {
      throw new IOException(String.format("Failed to open default application for %s",
        local.getName()));
    }
  }
  else if(applicationLauncher.open(local, application, quit)) {
    this.watch(local, listener);
  }
  else {
    throw new IOException(String.format("Failed to open application %s for %s",
      application.getName(), local.getName()));
  }
}
origin: iterate-ch/cyberduck

public EditSaveWorker(final Host bookmark, final AbstractEditor editor,
           final TransferErrorCallback callback, final ProgressListener listener, final NotificationService notification) {
  this.editor = editor;
  this.callback = callback;
  this.notification = notification;
  this.upload = new UploadTransfer(bookmark, editor.getRemote(), editor.getLocal(), new NullFilter<Local>()) {
    @Override
    public TransferAction action(final Session<?> source,
                   final Session<?> destination, final boolean resumeRequested, final boolean reloadRequested,
                   final TransferPrompt prompt, final ListProgressListener listener) {
      return TransferAction.overwrite;
    }
    @Override
    public AbstractUploadFilter filter(final Session<?> session, final Session<?> destination, final TransferAction action, final ProgressListener listener) {
      return super.filter(session, destination, action, listener).withOptions(new UploadFilterOptions()
          .withTemporary(PreferencesFactory.get().getBoolean("queue.upload.file.temporary"))
          .withPermission(PreferencesFactory.get().getBoolean("editor.upload.permissions.change")));
    }
  };
  this.listener = listener;
}
origin: iterate-ch/cyberduck

@Override
public String getActivity() {
  return MessageFormat.format(LocaleFactory.localizedString("Uploading {0}", "Status"),
      editor.getRemote().getName());
}
origin: iterate-ch/cyberduck

  @Override
  public void callback() {
    quit.callback();
    delete();
  }
}, this.listener, listener, notification) {
origin: iterate-ch/cyberduck

@Override
public Transfer run(final Session<?> session) throws BackgroundException {
  if(log.isDebugEnabled()) {
    log.debug(String.format("Run upload action for editor %s", editor));
  }
  final SingleTransferWorker worker
    = new SingleTransferWorker(session, session, upload, new TransferOptions(),
      new TransferSpeedometer(upload), new DisabledTransferPrompt(), callback,
    listener, new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledPasswordCallback(), notification);
  worker.run();
  if(!upload.isComplete()) {
    log.warn(String.format("File size changed for %s", editor.getRemote()));
  }
  else {
    // Update known remote file size
    editor.getRemote().attributes().setSize(upload.getTransferred());
  }
  return upload;
}
origin: iterate-ch/cyberduck

  @Override
  public int hashCode() {
    return editor != null ? editor.hashCode() : 0;
  }
}
origin: iterate-ch/cyberduck

  @Override
  public void delete() {
    if(log.isDebugEnabled()) {
      log.debug(String.format("Close monitor %s", monitor));
    }
    monitor.close();
    super.delete();
  }
}
origin: iterate-ch/cyberduck

  @Override
  public void delete() {
    if(log.isDebugEnabled()) {
      log.debug(String.format("Close monitor %s", monitor));
    }
    monitor.close();
    super.delete();
  }
}
ch.cyberduck.core.editorAbstractEditor

Most used methods

  • delete
  • edit
    Watch for changes in external editor
  • getLocal
  • getRemote
  • hashCode
  • setModified
  • watch

Popular in Java

  • Making http requests using okhttp
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • onRequestPermissionsResult (Fragment)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • BoxLayout (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now