ScrollFromSource shortcut feature
Answered
I would like to add 'Scroll from source' feature to my plugin, but my plugin brings it's own tree view structure and in my opinion I have to somehow add action to shortcut:
ActionUtil.getShortcutSet("SelectInProjectView").shortcuts
But if I just invoke registerCustomShortcutSet method on an action the shortcut it doesn't work when the a is open(files do not belong to the project). Seems the action is invoked only when my tree component is active, but it make no sense, because the idea is to select the file in tree view when the tree menu is closed or isn't active. So I also tried to find extension point that might fit for that purposes, but... so my question is what way you would recommend me for implementation? What is the right way?
Please sign in to leave a comment.
Hi,
I'm sorry, but I don't understand your problem. Please clarify the use case.
Do you want to scroll to a node in the Project View? How your custom tree is related to the project view? Please describe it in more detail.
I made plugin(https://github.com/epm-dev-priporov/idea-notes) which brings notes into intellij idea which are outside of Proejct and are kept in some folder in home user directory. In intellij idea these files are shown in separate window(not in project view structure). What I would like to add is a usecase when some file(note) is opened and user press the shortcut that file would be selected in TreeView structure and TreeView would be focused. That feature is already done in Idea for any files from project view structureand the shortcut is called Select File in Project view. The same behaviour I want to bind for the same shortcut.
Please take a look at: com.intellij.ide.SelectInTarget.