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.

View | Details | Raw Unified | Return to bug 157466
Collapse All | Expand All

(-)a/csl.api/src/org/netbeans/modules/csl/navigation/ElementNode.java (+9 lines)
Lines 42-47 Link Here
42
42
43
43
44
import java.awt.Image;
44
import java.awt.Image;
45
import java.util.Collections;
45
import java.util.Comparator;
46
import java.util.Comparator;
46
import java.util.HashMap;
47
import java.util.HashMap;
47
import java.util.HashSet;
48
import java.util.HashSet;
Lines 249-254 Link Here
249
250
250
    public void updateRecursively( StructureItem newDescription ) {
251
    public void updateRecursively( StructureItem newDescription ) {
251
        Children ch = getChildren();
252
        Children ch = getChildren();
253
254
        //If a node that was a LEAF now has children the child type has to be changed from Children.LEAF
255
        //to ElementChildren to be able to hold the new child data
256
        if(!(ch instanceof ElementChildren) && newDescription.getNestedItems().size()>0) {
257
            ch=new ElementChildren((List<StructureItem>)Collections.EMPTY_LIST, ui.getFilters(), ui, fileObject);
258
            setChildren(ch);
259
        }
260
        
252
        if ( ch instanceof ElementChildren ) {           
261
        if ( ch instanceof ElementChildren ) {           
253
           HashSet<StructureItem> oldSubs = new HashSet<StructureItem>( description.getNestedItems() );
262
           HashSet<StructureItem> oldSubs = new HashSet<StructureItem>( description.getNestedItems() );
254
263
(-)a/html.editor/src/org/netbeans/modules/html/editor/gsf/HtmlStructureScanner.java (-10 / +2 lines)
Lines 277-292 Link Here
277
        }
277
        }
278
278
279
        public boolean isLeaf() {
279
        public boolean isLeaf() {
280
            //potentialy incorrect workaround for ElementNode.updateRecursively(StructureItem) method.
280
            //The child if empty if it hasn't any nested items. If it has only text it's empty.
281
            //If the StructureItem says it is a leaf then if a new node is created inside
281
            return getNestedItems().isEmpty();
282
            //the navigator representation - ElementNode still holds empty children list 
283
            //which is not an instance of ElementChildren and then the subnodes are not refreshed.
284
            //possible fix would be to modify the ElementNode constructor to always create 
285
            //ElementChildren even if the node is a leaf, but I am not sure whether it may 
286
            //have some bad influence on other things.
287
            return false;
288
            
289
            //return handle.node().children().isEmpty();
290
        }
282
        }
291
283
292
        @Override
284
        @Override

Return to bug 157466