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.

Bug 86983 - Missing 'Go To' option on the queried node
Summary: Missing 'Go To' option on the queried node
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: bhate
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-12 05:35 UTC by htt
Modified: 2006-12-13 22:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Find Usages and refactoring patch (520.45 KB, application/octet-stream)
2006-10-19 23:01 UTC, bhate
Details
CT derivations and Substitution Groups patch (284.19 KB, application/octet-stream)
2006-10-19 23:02 UTC, bhate
Details

Note You need to log in before you can comment on or make changes to this bug.
Description htt 2006-10-12 05:35:57 UTC
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.
Comment 1 Ivan Sidorkin 2006-10-19 18:43:00 UTC
Go To also mising in find substitution results
Comment 2 Ivan Sidorkin 2006-10-19 18:50:49 UTC
and Go To missed in find derivation results
Comment 3 bhate 2006-10-19 22:57:51 UTC
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.
Comment 4 bhate 2006-10-19 23:01:23 UTC
Created attachment 35398 [details]
Find Usages and refactoring patch
Comment 5 bhate 2006-10-19 23:02:03 UTC
Created attachment 35399 [details]
CT derivations and Substitution Groups patch
Comment 6 bhate 2006-10-19 23:03:23 UTC
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.
Comment 7 Nam Nguyen 2006-10-19 23:46:11 UTC
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.
Comment 8 htt 2006-12-13 22:40:08 UTC
Verified in 061212_5.