Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Solved] DocumentTokenSource Injection
icon5.gif  [Solved] DocumentTokenSource Injection [message #1242641] Sun, 09 February 2014 23:09 Go to next message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 68
Registered: April 2013
Member
Hi,

Could someone help me to solve my problem ?

I'm injecting MyDocumentTokenSource in
@Inject
public XtextDocument(DocumentTokenSource tokenSource, ITextEditComposer composer)


So, I've written :
public class MyUiModule extends AbstractMyUiModule {
	public MyUiModule(AbstractUIPlugin plugin) {
		super(plugin);
	}
	
	@Override
	public void configure(Binder binder) 
	{
	super.configure(binder);
        binder.bind(DocumentTokenSource.class).to(MyDocumentTokenSource.class);
	}


and if it is useful, in the same class MyUiModule:
	
public Class<? extends DocumentTokenSource> bindDocumentTokenSource()
{
return MyDocumentTokenSource.class;
}


But I obtain an exception showing that MyDocumentTokenSource is not injected but DocumentTokenSource.

What's wrong, please ?

[Updated on: Thu, 13 February 2014 02:49]

Report message to a moderator

Re: DocumentTokenSource Injection [message #1242863 is a reply to message #1242641] Mon, 10 February 2014 07:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hmmm,

isnt documenttokensource a ui concept only => binding in ui module only

a binding like

	public Class<? extends DocumentTokenSource> bindDocumentTokenSource(){
		return XtendDocumentTokenSource.class;
	}



should work fine and is actually done by Xtend


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: DocumentTokenSource Injection [message #1244763 is a reply to message #1242863] Wed, 12 February 2014 21:28 Go to previous message
Didier Garcin is currently offline Didier GarcinFriend
Messages: 68
Registered: April 2013
Member
Thanks a lot, Christian.

I am reassured that it is supposed to work.

I'm an hobbyist and I'm going to try this, now.
Previous Topic:correct reference problem with import statement and unti-test
Next Topic:Import Ecore Elements in Xtext DSL
Goto Forum:
  


Current Time: Fri Apr 26 07:42:18 GMT 2024

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

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

Back to the top