Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Changing the doc without changing the model(Change the representation of cross refs w/o changing the cross refs in the model)
Changing the doc without changing the model [message #1697164] Tue, 02 June 2015 06:50 Go to next message
Marcus Höpfner is currently offline Marcus HöpfnerFriend
Messages: 56
Registered: February 2014
Member
Hi,

there is
FormulaMemberOperand returns FormulaMemberOperand:
	member=[QueryElement|STRING];

in the grammar.

Every QueryElement has a key and a text (description).
The STRING is concatenated (uniquely) in the ScopeProvider.

In the UI the user can change the representation of cross references by a toggle with the values: [key] | text | [key] text | text [key].
Example key: "[0VC_AMOUNT]"
Example text [key]: "Amount [0VC_AMOUNT]"

However the String is always unique (a suffix is added if there are clashes).

My question is, how can I handle the toggle in my DSL?
Only the document must change, not the model.
Toggling the representation should not be put on undo/redo stack.
Nevertheless it would be great if undo works (but under consideration of the new key/text setting).
Should also work on syntax errors.

BTW: I'm using embedded editor in composite (dialog). The model is saved as Xml.

Is it actually possible what I want to achieve?

Thanks, Marcus
Re: Changing the doc without changing the model [message #1697315 is a reply to message #1697164] Wed, 03 June 2015 06:46 Go to previous messageGo to next message
Marcus Höpfner is currently offline Marcus HöpfnerFriend
Messages: 56
Registered: February 2014
Member
May the 2.9 format api help here?
Re: Changing the doc without changing the model [message #1697320 is a reply to message #1697164] Wed, 03 June 2015 07:26 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Marcus,

sounds like you want to add something like QuickAssist to modify the
document. I'm not sure what you mean by 'Only the document must change'.
A change to the document will reparse the text and there change the
model, too - though the new mode may be semantically equivalent to the
prev version.

Best,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Find help at http://xtext.itemis.com or xtext(@)itemis.com
Blog: zarnekow.blogspot.com
Twitter: @szarnekow
Google+: https://www.google.com/+SebastianZarnekow
Previous Topic:Runnin Xtext in a no-display environment
Next Topic:Cannot launch runtime eclipse anymore
Goto Forum:
  


Current Time: Sat Apr 20 02:02:23 GMT 2024

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

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

Back to the top