CS298 Proposal
XML Editor
Commands with Multiple Undo/Redo
Swati
R. Pathak (swatibshah@yahoo.com)
Advisor: Dr. Cay Horstmann (horstman@cs.sjsu.edu)
Committee Members:
Dr. Chris Pollett (cpollett@yahoo.com),
Department of Computer Science, SJSU.
Dr. Mark Stamp (stamp@cs.sjsu.edu),
Department of Computer Science, SJSU.
Abstract:
Extensible Markup Language (XML) has now become a standard language to store and share structured documents on the Internet. It is quickly replacing its much restricted predecessor - Hypertext Markup Language (HTML). XML provides flexibility and extensibility by allowing arbitrary element structure as opposed to the fixed structure of HTML. Despite XML’s popularity, there are few good XML editors available today. Some editors are too general – providing little more functionality than simple text editors; and some are too specific – overly restricting the users’ actions. For example, <oXygen/>, Morphon and XMLMind support only well-formed XML documents; while XML Spy supports non-well-formed XML documents, it works only on Windows platform (source: Nupura Neurgaonkar’s CS297 report). Many of these editors are also very expensive.
In prior years,
Dr. Horstmann's students have produced several special-purpose XML editors
that are based on the Java Swing framework. The focus of my project is to enhance these implementations, and provide a robust support for What-You-See-Is-What-You-Get (WYSIWYG) document editing with multiple undo/redo. The main editing functionalities that I will implement are cut-copy-paste, search/replace etc. along with undo/redo support. Implementation in Java makes the editor essentially platform-independent. Nupura Neurgaonkar is developing DTD validation and pluggable rendering of XML elements on the same framework under Dr. Horstmann.
Summary of CS297 Work:
· Thoroughly understood the available framework.
· Implemented Tree View for WYSIWYG editing.
· Implemented some editing functionalities with undo/redo support.
Proposed Schedule:
Time Period |
Task |
Weeks
1 & 2 (Jan 28 – Feb 6) |
Implement
Flat Paragraph View |
Weeks 3,4 & 5
(Feb 9 – Feb 27) |
Implement
Search/replace with undo/redo functionality |
Weeks 6 & 7
(March 1 – March 12) |
Test and Clean up
the code |
Week 8 (March 15 – March 19) |
Prepare an outline
of CS298 report |
Week 9 to Week 12
(March 22 – April 16) |
Prepare CS298
report |
Week 13 (April 19 –
April 23) |
Show the report to
the committee |
Week 14 (April 26 – April 30) |
Finalize the report, and submit. |
Week 15 (May 3 –
May 7) |
Prepare for
presentation. |
Week 16 (May 10 – May 14) |
Defend the project. |
Deliverables:
I propose to deliver the following at the end of CS298
semester:
· The following XML editing features:
o Ability to insert and delete an element.
o Ability to split an element into two, and merge two consecutive elements if possible.
o Support for Cut-copy-paste and search/replace functionalities.
o Undo and redo up to any level of depth for any sequence of the above edit operations.
o Ability to show XML elements in “Tree View” – a view that displays all child elements of a given element at an offset, thereby clearly showing the parent-child relationship.
o A view for XML elements that lays out the child elements of a given element horizontally, and wraps along the x-axis if required (Flat Paragraph View).
· A report of about 50 double-spaced pages discussing the project.
Innovations and Challenges:
·
I am using the text package of Java Swing
framework for the implementation. This package is one of the most complex and
most poorly documented packages in Java Swing. Also, I need to cope with inconsistencies
and design flaws, which requires reverse-engineering and creative work-arounds.
·
I am implementing Flat Paragraph View to
overcome the limitations of the paragraph view provided by Swing. For the
implementation, I need to understand Swing’s paragraph view in detail. I also
need to design a new container view that can break itself in multiple lines
when required. This is highly non-trivial and challenging to implement. Besides,
no container view in Swing currently exhibits this behavior.
·
The javax.swing.undo
package does not provide a ready-to-use undo support. To use it, I need to
design all edit operations in such a way that their effects can be reversed.
References:
[GHJV02] Gamma, E., Helm, R.,
Johnson, R. & Vlissides, J. (2002). Design
Patterns. Addison Wesley.
[LEWEC02] Loy, M., Eckstein, R., Wood, D., Elliott, J. & Cole, B.
(2002). Java Swing. O’Reilly.
[S02] Sun, C. (2002). Undo as
Concurrent Inverse in Group Editors. ACM Transactions on Computer-Human
Interaction, v 9, n 4, p 309-361.
[T00] Topley, K. (2000). Core Swing
Advanced Programming. Prentice Hall.
[V03] Violet, S. (2003). Understanding
the ElementBuffer. http://java.sun.com/products/jfc/tsc/articles/text/element_buffer.
[WBT01] Wallace, G., Biddle, R.
& Tempero, E. (2001). Smarter
Cut-and-Paste for Programming Text Editors. Proceedings of the 2nd
Australasian Conference on User interface, p 56-63.
[WF02] Washizaki, H. & Fukazawa, Y. (2002). Dynamic Hierarchical Undo Facility in a
Fine-grained Component Environment. Proceedings
of the Fortieth International Conference on Tools Pacific: Objects for
internet, mobile and embedded applications, v 10, SESSION: Design, p 191-199.
[XML03] XML Software
(2003). http://xmlsoftware.com/editors.html
[ZW00] Zhang, M. & Wang,
K. (2000). Implementing Undo/Redo in PDF studio using
object-oriented design pattern. Proceedings of the Conference on Technology of Object-Oriented
Languages and Systems, v TOOLS, n TOOL 36, p 58-64.