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.
Open sample schema LoanApp. In Schema view, expand Complex Types, right-click AddressType & choose Find Usages. In the XML Usage graph pane, Go To is an option in the context menu for every node except AddressType itself.
Go To also mising in find substitution results
and Go To missed in find derivation results
The issue is that, for query component on the graph (which is used for find usages), we do not set activated node correctly, as its not part of explorer tree. RefactoringPanel must be corrected to accomodate query component. suggested fix public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals( ................. if (newVal == null){ ................ } else { if(newVal==((WhereUsedView)ui.getView()).getQueryComponent()) { // QueryComponent is not in tree // unselect selected node in JTree tree.getSelectionModel().clearSelection(); setActivatedNodes(AnalysisUtilities.getDisplayNode ((Referenceable)newVal)); } else { // select the corresponding JTree node int index = findTreeRowForUserObject(newVal); // set the tree selection, which will also set the activated nodes tree.setSelectionRow(index); } } The issue with complex type derivations and substitution group graphs is that we dont change the activated nodes at all. Suggested fix is to create new control adapter class as follows, and add it as controls in the two views. public class ActivatedNodesControlAdapter extends ControlAdapter { public void itemReleased(VisualItem item, MouseEvent e) { super.itemReleased(item, e); setActivatedNodes(e, item); } private void setActivatedNodes(final MouseEvent e, final VisualItem item) { if (item.canGet(AnalysisConstants.OPENIDE_NODE, Node.class)) { Node node = (Node) item.get(AnalysisConstants.OPENIDE_NODE); if(node!=null) { Component c = e.getComponent(); TopComponent tc = (TopComponent) SwingUtilities. getAncestorOfClass(TopComponent.class,c); if (tc!=null) { tc.setActivatedNodes(new Node[]{node}); } } } } } I will check in the fix in release55_dev and attach the patch jar for QE to test.
Created attachment 35398 [details] Find Usages and refactoring patch
Created attachment 35399 [details] CT derivations and Substitution Groups patch
Hao, QA, I have checked in the fix in release55_dev branch. Its reviewed by Nam and is low risk. please see the two patch jars attached, to verify the fix.
This is issue has morphed from GOTO on findusage target node to GOTO's on all the nodes of the 2 queries. IMO, eventhough the functionality is not primary, the seriousness can't no longer be P3. Without goto navigation on the result, the query functionality would loose a large part of its usefulness. The fix is good and isolated.
Verified in 061212_5.