Community
Participate
Working Groups
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.
CC'ing Noam to keep him up-to-date with respect to progress.
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
Created attachment 72204 [details] Test Plan: Text Edit Operations
* 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
* 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
* 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
* 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
* 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.
* 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.
* 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.
* Added utilty method to find nodes given a single node versus a list of child nodes Patch released to HEAD.
* 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.
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