Bug 192946 - [Editors] Generalize text edit operation framework for use by all XML-based editors
Summary: [Editors] Generalize text edit operation framework for use by all XML-based e...
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Mike Pawlowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 193214
  Show dependency tree
 
Reported: 2007-06-15 13:37 EDT by Mike Pawlowski CLA
Modified: 2007-08-13 15:15 EDT (History)
2 users (show)

See Also:


Attachments
Test Plan: Text Edit Operations (28.50 KB, application/binary)
2007-06-22 13:56 EDT, Mike Pawlowski CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Pawlowski CLA 2007-06-15 13:37:24 EDT
Currently the text edit operation framework is tightly coupled with the Plug-in Manifest Editor.  All other XML-based editors in PDE use a simple model that completely rewrites the underlying edited file on save.

We need to generalize the text edit operation framework so that all XML-based editors can take advantage of the benefits.
Comment 1 Mike Pawlowski CLA 2007-06-21 17:19:58 EDT
CC'ing Noam to keep him up-to-date with respect to progress.
Comment 2 Mike Pawlowski CLA 2007-06-22 13:55:29 EDT
Model portion of the framework released to HEAD.

Essentially 3 generalized model object components:

Elements:
-> Interface:   IDocumentNode 
-> Base Class:  PluginDocumentNode

Attributes:  
-> Interface:   IDocumentAttribute
-> Base Class:  DocumentAttributeNode

Text:
-> Interface:   IDocumentTextNode 
-> Base Class:  DocumentTextNode

Model Adaptation Steps

* All model objects should 
  -> Extend element base class
  -> Use attribute base class type for storing attribute instance variables
  -> Use text base class type for storing text instance variables
  -> Store attributes in the element base class
  -> Store children in the element base class
  -> Store text child in the element base class
  -> Override default write methods
  -> Track parent and siblings in element base class

TODO:

* Refactor names and locations

   IDocumentNode -> IDocumentElementNode
   PluginDocumentNode -> DocumentElementNode
   IDocumentAttribute -> IDocumentAttributeNode

* Test by implementing Bug # 193214
Comment 3 Mike Pawlowski CLA 2007-06-22 13:56:56 EDT
Created attachment 72204 [details]
Test Plan:  Text Edit Operations
Comment 4 Mike Pawlowski CLA 2007-07-24 11:56:26 EDT
* Added another generalized model object component:  DocumentObject
  -> Extends PluginDocumentNode
  -> Responsible for model related operations
   
* Refactored methods up and down the hierarchy to suit functionality
  -> XML operations vs. model domain

* Re-implemented Simple Cheat Sheet model
  -> Factory
  -> SAX handler
  -> Stub model objects
   
Patch released to HEAD and Toc_Editor branch   
   
Comment 5 Mike Pawlowski CLA 2007-07-25 11:21:13 EDT
* Updated DocumentObject
  -> Added generalized utility methods to encapsulate all model related 
     operations
  -> Abstracted event firing
  -> Abstracted element, attribute, XML decl writing

* Re-implemented Simple Cheat Sheet Model objects
  -> SimpleCS
  -> SimpleCSIntro

Patch released to HEAD and Toc_Editor branch   
Comment 6 Mike Pawlowski CLA 2007-07-25 17:15:28 EDT
* Updated DocumentObject
  -> Added generalized utility methods to 
      - Filter child node lists and arrays
      - Set / get boolean attribute values

* Re-implemented Simple Cheat Sheet Model objects
  -> SimpleCSItem

Patch released to HEAD and Toc_Editor branch 
Comment 7 Mike Pawlowski CLA 2007-07-30 15:36:19 EDT
* Added method to framework to create custom document text nodes
  -> Created custom document text node for writing descriptions
  
* Generalized writing of document attributes and text nodes

* Added generalized node factory to framework
  -> NodeDocumentFactory

* Added generalized node handler to framework
  -> DocumentNodeHandler

* Re-implemented Simple Cheat Sheet Model objects
  -> SimpleCSDescription

Patch released to HEAD and Toc_Editor branch 
Comment 8 Mike Pawlowski CLA 2007-07-31 15:43:40 EDT
* In the model flag generalized and pushed up to document object framework class
-> Fixes bug where model objects added to newly added model objects do not fire
   an event

Patch released to HEAD.
Comment 9 Mike Pawlowski CLA 2007-07-31 19:36:55 EDT
* Implemented generalized clone method for all document nodes
  -> Clones the document node by serializing, deserializing and reconnecting
     it
  -> Fixes move node utility method used for Up / Down actions
     - Insert edit text edit operation now used instead of a replace edit
       opearation

Patch released to HEAD.
Comment 10 Mike Pawlowski CLA 2007-08-01 13:45:07 EDT
* Made DocumentAttributeNode implement the IDocumentRange interface
  -> Implemented for backwards compatibility with utility methods that
     assume that an attribute is a document range.
     Stems from the problem that attributes are considered as elements
     in the hierarchy in the manifest model
  -> Offset and length returned are valid values but have no clients as in
     the manifest model case
     
Patch released to HEAD.
Comment 11 Mike Pawlowski CLA 2007-08-01 15:31:45 EDT
* Added utilty method to find nodes given a single node versus a list of 
  child nodes
  
Patch released to HEAD.
Comment 12 Mike Pawlowski CLA 2007-08-01 18:22:45 EDT
* Re-implemented all remaining Simple Cheat Sheet Model objects
  -> Action
  -> Command
  -> Conditional Sub-item
  -> Repeated Sub-item
  -> Perform When
  -> On Completion
  -> Sub-item

Patch released to HEAD.
Comment 13 Mike Pawlowski CLA 2007-08-13 15:15:53 EDT
Refactoring complete.  Patch released to HEAD.

We now have two working clients of the generalized text edit operation
framework:

* TOC Editor:  Bug # 193826

* Simple Cheat Sheet Editor:  Bug # 193214

Major work on the new framework can be considered complete

Target:  3.4 M2