mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-163234 SelectIn... | Favorites doesn't work if the toolwindow hasn't been opened yet
This commit is contained in:
+10
-11
@@ -68,20 +68,19 @@ public class FavoritesViewSelectInTarget extends SelectInTargetPsiWrapper {
|
||||
final ToolWindow favoritesToolWindow = windowManager.getToolWindow(ToolWindowId.FAVORITES_VIEW);
|
||||
|
||||
if (favoritesToolWindow != null) {
|
||||
final FavoritesTreeViewPanel panel = UIUtil.findComponentOfType(favoritesToolWindow.getComponent(), FavoritesTreeViewPanel.class);
|
||||
|
||||
if (panel != null) {
|
||||
final Runnable runnable = () -> {
|
||||
final Runnable runnable = () -> {
|
||||
final FavoritesTreeViewPanel panel = UIUtil.findComponentOfType(favoritesToolWindow.getComponent(), FavoritesTreeViewPanel.class);
|
||||
if (panel != null) {
|
||||
panel.selectElement(toSelect, virtualFile, requestFocus);
|
||||
result.setDone();
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
if (requestFocus) {
|
||||
favoritesToolWindow.activate(runnable, false);
|
||||
}
|
||||
else {
|
||||
favoritesToolWindow.show(runnable);
|
||||
}
|
||||
if (requestFocus) {
|
||||
favoritesToolWindow.activate(runnable, false);
|
||||
}
|
||||
else {
|
||||
favoritesToolWindow.show(runnable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -394,7 +394,6 @@ public final class ToolWindowImpl implements ToolWindowEx {
|
||||
|
||||
@Override
|
||||
public final JComponent getComponent() {
|
||||
ensureContentInitialized();
|
||||
return myComponent;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user