Skip to main content



      Home
Home » Modeling » TMF (Xtext) » how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ?(I hope you can help me i'm new user in xtext, i have xtext project , i want to call my java class ( with method main) to run it in Xtend file when generating the Xtext editor . also another case is w)
how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754722] Tue, 21 February 2017 14:21 Go to next message
Eclipse UserFriend
I hope you can help me i'm new user in xtext, i have xtext project , i want to call my java class ( with method main) to run it in Xtend file when generating the Xtext editor . also another case is when generating the editor Xtext in runtime eclipce , i need to run my java class when save my Xtext model is there any solution for that .
Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754723 is a reply to message #1754722] Tue, 21 February 2017 14:24 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

can you please be a bit more specific on what your main does and which which parmeters/contexts it should be invoked?
Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754724 is a reply to message #1754723] Tue, 21 February 2017 14:32 Go to previous messageGo to next message
Eclipse UserFriend
I want to run java class after finishing writing my grammar in xtext ediitor ie: use Xtend Generator file to call my java class .
Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754726 is a reply to message #1754724] Tue, 21 February 2017 14:35 Go to previous messageGo to next message
Eclipse UserFriend
i still dont get this.

you have opened your test.mydsl file and edit it.
then you hit save.
and then the main should be called with no params?
Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754728 is a reply to message #1754726] Tue, 21 February 2017 14:47 Go to previous messageGo to next message
Eclipse UserFriend
The class main has diffrent parameters independent for Xtext grammar
Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754730 is a reply to message #1754728] Tue, 21 February 2017 15:04 Go to previous messageGo to next message
Eclipse UserFriend
If it is on save only have a look at IXtextEditorCallback

(Implement it in yourdsl.ui and add a binding to yourdsluimodule)


def void configureMySpecialCallback(com.google.inject.Binder
binder) {
binder.bind(IXtextEditorCallback).annotatedWith(Names. named( "MySpecialCallback")).to(
MySpecialCallback);
}

If it should be called during build as well call it from your generator is the easiest one

Re: how to call or run Java class(pure java code) in the Xtend Code when generate my Xtext Project ? [message #1754732 is a reply to message #1754730] Tue, 21 February 2017 15:30 Go to previous message
Eclipse UserFriend
Thanks i will try it now .
Previous Topic:How use Xtext grammar DSL writing in editor for translating to another language ?
Next Topic:JDT - Check Instance of RuntimeException
Goto Forum:
  


Current Time: Sat Aug 30 19:22:55 EDT 2025

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

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

Back to the top