From be994559b27bd40dd0bb948a3e56a475111cb51a Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Wed, 5 Dec 2018 18:54:28 +0300 Subject: [PATCH] fix compilation Revert "resource bundle node should keep resource bundle as object to provide proper equals/hashCode IDEA-203616" This reverts commit 4694ff5fc8e35ffe9d3ae400a701fdae2c91c19b. --- .../projectView/ResourceBundleNode.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleNode.java b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleNode.java index 1912fa61ed7c..69a71bd18db8 100644 --- a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleNode.java +++ b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleNode.java @@ -1,6 +1,4 @@ -// Copyright 2000-2017 JetBrains s.r.o. -// Use of this source code is governed by the Apache 2.0 license that can be -// found in the LICENSE file. +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.lang.properties.projectView; @@ -37,7 +35,6 @@ import org.jetbrains.annotations.Nullable; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeNode; import java.util.*; -import java.util.stream.Collectors; import java.util.stream.Stream; public class ResourceBundleNode extends ProjectViewNode implements ValidateableNode, DropTargetNode, ResourceBundleAwareNode { @@ -79,11 +76,16 @@ public class ResourceBundleNode extends ProjectViewNode implements Va } @Override - public void update(PresentationData presentation) { + public void update(@NotNull PresentationData presentation) { presentation.setIcon(AllIcons.Nodes.ResourceBundle); presentation.setPresentableText(PropertiesBundle.message("project.view.resource.bundle.tree.node.text", myBundle.getBaseName())); } + @Override + protected boolean shouldUpdateData() { + return isValid() && super.shouldUpdateData(); + } + @Override public boolean canNavigateToSource() { return true; @@ -129,7 +131,7 @@ public class ResourceBundleNode extends ProjectViewNode implements Va } @Override - public boolean canDrop(TreeNode[] sourceNodes) { + public boolean canDrop(@NotNull TreeNode[] sourceNodes) { for (TreeNode node : sourceNodes) { if (extractPropertiesFileFromNode(node) == null) return false; } @@ -137,7 +139,7 @@ public class ResourceBundleNode extends ProjectViewNode implements Va } @Override - public void drop(TreeNode[] sourceNodes, DataContext dataContext) { + public void drop(@NotNull TreeNode[] sourceNodes, @NotNull DataContext dataContext) { MultiMap bundleGrouping = new MultiMap<>(); for (TreeNode sourceNode : sourceNodes) { final PropertiesFile propertiesFile = extractPropertiesFileFromNode(sourceNode); @@ -179,13 +181,7 @@ public class ResourceBundleNode extends ProjectViewNode implements Va @NotNull @Override public ResourceBundle getResourceBundle() { - return getValue(); - } - - @NotNull - @Override - public Collection getRoots() { - return getResourceBundle().getPropertiesFiles().stream().map(f -> f.getVirtualFile()).collect(Collectors.toList()); + return myBundle; } @Nullable