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:
- Usages of Name-of-Usage-Component-1 [3 occurrences]
- -MyProject
- --MySourceRoot
(project file group, called "Files" in XML project)
-
---MyFolder
(folder or directory, if one exists. If nested, then this
node will show the names concatenated:
MyFolder1/MyFolder2/MyFolder3)
-
----File1.xsd (equivalent to Java
class in the Java refactoring UI)
-
-----Name-of-Top-Most-Component (the global component at the top
of the path from
the usage component to the schema root)
-
------(Local
Element) xs:element
name="Name-of-Usage-Component-1" type="Query-Component-X" />
-
----File2.xsd
-
-----Name-of-Top-Most-Component-2
-
------(Local
Element) xs:element
name="Name-of-Usage-Component-1" type="Query-Component-X" />
-
---MyFolder/MyFolder2
-
----File3.xsd
-
-----Name-of-Top-Most-Component-3 (the global component at the top
of the path from
the usage component to the schema root)
-
------(Local
Element) xs:element
name="Name-of-Usage-Component-1" type="Query-Component-X" />
|
Physical view:
- Usages of Name-of-Usage-Component-1 [3 occurrences]
- -MyProject
- --File1.xsd (equivalent to Java
class in the Java refactoring UI)
-
----xs:element
name="Name-of-Usage-Component-1" type="Query-Component-X" />
- --File2.xsd
-
----xs:element
name="Name-of-Usage-Component-1" type="Query-Component-X" />
- --File3.xsd
-
----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:
- Show the property sheet for a selected node.
Selection is performed by single mouse click.
- 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.
- 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:
- schema
- Name-of-Top-Most-Component
(Complex Type)
-
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

[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.