This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
import java.awt.Image;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
public void updateRecursively( StructureItem newDescription ) {
Children ch = getChildren();
//If a node that was a LEAF now has children the child type has to be changed from Children.LEAF
//to ElementChildren to be able to hold the new child data
if(!(ch instanceof ElementChildren) && newDescription.getNestedItems().size()>0) {
ch=new ElementChildren((List<StructureItem>)Collections.EMPTY_LIST, ui.getFilters(), ui, fileObject);
setChildren(ch);
}
if ( ch instanceof ElementChildren ) {
HashSet<StructureItem> oldSubs = new HashSet<StructureItem>( description.getNestedItems() );
public boolean isLeaf() {
//potentialy incorrect workaround for ElementNode.updateRecursively(StructureItem) method.
//The child if empty if it hasn't any nested items. If it has only text it's empty.
//If the StructureItem says it is a leaf then if a new node is created inside
return getNestedItems().isEmpty();
//the navigator representation - ElementNode still holds empty children list
//which is not an instance of ElementChildren and then the subnodes are not refreshed.
//possible fix would be to modify the ElementNode constructor to always create
//ElementChildren even if the node is a leaf, but I am not sure whether it may
//have some bad influence on other things.
return false;
//return handle.node().children().isEmpty();
@Override