This commit is contained in:
Dmitry Batkovich
2017-05-17 13:53:54 +03:00
parent 8597d2a7de
commit f2c48ac436
6 changed files with 6 additions and 35 deletions
@@ -23,7 +23,6 @@ import com.intellij.codeInspection.reference.RefEntity;
import com.intellij.util.containers.FactoryMap;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.tree.TreeNode;
import java.util.Map;
@@ -35,7 +34,6 @@ import java.util.Set;
@SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
public class ExcludedInspectionTreeNodesManager {
private final Map<Class, Set<Object>> myExcludedNodeObjects = new FactoryMap<Class, Set<Object>>() {
@Nullable
@Override
protected Set<Object> create(Class key) {
return new THashSet<>();
@@ -43,7 +41,6 @@ public class ExcludedInspectionTreeNodesManager {
};
private final Map<String, Set<Object>> myExcludedByTool = new FactoryMap<String, Set<Object>>() {
@Nullable
@Override
protected Set<Object> create(String key) {
return new THashSet<>();
@@ -1,22 +0,0 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.codeInspection.ui;
/**
* @author Dmitry Batkovich
*/
public class InspectionRootNodeImpl {
}
@@ -352,7 +352,7 @@ public class InspectionTree extends Tree {
}
public void queueUpdate() {
((InspectionRootNode) getRoot()).getUpdater().update(null, true);
((InspectionRootNode) getRoot()).getUpdater().update(true);
}
public void restoreExpansionAndSelection(boolean treeNodesMightChange) {
@@ -123,7 +123,7 @@ public abstract class InspectionTreeNode extends DefaultMutableTreeNode {
super.add(newChild);
if (myUpdater != null) {
((InspectionTreeNode)newChild).propagateUpdater(myUpdater);
myUpdater.updateWithPreviewPanel(this);
myUpdater.updateWithPreviewPanel();
}
}
@@ -132,7 +132,7 @@ public abstract class InspectionTreeNode extends DefaultMutableTreeNode {
super.insert(newChild, childIndex);
if (myUpdater != null) {
((InspectionTreeNode)newChild).propagateUpdater(myUpdater);
myUpdater.updateWithPreviewPanel(this);
myUpdater.updateWithPreviewPanel();
}
}
@@ -18,10 +18,8 @@ package com.intellij.codeInspection.ui;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.util.ui.update.MergingUpdateQueue;
import com.intellij.util.ui.update.Update;
import org.jetbrains.annotations.Nullable;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeNode;
import java.util.concurrent.atomic.AtomicBoolean;
/**
@@ -37,12 +35,12 @@ public class InspectionTreeUpdater {
myUpdateQueue = new MergingUpdateQueue("InspectionView", 100, true, view, view);
}
public void updateWithPreviewPanel(@Nullable TreeNode node) {
public void updateWithPreviewPanel() {
myDoUpdatePreviewPanel.set(true);
update(node, false);
update(false);
}
public void update(@Nullable TreeNode node, boolean force) {
public void update(boolean force) {
if (ApplicationManager.getApplication().isDispatchThread() && !force) {
return;
}
@@ -19,7 +19,6 @@ import com.intellij.codeInspection.CommonProblemDescriptor;
import com.intellij.codeInspection.ProblemDescriptorBase;
import com.intellij.diff.tools.util.FoldingModelSupport;
import com.intellij.diff.util.DiffDrawUtil;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.FoldRegion;
import com.intellij.openapi.editor.ScrollType;
import com.intellij.openapi.editor.ex.DocumentEx;
@@ -39,7 +38,6 @@ import java.util.stream.Collectors;
* @author Dmitry Batkovich
*/
public class ProblemPreviewEditorPresentation {
private final static Logger LOG = Logger.getInstance(ProblemPreviewEditorPresentation.class);
private final static int VIEW_ADDITIONAL_OFFSET = 4;
private final EditorEx myEditor;