Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Store settings
Store settings [message #605591] Thu, 15 April 2010 08:20 Go to next message
ola  is currently offline ola Friend
Messages: 5
Registered: April 2010
Junior Member
Hi!

I need to save custom settings for my plugin to work (some coordinates). Is there a simple way to do this with the Eclipse pluigin enviroment or do I have to create my own settings-file (XML)?

Another question: My plugin creates a new project with the "new project wizard". And every time I need to copy in some "skeleton-files" to the new project. Is there some place where I can store this skeletone-files (like the plugin-root) and how can I access them? the thing I do now i just copy from C:\temp to where ever the new project path is.

// Regards Ola
Re: Store settings [message #605594 is a reply to message #605591] Thu, 15 April 2010 08:54 Go to previous message
Devi Vara Prasad Bandaru is currently offline Devi Vara Prasad BandaruFriend
Messages: 100
Registered: March 2010
Location: Hyderabad
Senior Member

Hi Ola,

1. For storing and retrieving settings i think you can do something like this

IPreferenceStore settings = Activator.getDefault().getPreferenceStore();
// get value from the store
String value = settings.getString(SampleCalss.class.getCanonicalName());
// set value to the store
String newValue = "some value";
settings.putValue(SampleCalss.class.getCanonicalName(), newValue);


2. For accesssing the reources inside a plugin you can use methods from class 'org.osgi.framework.Bundle' which can be obtained using Activator.getDefault().getBundle()

--
Regards,
Prasad


Previous Topic:Store settings
Next Topic:MultiPageEditorPart
Goto Forum:
  


Current Time: Tue Mar 19 04:51:05 GMT 2024

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

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

Back to the top