public void selectionChanged(@NotNull FileEditorManagerEvent event) { // The user has changed the editor they are working with - exit insert/replace mode, and complete any // appropriate repeat if (event.getOldFile() != null) { lastSelections.put(event.getManager(), event.getOldFile()); } } }
@Override public void selectionChanged(FileEditorManagerEvent event) { if ( !projectIsClosed ) currentEditorFileChangedEvent(event.getOldFile(), event.getNewFile()); }
public void selectionChanged(@NotNull FileEditorManagerEvent event) { debug("selection changed " + event.toString()); if (event.getNewFile() == null || _currentEditor == null) return; Editor newEditor = event.getManager().getSelectedTextEditor(); if (_currentEditor != newEditor) _currentEditor.getCaretModel().removeCaretListener(this); _viewer.selectElementAtCaret(); if (newEditor != null) _currentEditor = newEditor; _currentEditor.getCaretModel().addCaretListener(this); }
public void selectionChanged(@NotNull FileEditorManagerEvent event) { if (ExEntryPanel.getInstance().isActive()) { ExEntryPanel.getInstance().deactivate(false); } final FileEditor fileEditor = event.getOldEditor(); if (fileEditor instanceof TextEditor) { final Editor editor = ((TextEditor) fileEditor).getEditor(); ExOutputModel.getInstance(editor).clear(); if (CommandState.getInstance(editor).getMode() == CommandState.Mode.VISUAL) { VimPlugin.getMotion().exitVisual(editor); } } } }
@Override public void selectionChanged(@NotNull FileEditorManagerEvent event) { update(event.getManager().getProject()); }
@Test public void should_do_nothing_closed() { VirtualFile f1 = mock(VirtualFile.class); FileEditorManager mock = mock(FileEditorManager.class); editorTrigger.fileClosed(mock, f1); editorTrigger.selectionChanged(new FileEditorManagerEvent(mock, null, null, null, null)); } }
@Override public void selectionChanged(@NotNull FileEditorManagerEvent event) { releaseFileSpecificEditor(event.getOldFile()); VirtualFile newFile = event.getNewFile(); if (newFile != null && FileTypeExtensionUtil.isCypherFileTypeExtension(newFile.getExtension()) && project.getComponent(DataSourcesComponent.class).getDataSourceContainer().isDataSourceExists(getTabTitle(newFile))) { setupFileSpecificEditor(project, newFile); } } });