Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Eclipse Web Tools Platform Project (WTP) » Flexible XML editing
Flexible XML editing [message #1832873] Mon, 28 September 2020 11:27 Go to next message
Patrick Neubauer is currently offline Patrick NeubauerFriend
Messages: 4
Registered: May 2017
Junior Member
Hello!

We are working on extending the Flexmi editor (i.e. a reflective textual syntax editor for EMF models) [1] with content assistance capabilities.

Flexmi employs fuzzy matching to map XML tags to instances of EClasses in the target metamodel. The following line in the Flexmi file (i.e. a XML file) indicates to which Ecore it is supposed to conform. For example, the following line indicates that the Flexmi model instantiates the Ecore metamodel "myecore.ecore":
<?nsuri myecore?>


Although the Flexmi editor extends the org.eclipse.ui.editors.text.TextEditor class, this is not a requirement. It may extend the org.eclipse.wst.sse.ui.StructuredTextEditor instead.

Any suggestions or hints on which steps it may involve when extending an existing WTP/WST editor for XML instances that represent (flexible) instances conforming to a specific Ecore file are much appreciated--thanks!

Cheers
Patrick

[1] https://www.eclipse.org/epsilon/doc/flexmi/

[Updated on: Mon, 28 September 2020 11:35]

Report message to a moderator

Re: Flexible XML editing [message #1832897 is a reply to message #1832873] Tue, 29 September 2020 01:12 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Typically we don't recommend subclassing the StructuredTextEditor class, but if your file's content
type is already extending the platform's XML content type, you can contribute completions using the
same extension point that is used for the know content models (from DTDs and Schemas) at
https://github.com/eclipse/webtools.sourceediting/blob/master/xml/bundles/org.eclipse.wst.xml.ui/plugin.xml#L1619.
The big difference would be to refer to your own content type rather than the official XML content type, and then you can
use the XML Editor directly. But then I'm not entirely sure what you're trying
to implement. It would be easier to give guidance with that information.


_
Nitin Dahyabhai
Eclipse Web Tools Platform

[Updated on: Tue, 29 September 2020 01:16]

Report message to a moderator

Re: Flexible XML editing [message #1832933 is a reply to message #1832897] Tue, 29 September 2020 16:16 Go to previous message
Patrick Neubauer is currently offline Patrick NeubauerFriend
Messages: 4
Registered: May 2017
Junior Member
Dear Nitin,

thank you for your response. This is already helpful.

Let me try to better explain Flexmi [1,2].

Flexmi documents are essentially valid XML documents which only differ in their file extension (.flexmi as opposed to .xml). Flexmi documents are instances of an Ecore file/metamodel and associated through a specific tag pointing to the Ecore it is supposed to conform to.

One of the main differences of the Flexmi editor (i.e. when compared with XML editors) is that names of tags and attributes do not necessarily have to match the exact names of EClasses and EAttributes to successfully construct a metamodel-conforming in-memory model or XMI file. For example, a metamodel defining an EClass named "Task" containing EAttributes named "title" and "duration" can be specified as follows and still be parsed as a correct instance of the EClass named "Task":
<task title="Do the laundry" dur="3"></task>


Therefore, in regards to content assistance, we are looking to provide/inherit the same capability as the Eclipse XML editor offers for XML documents that specify their association to a XML Schema (i.e. an Ecore metamodel in case of Flexmi), however, also account for flexibly named elements and attributes.

Which approaches do you see that could implement such behavior?

Cheers
Patrick

[1] http://ceur-ws.org/Vol-1694/FlexMDE2016_paper_3.pdf
[2] https://www.eclipse.org/epsilon/doc/flexmi/

[Updated on: Tue, 29 September 2020 21:41]

Report message to a moderator

Previous Topic:Eclipse Java Preferences (2020-09)
Next Topic:Alternative XML Schema View
Goto Forum:
  


Current Time: Thu Apr 25 07:15:35 GMT 2024

Powered by FUDForum. Page generated in 0.02787 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top