Eclipse, plugin preference loading issue [message #767299] |
Sat, 17 December 2011 15:45 |
Eclipse User |
|
|
|
Hi,
I have trouble getting preference loaded on to eclipse. I am not able to
load the value for the preference without going to the preference page
first.
I start eclipse, use my plugin, i see that the feature is not enabled.
I start eclipse, go to preference page and the use my plugin, all works
fine.
I am trying to access the value for enable from preference store using
the below code
final IPreferenceStore preferences = new ScopedPreferenceStore(new
InstanceScope(), <my plugin id>);
this.enabled = preferences.getBoolean(<templateName>_ENABLE_TEMPLATE"));
this call goes to method
public boolean getBoolean(String name) {
String value = internalGet(name);
return value == null ? BOOLEAN_DEFAULT_DEFAULT : Boolean.valueOf(value)
.booleanValue();
}
internalGet(name) -- returns null..as a result this.enabled is set to false.
in my code i check this variable and if it is false i display an error
message and don't proceed further.
I want to know how we can make sure that the preferences are
enabled/loaded as soon as they are invoked.
Thanks in advance!!
|
|
|
|
Powered by
FUDForum. Page generated in 0.09772 seconds