Bug 294071 - [preferences] Add support for import/export of content assist settings
Summary: [preferences] Add support for import/export of content assist settings
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement with 4 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 457644 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-11-03 09:54 EST by Morten CLA
Modified: 2021-11-12 06:03 EST (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Morten CLA 2009-11-03 09:54:36 EST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)
Build Identifier: 20090621-0832

I wish there was a way to export the following eclipse setting: java > editor > content assist > favorites... I keep configuring the same hamcrest static imports everytime I get a fresh eclipse install

Reproducible: Always

Steps to Reproduce:
1. open Window > preferences
2. go to java > editor > content assist > favorites
3. there is no option to export/import settings
Comment 1 Noopur Gupta CLA 2015-01-19 02:07:18 EST
*** Bug 457644 has been marked as a duplicate of this bug. ***
Comment 2 Nathan McDonald CLA 2018-08-16 11:00:14 EDT
Our organisation currently has about 20 standard favorites we recommend for developers to use, e.g.

com.google.common.collect.Lists.*
com.google.common.collect.Maps.*
com.google.common.collect.Sets.*
org.apaache.commons.collections4.CollectionUtils.*
org.apaache.commons.collections4.MapUtils.*
org.apaache.commons.collections4.SetUtils.*
org.apache.commons.lang3.ArrayUtils.*
org.apache.commons.lang3.StringUtils.*

etc... can see there are lots of useful 3rd party libraries, and generally a new class for each flavour of Collection needed.  Also lots more for tests, precondition checking, hamcrest as well.

Having each developer have to manually enter these is laborious, no way to import, no way to bulk enter. Have to go through process of

 > Click button
 > Enter next item (copied from external list)
 > Click OK

Very easy to miss an item when building this list up manually (accidentally skip over an item from the external list.

Would be great to import or export to epf, or even to have ability to bulk import multiple in the UI (one paste from external source) instead of having to manually add one at a time.
Comment 3 Nathan McDonald CLA 2018-08-16 11:18:38 EDT
Also just mention, this is also frustrating to hit because very difficult to search the web for others having same issue.

Search the web on how to import favorites in eclipse, as you just get results on people using favorites to set up static imports.

Was surprised I was first to vote on this issue, but considering how long it took to even find this issue wondering if worth considering this may be affecting more people than can easily report it.
Comment 4 Dani Megert CLA 2018-08-17 05:35:57 EDT
While you wait for a fix there's a workaround that you could use:

1. Make the changes in the preference dialog.
2. Export ALL preferences

In the preference file cut out everything except the preference for favorites. You will end up with something like:

#Fri Aug 17 11:17:45 CEST 2018
\!/=
/instance/org.eclipse.jdt.ui/content_assist_favorite_static_members=java.lang.Math.*
file_export_version=3.0

You can now import that file to set the favorites. Of course you can also include other preferences that you would like to be part of your initial setup.


You can even go a step further and provide a default preferences customization file when starting Eclipse, e.g. add

-pluginCustomization C:\eclipse\pluginCustomization.ini

In the INI file you can add the exported preferences but remove "/instance/", e.g.

org.eclipse.jdt.ui/content_assist_favorite_static_members=java.lang.Math.*

This will set the default preferences for new workspaces.

HTH