Skip to main content



      Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to save information between the sessions of Eclipse?
How to save information between the sessions of Eclipse? [message #17954] Wed, 27 August 2008 07:26 Go to next message
Eclipse UserFriend
Good day! I've developed plugin. Now I want to save some data between the
sessions of Eclipse (for example, a String or int variable). How to do
this in a proper way?
Thanks.
Re: How to save information between the sessions of Eclipse? [message #18023 is a reply to message #17954] Thu, 28 August 2008 02:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: prashanto.chatterjee.gmail.com

Have a look at the ISaveParticipant mechanism. There is a good deal of help
avaialable on that.
You may also want to read the article:
http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html

"Drug Vignera" <DrugVignera@mail.ru> wrote in message
news:81b157f17a2542fa29be51b72bd55c4b$1@www.eclipse.org...
> Good day! I've developed plugin. Now I want to save some data between the
> sessions of Eclipse (for example, a String or int variable). How to do
> this in a proper way?
> Thanks.
>
IMHO, this is not appropriate. [message #18034 is a reply to message #18023] Thu, 28 August 2008 10:12 Go to previous messageGo to next message
Eclipse UserFriend
I mean, where to save my data? Into eclipse/plugins/myfile.ini? Into
eclipse/plugins/myplugin/myfile.ini? Is there some common default place?
(For example, something like eclipse/configuration/config.ini or
workspace/.metadata/config.ini.)
When my plugin starts to work, it must read this data and then save new
one.
Re: How to save information between the sessions of Eclipse? [message #18047 is a reply to message #17954] Thu, 28 August 2008 12:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tom.seidel.spiritlink.de

See http://www.eclipse.org/articles/Article-Preferences/preferen ces.htm

Tom

Drug Vignera schrieb:
> Good day! I've developed plugin. Now I want to save some data between
> the sessions of Eclipse (for example, a String or int variable). How to
> do this in a proper way?
> Thanks.
>
>
Re: How to save information between the sessions of Eclipse? [message #18060 is a reply to message #17954] Thu, 28 August 2008 13:57 Go to previous messageGo to next message
Eclipse UserFriend
OSGi allows a bundle to store data in its private data area, which is
accessed via the BundleContext API getDataFile(String). This approach is
nice since it keeps the data private to the bundle, and the data goes
away when you uninstall the bundle.

http://www.osgi.org/javadoc/r4/org/osgi/framework/BundleCont ext.html#getDataFile(java.lang.String)

Drug Vignera wrote:
> Good day! I've developed plugin. Now I want to save some data between
> the sessions of Eclipse (for example, a String or int variable). How to
> do this in a proper way?
> Thanks.
>
Re: How to save information between the sessions of Eclipse? [message #18767 is a reply to message #18047] Mon, 01 September 2008 08:09 Go to previous message
Eclipse UserFriend
Thanks.
The answer to my question is:
Activator.getDefault().getPreferenceStore().getString("my_key ");
...
Activator.getDefault().getPreferenceStore().setValue("my_key ", "my_value");
Re: How to save information between the sessions of Eclipse? [message #577608 is a reply to message #17954] Thu, 28 August 2008 02:28 Go to previous message
Eclipse UserFriend
Originally posted by: prashanto.chatterjee.gmail.com

Have a look at the ISaveParticipant mechanism. There is a good deal of help
avaialable on that.
You may also want to read the article:
http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html

"Drug Vignera" <DrugVignera@mail.ru> wrote in message
news:81b157f17a2542fa29be51b72bd55c4b$1@www.eclipse.org...
> Good day! I've developed plugin. Now I want to save some data between the
> sessions of Eclipse (for example, a String or int variable). How to do
> this in a proper way?
> Thanks.
>
IMHO, this is not appropriate. [message #577621 is a reply to message #18023] Thu, 28 August 2008 10:12 Go to previous message
Eclipse UserFriend
I mean, where to save my data? Into eclipse/plugins/myfile.ini? Into
eclipse/plugins/myplugin/myfile.ini? Is there some common default place?
(For example, something like eclipse/configuration/config.ini or
workspace/.metadata/config.ini.)
When my plugin starts to work, it must read this data and then save new
one.
Re: How to save information between the sessions of Eclipse? [message #577671 is a reply to message #17954] Thu, 28 August 2008 12:13 Go to previous message
Eclipse UserFriend
See http://www.eclipse.org/articles/Article-Preferences/preferen ces.htm

Tom

Drug Vignera schrieb:
> Good day! I've developed plugin. Now I want to save some data between
> the sessions of Eclipse (for example, a String or int variable). How to
> do this in a proper way?
> Thanks.
>
>
Re: How to save information between the sessions of Eclipse? [message #577686 is a reply to message #17954] Thu, 28 August 2008 13:57 Go to previous message
Eclipse UserFriend
OSGi allows a bundle to store data in its private data area, which is
accessed via the BundleContext API getDataFile(String). This approach is
nice since it keeps the data private to the bundle, and the data goes
away when you uninstall the bundle.

http://www.osgi.org/javadoc/r4/org/osgi/framework/BundleCont ext.html#getDataFile(java.lang.String)

Drug Vignera wrote:
> Good day! I've developed plugin. Now I want to save some data between
> the sessions of Eclipse (for example, a String or int variable). How to
> do this in a proper way?
> Thanks.
>
Re: How to save information between the sessions of Eclipse? [message #577959 is a reply to message #18047] Mon, 01 September 2008 08:09 Go to previous message
Eclipse UserFriend
Thanks.
The answer to my question is:
Activator.getDefault().getPreferenceStore().getString("my_key ");
...
Activator.getDefault().getPreferenceStore().setValue("my_key ", "my_value");
Previous Topic:Unwanted plugin/bundle getting deployed (jetty 1.1.0 ticked, jetty 2.0.0 NOT, both deployed)
Next Topic:Queries on Headless PDE Build
Goto Forum:
  


Current Time: Thu May 08 12:13:15 EDT 2025

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

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

Back to the top