Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Workbench view is not retaining the state in the new plugin.
Workbench view is not retaining the state in the new plugin. [message #50975] Thu, 19 March 2009 06:34 Go to next message
Rahul is currently offline RahulFriend
Messages: 13
Registered: July 2009
Location: India
Junior Member
Hi,
I am working on a plugin developed by someone. It has a perspective in
which the user is required to open a folder containing many .wav files
along with associated text and an xml with same name containing some
details of that wav file. The perspective will then show the Tabular view
in which a row contains the wav file path, a tick mark for the presence of
text and xml files. When one of the row is clicked it opens some editors
like text editor for text file and some buttons,etc for the details in xml
file.When I close and start eclipse then the Tabular view do not retain
the last selected wav files/folder state. I have read in may places that
eclipse retain the state by default, I tried to find out why it is not
retaining the state but I could not. Please help.


Thanks
Rahul
Re: Workbench view is not retaining the state in the new plugin. [message #51003 is a reply to message #50975] Thu, 19 March 2009 07:32 Go to previous messageGo to next message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 84
Registered: July 2009
Member
Rahul wrote:
>
> Hi,
> I am working on a plugin developed by someone. It has a perspective in
> which the user is required to open a folder containing many .wav files
> along with associated text and an xml with same name containing some
> details of that wav file. The perspective will then show the Tabular
> view in which a row contains the wav file path, a tick mark for the
> presence of text and xml files. When one of the row is clicked it opens
> some editors like text editor for text file and some buttons,etc for the
> details in xml file.When I close and start eclipse then the Tabular view
> do not retain the last selected wav files/folder state. I have read in
> may places that eclipse retain the state by default, I tried to find out
> why it is not retaining the state but I could not. Please help.
>

I doubt eclipse saves by default. You have to save the preferences using
IEclipsePreferences. And restore then on eclipse restart.

You might wanto read the details at

http://wiki.eclipse.org/FAQ_How_do_I_use_the_preference_serv ice%3F

http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/runtime_preferences.htm

hth,
Ankur..
Re: Workbench view is not retaining the state in the new plugin. [message #51307 is a reply to message #51003] Fri, 20 March 2009 14:37 Go to previous messageGo to next message
Rahul is currently offline RahulFriend
Messages: 13
Registered: July 2009
Location: India
Junior Member
Thanks Ankur for the information, but it didn't helped me much as I am new
to eclipse plugin development so I could not able to use the API
IPreferencesService.
Can you please give me an example.
my mail id is ag.rahul84@gmail.com

Thanks in Advance.
Rahul


Thanks
Rahul
Re: Workbench view is not retaining the state in the new plugin. [message #51335 is a reply to message #51307] Fri, 20 March 2009 14:50 Go to previous message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 84
Registered: July 2009
Member
Rahul wrote:
> Thanks Ankur for the information, but it didn't helped me much as I am new to eclipse plugin
> development so I could not able to use the API IPreferencesService. Can you please give me an
> example. my mail id is ag.rahul84@gmail.com
>
> Thanks in Advance. Rahul
>



To store the preferences:

IEclipsePreferences preferences = new
InstanceScope().getNode("com.my.plugin.id"); // Get the preferences for your plugin
preferences.put("key", "value"); // store a key-value pair in it
preferences.flush(); // persist it on disk


And to retrieve

IEclipsePreferences preferences = new InstanceScope().getNode("com.my.plugin.id"); // Get the
preferences for your plugin
String value = preferences.get("key", "default value"); // retrieve the value


Ankur..
Re: Workbench view is not retaining the state in the new plugin. [message #593462 is a reply to message #50975] Thu, 19 March 2009 07:32 Go to previous message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 84
Registered: July 2009
Member
Rahul wrote:
>
> Hi,
> I am working on a plugin developed by someone. It has a perspective in
> which the user is required to open a folder containing many .wav files
> along with associated text and an xml with same name containing some
> details of that wav file. The perspective will then show the Tabular
> view in which a row contains the wav file path, a tick mark for the
> presence of text and xml files. When one of the row is clicked it opens
> some editors like text editor for text file and some buttons,etc for the
> details in xml file.When I close and start eclipse then the Tabular view
> do not retain the last selected wav files/folder state. I have read in
> may places that eclipse retain the state by default, I tried to find out
> why it is not retaining the state but I could not. Please help.
>

I doubt eclipse saves by default. You have to save the preferences using
IEclipsePreferences. And restore then on eclipse restart.

You might wanto read the details at

http://wiki.eclipse.org/FAQ_How_do_I_use_the_preference_serv ice%3F

http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/runtime_preferences.htm

hth,
Ankur..
Re: Workbench view is not retaining the state in the new plugin. [message #593658 is a reply to message #51003] Fri, 20 March 2009 14:37 Go to previous message
Rahul is currently offline RahulFriend
Messages: 13
Registered: July 2009
Location: India
Junior Member
Thanks Ankur for the information, but it didn't helped me much as I am new
to eclipse plugin development so I could not able to use the API
IPreferencesService.
Can you please give me an example.
my mail id is ag.rahul84@gmail.com

Thanks in Advance.
Rahul


Thanks
Rahul
Re: Workbench view is not retaining the state in the new plugin. [message #593670 is a reply to message #51307] Fri, 20 March 2009 14:50 Go to previous message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 84
Registered: July 2009
Member
Rahul wrote:
> Thanks Ankur for the information, but it didn't helped me much as I am new to eclipse plugin
> development so I could not able to use the API IPreferencesService. Can you please give me an
> example. my mail id is ag.rahul84@gmail.com
>
> Thanks in Advance. Rahul
>



To store the preferences:

IEclipsePreferences preferences = new
InstanceScope().getNode("com.my.plugin.id"); // Get the preferences for your plugin
preferences.put("key", "value"); // store a key-value pair in it
preferences.flush(); // persist it on disk


And to retrieve

IEclipsePreferences preferences = new InstanceScope().getNode("com.my.plugin.id"); // Get the
preferences for your plugin
String value = preferences.get("key", "default value"); // retrieve the value


Ankur..
Previous Topic:[Jade] Can't get a proxy to the Platform Manager
Next Topic:RCP Export Problems -- "Unable to acquire application service"
Goto Forum:
  


Current Time: Thu Apr 18 02:46:25 GMT 2024

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

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

Back to the top