Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Custom Multi-Workspace
Custom Multi-Workspace [message #512697] Sat, 06 February 2010 08:06
Eclipse UserFriend
Originally posted by:

i would like to use multi-workspace by user for save preferences, e.g.:



I have followed guide

It is:

1. turn off default workspace
-data @noDefault

2. create custom workspace in the

// create dirs
File workspace = new File("workspace/" + username);
if (!workspace.exists()) workspace.mkdirs();

// create URL and set Location
URL url = new URL("file", null, workspace.getAbsolutePath());

if (url != null) {
Location instanceLoc = Platform.getInstanceLocation();
instanceLoc.set(url, false);

That's OK. After user login will be workspace created.

My problem:

In my application I use save preferences (e.g. show chart) in method
saveState(memento) of View this way:

Activator.getDefault().getPreferenceStore().setValue(Prefere nceConstants.SHOW_CHART,

Before I have loaded this preferences as per description mention above,
this way has been followed:

Platform.getPreferencesService().getBoolean(Activator.PLUGIN _ID,
PreferenceConstants.SHOW_CHART, true, null);

But I started to use custome workspace the loading preferences doesn't
work anymore. When I close View these preferences are saved with any
problem into file 'xx.prefs', but after open View
preferences are not loading.

I understood the problem is because of not turn on default workspace
(@noDefault). Do I have to these preferences again somehow loaded? Am I
using for the loading correct getPreferencesService() ?

I have tried after View open loaded preferences again by:

private IPreferenceStore m_preferences =
try {
m_preferences = new PreferenceStore("xx.prefs");
((PreferenceStore) m_preferences).load();
} catch (IOException e) {

It gets better but doesn't work for default values.

How to use loading preferences into workspace? What am I doing wrong?


Previous Topic:Can't launch RCP app from new Product Config
Next Topic:Adding Update Manager
Goto Forum:

Current Time: Mon Jun 25 00:47:39 GMT 2018

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

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

Back to the top