Skip to main content



      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 11:26 Go to next message
Eclipse UserFriend
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 11:35 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

guess that could work.
just bind the class in YourdslUiModule

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

~Christian
Re: Override Xtext editor's doSetInput() method [message #725388 is a reply to message #725366] Wed, 14 September 2011 12:11 Go to previous message
Eclipse UserFriend
Thanks again, Christian. That absolutely worked.
Previous Topic:JUnit Testing for templates
Next Topic:Quick fixes for CompleteOCLEObjectValidator?
Goto Forum:
  


Current Time: Sat Jul 12 14:47:52 EDT 2025

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

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

Back to the top