mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
structure view is dumb-aware (IDEADEV-41813)
This commit is contained in:
+5
-4
@@ -16,15 +16,16 @@
|
||||
|
||||
package com.intellij.ide.structureView.impl;
|
||||
|
||||
import com.intellij.openapi.wm.ToolWindowFactory;
|
||||
import com.intellij.openapi.wm.ToolWindow;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.ide.structureView.StructureViewFactory;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.wm.ToolWindow;
|
||||
import com.intellij.openapi.wm.ToolWindowFactory;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class StructureViewToolWindowFactory implements ToolWindowFactory {
|
||||
public class StructureViewToolWindowFactory implements ToolWindowFactory, DumbAware {
|
||||
public void createToolWindowContent(Project project, ToolWindow toolWindow) {
|
||||
StructureViewFactoryImpl factory = (StructureViewFactoryImpl)StructureViewFactory.getInstance(project);
|
||||
factory.initToolWindow(toolWindow);
|
||||
|
||||
+2
-1
@@ -21,8 +21,9 @@ import com.intellij.ide.util.treeView.smartTree.TreeAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.Presentation;
|
||||
import com.intellij.openapi.actionSystem.ToggleAction;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
|
||||
public class TreeActionWrapper extends ToggleAction{
|
||||
public class TreeActionWrapper extends ToggleAction implements DumbAware {
|
||||
private final TreeAction myAction;
|
||||
private final TreeActionsOwner myStructureView;
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ package com.intellij.ui;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.ToggleAction;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
@@ -42,16 +43,22 @@ public abstract class AutoScrollFromSourceHandler implements Disposable {
|
||||
public abstract void install();
|
||||
|
||||
public ToggleAction createToggleAction() {
|
||||
return new ToggleAction(UIBundle.message("autoscroll.from.source.action.name"),
|
||||
UIBundle.message("autoscroll.from.source.action.description"), IconLoader.getIcon("/general/autoscrollFromSource.png")) {
|
||||
public boolean isSelected(AnActionEvent event) {
|
||||
return isAutoScrollMode();
|
||||
}
|
||||
return new AutoScrollFromSourceAction();
|
||||
}
|
||||
|
||||
public void setSelected(AnActionEvent event, boolean flag) {
|
||||
setAutoScrollMode(flag);
|
||||
}
|
||||
};
|
||||
private class AutoScrollFromSourceAction extends ToggleAction implements DumbAware {
|
||||
public AutoScrollFromSourceAction() {
|
||||
super(UIBundle.message("autoscroll.from.source.action.name"), UIBundle.message("autoscroll.from.source.action.description"),
|
||||
IconLoader.getIcon("/general/autoscrollFromSource.png"));
|
||||
}
|
||||
|
||||
public boolean isSelected(AnActionEvent event) {
|
||||
return isAutoScrollMode();
|
||||
}
|
||||
|
||||
public void setSelected(AnActionEvent event, boolean flag) {
|
||||
setAutoScrollMode(flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user