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 69a71bd18db8..1912fa61ed7c 100644 --- a/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleNode.java +++ b/plugins/properties/src/com/intellij/lang/properties/projectView/ResourceBundleNode.java @@ -1,4 +1,6 @@ -// 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; @@ -35,6 +37,7 @@ 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 { @@ -76,16 +79,11 @@ public class ResourceBundleNode extends ProjectViewNode implements Va } @Override - public void update(@NotNull PresentationData presentation) { + public void update(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; @@ -131,7 +129,7 @@ public class ResourceBundleNode extends ProjectViewNode implements Va } @Override - public boolean canDrop(@NotNull TreeNode[] sourceNodes) { + public boolean canDrop(TreeNode[] sourceNodes) { for (TreeNode node : sourceNodes) { if (extractPropertiesFileFromNode(node) == null) return false; } @@ -139,7 +137,7 @@ public class ResourceBundleNode extends ProjectViewNode implements Va } @Override - public void drop(@NotNull TreeNode[] sourceNodes, @NotNull DataContext dataContext) { + public void drop(TreeNode[] sourceNodes, DataContext dataContext) { MultiMap bundleGrouping = new MultiMap<>(); for (TreeNode sourceNode : sourceNodes) { final PropertiesFile propertiesFile = extractPropertiesFileFromNode(sourceNode); @@ -181,7 +179,13 @@ public class ResourceBundleNode extends ProjectViewNode implements Va @NotNull @Override public ResourceBundle getResourceBundle() { - return myBundle; + return getValue(); + } + + @NotNull + @Override + public Collection getRoots() { + return getResourceBundle().getPropertiesFiles().stream().map(f -> f.getVirtualFile()).collect(Collectors.toList()); } @Nullable