Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Override Xtext editor's doSetInput() method(how best to override/extend an Xtext-generated editor)
Override Xtext editor's doSetInput() method [message #725362] Wed, 14 September 2011 15:26 Go to next message
Joey Mink is currently offline Joey MinkFriend
Messages: 87
Registered: July 2009
Location: Centreville, VA, USA
Member

Hi,

We previously wrote an Eclipse editor by hand for our DSL. We overrode the doSetInput() method on that editor so that we could check to see if a user tried to open a file that was outside the Eclipse workspace. If it was a file outside the workspace, we would launch a wizard allowing the user to import their work.

Since we are replacing the old, hand-written Eclipse editor with the new, Xtext-generated editor, we would like to retain the same ability to intercept the user's attempt to open a file. Can it be done the same way (by overriding the doSetInput() method)? If so, is there documentation on how to override or extend the Xtext-generated editor?

Thanks!
Re: Override Xtext editor's doSetInput() method [message #725366 is a reply to message #725362] Wed, 14 September 2011 15:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
Hi,

guess that could work.
just bind the class in YourdslUiModule

public Class<? extends XtextEditor> bindXtextEditor() {
return YourXtextEditor.class;
}

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Override Xtext editor's doSetInput() method [message #725388 is a reply to message #725366] Wed, 14 September 2011 16:11 Go to previous message
Joey Mink is currently offline Joey MinkFriend
Messages: 87
Registered: July 2009
Location: Centreville, VA, USA
Member

Thanks again, Christian. That absolutely worked.
Previous Topic:JUnit Testing for templates
Next Topic:Quick fixes for CompleteOCLEObjectValidator?
Goto Forum:
  


Current Time: Fri Apr 26 21:04:21 GMT 2024

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

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

Back to the top