Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » xtext.createEditor issue by using orion codeEdit plugin(I want to ask how to call xtext.createEditor() more than once in one page when take orion editor as plugin.)
xtext.createEditor issue by using orion codeEdit plugin [message #1733202] Wed, 25 May 2016 11:18 Go to next message
Yuwen Hu is currently offline Yuwen HuFriend
Messages: 6
Registered: July 2014
Junior Member
I'm trying to create web editor by using Orion CodeEditor 11.0 and above.
But unfortunately, I found when I call xtext.createEditor() twice to create two editors separately, it always failed.

require([ "orion/code_edit/built-codeEdit-amd" ], function() {
require([ "xtext/xtext-orion" ], function(xtext) {
xtext.createEditor({
baseUrl : baseUrl,
...
position : "absolute",
sendFullText: onlyInBrowser
}).done(function(editorViewer) {
editorViewer.xtextServices.successListeners.push(handleSuccessResponse);
editorViewer.xtextServices.errorListeners.push(handleErrorResponse)

Actually, I know xtext.createEditor() can create multi editors during one invocation.
But what I want to do is to create these editors on demand and dynamically.

After I search for Orion CodeEditor example and source code, I found, Orion CodeEdit couldn't be new twice in the same document/page.
That means (I think), in xtext-orion.js, the following statement will introduce problem.
var startupOptions = options.startupOptions;
if (!startupOptions)
startupOptions = { defaultPlugins: ['webToolsPlugin.html'] };
--> var embeddedEditor = new mEmbeddedEditor(startupOptions);
var editorData = [];

Does any one meet the same problem? Or any one knows how to fix this?

BTW, it seems, xtext-orion.js can't work with orion editor 10.0. But I can't find where to mention this limitation.
Re: xtext.createEditor issue by using orion codeEdit plugin [message #1733205 is a reply to message #1733202] Wed, 25 May 2016 04:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13202
Registered: July 2009
Senior Member
Seems https://github.com/eclipse/xtext/blob/master/web/org.eclipse.xtext.web.example.jetty/src/main/webapp/orion-statemachine-resource-multi.html calls it once only as well

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: xtext.createEditor issue by using orion codeEdit plugin [message #1733282 is a reply to message #1733205] Thu, 26 May 2016 00:32 Go to previous messageGo to next message
Yuwen Hu is currently offline Yuwen HuFriend
Messages: 6
Registered: July 2014
Junior Member
HI Christian,

I know that example.
But just as I mentioned in the topic.
That's just static call. You have to decide how many editors do you want to create at the beginning.

My target is to invoke xtext.createEdtior on demand.
That means when user wants to create new editor, then we create it.

It (calling xtext.createEditor on demand) works when I use ace editor plugin, but it doesn't work when I use orion editor plugin.

Actually, I think it is a bug or at least an improvement point for xtext-orion.js. I registered a bug in Eclipse Bug.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=494315

But it seems no one read it at all.
Re: xtext.createEditor issue by using orion codeEdit plugin [message #1733285 is a reply to message #1733282] Thu, 26 May 2016 07:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13202
Registered: July 2009
Senior Member
its just a matter of "we are all too busy"

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: xtext.createEditor issue by using orion codeEdit plugin [message #1733296 is a reply to message #1733285] Thu, 26 May 2016 02:24 Go to previous messageGo to next message
Miro Spönemann is currently offline Miro SpönemannFriend
Messages: 67
Registered: March 2015
Location: Kiel, Germany
Member

Currently Orion CodeEdit does not work well with the Xtext integration when multiple editors are used:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=482594

If you want multiple editors, at the moment I would recommend to use Ace or CodeMirror.
Re: xtext.createEditor issue by using orion codeEdit plugin [message #1733354 is a reply to message #1733285] Thu, 26 May 2016 18:35 Go to previous message
Yuwen Hu is currently offline Yuwen HuFriend
Messages: 6
Registered: July 2014
Junior Member
Get it. Sad
Previous Topic:Separate model project
Next Topic:Using Names from a text file inside the DSL
Goto Forum:
  


Current Time: Tue Nov 19 13:17:27 GMT 2019

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

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

Back to the top