This commit is contained in:
Alexey Kudravtsev
2014-02-21 17:51:07 +04:00
parent cad71fe1cd
commit 75ca104cb9
5 changed files with 12 additions and 6 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 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.
@@ -58,6 +58,7 @@ public final class PackageElement implements Queryable, RootsProvider {
return myElement;
}
@NotNull
@Override
public Collection<VirtualFile> getRoots() {
Set<VirtualFile> roots= new HashSet<VirtualFile>();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 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.
@@ -108,7 +108,7 @@ public abstract class ProjectViewNode <Value> extends AbstractTreeNode<Value> im
Object value,
ViewSettings settings) throws
InstantiationException {
Object[] parameters = new Object[]{project, value, settings};
Object[] parameters = {project, value, settings};
for (Constructor<? extends AbstractTreeNode> constructor : (Constructor<? extends AbstractTreeNode>[])nodeClass.getConstructors()) {
if (constructor.getParameterTypes().length != 3) continue;
try {
@@ -164,6 +164,7 @@ public abstract class ProjectViewNode <Value> extends AbstractTreeNode<Value> im
return false;
}
@NotNull
@Override
public Collection<VirtualFile> getRoots() {
Value value = getValue();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
* Copyright 2000-2014 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.
@@ -17,6 +17,7 @@ package com.intellij.ide.projectView;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.HashSet;
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
import java.util.Set;
@@ -25,6 +26,7 @@ public interface RootsProvider {
Set<VirtualFile> EMPTY_ROOTS = new HashSet<VirtualFile>();
@NotNull
Collection<VirtualFile> getRoots();
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 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.
@@ -62,6 +62,7 @@ public abstract class AbstractModuleNode extends ProjectViewNode<Module> impleme
return "Module";
}
@NotNull
@Override
public Collection<VirtualFile> getRoots() {
return Arrays.asList(ModuleRootManager.getInstance(getValue()).getContentRoots());
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 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.
@@ -70,6 +70,7 @@ public abstract class ModuleGroupNode extends ProjectViewNode<ModuleGroup> imple
return result;
}
@NotNull
@Override
public Collection<VirtualFile> getRoots() {
Collection<AbstractTreeNode> children = getChildren();