@Override public Editor create(final ProgressListener listener, final SessionPool session, final Application application, final Path file) { return new FSEventWatchEditor(application, session, file, listener); } }
@Override public int hashCode() { return editor != null ? editor.hashCode() : 0; } }
@Override public Editor create(final ProgressListener listener, final SessionPool session, final Application application, final Path file) { return new DefaultWatchEditor(application, session, file, listener); } }
protected void edit(final Editor editor) { this.background(new WorkerBackgroundAction<Transfer>(this, pool, editor.open( new DisabledApplicationQuitCallback(), new DisabledTransferErrorCallback(), new DefaultEditorListener(this, pool, editor)))); }
@Override protected void finalize() throws Throwable { try { this.delete(); } finally { super.finalize(); } }
public List<Application> getEditors() { final List<Application> editors = new ArrayList<Application>(this.getConfigured()); // Add the application set as the default editor in the Preferences to be always // included in the list of available editors. final Application defaultEditor = this.getDefaultEditor(); if(applicationFinder.isInstalled(defaultEditor)) { if(!editors.contains(defaultEditor)) { editors.add(defaultEditor); } } return editors; }
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; }
@Override public String getActivity() { return MessageFormat.format(LocaleFactory.localizedString("Uploading {0}", "Status"), editor.getRemote().getName()); }
@Override public void cleanup(final Transfer upload) { editor.setModified(false); }
@Override public void fileDeleted(final Local file) { if(log.isInfoEnabled()) { log.info(String.format("File %s deleted", file)); } editor.delete(); }
public FSEventWatchEditorFactory(final ApplicationFinder finder) { super(finder); this.finder = finder; this.add(new Application("com.apple.TextEdit", "TextEdit")); this.add(new Application("com.apple.Xcode", "Xcode")); this.add(new Application("com.apple.dt.Xcode", "Xcode")); this.add(new Application("de.codingmonkeys.SubEthaEdit", "SubEthaEdit")); this.add(new Application("com.barebones.bbedit", "BBEdit")); this.add(new Application("com.barebones.textwrangler", "TextWrangler")); this.add(new Application("com.macromates.textmate", "TextMate")); this.add(new Application("com.macromates.TextMate.preview", "TextMate 2")); this.add(new Application("com.sublimetext.2", "Sublime Text 2")); this.add(new Application("com.sublimetext.3", "Sublime Text 3")); this.add(new Application("com.github.atom", "Atom")); this.add(new Application("com.transtex.texeditplus", "Tex-Edit Plus")); this.add(new Application("jp.co.artman21.JeditX", "Jedit X")); this.add(new Application("net.mimikaki.mi", "mi")); this.add(new Application("org.smultron.Smultron", "Smultron")); this.add(new Application("org.fraise.Fraise", "Fraise")); this.add(new Application("com.aynimac.CotEditor", "CotEditor")); this.add(new Application("com.coteditor.CotEditor", "CotEditor")); this.add(new Application("com.macrabbit.cssedit", "CSSEdit")); this.add(new Application("com.talacia.Tag", "Tag")); this.add(new Application("org.skti.skEdit", "skEdit")); this.add(new Application("com.cgerdes.ji", "JarInspector")); this.add(new Application("com.optima.PageSpinner", "PageSpinner")); this.add(new Application("com.hogbaysoftware.WriteRoom", "WriteRoom")); this.add(new Application("org.vim.MacVim", "MacVim")); this.add(new Application("com.forgedit.ForgEdit", "ForgEdit")); this.add(new Application("com.tacosw.TacoHTMLEdit", "Taco HTML Edit"));
@Override public void callback() { quit.callback(); delete(); } }, this.listener, listener, notification) {
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; }
@Override public int hashCode() { return editor != null ? editor.hashCode() : 0; } }
@Override public String getActivity() { return MessageFormat.format(LocaleFactory.localizedString("Downloading {0}", "Status"), editor.getRemote().getName()); }
@Override public void delete() { if(log.isDebugEnabled()) { log.debug(String.format("Close monitor %s", monitor)); } monitor.close(); super.delete(); } }
@Override public void delete() { if(log.isDebugEnabled()) { log.debug(String.format("Close monitor %s", monitor)); } monitor.close(); super.delete(); } }