use of com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionConfigTreeNode in project intellij-community by JetBrains.
the class SingleInspectionProfilePanel method updateProperSettingsForSelection.
private void updateProperSettingsForSelection() {
final TreePath selectionPath = myTreeTable.getTree().getSelectionPath();
if (selectionPath != null) {
InspectionConfigTreeNode node = (InspectionConfigTreeNode) selectionPath.getLastPathComponent();
final Descriptor descriptor = node.getDefaultDescriptor();
if (descriptor != null) {
final boolean properSetting = myProfile.isProperSetting(descriptor.getKey().toString());
if (node.isProperSetting() != properSetting) {
myAlarm.cancelAllRequests();
myAlarm.addRequest(() -> myTreeTable.repaint(), 300);
node.dropCache();
updateUpHierarchy((InspectionConfigTreeNode) node.getParent());
}
}
}
}
use of com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionConfigTreeNode in project intellij-community by JetBrains.
the class VisibleTreeState method saveVisibleState.
public void saveVisibleState(Tree tree) {
myExpandedNodes.clear();
final DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) tree.getModel().getRoot();
Enumeration<TreePath> expanded = tree.getExpandedDescendants(new TreePath(rootNode.getPath()));
if (expanded != null) {
while (expanded.hasMoreElements()) {
final TreePath treePath = expanded.nextElement();
final InspectionConfigTreeNode node = (InspectionConfigTreeNode) treePath.getLastPathComponent();
myExpandedNodes.add(getState(node));
}
}
setSelectionPaths(tree.getSelectionPaths());
}
use of com.intellij.profile.codeInspection.ui.inspectionsTree.InspectionConfigTreeNode in project intellij-community by JetBrains.
the class VisibleTreeState method traverseNodes.
private void traverseNodes(final DefaultMutableTreeNode root, List<TreePath> pathsToExpand, List<TreePath> toSelect) {
final State state = getState((InspectionConfigTreeNode) root);
final TreeNode[] rootPath = root.getPath();
if (mySelectedNodes.contains(state)) {
toSelect.add(new TreePath(rootPath));
}
if (myExpandedNodes.contains(state)) {
pathsToExpand.add(new TreePath(rootPath));
}
for (int i = 0; i < root.getChildCount(); i++) {
traverseNodes((DefaultMutableTreeNode) root.getChildAt(i), pathsToExpand, toSelect);
}
}
Aggregations