@Override public void projectOpened() { StartupManager.getInstance(myProject).registerPreStartupActivity(new Runnable() { @Override public void run() { final MyFileStatusListener fileStatusListener = new MyFileStatusListener(); final EditorFactoryListener editorFactoryListener = new MyEditorFactoryListener(); final MyVirtualFileListener virtualFileListener = new MyVirtualFileListener(); final EditorColorsListener editorColorsListener = new MyEditorColorsListener(); final FileStatusManager fsManager = FileStatusManager.getInstance(myProject); fsManager.addFileStatusListener(fileStatusListener, myDisposable); final EditorFactory editorFactory = EditorFactory.getInstance(); editorFactory.addEditorFactoryListener(editorFactoryListener, myDisposable); final VirtualFileManager virtualFileManager = VirtualFileManager.getInstance(); virtualFileManager.addVirtualFileListener(virtualFileListener, myDisposable); final EditorColorsManager editorColorsManager = EditorColorsManager.getInstance(); editorColorsManager.addEditorColorsListener(editorColorsListener, myDisposable); } }); }
public TemplateManagerImpl(Project project) { myProject = project; final EditorFactoryListener myEditorFactoryListener = new EditorFactoryAdapter() { @Override public void editorReleased(@NotNull EditorFactoryEvent event) { Editor editor = event.getEditor(); if (editor.getProject() != null && editor.getProject() != myProject) return; if (myProject.isDisposed() || !myProject.isOpen()) return; TemplateState state = getTemplateState(editor); if (state != null) { state.gotoEnd(); } clearTemplateState(editor); } }; EditorFactory.getInstance().addEditorFactoryListener(myEditorFactoryListener, myProject); }
@Override public void projectOpened() { final EditorFactoryListener myEditorFactoryListener = new EditorFactoryAdapter() { @Override public void editorReleased(@NotNull EditorFactoryEvent event) { Editor editor = event.getEditor(); if (editor.getProject() != null && editor.getProject() != myProject) return; if (myProject.isDisposed() || !myProject.isOpen()) return; TemplateState tState = getTemplateState(editor); if (tState != null) { tState.gotoEnd(); } editor.putUserData(TEMPLATE_STATE_KEY, null); } }; EditorFactory.getInstance().addEditorFactoryListener(myEditorFactoryListener, myProject); }
@Override public void projectOpened() { StartupManager.getInstance(myProject).registerPreStartupActivity(new Runnable() { @Override public void run() { final MyFileStatusListener fileStatusListener = new MyFileStatusListener(); final EditorFactoryListener editorFactoryListener = new MyEditorFactoryListener(); final MyVirtualFileListener virtualFileListener = new MyVirtualFileListener(); final FileStatusManager fsManager = FileStatusManager.getInstance(myProject); fsManager.addFileStatusListener(fileStatusListener, myDisposable); final EditorFactory editorFactory = EditorFactory.getInstance(); editorFactory.addEditorFactoryListener(editorFactoryListener, myDisposable); final VirtualFileManager virtualFileManager = VirtualFileManager.getInstance(); virtualFileManager.addVirtualFileListener(virtualFileListener, myDisposable); } }); }
public TemplateManagerImpl(Project project) { myProject = project; final EditorFactoryListener myEditorFactoryListener = new EditorFactoryAdapter() { @Override public void editorReleased(@Nonnull EditorFactoryEvent event) { Editor editor = event.getEditor(); if (editor.getProject() != null && editor.getProject() != myProject) return; if (myProject.isDisposed() || !myProject.isOpen()) return; TemplateState state = getTemplateState(editor); if (state != null) { state.gotoEnd(); } clearTemplateState(editor); } }; EditorFactory.getInstance().addEditorFactoryListener(myEditorFactoryListener, myProject); }
public void projectOpened() { StartupManager.getInstance(myProject).registerPreStartupActivity(new Runnable() { @Override public void run() { final MyFileStatusListener fileStatusListener = new MyFileStatusListener(); final EditorFactoryListener editorFactoryListener = new MyEditorFactoryListener(); final MyVirtualFileListener virtualFileListener = new MyVirtualFileListener(); final EditorColorsListener editorColorsListener = new EditorColorsListener() { public void globalSchemeChange(EditorColorsScheme scheme) { resetTrackersForOpenFiles(); } }; final FileStatusManager fsManager = FileStatusManager.getInstance(myProject); fsManager.addFileStatusListener(fileStatusListener, myProject); final EditorFactory editorFactory = EditorFactory.getInstance(); editorFactory.addEditorFactoryListener(editorFactoryListener,myProject); final VirtualFileManager virtualFileManager = VirtualFileManager.getInstance(); virtualFileManager.addVirtualFileListener(virtualFileListener,myProject); final EditorColorsManager editorColorsManager = EditorColorsManager.getInstance(); editorColorsManager.addEditorColorsListener(editorColorsListener); Disposer.register(myDisposable, new Disposable() { public void dispose() { fsManager.removeFileStatusListener(fileStatusListener); virtualFileManager.removeVirtualFileListener(virtualFileListener); editorColorsManager.removeEditorColorsListener(editorColorsListener); } }); } }); }
@Override public void addEditorFactoryListener(@NotNull EditorFactoryListener listener) { }
@Override public void addEditorFactoryListener(@NotNull EditorFactoryListener listener, @NotNull Disposable parentDisposable) { }
@Override public void removeEditorFactoryListener(@NotNull EditorFactoryListener listener) { }
@Override @Deprecated public void addEditorFactoryListener(@NotNull EditorFactoryListener listener) { myEditorFactoryEventDispatcher.addListener(listener); }
@Override public void addEditorFactoryListener(@NotNull EditorFactoryListener listener, @NotNull Disposable parentDisposable) { myEditorFactoryEventDispatcher.addListener(listener,parentDisposable); }
@Override @Deprecated public void removeEditorFactoryListener(@NotNull EditorFactoryListener listener) { myEditorFactoryEventDispatcher.removeListener(listener); }
@Override public void addEditorFactoryListener(@NotNull EditorFactoryListener listener) { myEditorFactoryEventDispatcher.addListener(listener); }
@Override public void removeEditorFactoryListener(@NotNull EditorFactoryListener listener) { myEditorFactoryEventDispatcher.removeListener(listener); }
@Override public void addEditorFactoryListener(@Nonnull EditorFactoryListener listener) { }
@Override public void addEditorFactoryListener(@Nonnull EditorFactoryListener listener, @Nonnull Disposable parentDisposable) { }
@Override public void removeEditorFactoryListener(@Nonnull EditorFactoryListener listener) { }
@Override @Deprecated public void addEditorFactoryListener(@Nonnull EditorFactoryListener listener) { myEditorFactoryEventDispatcher.addListener(listener); }
@Override public void addEditorFactoryListener(@Nonnull EditorFactoryListener listener, @Nonnull Disposable parentDisposable) { myEditorFactoryEventDispatcher.addListener(listener,parentDisposable); }
@Override @Deprecated public void removeEditorFactoryListener(@Nonnull EditorFactoryListener listener) { myEditorFactoryEventDispatcher.removeListener(listener); }
/** * Registers a listener for receiving notifications when editor instances are created * and released. * * @param listener the listener instance. * @deprecated use the {@link #addEditorFactoryListener(EditorFactoryListener, Disposable)} instead */ public abstract void addEditorFactoryListener(@NotNull EditorFactoryListener listener);
/** * Registers a listener for receiving notifications when editor instances are created and released * and removes the listener when the <code>'parentDisposable'</code> gets disposed. * * @param listener the listener instance. * @param parentDisposable the Disposable which triggers the removal of the listener */ public abstract void addEditorFactoryListener(@NotNull EditorFactoryListener listener, @NotNull Disposable parentDisposable);
/** * Un-registers a listener for receiving notifications when editor instances are created * and released. * * @param listener the listener instance. * @deprecated you should have used the {@link #addEditorFactoryListener(EditorFactoryListener, Disposable)} instead */ public abstract void removeEditorFactoryListener(@NotNull EditorFactoryListener listener);
/** * Registers a listener for receiving notifications when editor instances are created * and released. * * @param listener the listener instance. * @deprecated use the {@link #addEditorFactoryListener(EditorFactoryListener, Disposable)} instead */ public abstract void addEditorFactoryListener(@Nonnull EditorFactoryListener listener);
/** * Registers a listener for receiving notifications when editor instances are created and released * and removes the listener when the <code>'parentDisposable'</code> gets disposed. * * @param listener the listener instance. * @param parentDisposable the Disposable which triggers the removal of the listener */ public abstract void addEditorFactoryListener(@Nonnull EditorFactoryListener listener, @Nonnull Disposable parentDisposable);
/** * Un-registers a listener for receiving notifications when editor instances are created * and released. * * @param listener the listener instance. * @deprecated you should have used the {@link #addEditorFactoryListener(EditorFactoryListener, Disposable)} instead */ public abstract void removeEditorFactoryListener(@Nonnull EditorFactoryListener listener);