Searching for an Element in all Classes in the Current Schema

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:

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

  1. 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.

  2. In the Search combo box, specify the text that you want to locate.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

  9. By default, comments in the source of a method are searched for and optionally replaced, in Jade methods only. Uncheck the Include Comments check box if you do not want to search for and optionally replace occurrences of the search text in method comments, including line (//) and block (/* */) comments.

    The Include Comments check box is not displayed if the Methods check box is not checked, as it does not apply to the search of class or global constants.

    The Include Comments check box is set to true (that is, checked) for the first search performed after logging on. Subsequent displays of the Global Search and Replace dialog set the check box value to the prior setting that was used to perform a search or replace action.

  10. If you want the search text to be interpreted as a regular expression pattern, check the Regex check box; for example, enter [A-Za-z]+\d{4} to search for one or more letters followed by four digits. By default, the Regex check box is unchecked. If you check the Regex check box, the Separate Lines check box is enabled.

    The following list shows examples of regular expressions that you can use in a Regex search. To search for:

    • At least a 4‑ or 5‑digit number assignment ignoring whitespace; for example, an error code

      \s*:=\s*\d{4,5}
    • Transaction methods

      (abortTransaction|beginTransaction|commitTransaction)
    • unloadForm in an epilog

      epilog[\s\S]*unloadForm
    • A variable declaration named userName

      vars[\s\S]*\buserName\b[\s\S]*begin
  11. If you want to treat the search text as if it is broken up into separate lines, check the Separate Lines check box; for example, if you want to search for a specified string at the start or end of a line, check this check box. When this check box is checked, the search breaks the text into individual lines at each CrLf end‑of‑line sequence. By default, the Separate Lines check box is unchecked.

  12. 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
  13. 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.

    • If you want to search the names and values of all imported entities that match your search criteria, check the Include Imported check box. This check box is unchecked by default.

    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.

  14. To start searching the selected class and schema options for your specified text, click the Find button.

  15. 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.

  16. 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.

The values of the Case Sensitive and Full Word Only check boxes are false (that is, unchecked) the first time the dialog is displayed after logging on to the Jade Platform development environment. After you perform a search, the values used in the search are saved. Those values are restored the next time the dialog is used in your current development environment session.