mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-170381 Hide empty middle packages bug
This commit is contained in:
@@ -2214,7 +2214,7 @@ public class AbstractTreeUi {
|
||||
boolean needToUpdate = false;
|
||||
NodeDescriptor loadedDesc = loadedChildren.getDescriptor(child);
|
||||
final NodeDescriptor childDescr;
|
||||
if (!isValid(loadedDesc)) {
|
||||
if (!isValid(loadedDesc, descriptor)) {
|
||||
childDescr = getTreeStructure().createDescriptor(child, descriptor);
|
||||
needToUpdate = true;
|
||||
}
|
||||
@@ -2674,7 +2674,7 @@ public class AbstractTreeUi {
|
||||
final LoadedChildren loaded = new LoadedChildren(loadedElements);
|
||||
for (final Object each : loadedElements) {
|
||||
NodeDescriptor existingDesc = getDescriptorFrom(getNodeForElement(each, true));
|
||||
final NodeDescriptor eachChildDescriptor = isValid(existingDesc) ? existingDesc : getTreeStructure().createDescriptor(each, updateInfo.getDescriptor());
|
||||
final NodeDescriptor eachChildDescriptor = isValid(existingDesc, updateInfo.getDescriptor()) ? existingDesc : getTreeStructure().createDescriptor(each, updateInfo.getDescriptor());
|
||||
execute(new TreeRunnable("AbstractTreeUi.queueBackgroundUpdate") {
|
||||
@Override
|
||||
public void perform() {
|
||||
@@ -3286,6 +3286,19 @@ public class AbstractTreeUi {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the given {@code descriptor} is valid
|
||||
* and its parent is equal to the specified {@code parent}.
|
||||
*
|
||||
* @param descriptor a descriptor to test
|
||||
* @param parent an expected parent for the testing descriptor
|
||||
* @return {@code true} if the specified descriptor is valid
|
||||
*/
|
||||
private boolean isValid(NodeDescriptor descriptor, NodeDescriptor parent) {
|
||||
if (descriptor == null) return false;
|
||||
if (parent != null && parent != descriptor.getParentDescriptor()) return false;
|
||||
return isValid(getElementFromDescriptor(descriptor));
|
||||
}
|
||||
|
||||
private boolean isValid(@Nullable NodeDescriptor descriptor) {
|
||||
return descriptor != null && isValid(getElementFromDescriptor(descriptor));
|
||||
|
||||
Reference in New Issue
Block a user