|Editor for multi-layered XML using IDocumentExtension3 and ProjectionDocument? [message #598006]
||Thu, 26 August 2004 21:08
Originally posted by: Mickel76.gmx.net|
I'm very new using and developing Eclipse plug-ins and I'm also new to this newsgroup. I don't know
either whether this is the right one of the several Eclipse newsgroups to ask this question. So I
hope you can help me. Any comments, suggestions and hints would be very useful for me.
I consider developing an editor plug-in for multi-layered XML data. This is something like
<1_utterance who="peter"><2_sentence>Can you give me</1_utterance>
<1_utterance who="paul">the hammer?</2_sentence></1_utterance>
The problem is that I have no hierarchical data structure, but rather a multi-hierarchical one. So
I have several hierarchical XML structures mapped on one common primary data instance. To
distinguish the several annotation layers I use layer-ID prefixes, which function a bit like
namespaces (and which are connected with the used annotation schemes (normaly DTD subsets)).
My editor should hide the layer-ID prefixes (using coloring instead) and should only allow the
annotation on one selected annotation layer. The tags of foreign annotation layers should be hidable
I have searched the Eclipse API and I found
- org.eclipse.jface.text.IDocumentExtension3, which adds the concept of multiple partitionings and
delimited partitions which has a well defined start delimiter and a well defined end delimiter
(working together with org.eclipse.jface.text.IDocumentPartitionerExtension2) and
- org.eclipse.jface.text.projection.ProjectionDocument which is a sequence of fragments of the
corresponding master document
Now my conception is to use the above structure as the content of a master IDocument and to define
for each annotation layer a different partitioning of the document with the layer-ID as a parameter
using IDocumentPartitionerExtension2 (the master document therefore must implement
IDocumentExtension3). Thus, I have a hierarchical partitioning in one layer, where each element in
this layer should be a delimited partition, and tags of foreign layers should be handled flat
similar to the normal character element content.
This partitionings I will use to define ProjectionDocuments where layer-IDs are hidden and elements
of the current annotation layer are highlighted different to them of foreign layers, and to hide
some user-selectable annotation layers by hiding their tags or to lock them.
Here are my questions:
- Is this design conformable to the conception of the mentioned interfaces?
- Can I first define the partitionings and then use them and their types to define ProjectionDocuments?
- How and where are projections defined? Are there any existing code examples using
ProjectionDocument and ProjectionDocumentManager?
- How and where are delimited Partitions defined and how is the interaction between
IDocumentExtension3 and IDocumentPartitionerExtension2? Are there any existing code examples using
- How can I lock regions so that the user can't change or delete the foreign tags? Example code?
The last time I implemented something in Java is several years ago. I read several articles,
documentations and news entries concerning Eclipse but I don't know how to start with my problem. I
don't know which classes/methods should be instanciated/called or overwritten and where to achieve a
special purpose. That's very frustrating. So any hint is welcome.
Thank you for reading the whole bunch of problems and in advance for helping me,
Powered by FUDForum
. Page generated in 0.02154 seconds