Best viewed in the Internet Explorer.
Contact us at info@sourceglider.com
for feedback about MetriX.
Online Manual
Analysis Query Tree View
Analysis Query Tree View
Query Tree View is another way of representing the dataflow information in the form of Java Elements Queries, like it is
displayed in Analysis Report View. While Analysis Report View displays all the information on
some Java Element, Query Tree View displays this information on demand. Here you need to select which query you want to
display. You can find the list of all available queries in the Reference.
Query Tree View is designed to show the history of selected Java Elements
in the form of a tree. It is a kind of extension of the functionality of the standard Package Explorer. In the Package Explorer
they attempted to create the hierarchy that will contain all the Java Elements of the workspace: each project contains the list of packages,
each package contains types, each type contains methods and fields, etc. Query Tree View can display arbitrary hierarchies of Java
Elements.
Query Tree View appears at the left lower part of Eclipse workbench. To get the Query Tree View on some Java Element,
you need to select that Java Element and display the view by either of the
following ways:
Select Source Analysis > Show Query Tree in the Eclipse menu. If there's no active analysis, the
Quick Analysis will be computed on the current Compilation Unit (which contains
the current Java Element, if there is any).
Select Source Analysis > Show Query Tree in the context menu of the selected Java Element. If there's no active analysis,
the Quick Analysis will be computed on the current Compilation Unit (which
contains the current Java Element, if there is any).
Select Window > Show View > Other... and choose Analysis Query Tree from the Source Analysis group. In this
case no analysis will be computed if there's no active analysis.
In addition, if the corresponding option is switched on (it is switched on by default), Query
Tree View will be automatically displayed when user selects the Java Element for the first time after the analysis is computed.
Once the Query Tree View is open, it will add the freshly selected Java Elements to the end of the tree. You may disable this
feature by the button at the toolbar of the view.
Query Tree View has the toolbar with the following buttons:
button will freeze the Query Tree View: it will not change the tree each time you select
the new Java Element.
button will clear the history of selected Java Elements. Only the last one will be left in
the tree. However this button does not clear the history of the queries for that Java Element.
When the analysis is computed, Query Tree View displays the following content:
The parts of the view marked with numbers represent the following:
1: The root (topmost) nodes of the tree represent the history list of the selected Java Elements. Only Java Elements that
were queried (that have the children in this tree) are included in the topmost nodes. When you select the new Java Element, it will
be added to the tree as the new topmost element. The last topmost node of the tree corresponds to the last selected Java Element.
To clear all topmost nodes except the last one press the button.
2: The nodes with the icons represent the queries that were used. The query is
said to be used if it was directly executed in this tree (see below) or if you followed the hyperlink of any of answers of this query
in Analysis Report View. The parent node of the query node is the Java Element on which the
query was executed. The children nodes of the query node are the answers of it.
3: Answers for the Queries are represented as the list of children nodes for the Query nodes. If the number of answers
is quite big for some Query, not all of them are presented in the tree. In this case the special node ...more kids... appears
as the last child of the answers list.
When you hover the mouse over the node that represents the Java Element, the tooltip window will show the part of source code that
contains this Java Element.
The real power of Query Tree View is when it is used along with Analysis Report View. Each time you follow some link in Analysis
Report View, the new set of nodes will be added to the Query Tree. If you want to go back to some previously queried Java Element,
you simply search this element in the tree - it will be much easier than walking through the Back/Forward buttons, because you
see the whole query history at one glance.
However Query Tree View can be used solely like Analysis Report View. To show the query manually on some Java Element select the
corresponding node, press the right mouse button and find the desired query in the context menu. First you need to select the
group of queries (it corresponds to the section in Analysis Report View), then select the query from the group. The new set of
nodes will be added to the queried tree node.
To remove the node from the tree (either Java Element node or query node) select this node and choose Remove node from the
context menu. To remove all children of some node, select the node and choose Remove all children in the context menu.
Query Tree View is even more powerful than Analysis Report: it supports user-defined queries. To launch the user-defined query
on some node, select this node and choose Enter query... in the context menu. Type some query in the dialog and press
Perform. Use the simple first-order logic language, the set of basic dataflow relations and the queried Java Element. Press
Ctrl+Space to launch Quick Assist. All the basic relations and the queried Java Element will be in the list. If your
query formula is incorrect you will get an error message and the first incorrect lexem will be revealed.
Instead of formal description of the query language we provide the set of example queries. We think that it is possible to learn
all the basic concepts of the language from these live examples. If you think that it is not enough and you are still confused with
the query language, you may ask us about it at support@sourceglider.com.