|
|
Re: DI in activator with Compatibility layer [message #1084937 is a reply to message #1084927] |
Mon, 12 August 2013 08:35 |
Ludwig Moser Messages: 476 Registered: July 2009 |
Senior Member |
|
|
so i need to do it like this?
@Creatable
public class DAO {
@Inject
public DAO([b]@Preference[/b] IEclipsePreferences preferences) {
preferences.put(*/put something here*/);
try {
preferences.flush();
} catch (BackingStoreException e) {
e.printStackTrace();
}
}
}
EDIT: my mistake was the missing @Preference in the constructor
Thanks Tom!
one thing is still missing... when i call a function on my class, which also has inected fields. the fields are null. afaik the fields are injected right after the constructor, so when i call a function after construction the fields should be already available to this function, right?
[Updated on: Mon, 12 August 2013 09:52] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03793 seconds