Find and Replace Dialog

The Find and Replace Dialog is used to search for and replace text in the currently active document, and to search for text in all project files. The dialog can be opened by clicking Find and Replace under the Edit menu, then selecting Find..., Replace... or Find in Project, or by using the context menu after right-clicking on an XJEase editor.

Alternatively, the Ctrl + F, Ctrl + H and Ctrl + Shift + F keyboard shortcuts may be used from an XJEase editor.

The Results Panel

In the lower half of the Find and Replace Dialog, the results panel displays search results for each of the different search types (current document, all project files and finding all references).

The results from each search type are displayed in separate tabs, so that a comparison can be made. Any subsequent searches for each search type will replace the results in the corresponding tab. Search results are organised into a hierarchy of collapsable nodes, firstly by their file type at the highest level (either a test device file, circuit code file, BSDL file or XJEase library file), then followed by the name of the file that the result was found within (relative to the project base directory), followed by individual results.

Each search result displays a section of the line that the result was found in (in the case of multi-line results, the first line will be displayed) with the match inside the line highlighted. Both the line number and column number are given for each result.

Left-clicking on a search result will navigate to both the file and location within that file where the result is found. Depending on which screen is currently displayed in XJDeveloper, this may either involve opening a new tab within the editor, navigating to a different screen, opening the BSDL editor, or giving focus to a separated screen. After navigating to the result, the contents of the match is highlighted within the document.

If a file has been edited either from within XJDeveloper or externally, then any results from prior searches that were found within the subsequently modified files are marked to indicate that the results may no longer be accurate. If a file has been modified since a search, the text of the row displaying the file name is recoloured to grey and all rows containing individual results found within the file are displayed in italics.

The results pane contains Next Result and Previous Result navigation buttons to cycle through results in the tree. Clicking on these buttons will select and navigate to the next or previous result respectively, and will automatically expand any collapsed nodes necessary to display the next/previous result in the tree.

The status label below the tree displays both how many matches have been found in total, and how many files have been found that contain matches.

Current Document Search

Selecting the Current document radio button enables searching the active document displayed in the XJEase editor window that currently has focus. Opening the dialog using the Ctrl + F shortcut will select this radio button automatically. The document that is currently active is displayed in the title bar of the Find and Replace dialog, indicating which document will be searched.

A variety of search options are available which can be toggled by using the corresponding checkboxes. These options are described in the table below.

Search Option Description
Use Regular Expression Enables searching to find all results that match a regular expression. Note that multi-line searches may be performed using a regular expression.
Search in Selection Enables searching only the current selection within the document. If no selection is present, this option is disabled.
Match Case If checked, this enables matching with case sensitivity.
Whole Word If checked, this restricts the search to find only whole words that are a match, and ignores any occurences of what would otherwise be a match but is contained within one or more words. Note that this option may only be used if the Starts With option is unchecked.
Starts With If checked, restricts the search to find words that begin with the match, and ignores any occurences of what would otherwise be a match but is present at the end of a word. Note that this option may only be used if the Whole Word option is unchecked.

When using the Find Next button, the Search Direction radio buttons indicate which direction within the document the next result found will be respective to the result that the caret is positioned on.

The Mark All button will highlight all matches within the document (note that this is only a visual highlight, and does not affect the selection). The Clear button removes these highlights.

All Project Files Search

If a project is open, selecting the All project files radio button enables searching all files that are used within the project. Opening the dialog using the Ctrl + Shift + F shortcut will select this radio button automatically. If a project is not open, this option will be disabled.

Project files that are searched include device files and their include files, circuit code files and BSDL files. This does not include library files, unless they have been assigned to a device and are used within the project. Searching all project files will search the contents of files on disk unless the file has been opened inside an XJEase editor, in which case the current contents of the editor is searched.

Options similar to those shown in the table above are available when searching all project files, with the exception of searching in selection. The search direction buttons are disabled when searching all project files, and clicking Find All will always begin a new search, regardless of whether the text in the search bar has changed.

Finding All References

Finding all references cannot be launched directly from the Find and Replace dialog, however results from a reference search are displayed in the results panel. More information about finding all references can be found on the Test Code Editor page.