Product Information > JADE Development Environment User’s Guide > Chapter 3 - Defining Classes in Your Own Schema > Searching for an Element in all Classes in the Current Schema

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:

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

  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.

    You can optionally replace an instruction (for example, beginTransaction) that is located with another instruction (for example, beginTransientTransaction) specified in the Replace combo box.

    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. 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
  10. To start searching the selected class and schema options for your specified text, click the Find button.

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

    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.

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

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.