fix compilation

Revert "resource bundle node should keep resource bundle as object to
provide proper equals/hashCode IDEA-203616"

This reverts commit 4694ff5fc8.
This commit is contained in:
Aleksey Pivovarov
2018-12-05 18:56:13 +03:00
parent 4694ff5fc8
commit be994559b2
@@ -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<PsiFile[]> implements ValidateableNode, DropTargetNode, ResourceBundleAwareNode {
@@ -79,11 +76,16 @@ public class ResourceBundleNode extends ProjectViewNode<PsiFile[]> 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<PsiFile[]> 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<PsiFile[]> implements Va
}
@Override
public void drop(TreeNode[] sourceNodes, DataContext dataContext) {
public void drop(@NotNull TreeNode[] sourceNodes, @NotNull DataContext dataContext) {
MultiMap<ResourceBundle, PropertiesFile> bundleGrouping = new MultiMap<>();
for (TreeNode sourceNode : sourceNodes) {
final PropertiesFile propertiesFile = extractPropertiesFileFromNode(sourceNode);
@@ -179,13 +181,7 @@ public class ResourceBundleNode extends ProjectViewNode<PsiFile[]> implements Va
@NotNull
@Override
public ResourceBundle getResourceBundle() {
return getValue();
}
@NotNull
@Override
public Collection<VirtualFile> getRoots() {
return getResourceBundle().getPropertiesFiles().stream().map(f -> f.getVirtualFile()).collect(Collectors.toList());
return myBundle;
}
@Nullable