TPR3 changes to the Find Usages Query

 7 March 2006

version 1.5 -  revised 31 March 2006
Currently, in the TPR2 release, the Find Usages query is in the Analysis View.  It can also be invoked from the Schema View, a.k.a., Advanced or Column View.  For TPR3, the query will be moved from the Analysis View to the vicinity of the Java refactoring Usages mode.  The query will only be invocable from the Schema View.  The rest of this document describes the new  or changed features of the Find Usages Query.

Description of new Find Usages results window:
The  result window is a split pane; on the left side, an explorer, on the right, a graph.  

The explorer  is patterned after the Java refactoring Find Usages window.  The containing Top Component is "XML Schema Usages".  Each tab is "Find Schema Usages".

            Logical view:

  1. Usages of Name-of-Usage-Component-1 [3 occurrences]
  2.       -MyProject
  3.             --MySourceRoot   (project file group, called "Files" in XML project)
  4.                    ---MyFolder  (folder or directory, if one exists.  If nested, then this node will show the names concatenated:  MyFolder1/MyFolder2/MyFolder3)
  5.                          ----File1.xsd  (equivalent to Java class in the Java refactoring UI)
  6.                                 -----Name-of-Top-Most-Component  (the global component at the top of the path from the usage component to the schema root)
  7.                                        ------(Local Element) xs:element name="Name-of-Usage-Component-1" type="Query-Component-X" />
  8.                          ----File2.xsd  
  9.                                 -----Name-of-Top-Most-Component-2  
  10.                                         ------(Local Element) xs:element name="Name-of-Usage-Component-1" type="Query-Component-X" />
  11.                     ---MyFolder/MyFolder2
  12.                          ----File3.xsd 
  13.                                 -----Name-of-Top-Most-Component-3  (the global component at the top of the path from the usage component to the schema root)
  14.                                         ------(Local Element) xs:element name="Name-of-Usage-Component-1" type="Query-Component-X" />


            Physical view:

  1. Usages of Name-of-Usage-Component-1 [3 occurrences]
  2.      -MyProject
  3.          --File1.xsd  (equivalent to Java class in the Java refactoring UI)
  4.                   ----xs:element name="Name-of-Usage-Component-1" type="Query-Component-X" />
  5.          --File2.xsd  
  6.                   ----xs:element name="Name-of-Usage-Component-1" type="Query-Component-X" />
  7.          --File3.xsd  
  8.                   ----xs:element name="Name-of-Usage-Component-1" type="Query-Component-X" />




The graph is similar to the one in TPR2, with the exception of the two new features below (1 & 2), and the two new features that were implemented post TPR2 (3 & 4).   The version of the graph that is in the daily build is the final TPR3 graph sans #1 and #2 below.

New features on the schema component nodes in the explorer and the graph:
  1. Show the property sheet for a selected node. 

    Selection is performed by single mouse click.

  2. Enable navigation to Schema View with "Find in Schema View" action.
Use the Schema View search facility.  Put text in the search textfield "Find ComponentX" or "Find ComponentX ref".  Enable the search dismiss button.  Highlight the search target nodes and parents. This text is used to distinguish this type of search from one that the user invokes by typing in a name.  It would be misleading to insert only the name of the component  into the textfield,  because a search on component name could result in different nodes being highlighted.  When "Find in Schema View" in invoked from the Find Usages window, the search facility will find a specific schema component, not all components that have the same name.

New features of the graph since TPR2 that are in the daily build. 
  1. The query now scans all the schema files in the project.   For each file in which usages are found, a file node is shown in the graph.  Initially, the file nodes are "collapsed", that is, the usages are not visible, unless there is only one file containing usages.  If there is only one file containing usages, the file node is expanded by default, that is, the usage nodes are visible.  The screenshot below shows that two files contain usages.  The user has expanded both file nodes via a popup menuitem, "Expand" or "Collapse", depending on the current state of the file node.


  • The nodes now have an icon, representing the component type, and the component name.  The component type in text format is in a tooltip, containing the following information:
  • The query node:
    "Query Component"
    component type, e.g. "Global Element"

    The file nodes:
    "Schema file containing usages of  The-Name-of-the-Query-Component"
    full path to file, e.g. on Windows, "C:\REMC\src\xml\REMCLibrary.xsd"

    The usage nodes:
    "Uses The-Name-of-the-Query-Component"
    component type, e.g.,  "Local Element"

    Other nodes in the path from the usage node to its penultimate-level ancestor, which is a global component under the schema root:
    component type, e.g., "Global Complex Type"

    Description of the Find Usages Navigator
    The navigator will be linked to any Schema Component node in the explorer or  graph.  It will show the path from the schema root to the target schema component.  For explorer node #6 above, for example, the navigator might look like this:

    1. schema
    2.     Name-of-Top-Most-Component (Complex Type)
    3.         Name-of-Usage-Component-1 (Element)


    These nodes are all named schema components.  The only unnamed components in the navigator, graph, or explorer are Local Elements that reference a Global Element.  All nodes will have the "Go to Source" and "Find in Schema View" actions. "Find in Schema View" is the default action.  Simple selection does not result in any interaction with the other Top Components.  

    Note that the Java refactoring Find Usages window is not linked to the navigator.



    Screenshots

    Java Find Usages
    Java Find Usages


    Find Usages query output
    [Click image for a larger view]

    IDE after running Find Usages query.  
    The user has double-clicked the "Check" node in the graph, which highlights the "Check" schema component nodes (and ancestors) in the Schema View.


    Project Features

    About this Project

    XML was started in November 2009, is owned by dstrupl, and has 58 members.
    By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
     
     
    Close
    loading
    Please Confirm
    Close