Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-9408

JBoss Tools XML Editor should not format XML if the file is edited in Source tab.

    Details

    • Release Notes Text:
      Hide
      A bug existed when a user had edited XML in the Source view and changed focus from the XML editor to the Project Explorer. When the focus changed the XML editor would revert any changes made in the Source view. This issue has been resolved by ensuring the Synchronized To Text state of the Source XML editor is correct when focus is changed. The Source view of the XML editor now synchronizes correctly and does not revert to old content when the focus is changed from the XML editor to the Project Explorer.
      Show
      A bug existed when a user had edited XML in the Source view and changed focus from the XML editor to the Project Explorer. When the focus changed the XML editor would revert any changes made in the Source view. This issue has been resolved by ensuring the Synchronized To Text state of the Source XML editor is correct when focus is changed. The Source view of the XML editor now synchronizes correctly and does not revert to old content when the focus is changed from the XML editor to the Project Explorer.
    • Release Notes Docs Status:
      Documented as Resolved Issue

      Description

      EXECUTE: Create JSF KickStart project
      EXECUTE: Open web.xml with JBoss Tools XML Editor
      EXECUTE: Re-format the text (use Ctrl+A & Ctrl+Shift+F for example)
      EXECUTE: Save the file
      EXECUTE: Change

      <load-on-startup>1</load-on-startup>

      to

      <load-on-startup>some string</load-on-startup>


      EXECUTE: Save the file
      ASSERT: Text keeps current format.
      FAILURE: The text is re-formated back.

        Gliffy Diagrams

          Activity

          Hide
          scabanovich Viacheslav Kabanovich added a comment -

          Alexey, please verify.

          Show
          scabanovich Viacheslav Kabanovich added a comment - Alexey, please verify.
          Hide
          scabanovich Viacheslav Kabanovich added a comment -

          Alexey, please verify.

          Show
          scabanovich Viacheslav Kabanovich added a comment - Alexey, please verify.
          Hide
          akazakov Alexey Kazakov added a comment -

          Fixed.

          Show
          akazakov Alexey Kazakov added a comment - Fixed.
          Hide
          maxandersen Max Rydahl Andersen added a comment -

          reopening for clarification:

          There was alot of commits for this one - but no info on what the change/fix actually is ?

          Does this just keep track if things were just edited via the source pane and then just save it raw if that is the case ?

          does switching between the tabs before saving affect it or?

          Show
          maxandersen Max Rydahl Andersen added a comment - reopening for clarification: There was alot of commits for this one - but no info on what the change/fix actually is ? Does this just keep track if things were just edited via the source pane and then just save it raw if that is the case ? does switching between the tabs before saving affect it or?
          Hide
          scabanovich Viacheslav Kabanovich added a comment -

          Yes, when change is done in source pane, model is updated by that source and should come into state 'synchronized'.

          Switching between tabs runs synchronization between model and source, because, if user modified the source and switched to 'Tree' pane he has to see actual nodes in the tree and actual values in attribute field editors. The same argument is for synchronizing model when focus is moved from the text editor to Project Explorer or other view that may display contents of the file.

          The synchronization was already implemented with this one exception (that takes some length to describe is steps):
          a) model checks correctness of attributes to display errors in 'Tree' pane, and to set model object's state to error/correct;
          b) when model object's error state changes (new error appears in the source, or old error is fixed in the source), model has to fire change to 'Tree' pane for it to update error icons at tree nodes and attribute input fields;
          c) The update checks object's 'time stamp' to avoid unnecessary work, and so model object's time stamp is increased before firing;
          d) The update works both at 'Tree' and 'Source' pane and before firing event it is necessary to set correctly object's 'synchronized to text' state (which by default is set to 'not synchronized to text' as soon as object's time stamp is increased - that is helpful, when 'Tree' pane is edited)
          The failure was at the step (d).

          Show
          scabanovich Viacheslav Kabanovich added a comment - Yes, when change is done in source pane, model is updated by that source and should come into state 'synchronized'. Switching between tabs runs synchronization between model and source, because, if user modified the source and switched to 'Tree' pane he has to see actual nodes in the tree and actual values in attribute field editors. The same argument is for synchronizing model when focus is moved from the text editor to Project Explorer or other view that may display contents of the file. The synchronization was already implemented with this one exception (that takes some length to describe is steps): a) model checks correctness of attributes to display errors in 'Tree' pane, and to set model object's state to error/correct; b) when model object's error state changes (new error appears in the source, or old error is fixed in the source), model has to fire change to 'Tree' pane for it to update error icons at tree nodes and attribute input fields; c) The update checks object's 'time stamp' to avoid unnecessary work, and so model object's time stamp is increased before firing; d) The update works both at 'Tree' and 'Source' pane and before firing event it is necessary to set correctly object's 'synchronized to text' state (which by default is set to 'not synchronized to text' as soon as object's time stamp is increased - that is helpful, when 'Tree' pane is edited) The failure was at the step (d).
          Hide
          maxandersen Max Rydahl Andersen added a comment -

          Thanks great explanation!

          Show
          maxandersen Max Rydahl Andersen added a comment - Thanks great explanation!
          Hide
          vpakan Vlado Pakan added a comment -

          Verified on jbdevstudio-product-eap-linux-gtk-5.0.0.v201109021637R-H24-M3.

          Show
          vpakan Vlado Pakan added a comment - Verified on jbdevstudio-product-eap-linux-gtk-5.0.0.v201109021637R-H24-M3.
          Hide
          irooskov Isaac Rooskov added a comment -

          Re-opening to document release note text

          Show
          irooskov Isaac Rooskov added a comment - Re-opening to document release note text
          Hide
          irooskov Isaac Rooskov added a comment -

          Closing this issue again now that the release note has been writen

          Show
          irooskov Isaac Rooskov added a comment - Closing this issue again now that the release note has been writen

            People

            • Assignee:
              scabanovich Viacheslav Kabanovich
              Reporter:
              akazakov Alexey Kazakov
              Writer:
              Isaac Rooskov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development