Bug 247269 - [Preferences] Import/Export Workspace Settings
Summary: [Preferences] Import/Export Workspace Settings
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-15 06:09 EDT by Fabian Schmidt CLA
Modified: 2019-09-06 16:13 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Schmidt CLA 2008-09-15 06:09:31 EDT
Hallo,

I'm working in a software development company and work a lot with eclipse. As there is a requirement for specific workspace settings and use of a seperate workspace for every project it would be great to have the possiblity to export or import workspace settings. Things like formatter, warnings, keybindings, linked resources. Nothing very specific for project but settings used for many projects.

greetings 
Fabian Schmidt
Comment 1 Remy Suen CLA 2008-09-15 07:17:29 EDT
'File > Export > General > Preferences' no good?
Comment 2 Fabian Schmidt CLA 2008-09-15 07:25:40 EDT
(In reply to comment #1)
> 'File > Export > General > Preferences' no good?
> 

These will export exactly the specific preferences I don't want to export. The settings I want to report are in the ".metadata\.plugins\org.eclipse.core.runtime\.settings" directory. For my company I wrote a plugin which packs a zip archive from this folder and than later on extract it into this directory of the new workspace.
So for me its practically solved. But after using Google I guess it would be good if the IDE is able to provide this functionality as it is shipped.



Comment 3 Paul Webster CLA 2008-09-15 07:34:47 EDT
Those preferences are already saved in source control along with the project.

Or do you mean you want the ability to copy these preferences into a different project (say a newly created one)?

PW
Comment 4 Remy Suen CLA 2008-09-15 07:37:00 EDT
(In reply to comment #0)
> Things like formatter, warnings, keybindings,
> linked resources.
(In reply to comment #1)
> 'File > Export > General > Preferences' no good?
(In reply to comment #2)
> These will export exactly the specific preferences I don't want to export.

Well, the wizard specifically lists keybindings as one of the things that's exportable actually. :O

Anyway, I just tried it out. So I exported my preferences then I started a second Eclipse on a non-existent folder (so that it'd create a new workspace) and then imported my original preferences and things like my company's formatter settings and my syntax colouring seems to be working just fine. I verified it by typing some Java code and by checking the preference page that it's not using the 'Eclipse [built-in]' formatter.
Comment 5 Paul Webster CLA 2008-09-15 07:41:56 EDT
Remy pointed out I'm barking up the wrong tree.  The problem is you want to export some global preferences, but not all of them?

That is supported using the preferenceTransfers extension point and mechanism.  You might be able to provide that yourself, or you might have to open a bug against the preference provider component and get them to do it.

PW
Comment 6 Fabian Schmidt CLA 2008-09-15 07:53:02 EDT
(In reply to comment #5)
> Remy pointed out I'm barking up the wrong tree.  The problem is you want to
> export some global preferences, but not all of them?
> 
> That is supported using the preferenceTransfers extension point and mechanism. 
> You might be able to provide that yourself, or you might have to open a bug
> against the preference provider component and get them to do it.
> 
> PW
> 

Correct I only want to export some of the settings. Like the ones I said, but stuff like JRE Buildpath and stuff which really belongs to one specific project I don't need to export. The point is that I tried this with the export settings wizard but was not able to export setting made with Window -> preferences.
So even if such a functionality is already build in I don't understand how to access it.

FS
Comment 7 Fabian Schmidt CLA 2008-09-15 07:59:44 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > Remy pointed out I'm barking up the wrong tree.  The problem is you want to
> > export some global preferences, but not all of them?
> > 
> > That is supported using the preferenceTransfers extension point and mechanism. 
> > You might be able to provide that yourself, or you might have to open a bug
> > against the preference provider component and get them to do it.
> > 
> > PW
> > 
> 
> Correct I only want to export some of the settings. Like the ones I said, but
> stuff like JRE Buildpath and stuff which really belongs to one specific project
> I don't need to export. The point is that I tried this with the export settings
> wizard but was not able to export setting made with Window -> preferences.
> So even if such a functionality is already build in I don't understand how to
> access it.
> 
> FS
> 

And Yes it is practically for building up a new workspace with new projects
Comment 8 Paul Webster CLA 2008-09-15 08:36:15 EDT
(In reply to comment #6)
> Correct I only want to export some of the settings. Like the ones I said, but
> stuff like JRE Buildpath and stuff which really belongs to one specific project
> I don't need to export. The point is that I tried this with the export settings
> wizard but was not able to export setting made with Window -> preferences.
> So even if such a functionality is already build in I don't understand how to
> access it.

Right, so you need to follow my instructions and try and write a PreferenceTransfer

PW
Comment 9 Fabian Schmidt CLA 2008-09-15 08:43:37 EDT
> 
> Right, so you need to follow my instructions and try and write a
> PreferenceTransfer
> 
> PW
> 

So in fact I have to write a plugin, which is surely better but do the same like the one copying the preference files. 
That is to solve my problem.

But the reason for me to open this bug is actually that the platform should have a wizard or something that let you chose which preferences to export, because I think i'm not the only one who wants to have such feature and for the bigger part of the users it is not good to let them write a plugin in order to get that. So the most people will just copy the files I statet in the beginning because thats easier.

FS
Comment 10 Fabian Schmidt CLA 2008-09-15 08:50:10 EDT
(In reply to comment #8)
> (In reply to comment #6)
> > Correct I only want to export some of the settings. Like the ones I said, but
> > stuff like JRE Buildpath and stuff which really belongs to one specific project
> > I don't need to export. The point is that I tried this with the export settings
> > wizard but was not able to export setting made with Window -> preferences.
> > So even if such a functionality is already build in I don't understand how to
> > access it.
> 
> Right, so you need to follow my instructions and try and write a
> PreferenceTransfer
> 
> PW
> 

Is there any information how to use or implement this PreferensTransfer?
Comment 11 Remy Suen CLA 2008-09-15 09:01:37 EDT
(In reply to comment #9)
> But the reason for me to open this bug is actually that the platform should
> have a wizard or something that let you chose which preferences to export,

Right, that is implemented with the current wizard and its checkboxes.

> I think i'm not the only one who wants to have such feature and for the
> bigger part of the users it is not good to let them write a plugin in order to
> get that.

Yes, I agree with this. The alternative would be what Paul suggested, namely, filing a bug against the preference providers. So if you want Java syntax colouring, then ask JDT/UI to implement said extension point.
Comment 12 Kim Horne CLA 2008-09-15 09:04:53 EDT
(In reply to comment #10)
> (In reply to comment #8)
> > (In reply to comment #6)
> > > Correct I only want to export some of the settings. Like the ones I said, but
> > > stuff like JRE Buildpath and stuff which really belongs to one specific project
> > > I don't need to export. The point is that I tried this with the export settings
> > > wizard but was not able to export setting made with Window -> preferences.
> > > So even if such a functionality is already build in I don't understand how to
> > > access it.
> > 
> > Right, so you need to follow my instructions and try and write a
> > PreferenceTransfer
> > 
> > PW
> > 
> 
> Is there any information how to use or implement this PreferensTransfer?
> 

Have you checked the documentation at all?  There is information in the preference transfer extension point schema including an example.
Comment 13 Paul Webster CLA 2008-09-15 09:08:01 EDT
(In reply to comment #9)
> But the reason for me to open this bug is actually that the platform should
> have a wizard or something that let you chose which preferences to export,
> because I think i'm not the only one who wants to have such feature and for the
> bigger part of the users it is not good to let them write a plugin in order to
> get that. So the most people will just copy the files I statet in the beginning
> because thats easier.

I think many developers do as you currently do (create a workspace, exit eclipse, and then copy over the *.prefs files that they care about).

While we could provide a dialog to copy over all individual preferences (without any descriptions, of course, that information is not available), it wouldn't be that useful.  Some preferences work as a group, copying over only some of them will break your workspace.  That's where preferenceTransfers come in ... the preference provider can provide a list that can be exported/imported without problem (groups that work together, preferences that aren't machine specific, etc).

There should be information on transfers in Help>Help Contents>Platform Plug-in Developer Guide.

But as mentioned, if you don't want to do it yourself you need to open a bug against the provider component and wait for them to get it in (the next release is July 2009 :-)

PW
Comment 14 Fabian Schmidt CLA 2008-09-15 09:20:02 EDT
(In reply to comment #12)
> (In reply to comment #10)
> > (In reply to comment #8)
> > > (In reply to comment #6)
> > > > Correct I only want to export some of the settings. Like the ones I said, but
> > > > stuff like JRE Buildpath and stuff which really belongs to one specific project
> > > > I don't need to export. The point is that I tried this with the export settings
> > > > wizard but was not able to export setting made with Window -> preferences.
> > > > So even if such a functionality is already build in I don't understand how to
> > > > access it.
> > > 
> > > Right, so you need to follow my instructions and try and write a
> > > PreferenceTransfer
> > > 
> > > PW
> > > 
> > 
> > Is there any information how to use or implement this PreferensTransfer?
> > 
> 
> Have you checked the documentation at all?  There is information in the
> preference transfer extension point schema including an example.
> 

Yes I found that one but to be honest I don't understand how to use it. It only tells me how to prepare the Plugin.xml file but it doesn't how to implement a transfer with this extension. I normaly create extension with the PDE and not by editing the plugin.xml file. And so these information which are there don't really help me in order to write my plugin

FS
Comment 15 Fabian Schmidt CLA 2008-09-15 09:22:45 EDT
(In reply to comment #11)
> (In reply to comment #9)
> > But the reason for me to open this bug is actually that the platform should
> > have a wizard or something that let you chose which preferences to export,
> 
> Right, that is implemented with the current wizard and its checkboxes.
> 

That Wizard provides exactly 3 boxes in my installation which is Installed
JREs, Keybindings and SVN Preferences. you said that it actually exports much
more, but how should I know what kind of preferences will be exported. If i
read this three options I have to say extracting only the keybindings is not
what I want as they are part of what I want, but if i would have to export
every setting seperatly, than it would be faster to just set them new. And I
wouldn't save any time.

> > I think i'm not the only one who wants to have such feature and for the
> > bigger part of the users it is not good to let them write a plugin in order to
> > get that.
> 
> Yes, I agree with this. The alternative would be what Paul suggested, namely,
> filing a bug against the preference providers. So if you want Java syntax
> colouring, then ask JDT/UI to implement said extension point.
> 

Isn't it easier to build a mechanism that let the user chose instead of me
running to every part of the group that implements preferences i'm interested
in and ask them to build a extension? 

I only want a simple easy to use Platform and not one that is easy to extend.
Becuase most of the user will use it. I mean I gonna write a plugin now usings
this preferenceTransfer extension point as soon as I understand how it workes
what is nearly not statet anywhere. But the most of the users don't want to
write a extension to export their specific set of preferences. I think it would
be better to parse them in the running system and ask the user which ones to
export.

But again is there any documentation for that extension point, because without
I'm not sure whether I can create my plugin...

FS
Comment 16 Paul Webster CLA 2008-09-15 09:25:40 EDT
(In reply to comment #15)
> Isn't it easier to build a mechanism that let the user chose instead of me
> running to every part of the group that implements preferences i'm interested
> in and ask them to build a extension? 

It is not easier, for the reasons outlined above.

PW
Comment 17 Fabian Schmidt CLA 2008-09-15 09:31:50 EDT
(In reply to comment #16)
> (In reply to comment #15)
> > Isn't it easier to build a mechanism that let the user chose instead of me
> > running to every part of the group that implements preferences i'm interested
> > in and ask them to build a extension? 
> 
> It is not easier, for the reasons outlined above.
> 
> PW
> 

Mhm... well I guess than it easier to just use the quick and dirty approach to copy files which I allready implemented. I only thought it might be better to the Eclipse Platform it self in order to avoid problems...

I didn't expect it to be that complicated to export a couple of prefernces...

Don't get me wrong Eclipse is a great IDE but i find it sometimes a little unfriendly to people who try to develop plugins for it...

FS
Comment 18 Remy Suen CLA 2008-09-15 09:34:30 EDT
(In reply to comment #15)
> That Wizard provides exactly 3 boxes in my installation which is Installed
> JREs, Keybindings and SVN Preferences. you said that it actually exports much
> more, but how should I know what kind of preferences will be exported.

Right, you don't know that. That is one of the problems I've always had with that dialog. The checkboxes make it seem like it only exports the items present in the table.

> Isn't it easier to build a mechanism that let the user chose instead of me
> running to every part of the group that implements preferences i'm interested
> in and ask them to build a extension?

I think Paul addressed this with his "grouping" comment in comment 13. This mechanism of letting a user choose is already in place though, it's that dialog and the preferenceTransfer extension point. The Platform can't help it if people don't leverage the extension point though.

(In reply to comment #17)
> Don't get me wrong Eclipse is a great IDE but i find it sometimes a little
> unfriendly to people who try to develop plugins for it...

If you have problems writing plug-ins, there are many people that would be happy to assist you. This conversation should probably not take place on this bug report though.
Comment 19 Fabian Schmidt CLA 2008-09-15 09:40:43 EDT
(In reply to comment #18)
> (In reply to comment #15)
> > That Wizard provides exactly 3 boxes in my installation which is Installed
> > JREs, Keybindings and SVN Preferences. you said that it actually exports much
> > more, but how should I know what kind of preferences will be exported.
> 
> Right, you don't know that. That is one of the problems I've always had with
> that dialog. The checkboxes make it seem like it only exports the items present
> in the table.
> 
> > Isn't it easier to build a mechanism that let the user chose instead of me
> > running to every part of the group that implements preferences i'm interested
> > in and ask them to build a extension?
> 
> I think Paul addressed this with his "grouping" comment in comment 13. This
> mechanism of letting a user choose is already in place though, it's that dialog
> and the preferenceTransfer extension point. The Platform can't help it if
> people don't leverage the extension point though.
 
That grouping thing is a little confusing for me. It workes if I copy files on my hardisk, but it is not possible to extract the same date from the Platform...

> (In reply to comment #17)
> > Don't get me wrong Eclipse is a great IDE but i find it sometimes a little
> > unfriendly to people who try to develop plugins for it...
> 
> If you have problems writing plug-ins, there are many people that would be
> happy to assist you. This conversation should probably not take place on this
> bug report though.
> 

No not really. It wasn't meant as bug report but as feature request. I only wanted to help to improve eclipse. 
Comment 20 Remy Suen CLA 2008-09-15 09:57:40 EDT
(In reply to comment #19)
> That grouping thing is a little confusing for me. It workes if I copy files on
> my hardisk, but it is not possible to extract the same date from the
> Platform...

Well, considering you are "[packing] a zip archive from [the .settings folder]", it's naturally going to work. You just made all the little groups into one big group. So hey, even if X depended on Y, it doesn't matter because you copied them all from A-Z.
Comment 21 Fabian Schmidt CLA 2008-09-15 10:02:43 EDT
(In reply to comment #20)
> (In reply to comment #19)
> > That grouping thing is a little confusing for me. It workes if I copy files on
> > my hardisk, but it is not possible to extract the same date from the
> > Platform...
> 
> Well, considering you are "[packing] a zip archive from [the .settings
> folder]", it's naturally going to work. You just made all the little groups
> into one big group. So hey, even if X depended on Y, it doesn't matter because
> you copied them all from A-Z.
> 

I think this will be my last comment on this as I see that my wish seems to be very complicated.
I will work on a plugin which uses the eclipse export dialog. As this is not the best place to get the neccessary information I need to achieve this. I want to ask where I can get Information about the grouping issue and this extension point.
I allready subscribes the pde newsgroup, but If there are any other goud sources for information I would be happy to know 

kind regards 
FS
Comment 22 Fabian Schmidt CLA 2008-09-15 10:17:04 EDT
(In reply to comment #13)
> (In reply to comment #9)
> > But the reason for me to open this bug is actually that the platform should
> > have a wizard or something that let you chose which preferences to export,
> > because I think i'm not the only one who wants to have such feature and for the
> > bigger part of the users it is not good to let them write a plugin in order to
> > get that. So the most people will just copy the files I statet in the beginning
> > because thats easier.
> 
> I think many developers do as you currently do (create a workspace, exit
> eclipse, and then copy over the *.prefs files that they care about).
> 
> While we could provide a dialog to copy over all individual preferences
> (without any descriptions, of course, that information is not available), it
> wouldn't be that useful.  Some preferences work as a group, copying over only
> some of them will break your workspace.  That's where preferenceTransfers come
> in ... the preference provider can provide a list that can be exported/imported
> without problem (groups that work together, preferences that aren't machine
> specific, etc).
> 
> There should be information on transfers in Help>Help Contents>Platform Plug-in
> Developer Guide.
> 
> But as mentioned, if you don't want to do it yourself you need to open a bug
> against the provider component and wait for them to get it in (the next release
> is July 2009 :-)
> 
> PW
> 

I had another look on the Preferences the two interessting groups for me are Java and General. I guess Jave is a seperate group and maintained by the JDT component people. So I will write a request there. But which component belongs to the Generel Preferences?

cheers FS
Comment 23 Boris Bokowski CLA 2008-09-16 11:33:47 EDT
(In reply to comment #22)
> I had another look on the Preferences the two interessting groups for me are
> Java and General. I guess Jave is a seperate group and maintained by the JDT
> component people. So I will write a request there. But which component belongs
> to the Generel Preferences?

The General section in the preferences dialog has many contributions from all over the place. To find out more, select a specific preference page and then press Alt+Shift+F1 - assuming that you have the PDE installed, this will open the Plug-in Spy, and give you class names and contributing plug-ins of the active preference page.
Comment 24 James Davis CLA 2009-06-07 14:24:06 EDT
Honestly, I'm surprised that this hasn't been addressed yet.  One of the largest issues I've had with eclipse over the last couple years is always having to re-create my syntax highlighting settings.  This should be provided by the framework.

I have been having to resort to copying the prop files around or use the copy settings from workspace option.  However, what if I don't have a workspace around?  I have to re-create the stuff all over again.

Really annoying.
Comment 25 Eclipse Webmaster CLA 2019-09-06 16:13:01 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.