XML Schema Analysis, Safe Rename, and Safe Delete
Draft Version 1.5
8 May 2006 (Revised 1 June 2006)
Jeri Lockhart

This document describes changes and additions to TPR3 for the Analysis View, Safe Rename, Safe Delete, and Find Usages..

  • Analysis View Menu
The Find Unused Globals, Find Primitive Uses, Find Substitution Groups, and Find Derivations of a Complex Type queries will continue to be invoked from the Analysis View, but the menu UI will change.  Instead of using the column view control, the queries will be listed in a sectioned document-style UI, which makes better use of horizontal space.  This is a rough sketch:

Query Menu

 If more queries are added for Coke, a nested version of this UI will be used so that the queries can be categorized. 



  • Analysis View Output

           TPR3 Find Usages Results Window
            Find Usages Single File Results

The results of the Analysis View queries will move to the IDE output mode to the same window as the Find Usages output (see TPR3 screenshot above).  The window will be renamed from "XML Usages" to "XML Analysis" or "XML Query Results".  For the Find Usages query, the child tab will be labeled  "Find XML Usages".  The tabs for the other queries will be labeled "Find Primitive", "Find Substitution Groups", or "Find Derivations", as appropriate.  The advantages of moving the results to the output mode, are that the results can be retained when selecting a new query,  and that the actions to navigate or highlight the Schema View or Source View will be easier to use.

A button to layout the graph will be added to the vertical toolbar  on the left side of the window, immediately beneath the Refresh button.  [Need an icon for the Graph Layout button]

If there's time, a graph search facility will be added.  The search textfield will be part of a horizontal toolbar on the lower end of the graph pane.  If this search facility is added, the Graph Layout button will be relocated to the graph toolbar.   The minimum capability of the search facility would be to highlight nodes whose labels match, case-insensitively,  the text that is typed into the search text field

  • Rename and Safely Delete Schema Components
In TPR3,  there are two kinds of delete actions on  a schema component node in the Schema View, "Delete" and "Safely Delete".  Safely Delete checks for usages of the component in the schema file and warns the user if usages are found.  For  Coke, Rename and Safely Delete will be changed to behave like the Java refactoring rename and delete actions.  The schema components nodes will have a "Refactoring" popup item.  In addition the following rename actions will behave like an explicit rename refactoring:

  1. Rename a component in a property sheet
  2. Rename a component in place in the Schema View or Instance View
The Java "Refactor" item in the main menu of the IDE does not have any affect on Schema refactoring.


Behaviour of Rename:
["refactoring set" refers to the set of schema models and multiviews that is modified during a rename or delete refactoring]
  1. Rename will check for usages of the component in the current project if the component is a global component.  
  2. Non-global components will be renamed without checking for usages and without showing a preview window.  Otherwise, the behaviour is the same as that for a global component (auto save and undo/redo capability).  
  3. It will also check for usages of the component in WSDL and BPEL files.  [see related section "Scope of Find Usages Action"]
  4. The UI will be blocked while the usages are being found.  
  5. After the IDE has completed the search for usages:
  1. They will be shown in a preview window if the user has specified "Preview All Changes" , which is the default
  2. The Preview shows the components in the files of the project that use the rename component.
  3. If the Preview window is shown, the user can deselect components that should be excluded from the refactoring
  4. If any changes are made to the refactoring set, such as a user edit, another refactoring, or a deletion of a file, the Preview will be disabled.  Unlike Java refactoring, which disables the Preview if any Java changes occur in the IDE, only changes to the refactoring set will disable the XML Preview.  
  5. Modifications to models that are external to the Preview, even if the change is to add a usage of the rename component to an external model, do not affect the Preview.
  6. If the Preview has been disabled, the user must refresh the Preview before running the refactoring.
  7. From the Preview, the user runs the refactoring by pressing the "Do Refactoring" button [Should this button be labeled "Refactor"?]
  • The refactoring will run automatically if the user has unchecked "Preview All Changes" when first invoking the rename
  • The UI is blocked by a modal progress dialog while the refactoring is running
  • After the refactoring has completed, if the Preview was shown, it is automatically closed
  • After the refactoring the files are automatically saved.
  • Undo/Redo behaviour  [see note]
    1. To undo the rename, the user selects  "Undo Rename" from the schema component node's popup menu.  
    2. The Undo menu item is enabled after a rename refactoring has completed.
    3. Undo is disabled if any member of the refactoring set is modified after the refactoring
    4. After undoing the rename, the user can  redo the rename from the same popup menu
    5. The undo depth is one, i.e., only the last refactoring can be undone
    Behaviour of Safe Delete:
    1. Safely Delete will check for usages of the component in the project, if the component is global 
    2. Non-global components will be deleted without checking for usages and without showing a preview window.  Otherwise, the behaviour is the same as that for a global component (auto save and undo/redo capability).  [Should BPEL assignment XPATH statements be checked for usages of  local components?]
    3. Scope of Find Usages Action It will also check for usages of the component in WSDL and BPEL files [see related section "Scope of Find Usages Action"]
    4. When the user invokes Safely Delete, he or she can choose to bypass the Preview
    5. If usages are found, a warning dialog will be shown. (The dialog could also contain Errors).
    6. If only warnings are issued, the user can   
    1. Continue to the Preview
    • If usages had been found, and the user has chosen to proceed to the Preview, the Preview will display the message "Delete component but keep the 5 usages of it. [1 occurrence]".
    • (The Java delete preview has this message:   "Delete classes and keep references to them, if any. [1 occurrence]" )
  • or, if bypassing the Preview, proceed directly to the refactoring,
  • or press the "Show Usages" button
    • The Show Usages results is identical to the TPR3 Show Usages, except that there is a button "Rerun Safe Delete".
  • or cancel the deleteThe refactoring will run automatically if the user has unchecked "Preview All Changes" when first invoking the delete
  • The UI is blocked by a modal progress dialog while the refactoring is running
  • After the refactoring has completed, if the Preview was shown, it is automatically closed. 
  • After the refactoring the files are automatically saved.
  • Undo/Redo behaviour is similar to the undo/redo behaviour for rename
  • Note on Undo/Redo:
    If feasible, the following "smart" Undo/Redo behaviour will be implemented:
    1. To undo the refactoring, the user can do one of the following:
    1. Select "Undo" from the schema component node's popup menu.  
    2. Select Edit | Undo from the IDE main menu when a multiview in the refactoring set is active
    3. Press Ctrl+Z  when a multiview in the refactoring set is active
  • The menu items and  accelerator are enabled after a refactoring is done, and remain enabled even if a model in the refactoring set is subsequently modified.
  • When the user selects Undo, a warning message will be issued if any of the models in the refactoring set have been modified after the refactoring.  The user can choose to 
    1. undo only the model for the currently active multiview
    2. cancel the undo request
  • After undoing the rename, the user can  redo the refactoring from the popup menu, the main Edit menu, or with Ctrl+Y 
  • There is no limit to the number of undos that can be accumulated

  • TPR3 Popup Coke Schema Component Node Popup
    Old TPR3 Schema Component Node Popup New Coke Schema Component Popup
    ["Show Usages" changed to "Find Usages"
    Java Refactoring Popup
    Java Refactoring Popup on Method Node in Projects Explorer
    (Shown for comparison)

    Warning if trying to delete component that has uses

    Warning if trying to delete a component that has usages.

    • Scope of Find Usages Action
    The Find Usages action on the nodes for global component in the Schema View will use refactoring engines provided by the WSDL, BPEL, and Schema modules to find usages of the component in the current project.  The file nodes in the visualization will have different icons, node shapes and/or node colors to differentiate them.


    Project Features

    About this Project

    XML was started in November 2009, is owned by dstrupl, and has 58 members.
    By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
     
     
    Close
    loading
    Please Confirm
    Close