Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to save/load Preferences to DB?
How to save/load Preferences to DB? [message #1272968] Wed, 19 March 2014 07:39 Go to next message
Marco Feldmann is currently offline Marco FeldmannFriend
Messages: 26
Registered: March 2013
Junior Member
Hello,
is it possible to override the save/load-Method of the preferenceStore? I would like to use a DB as backend.

How can I do this? Need I a special IScopeContext or a own PreferencesStore? Can I extend existing classes?

Thanks a lot.

Marco
Re: How to save/load Preferences to DB? [message #1272991 is a reply to message #1272968] Wed, 19 March 2014 08:52 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Marko,
you have to create and register your own SettingStoreFactory. See [1]
and [2] for more details.

[1]
http://help.eclipse.org/kepler/topic/org.eclipse.rap.doc/guide/articles/data-stores.html?cp=52_3_2
[2]
http://help.eclipse.org/kepler/topic/org.eclipse.rap.doc/guide/reference/extension-points/org_eclipse_rap_ui_settingstores.html?cp=52_5_1_6
HTH,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to save/load Preferences to DB? [message #1272995 is a reply to message #1272968] Wed, 19 March 2014 09:05 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 243
Registered: March 2010
Location: France
Senior Member
Hello,

In RAP, eclipse preferences are delegated to org.eclipse.rap.rwt.service.SettingStore

so you can achieve that by writing your own SettingStore implementation, that will persist preferences in DB instead of file.
You have also to implement SettingStoreFactory that will provide your SettingStore implementation.
I guess you have a Workbench application so you have to declare your factory using org.eclipse.rap.ui.settingstores extension and launch your application with -Dorg.eclipse.rap.rwt.settingStoreFactory=yourFactoryName

In RWT standalone it is a bit simpler, the SettingStoreFactory can directly be set on the Application

Regards,
Arnaud


Re: How to save/load Preferences to DB? [message #1273062 is a reply to message #1272995] Wed, 19 March 2014 12:32 Go to previous message
Marco Feldmann is currently offline Marco FeldmannFriend
Messages: 26
Registered: March 2013
Junior Member
Hello,
that works fine.

Thanks a lot for your answers.

Regards Marco
Previous Topic:Eclipse RAP Save As dialog
Next Topic:Mobile browser support and global scrollbars
Goto Forum:
  


Current Time: Fri Apr 26 21:23:59 GMT 2024

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

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

Back to the top