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.
When expanding the html navigator tree, all tags have an expansion "+" next to them, weather they can expand or not. Only tags that have children should have a "+" next to them to expand. Once a tag is clicked, the "+" goes away if it isn't expandable, but this doesn't allow for visual distinction of what elements have children. Tested in NB PHP 6.5 and 7M1 on WinXP.
reproducible
The StructureItem.isLeaf() method must always return false for html items. See the code comment below for clarification. I belive this needs to be fixed in CSL somehow, maybe the proposed way. HtmlStructureScanner$HtmlStructureItem.isLeaf() { //potentialy incorrect workaround for ElementNode.updateRecursively(StructureItem) method. //If the StructureItem says it is a leaf then if a new node is created inside //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(); }
This issue was added to the list of NetFIX [1] candidates. If module owner does not agree, please speak up. Thanks! [1] http://wiki.netbeans.org/NetFIXIssues
Vita Stejskal is willing to review & integrate possible patch if you manage to fix this issue. Good luck Joan!
Created attachment 96483 [details] Proposed patch I attach my proposed patch. My approach is that isLeaf() return only true when the node is really a leaf. That is: when the node has no tags inside it (text inside tag is ok). Then to solve the update problem in CSL module I convert the Children.LEAF to ElementChildren if it's needed beacause a node that was a Leaf now it isn't. I have tested it manually and it works. I hope that the patch doesn't break any invariants that I'm not aware of.
Vito, can you please review the patch and provide your comments? Thanks!
The patch looks ok to me. Thanks.
http://hg.netbeans.org/jet-main/rev/a8467d01a39f Thanks for the patch!
Excellent, thanks Vito and especially thanks to Joan for his patch!
Integrated into 'main-golden', will be available in build *201004090201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/a8467d01a39f User: Vita Stejskal <vstejskal@netbeans.org> Log: #157466: applying lujop's patch fixing navigator nodes