Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » DSLProposalProvider (access external data)
DSLProposalProvider (access external data) [message #1256768] Tue, 25 February 2014 19:42 Go to next message
Rui Domingues is currently offline Rui DominguesFriend
Messages: 194
Registered: October 2010
Senior Member
Hi everyone,

After develop a grammar for my language and integrate it in my RCP, I stumbled upon costumizing my proposal provider.


I need to access to some information which is outside my language plugins, I don't see can I pass that information unless I put some static which must be assigned before editor being used..

I thought about google injection, but I don't know if it is possible put in there my own objects. I couldn't figure it out.


Someone can tell which is the right approach.

My fundamental problem is that I need information that is outside DSL plugins.

Thanks in advance.
Re: DSLProposalProvider (access external data) [message #1256788 is a reply to message #1256768] Tue, 25 February 2014 20:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi can you be a bit more specific on your usecase

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: DSLProposalProvider (access external data) [message #1256851 is a reply to message #1256788] Tue, 25 February 2014 21:48 Go to previous messageGo to next message
Rui Domingues is currently offline Rui DominguesFriend
Messages: 194
Registered: October 2010
Senior Member
Hi. Thanks for replying.

Summing up... My custom proposals are based on some objects contained by some resources in the workspace and I am able to access these resources through another plugin.

I'm using embedded editor, and I don't want to polute the generated code with static access in the proposalprovider to make available in there the objects I need.

Do you know any way, for example using injection that allows me to pass my objects into proposalprovider, without doing unsafe/ugly code.

Rui
Re: DSLProposalProvider (access external data) [message #1257198 is a reply to message #1256851] Wed, 26 February 2014 06:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi this is still to unspecific to give advice. What about simply injecting your util to the proposal provider

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: DSLProposalProvider (access external data) [message #1257359 is a reply to message #1257198] Wed, 26 February 2014 10:40 Go to previous messageGo to next message
Rui Domingues is currently offline Rui DominguesFriend
Messages: 194
Registered: October 2010
Senior Member
Hi. Thanks again. That would be one of my questions.

I can put
@Inject 
MyUtil myutil 


in proposalprovider. How do I make a MyUtil object available to be injected, in the code where I create the embedded editor.
I explorer the Injector class, but couldn't figure out How to add a Binding with my object.
Re: DSLProposalProvider (access external data) [message #1257429 is a reply to message #1257359] Wed, 26 February 2014 12:15 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

simply da a dependency from your ui bundle to your util bundle ?!?
have no idea what your util is and where it is...


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:How to get rid of Tycho's downloading of p2.indexes on every build
Next Topic:Combining Grammars
Goto Forum:
  


Current Time: Fri Mar 29 05:59:34 GMT 2024

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

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

Back to the top