Apr 06

Several months ago, I posted a blog about writing a Xml editor based on JFace Text Framework. What has changed in the past months?

On my side, I went to frequently the eclipse newsgroups. I went to EclipseCon’09 and listened to Xml editor tutorial by WTP committers. While more gained experience, I would recommend that you extend WTP xml editor to build your own. Reasons are simple:

1. You don’t need to invent wheels from scratch
2. You can improve yourselves by reading WTP source codes
3. There are active communities you can turn to for help.

I’d like to recommend some additional resources for building your own xml editors:

1. The slides and code “Extending the XML and JSP editors from the WTP Project“, by IBM WTP committers
2. The lecture at EclipseCon2009 “Building the XML Editor you’ve always wanted“, and slides/sample.

Hope it helps.

  • Share/Bookmark
Mar 15

I am trying to understand Eclipse Modeling Framework (EMF). It is so important, because it’s the foudation of other modeling technologies. To name a few, TMF/Xtext and GMF.

So, what’s the relationship among EMF, Rational Rose, Annotated Java, and XML documents? Is one superior to another? Can EMF replace other stuff?

So far I can answer the questions partially. Let’s draw three circles on a whiteboard, and label them Rational Rose, Annotated Java, and XML Schema. As we can see, all three can have model definitions. If we describe a model by all 3 formats, there will definitely be some duplication.

This is partially where EMF fits in. It lands among the 3 modeling methods, and can works as bridges for the models.

One models his/her domain problems once, and transform the modeling to other forms as needed. For example, developers would like to see Java code, and managers prefer to looking at Rose class diagrams, and clients would love documentations.

Transformation is helpful. Like the animated TV Transformers. The robots gain speed performance in vehicle form, and gain fighting/fire performance in soldier form. You model gains different performance in different forms.

So, one of the benefits is lying in its magic transformation. I think mostly it is very straightforward for data model. We know that there are 2 elements in a class definition: data and operation. I am wondering if it helps in modeling the operations. Still a lot to dig out. Will keep walking on it.

  • Share/Bookmark
Jan 05

I am trying to write an XML Editor using JFace Text Framework. I started from the default XML Editor template created by eclipse. The editor is much more powerful than the very beginning. What I have finished during the weekend are:

  • Document Partitioning
    • Add CDATA scanner
    • Configured SourceViewConfiguration
    • Modified TagRule and a couple of classes
  • Syntax Coloring
    • Mimicked the color theme in XMLSpy, but added more colors
    • Merged some functions. Therefore a couple of classes are of no use now. Will clean them later.

I wish to add the following features:

  1. XML validation
  2. Error marker
  3. Content Assist
  4. Proposal for errors
  5. Define extension points for easy customization

I have created a project at google code. But right now it is not the timing to paste the link here. I might release it in the future.

If you are looking for reference materials about writing an editor, I recommend the following staff:

  1. Building an Eclipse Text Editor with JFace Text
    http://www.realsolve.co.uk/site/tech/jface-text.php
  2. Rinzo – Open Source XML Editor
    http://editorxml.sourceforge.net/features.html
  3. Java Developer’s Guide to Eclipse, download the CD-ROM content and find the SQL Editor sample:
    http://www.jdg2e.com/
  4. Eclipse Web Tools Platform (WTP) has an XML Editor:
    http://download.eclipse.org/webtools/downloads/
  5. HTML Editor also contains an XML editor:
    http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=EclipseHTMLEditor
  • Share/Bookmark