This commit is contained in:
Alexey Kudravtsev
2012-10-18 19:04:05 +04:00
parent 8745440c6d
commit da4c1d7b34
12 changed files with 133 additions and 20 deletions
@@ -19,9 +19,9 @@ import com.intellij.analysis.AnalysisScope;
import com.intellij.analysis.AnalysisUIOptions;
import com.intellij.analysis.BaseAnalysisActionDialog;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.module.ModuleUtilCore;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.psi.PsiElement;
import javax.swing.*;
@@ -36,7 +36,7 @@ public class SliceForwardHandler extends SliceHandler {
@Override
public SliceAnalysisParams askForParams(PsiElement element, boolean dataFlowToThis, SliceManager.StoredSettingsBean storedSettingsBean, String dialogTitle) {
AnalysisScope analysisScope = new AnalysisScope(element.getContainingFile());
Module module = ModuleUtil.findModuleForPsiElement(element);
Module module = ModuleUtilCore.findModuleForPsiElement(element);
String name = module == null ? null : module.getName();
Project myProject = element.getProject();
@@ -117,7 +117,7 @@ public class SliceManager implements PersistentStateComponent<SliceManager.Store
myCanceled = true;
}
public void slice(@NotNull PsiElement element, boolean dataFlowToThis, SliceHandler handler) {
public void slice(@NotNull PsiElement element, boolean dataFlowToThis, @NotNull SliceHandler handler) {
String dialogTitle = getElementDescription((dataFlowToThis ? BACK_TOOLWINDOW_ID : FORTH_TOOLWINDOW_ID) + " ", element, null);
dialogTitle = Pattern.compile("(<style>.*</style>)|<[^<>]*>").matcher(dialogTitle).replaceAll("");
@@ -129,7 +129,7 @@ public class SliceManager implements PersistentStateComponent<SliceManager.Store
createToolWindow(dataFlowToThis, rootNode, false, getElementDescription(null, element, null));
}
public void createToolWindow(final boolean dataFlowToThis, final SliceRootNode rootNode, boolean splitByLeafExpressions, String displayName) {
public void createToolWindow(boolean dataFlowToThis, @NotNull SliceRootNode rootNode, boolean splitByLeafExpressions, @NotNull String displayName) {
final SliceToolwindowSettings sliceToolwindowSettings = SliceToolwindowSettings.getInstance(myProject);
final ContentManager contentManager = getContentManager(dataFlowToThis);
final Content[] myContent = new Content[1];
@@ -23,6 +23,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import javax.swing.tree.DefaultTreeModel;
@@ -64,7 +65,11 @@ public class SliceTreeBuilder extends AbstractTreeBuilder {
}
};
public SliceTreeBuilder(JTree tree, Project project, boolean dataFlowToThis, final SliceNode rootNode, boolean splitByLeafExpressions) {
public SliceTreeBuilder(@NotNull JTree tree,
@NotNull Project project,
boolean dataFlowToThis,
@NotNull SliceNode rootNode,
boolean splitByLeafExpressions) {
super(tree, (DefaultTreeModel)tree.getModel(), new SliceTreeStructure(project, rootNode), SLICE_NODE_COMPARATOR, false);
this.dataFlowToThis = dataFlowToThis;
this.splitByLeafExpressions = splitByLeafExpressions;
@@ -18,6 +18,7 @@ package com.intellij.slicer;
import com.intellij.ide.projectView.TreeStructureProvider;
import com.intellij.ide.util.treeView.AbstractTreeStructureBase;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
import java.util.Collections;
import java.util.List;
@@ -28,7 +29,7 @@ import java.util.List;
public class SliceTreeStructure extends AbstractTreeStructureBase {
private final SliceNode myRoot;
public SliceTreeStructure(Project project, SliceNode rootNode) {
public SliceTreeStructure(@NotNull Project project, @NotNull SliceNode rootNode) {
super(project);
myRoot = rootNode;
}