Bug 103096 - [preferences] Need option to save custom syntax color settings
Summary: [preferences] Need option to save custom syntax color settings
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 enhancement with 8 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 107508 112130 113223 144463 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-07-07 18:29 EDT by Timothy Mowlem CLA
Modified: 2011-09-30 07:24 EDT (History)
11 users (show)

See Also:


Attachments
Patch to allow the Java and properties file syntax highlighting to be imported and exported from the import/export preferences wizard. (18.54 KB, patch)
2008-11-13 01:59 EST, Remy Suen CLA
daniel_megert: review-
Details | Diff
JDT editor preferences import/export patch v2 (3.56 KB, patch)
2010-02-17 19:01 EST, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Mowlem CLA 2005-07-07 18:29:48 EDT
AFAIK there is not currently an option to save syntax color settings as there is in IDEA. There is an option 
to save the formatter settings in Code Settings.

I would like to see an enahncement to allow the user to save custom settings under a name like the 
formatter for:

(1) Java editor syntax coloring settings
(2) Java editor appearance color options (Java Editor page)
Comment 1 Helen Beeken CLA 2005-07-08 03:29:28 EDT
Transferring this to the JDT-ui team as this is to do with the Java Editor.
Comment 2 Brian Miller CLA 2005-07-08 19:48:06 EDT
I really miss this feature from IntelliJ and JBuilder.  JBuilder comes with a 
few predefined color schemes, including Twilight which has a black background 
for saving laptop battery or for reducing harmful radition from a cathode ray 
tube.
Comment 3 Dani Megert CLA 2005-07-11 05:27:02 EDT
If export all preferences it will contain the coloring preferences as well.

We should allow to import/export the coloring options on their own.
Comment 4 Dani Megert CLA 2005-10-13 09:36:45 EDT
*** Bug 107508 has been marked as a duplicate of this bug. ***
Comment 5 Tom Hofmann CLA 2005-10-20 09:25:29 EDT
*** Bug 113223 has been marked as a duplicate of this bug. ***
Comment 6 Dani Megert CLA 2006-05-30 11:34:43 EDT
*** Bug 144463 has been marked as a duplicate of this bug. ***
Comment 7 Remy Suen CLA 2008-11-13 01:59:21 EST
Created attachment 117736 [details]
Patch to allow the Java and properties file syntax highlighting to be imported and exported from the import/export preferences wizard.

It appears to work nicely but I do not have any icons so the import/export wizard just shows blank space in the table.

This does _not_ include the 'Appearance color options:' table in the 'Java > Editor' page per requested by comment 0. I can add this if necessary but I would like to check with JDT/UI as to whether this org.eclipse.ui.preferenceTransfer extension point approach is the way they envisioned this feature be implemented.
Comment 8 Dani Megert CLA 2008-11-24 08:50:57 EST
It's the right approach but the patch is broken as it uses the same ID twice. Use
- org.eclipse.jdt.ui.javaEditorColors
- org.eclipse.jdt.ui.javaPropertiesEditorColors

Also use better names: "Java Editor Colors" and "Java Properties File Editor Colors".

>It appears to work nicely but I do not have any icons so the import/export
>wizard just shows blank space in the table.
Just draw one for a start (but do not copy from somewhere). We can then let the designer create one for us.

>This does _not_ include the 'Appearance color options:' table in the 'Java >
>Editor' page per requested by comment 0. I can add this if necessary
It's needed to get a working end result. Besides that we also want to include the colors from Text Editors > Appearance Color options.
Comment 9 Dani Megert CLA 2009-10-01 09:41:09 EDT
*** Bug 112130 has been marked as a duplicate of this bug. ***
Comment 10 Martin Oberhuber CLA 2010-02-02 05:31:02 EST
(In reply to comment #9)
I don't think that bug 112130 is really a duplicate of this one:

- This bug talks about export/import of color schemes
- Bug 112130 talks about sharing color schemes across workspaces

Where sharing is different (and more complex) since it would allow a modification of the setting in Workspace A to automatically replicate to workspace B. 

In the intereste of keeping things simple, I suggest using bug 70683 for all sharing discussions. This bug does not depend on the sharing.
Comment 11 Dani Megert CLA 2010-02-02 05:45:40 EST
>- Bug 112130 talks about sharing color schemes across workspaces
>I don't think that bug 112130 is really a duplicate of this one:
I disagree. Yes, it does talk about sharing too but in comment 0 and 3 it also talks about import export and it correctly refers to bug for the sharing scenario.
Comment 12 Remy Suen CLA 2010-02-17 19:01:07 EST
Created attachment 159392 [details]
JDT editor preferences import/export patch v2

(In reply to comment #8)
> It's the right approach but the patch is broken as it uses the same ID twice.
> Use
> - org.eclipse.jdt.ui.javaEditorColors
> - org.eclipse.jdt.ui.javaPropertiesEditorColors

Corrected. How embarassing.

> Also use better names: "Java Editor Colors" and "Java Properties File Editor
> Colors".

Done.

> >It appears to work nicely but I do not have any icons so the import/export
> >wizard just shows blank space in the table.
> Just draw one for a start (but do not copy from somewhere). We can then let the
> designer create one for us.

I just used the perspective icon that the other two transfers use (compiler and Java appearance).

> >This does _not_ include the 'Appearance color options:' table in the 'Java >
> >Editor' page per requested by comment 0. I can add this if necessary
> It's needed to get a working end result.

Added:
Matching bracket highlight
Parameter hints background
Parameter hints foreground
Completion overwrite background
Completion overwrite foreground
Source hover background (two here, including the "System Default" boolean setting)

> Besides that we also want to include
> the colors from Text Editors > Appearance Color options.

Dani, do you want a separate bug for this or do you want them all in one patch attached to this bug?
Comment 13 Dani Megert CLA 2010-02-18 04:26:33 EST
>Dani, do you want a separate bug for this or do you want them all in one patch
>attached to this bug?
Same patch, but not a different category: those colors need to be part of the new JDT color categories so that the colors are usable after importing.
Comment 14 Remy Suen CLA 2010-02-18 07:48:53 EST
(In reply to comment #13)
> Same patch, but not a different category: those colors need to be part of the
> new JDT color categories so that the colors are usable after importing.

Understood. So it seems to me we need the colours for:
General > Editors > Text Editors
General > Editors > Text Editors > Annotations
General > Editors > Text Editors > Linked Mode
General > Editors > Text Editors > Quick Diff (yes/no?)

For the settings above, they'll both be referenced by the Java editor colours _and_ the Properties file editor colours, correct? That is...

Java editor colours
-Java editor colours
-Text editor colours

Properties file editor colours
-Properties file editor colours
-Text editor colours

Does this sound right to you?
Comment 15 Dani Megert CLA 2010-04-08 08:58:20 EDT
>Does this sound right to you?
At a first glance I see the content assist colors missing (they are on the Appearance page).

This is too late for 3.6 (needs work and testing).
Comment 16 Dani Megert CLA 2010-06-21 10:44:43 EDT
>At a first glance I see the content assist colors missing (they are on the
>Appearance page).
Remy, do you want to take a look?
Comment 17 Remy Suen CLA 2010-06-21 10:47:39 EDT
(In reply to comment #16)
> >At a first glance I see the content assist colors missing (they are on the
> >Appearance page).
> Remy, do you want to take a look?

Sure.

But only after e4 is out the door. >_<
Comment 18 Dani Megert CLA 2010-06-21 11:27:12 EDT
>But only after e4 is out the door. >_<
Of course.
Comment 19 ivar vasara CLA 2010-07-24 02:40:27 EDT
I am very glad to see that this issue is finally getting some love !

In an effort to bump up the priority I'd like to point out that if you google 'eclipse color scheme' the top two hits are :

http://stackoverflow.com/questions/96981/color-themes-for-eclipse
and
http://stackoverflow.com/questions/120621/dark-color-scheme-for-eclipse

which both highlight how poorly Eclipse supports custom editor color schemes.

There is even a cross editor/ide color scheme converter now at http://github.com/sickill/coloration -- Given a standard format for editor color schemes for eclipse, it should be easy to add eclipse support to coloration.  It would fantastic to be able to *easily* use tried, tested and true schemes that I have grown to love.
Comment 20 Dani Megert CLA 2011-04-12 06:17:13 EDT
Remy, are you still planning to do this? Probably not for 3.7, right?
Comment 21 Remy Suen CLA 2011-04-12 06:21:40 EDT
(In reply to comment #20)
> Remy, are you still planning to do this?

I'm still interested in implementing this, yes. If someone else on the CC list wants to submit a patch though they are welcome to do so. ;)

> Probably not for 3.7, right?

But probably not enough time for M7, no.
Comment 22 Remy Suen CLA 2011-09-29 07:46:00 EDT
Unfortunately, I have to devote my spare time to EGit so I don't think I'll be able to implement this.

Hopefully someone else in the community will be willing to contribute a patch.
Comment 23 Martin Oberhuber CLA 2011-09-29 12:06:55 EDT
It seems odd to me that we think about a special import/export wizard for JDT specifically. As an end user, I'm much more interested in applying a color scheme globally across all my editors (like Eclipse Color Themes provides).

I'm wondering what http://www.eclipsecolorthemes.org/ is lacking ? I can import tons of themes or create my own there...

Sure it would be nice having such support out of the box. But as a primary user of C/C++, webtools, JSDT and PHP it seems odd to me that JDT is cooking its own here.
Comment 24 Dani Megert CLA 2011-09-30 06:02:16 EDT
(In reply to comment #23)
> It seems odd to me that we think about a special import/export wizard for JDT
> specifically. As an end user, I'm much more interested in applying a color
> scheme globally across all my editors (like Eclipse Color Themes provides).
> 
I agree that you would probably want to export/import all colors at once but since there is no API or predefined key prefix, this is not doable - at least not without an additional layer where the color keys can be registered to be part of a single transfer.
Comment 25 Martin Oberhuber CLA 2011-09-30 06:51:23 EDT
Perhaps we should think about new API along those lines.

I don't quite see the value of a JDT-specific import/export when EclipseColorThemes already exists providing this (and more).
Comment 26 Dani Megert CLA 2011-09-30 06:55:27 EDT
> I don't quite see the value of a JDT-specific import/export when
> EclipseColorThemes already exists providing this (and more).
For those only using JDT the value is that they can transfer just those settings to a new workspace. Having said that, it's not something that I would use. Maybe someone from the cc-list can comment on why they still need this.
Comment 27 Michael N. Lipp CLA 2011-09-30 07:24:20 EDT
> Having said that, it's not something that I would
> use. Maybe someone from the cc-list can comment on why they still need this.

I reported the Bug 107508 (marked as duplicate) ages ago. The problem then was simply that I had adjusted the color settings to my liking (actually to the scheme emacs uses, which IMHO is much better) on the computer that I used at work, and there was no possibility whatsowever (then) to transfer these settings to the computer that I used in my home office.

Honestly, I don't know if there is a way to achieve this transfer of settings nowadays, dozens of eclipse versions later. After loosing the settings several times due to some reinstallations and using emacs less and less, I got accustomed to using the defaults. So I'm no longer interested in this bug.

 - Michael