Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[orion-dev] Editor plugin : edit only part of an XML doc ?

Hi,

I'm looking for some advice.

We deal with projects that have specific files inside, with our own DSLs, allowing to define rules and such stuff.

Those files contain the text of the DSL, wrapped into XML, as we need additional properties, not the text only :

<rule>
  <foo>bar</foo>
  <dsl>this is a dsl !</dsl>
</rule>

In eclipse, we already provide custom editors for these files. They implement the UI of the editor, and the loading of the resource (the XML with DSL inside). Therefore, they can extract the DSL and show the text in a specific Editor, and also show other properties as they see fit.

I'm now trying to edit those files in Orion. I have customized the editor with plugins that know the grammar etc for our DSLs. I can actually edit my DSLs using the orion editor, works fine.

Problem is, the DSL is inside an XML doc, which opens as-is into orion. Therefore my "parser" ain't happy with the whole XML, it expects only the DSL text to be used.

I'd like to extract the DSL text from the XML doc in some way, and edit this only in the orion editor. The XML would not be displayed in the editor. Then, on save, I need to add the XML back around the potentially modified DSL text. I basically want the editor to edit only an element's text in a XML doc...

What's the preferred way to do this ? Any idea ? I was thinking about modifying the buffer in my plugin, extract the text, keep the rest of the xml at hand for later etc... looks pretty ugly for now I must say :/

I guess I probably have to rewrite a full "custom editor", which would embed the regular Orion editor ? Just like if I'd write my own editor with custom widgets inside ?

TIA

Rémi
Sauf indication contraire ci-dessus:/ Unless stated otherwise above:
Compagnie IBM France
Siège Social : 17 avenue de l'Europe, 92275 Bois-Colombes Cedex
RCS Nanterre 552 118 465
Forme Sociale : S.A.S.
Capital Social : 657.364.587 €
SIREN/SIRET : 552 118 465 03644 - Code NAF 6202A

Back to the top