public abstract class ProjectViewNode<Value> extends AbstractTreeNode<Value> implements RootsProvider, SettingsProvider
PresentableNodeDescriptor.ColoredFragment
NodeDescriptor.NodeComparator<T extends NodeDescriptor<?>>
Modifier and Type | Field and Description |
---|---|
protected static Logger |
LOG |
DEFAULT_WEIGHT, EMPTY_ARRAY, myClosedIcon, myColor, myName, myOpenIcon, myProject
EMPTY_ROOTS
EMPTY_NAVIGATION_ITEM_ARRAY
Modifier | Constructor and Description |
---|---|
protected |
ProjectViewNode(Project project,
Value value,
ViewSettings viewSettings)
Creates an instance of the project view node.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canHaveChildrenMatching(Condition<PsiFile> condition)
Efficiently checks if there are nodes under the project view node which match the specified condition.
|
abstract boolean |
contains(VirtualFile file)
Checks if this node or one of its children represents the specified virtual file.
|
static AbstractTreeNode<?> |
createTreeNode(java.lang.Class<? extends AbstractTreeNode<?>> nodeClass,
Project project,
java.lang.Object value,
ViewSettings settings) |
protected static java.util.Collection<VirtualFile> |
getDefaultRootsFor(VirtualFile file) |
java.lang.Comparable |
getManualOrderKey() |
java.lang.String |
getQualifiedNameSortKey() |
java.util.Collection<VirtualFile> |
getRoots() |
ViewSettings |
getSettings() |
java.lang.Comparable |
getSortKey()
When nodes aren't sorted by type all objects with same weigh will be sorted using
some common algorithm (e.g alpha comparator).
|
java.lang.String |
getTitle() |
java.lang.Comparable |
getTypeSortKey()
When nodes are sorted by type all objects with same weigh will be sorted using
some common algorithm (e.g alpha comparator).
|
int |
getTypeSortWeight(boolean sortByType) |
VirtualFile |
getVirtualFile()
Returns the virtual file represented by this node or one of its children.
|
protected boolean |
hasProblemFileBeneath() |
boolean |
isSortByFirstChild() |
boolean |
isValidating() |
protected boolean |
shouldApply() |
boolean |
shouldDrillDownOnEmptyElement() |
protected boolean |
shouldPostprocess() |
boolean |
someChildContainsFile(VirtualFile file) |
boolean |
someChildContainsFile(VirtualFile file,
boolean optimizeByCheckingFileRootsFirst) |
boolean |
validate() |
static java.util.List<AbstractTreeNode<?>> |
wrap(java.util.Collection objects,
Project project,
java.lang.Class<? extends AbstractTreeNode<?>> nodeClass,
ViewSettings settings) |
apply, canNavigate, canNavigateToSource, canRepresent, equals, getChildren, getChildToHighlightAt, getElement, getEqualityObject, getFileStatus, getFileStatusColor, getLeafState, getName, getNullValueSetTrace, getParent, getParentDescriptor, getParentValue, getTestPresentation, getToolTip, getValue, hashCode, isAlwaysExpand, isAlwaysLeaf, isAlwaysShowPlus, navigate, postprocess, setParent, setValue, shouldUpdateData, toTestString, valueIsCut
apply, apply, applyFrom, createPresentation, getHighlightColor, getPresentation, getTemplatePresentation, isAncestorOrSelf, isContentHighlighted, isHighlightableContentNode, isParentOf, update, update
expandOnDoubleClick, getChildrenSortingStamp, getClosedIcon, getColor, getIcon, getIndex, getOpenIcon, getProject, getUpdateCount, getWeight, isWasDeclaredAlwaysLeaf, setChildrenSortingStamp, setIcon, setIndex, setUpdateCount, setWasDeclaredAlwaysLeaf, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPresentation
protected static final Logger LOG
protected ProjectViewNode(Project project, Value value, ViewSettings viewSettings)
project
- the project containing the node.value
- the object (for example, a PSI element) represented by the project view nodeviewSettings
- the settings of the project view.public abstract boolean contains(VirtualFile file)
file
- the file to check for.public VirtualFile getVirtualFile()
getVirtualFile
in class AbstractTreeNode<Value>
public final ViewSettings getSettings()
getSettings
in interface SettingsProvider
public static java.util.List<AbstractTreeNode<?>> wrap(java.util.Collection objects, Project project, java.lang.Class<? extends AbstractTreeNode<?>> nodeClass, ViewSettings settings)
public static AbstractTreeNode<?> createTreeNode(java.lang.Class<? extends AbstractTreeNode<?>> nodeClass, Project project, java.lang.Object value, ViewSettings settings) throws java.lang.InstantiationException
java.lang.InstantiationException
public boolean someChildContainsFile(VirtualFile file)
public boolean someChildContainsFile(VirtualFile file, boolean optimizeByCheckingFileRootsFirst)
public java.util.Collection<VirtualFile> getRoots()
getRoots
in interface RootsProvider
protected static java.util.Collection<VirtualFile> getDefaultRootsFor(VirtualFile file)
protected boolean hasProblemFileBeneath()
hasProblemFileBeneath
in class AbstractTreeNode<Value>
public boolean canHaveChildrenMatching(Condition<PsiFile> condition)
condition
- the condition to check the nodes.public java.lang.String getTitle()
public boolean isSortByFirstChild()
public int getTypeSortWeight(boolean sortByType)
public java.lang.Comparable getTypeSortKey()
public java.lang.Comparable getSortKey()
public java.lang.Comparable getManualOrderKey()
public java.lang.String getQualifiedNameSortKey()
public boolean shouldDrillDownOnEmptyElement()
public boolean validate()
protected boolean shouldPostprocess()
shouldPostprocess
in class PresentableNodeDescriptor<AbstractTreeNode<Value>>
protected boolean shouldApply()
shouldApply
in class PresentableNodeDescriptor<AbstractTreeNode<Value>>
public boolean isValidating()