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.
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.
//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.
This issue was added to the list of NetFIX  candidates. If module owner does not agree, please speak up. Thanks!
Vita Stejskal is willing to review & integrate possible patch if you manage to fix this issue. Good luck Joan!
Created attachment 96483 [details]
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.
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)
User: Vita Stejskal <firstname.lastname@example.org>
Log: #157466: applying lujop's patch fixing navigator nodes