Workbench view is not retaining the state in the new plugin. [message #50975] |
Thu, 19 March 2009 02:34  |
Eclipse User |
|
|
|
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.
|
|
|
|
|
Re: Workbench view is not retaining the state in the new plugin. [message #51335 is a reply to message #51307] |
Fri, 20 March 2009 10:50  |
Eclipse User |
|
|
|
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 #593670 is a reply to message #51307] |
Fri, 20 March 2009 10:50  |
Eclipse User |
|
|
|
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..
|
|
|
Powered by
FUDForum. Page generated in 0.05268 seconds