a query-based code browser
 
Home
Download
Papers
Screen Shots
Contact
 

Basic Features

< ^ >

This section describes the basic features of JQuery.


Creating a new query tab

You can create a query tab for as many working sets as you want. You are limited by the amount of memory in your system, so it is recommended that only two or three tabs be used at the same time. To create a new query tab:

  1. Click on the icon or select New Query Tab from the drop down menu (). This will bring up a working set selector in which you can select/create/edit the working set that this query tab will operate on.

  2. Warning: Only select the code that you want to be able to query. Do not select an entire project or large library jar files (unless you want to query on those files). It can take a very long time and use a lot of memory to parse a huge number of files.

    It is recommended that you first parse your codebase and then edit your working set to include only the class files that you need (i.e the class files in java.lang or java.util in rt.jar).
  3. Select a working set and click OK. The query tab will then show up. Depending on the size of the codebase in your working set it may take a few seconds for it to show up.

  4. Right-click in the tree subtab to start updating the database.


Editing the working set for a query tab

As a query tab is linked to a working set, you can change the working set for a query tab to add or remove files. To do this:

  1. Select Edit Tab's Working Set from the drop down menu (). This will bring up a working set editor in which you can modify the working set.

  2. After you have finshed modifying the working set, click on Finish.

  3. Right-click in the tree subtab to start updating the database. This will only cause new files to get parsed. You will still have to re-execute any queries you currently have in order to make the new results show up.


Closing a query tab

To close a query tab, click on the icon on the tab or select Close Query Tab from the drop down menu ().

Note: Closing a query tab does not delete any of the data in the JQuery database for that tab. If you re-create a query tab for a working set for which you had a previous query tab, it will load the old one. If you actually want to delete the data, follow the instructions for "Clearing all JQuery data".

Running a query


Re-executing a query

To re-exectute a query:

  1. Right-click on the icon for the query you want to re-execute.

  2. Select Re-execute Query from the menu that pops up.


Stopping a query

If you notice that a query is taking far too long to execute, you can stop it by clicking on the icon or selecting Stop Query from the drop down menu ().


Editing a query

To edit a query:

  1. Double-click on the icon for the query you want to edit or right-click on it and select Edit Query from the context menu.

    This brings up the query editor.

  2. Modify the query:

    • Query Name - The name that will show up on the query node in the tree.

    • Query - The query to be run. You can right-click on this text box to get a list of predicates that you can insert into your query.

    • Order of variables - The hierarchical order of the results. To initially populate this list from your query, click on Get Vars. You can change the order in which the variables are displayed by selecting them and using the Move Up and Move Down buttons. To hide a particular variable from the results, uncheck the checkbox for that variable and it will not show up in the tree.

  3. Click OK to run the edited query.


Deleting a query

To delete a query:

  1. Right-click on the icon for the query you want to delete.

  2. Select Delete Query from the menu that pops up.


Forcing a complete refresh of the database

It is possible for the JQuery database to become corrupted from a system crash or an incorrect shutdown of Eclipse. In most cases JQuery will recover by itself, but if you find that the data being returned from queries looks corrupted you can force JQuery to reparse your working set and refresh its database:

  1. Select "Force Complete Refresh" from the drop down menu ().

  2. Right-click in the tree subtab to start updating the database. A complete refresh can take up to twice as long as an initial update.


Clearing all JQuery Data

You may find that you have created query tabs for working sets that you aren't using anymore and that too much data is currently in the JQuery database. You can reset JQuery to its initial state which will delete all query tabs and any queries that you have done by doing the following:

  1. Close Eclipse.

  2. Remove the ca.ubc.jquery directory from the .metadata directory in your workspace.

  3. Restart Eclipse. Any query tabs that you were currently working on will have dissapeared as well as any rules files or fact libraries that you have added (you will have to re-add them).

 

< ^ >