[index]

JQuery Tutorial

JQuery is a flexible, query-based source code browser. Having created a working set on the elements of interest, a JQuery user can issue a variety of pre-written queries whose results are displayed as a tree. Individual elements in the tree can then be queried individually in the same fasion.

Getting Start

This section will get you aquainted with the JQuery user interface and the more common features of JQuery by going through a simple example. The code base used for this example and other examples is JHotDraw, a Java GUI framework for structured graphics.

Select the JHotDraw tab, if it is not already selected.

We are now ready to run our first query. To do this, we:

  1. Right click inside the tree subtab which brings up a context-sensitive menu. The contents of the menu depend on what type of element we click on

  2. Select Available Top Level Queries -> Package Browser (.java files) to run a query that will show us all of the packages in the working set and all of the classes and interfaces in those packages.

  3. The query result shows up in the tree subtab.

We can now navigate the results of the query by expanding tree nodes until we get to something that interests us.

To conclude this example, we will perform two sub-queries on the org.jhotdraw.framework.Figure interface.

  1. Navigate into the org.jhotdraw.framework package from the main Package Browser query.

  2. Right click on the Figure interface to bring up a context-sensitive menu.

  3. Select Members -> Methods

  4. The results of the sub-query show up as a child node of Figure. We can navigate these results the same as the top-level query results. If we wanted to, we could keep running subqueries until we found what we were looking for (e.g. all of the calls to the addToContainer method).

  5. JQuery supports more queries than just on the structural information in Java code. Right click again on the Figure interface and select the Usage -> Argument. The results of this sub-query show those methods with an argument of type Figure.

You may wish to try some of the other queries and sub-queries.

When you are ready to proceed, please notify the investigator.


Last Updated: 2006/07/11