Intellij plugin development - How to override any Intellij open file action?

已回答

Clicks, enter, search, whatever. I want to modify the position where this new tab is about to open as the current implementation is flawed / does not work as intended. 

Open file at the end does not work and also thus files fill also open in various splitters. 

0

Such a location of the new tab is handled by the FileEditorOpenOptions which belongs to a part of the internal API and cannot be modified 

0

Such a shame since the current internal implementation does not work as intended. 

 

Related. https://youtrack.jetbrains.com/issue/IDEA-233543

0

Seems there is a way to listen to when things open and close and then I guess you could have some actions triggered. 



MessageBus bus = project.getMessageBus();

MessageBusConnection connection = bus.connect();

connection.subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, new FileEditorManagerListener() {
@Override
public void fileOpened(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
System.out.println("11111111111111111111111111");
}

@Override
public void fileClosed(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
System.out.println("222222222222222222222222222");
}
});
0

请先登录再写评论。