Class.Insight - Forget about typing your import statements!

Class.Insight allows quick finding Java classes with short names matching the word at the cursor position, and inserting there the class name found and its import statement. To choose a class from several possible variants, it employs a popup window similar to other JavaInsight popups (MemberInsight, ParameterInsight etc.). You don't need to type import statements manually - just use Class.Insight to find and insert the required class and let it make all other job for you!

Sample of Class.Insight hint
Sample of Class.Insight hint

The Class.Insight backend caches all the required information about classes containing in project, JDK and project required libraries to speedup usage. The cache build is initiated only on the first Class.Insight invocation so it doesn't affect JBuilder startup and a project opening time. The Class.Insight saves the cache in the project directory while project closing and loads the cache from disk when the project is opened next time. The cache file is named <Project Name>.cache and it can be easily removed when unneeded us Productivity! will automatically recreate it before the next Class.Insight use.

When editing a file, place the cursor over the word you want to expand as a class name (or at a blank space) and press Ctrl+Alt+Space (Ctrl+Alt+H ) (CUA) to invoke Class.Insight. The Class.Insight popup will be shown with the list of classes matching the word at the cursor position. You can select a class navigating through the list with the help of the usual keyboard. An alternative way to do it is to continue typing the word; the list selection will be changed to produce the closest match possible.

Class.Insight Actions

On selecting a class, you may choose from several options with the help of the following shortcuts:

If there are no matches found and Navigation Pane is not visible, Class.Insight - Select Class dialog is shown. Select a class in this dialog and press OK. The Class.Insight will replace (or just insert) the word at the cursor position with a selected class name adding the appropriate import statement.

Showing Navigation Pane

You can switch Class.Insight popup to show the Navigation Pane by turning off the Editor Options | Productivity! | Usage | Show Class.Insight popup as list checkbox. With this option turned off, Class.Insight popup will be shown with the Navigation Pane, that allows using Class.Insight popup instead of Class.Insight - Select Class dialog even if there is no word at the cursor position or if there are no matching classes found. To find matches, type a word in the Use Class edit box and Class.Insight will dynamically rearrange the classes’ list to show the matching ones.

Options Dependency

Please note that set of classes shown in the Class.Insight list depends on Packages Exclusion settings on Project Properties | Productivity! | General property page.

Import statements are generated basing on the Imports Generation settings on the Editor Options | Productivity! | General property page. There you can also customize other Class.Insight options, such as Search Options, Sort Classes By, Autocomplete and Productivity! Insights Usage

See also: Productivity! Tools, Customizing Productivity!