The Global Search And Replace dialog, accessed from the Edit menu when a browser has focus, enables you to locate and display all occurrences of specified text in the:
Current class, the current class and subclasses, the current class and superclasses, or in all classes.
Current schema, the current schema and subschemas, the current schema and superschemas, or in all schemas.
The global find functionality searches all methods that meet the specified search criteria, regardless of whether the method cannot be modified or whether it is currently being edited. Any methods currently modified and unsaved by you are also included, but the find action searches only the saved persistent source; not the unsaved source.
The search uses the current method source according to whether or not a delta is set. If you have a delta set, the checked‑out source of a method is searched if it exists; otherwise the unchecked-out source is used.
The replace functionality ignores any methods that cannot be modified, including any unsaved methods that you currently have open.
See also "Locating an Element in a Browser Editor Pane", "Finding the Next Occurrence of Specified Text", and "Locating Text on Which the Caret is Positioned", earlier in this chapter.
To locate and display all occurrences of specified text
Select the Global Find/Replace command from the Edit menu or press Shift+Ctrl+F3.
The Global Search And Replace dialog, shown in the following image, is then displayed.
The contents of the Search combo box is selected (overtype mode) when the dialog is opened. This combo box contains a list of the text of the last 50 unique searches that you performed, so that you can repeat previous searches by selecting an entry from the combo box list. This list is maintained in the user profile of your current user logon.
In the Search combo box, specify the text that you want to locate.
In the Replace combo box, specify the text that is to replace any located text that is specified, if required. When the dialog is opened, this combo box is always blank, to prevent accidental replacements with text from previous replacements.
This combo box contains a list of the text of the last 50 unique replacements that you performed, so that you can repeat previous replacements by selecting an entry from the combo box list. This list is maintained in the user profile of your current user logon.
If you want the exact match by case (where uppercase or lowercase is significant), check the Case Sensitive check box. A search is then performed for text with the same capitalization as the text in the Search combo box. By default, searching is case-insensitive; that is, this check box is unchecked.
You can optionally replace text that is located and matched by case with text with the same capitalization as that specified in the Replace combo box.
If you do not want to confirm that each occurrence of the specified search text is replaced with the specified replacement text, uncheck the Prompt on Replace check box. You are prompted to confirm text replacement by default; that is, this check box is checked.
When text replacement confirmation is selected and you click the Replace button, the Verify Replace dialog is displayed every time the search text is located, superimposed on an editor pane that displays the located text highlighted in the pane and the schema, class, and method in which the located text occurs displayed in the title bar.
In the Verify Replace dialog, perform one of the following actions.
Click the Yes button to confirm that the located text is to be replaced.
Click the No button to leave the highlighted text unchanged and continue searching for the specified string.
Click the Cancel button to abandon the search and return focus to the editor pane.
If you want to search for a JADE instruction, or keyword, check the Keyword Search check box. A search is then performed for the specified JADE instruction. By default, searching is case-insensitive; that is, this check box is unchecked.
The Replace button is disabled when a keyword search is performed.
As JADE instructions are located only in methods that have been compiled, no search results are displayed for any method that matches your selection criteria but is uncompiled.
If you want to locate only text in which the whole word matches, check the Full Word Only check box. A search is then performed for text that exactly matches the text in the Search combo box. By default, any text that matches the string that is being searched for will be located, regardless of whether it is embedded or not in another word; that is, this check box is unchecked.
You can optionally replace the full word that is located with text with specified in the Replace combo box.
If you want each method in which the text is located and replaced to be saved as the replacement is made, check the Progressive Save check box. By default, all methods in which replacements are made are saved, or committed, after all replacements have been made; that is, this check box is unchecked.
Use the options in the Restrict Search To group box to select the classes and schemas in which the search is actioned.
When the Class Browser or Primitive Types Browser has focus, the search is performed only on the selected class in the current schema and its superschemas (that is, the Selected Class Only option button and the Current Schema And Superschemas option button are selected).
Conversely, when the Schema Browser has focus, options that are not valid are disabled and the All Classes and Current Schema And Superschemas option buttons are selected by default.
If you want to restrict the search or replacement to another option, the values that are you can select are listed in the following table, to enable you to select the appropriate option.
Class Restriction Options | Schema Restriction Options |
---|---|
Selected Class Only (Class or Primitive Types Browser default value) | Current Schema Only |
Selected Class And Subclasses | Current Schema and Subschemas |
Selected Class And Superclasses | Current Schema and Superschemas (default value) |
All Classes (Schema Browser default value) | All Schemas |
To specify the entities for which to search, in the Search Entities group box:
If you do not want to search the name and text of all methods that match your search criteria, uncheck the Methods check box. This check box is checked by default.
If you want to search the names and values of all class constants that match your search criteria, check the Class Constants check box. This check box is unchecked by default.
If you want to search the names and values of all global constants that match your search criteria, check the Global Constants check box. This check box is unchecked by default.
The options in the Restrict Search To group box that control what classes to search are ignored when searching for global constant names and values. If the Global Constants check box is the only one checked in the Search Entities group box, the classes options group box is disabled.
The Class Constants and Global Constants check boxes are disabled if you checked the Keyword Search check box in step 6 of this instruction.
The Class Constants and Global Constants check boxes are unchecked by default, because those options cannot be used with the replace facility. Checking those options disables the Replace button.
To start searching the selected class and schema options for your specified text, click the Find button.
If you want to replace all occurrences of the text specified in the Search combo box in all classes and schemas that match your selection criteria with the replacement text specified in the Replace combo box, click the Replace button. (This button is disabled for keyword searches.)
If JADE finds the text string that matches your specified options and you unchecked the Prompt On Replace check box, all occurrences of the located text are then replaced with the specified replacement text and focus is returned to the editor pane.
The default Prompt on Replace check box value indicates that a message dialog is displayed for each occurrence of the searched for text, to enable you to confirm that you want to replace it with the specified text.
Click the OK button. Alternatively, click the Cancel button to abandon your selection.
A progress dialog is then displayed, showing the current class that is being searched, the percentage of the search that has been completed, and the current number of occurrences that have been located.
When the search is complete, any entries that are located are displayed alphabetically, and depending on the entities that were included in your search, the list could contain the names of methods, class constants, and global constants. Clicking on a class constant or global constant entry displays the details of the constant definition.
You can cancel a search, by clicking the Cancel button in the progress dialog.
If no occurrences of your specified text are located, the Message dialog is displayed, advising you that the search text was not found.
For details about viewing search results, see "Viewing Located Search Results", in the following section.