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.
Summary: | html navigator tree expansion inaccurate | ||
---|---|---|---|
Product: | editor | Reporter: | phazei <phazei> |
Component: | CSL (API & infrastructure) | Assignee: | Vitezslav Stejskal <vstejskal> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | jkovalsky, lujop, mfukala |
Priority: | P3 | Keywords: | NETFIX |
Version: | 6.x | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | Proposed patch |
Description
phazei
2009-01-26 23:00:57 UTC
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 |