public class JavaSyntheticLibrary extends SyntheticLibrary
Constructor and Description |
---|
JavaSyntheticLibrary(java.util.Collection<VirtualFile> sourceRoots,
java.util.Collection<VirtualFile> binaryRoots,
java.util.Set<VirtualFile> excludedRoots,
Condition<VirtualFile> excludeCondition)
Deprecated.
use
SyntheticLibrary.newImmutableLibrary(List) instead |
JavaSyntheticLibrary(java.util.List<VirtualFile> sourceRoots,
java.util.List<VirtualFile> binaryRoots,
java.util.Set<VirtualFile> excludedRoots,
Condition<VirtualFile> excludeCondition) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
This method is vital if this library is shown under "External Libraries" (the library should implement ItemPresentation for that).
|
java.util.Collection<VirtualFile> |
getBinaryRoots() |
java.util.Set<VirtualFile> |
getExcludedRoots() |
Condition<VirtualFile> |
getExcludeFileCondition() |
java.util.Collection<VirtualFile> |
getSourceRoots() |
int |
hashCode() |
contains, contains, getAllRoots, isShowInExternalLibrariesNode, newImmutableLibrary, newImmutableLibrary, newImmutableLibrary, newImmutableLibrary
public JavaSyntheticLibrary(java.util.List<VirtualFile> sourceRoots, java.util.List<VirtualFile> binaryRoots, java.util.Set<VirtualFile> excludedRoots, Condition<VirtualFile> excludeCondition)
@Deprecated public JavaSyntheticLibrary(java.util.Collection<VirtualFile> sourceRoots, java.util.Collection<VirtualFile> binaryRoots, java.util.Set<VirtualFile> excludedRoots, Condition<VirtualFile> excludeCondition)
SyntheticLibrary.newImmutableLibrary(List)
insteadpublic java.util.Collection<VirtualFile> getSourceRoots()
getSourceRoots
in class SyntheticLibrary
public java.util.Collection<VirtualFile> getBinaryRoots()
getBinaryRoots
in class SyntheticLibrary
public java.util.Set<VirtualFile> getExcludedRoots()
getExcludedRoots
in class SyntheticLibrary
public Condition<VirtualFile> getExcludeFileCondition()
getExcludeFileCondition
in class SyntheticLibrary
null
E.g. you can exclude all non-java file by returning file -> !file.getName().endsWith(".java")
Excluding directory leads to excluding all its content recursively.
NOTE: The condition is participating in building indexing and project model, it must be bloody fast in order not to affect overall IDE performance.
NOTE 2: Try not to use file.getFileType() method since it might load file's content to know the type, which will try to load encoding and guess files project which is lead to SOE.
public boolean equals(java.lang.Object o)
SyntheticLibrary
ExternalLibrariesNode.getChildren()
invocation will create a new
SyntheticLibraryElementNode
instance passing this library as a value.
In order to figure out if "External Library" children are updated or not, AbstractTreeUi uses
node's equals/hashCode methods which in turn depend on this library's equals/hashCode methods:
see AbstractTreeNode.hashCode()
.
Please make sure that two SyntheticLibrary instances are equal if they reference the same state. Otherwise, constant UI updates
will degrade performance.
Consider implementing a better equals/hashCode if needed or instantiate SyntheticLibrary
only if state
changed (use some caching in AdditionalLibraryRootsProvider.getAdditionalProjectLibraries(Project)
).
equals
in class SyntheticLibrary
public int hashCode()
hashCode
in class SyntheticLibrary
javadoc