mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-78207 Ctrl-N keyboard shortcut in favorites window seems hard-coded
This commit is contained in:
@@ -199,6 +199,8 @@ public class FavoritesTreeViewPanel extends JPanel implements DataProvider {
|
||||
|
||||
decorator.addExtraAction(new FavoritesAutoScrollToSourceAction(myProject, myAutoScrollToSourceHandler, myBuilder));
|
||||
|
||||
AnAction action = ActionManager.getInstance().getAction(IdeActions.ACTION_NEW_ELEMENT);
|
||||
action.registerCustomShortcutSet(action.getShortcutSet(), myTree);
|
||||
final JPanel panel = decorator.createPanel();
|
||||
|
||||
panel.setBorder(IdeBorderFactory.createEmptyBorder(0));
|
||||
@@ -532,6 +534,14 @@ public class FavoritesTreeViewPanel extends JPanel implements DataProvider {
|
||||
}
|
||||
}
|
||||
return ((PsiDirectoryContainer)psiElement).getDirectories(searchScope);
|
||||
} else if (psiElement != null) {
|
||||
PsiFile file = psiElement.getContainingFile();
|
||||
if (file != null) {
|
||||
PsiDirectory parent = file.getParent();
|
||||
if (parent != null) {
|
||||
return new PsiDirectory[]{parent};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return selectedNodeElements[0] instanceof PsiDirectory ? new PsiDirectory[] {(PsiDirectory)selectedNodeElements[0]} : null;
|
||||
|
||||
Reference in New Issue
Block a user