Reputation: 103
Original Question: Eclipse luna theme issue
Related Question: How to make Eclipse color settings permanent?
TL;DR Eclipse Luna 4.4, Dark theme, Win 7 64bit, some settings reset to an initial value on start. How to make them stay the way i configured them ? Examples: Java Syntax Coloring, enums are italics with the dark theme, i dont want them italics tho...
Additional Research
In the workspace\.metadata\.plugins\org.eclipse.core.runtime.settings\org.eclipse.jdt.ui.prefs
file there is a tag named overriddenByCSS
that seems to cause this issue. It only exists if the dark theme is used. I looked into the CSS files of the dark theme but couldnt find anything related...
Also removing or changing the line manually doesnt work, it gets written every start of eclipse.
Why do i ask ?
Even tho the "How to ask" mentions that a new question should be different to an allready existing one, i dont have enough reputation to comment on the original question and add details to it. So i tried in the form of an answer, but someone "thought" it was a good idea to delete my answer (that wasnt really answering, just adding more details...). So, well, lets just flood SO with duplicates then...
EDIT: I posted a bug at the eclipse bugzilla
Upvotes: 9
Views: 4990
Reputation: 133
To set up Dark theme as a "global" theme, and the theme you like from Eclipse Color Theme that you installed from Market Place, you can do the following. I used:
Steps:
Windows>Preferences>General>Appearance>Theme:Dark
)C:\Users\[user]\eclipse-workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings
org.eclipse.e4.ui.css.swt.theme
.=
, and keep that in your clipboard , in my case it was org.eclipse.e4.ui.css.theme.e4_dark
org.eclipse.e4.ui.css.swt.theme
again and paste what was in the clipboard (themeid=org.eclipse.e4.ui.css.theme.e4_dark
, in my case) after the =.Upvotes: 0
Reputation: 151
On Eclipse 4.6 (Ubuntu) the solution that worked for me is the following:
Upvotes: 4
Reputation: 23
Just go to window->preferences->oomph->setup tasks, and enable skip automatic task execution at startup time
Upvotes: 2
Reputation: 799
A few days ago a comment was added to your Eclipse bug report and I have been able to successfully workaround this issue using that advice. It's tedious, but it worked for me.
Eclipse will load your preferences on startup, overwrite them with overriddenByCSS=
, etc. and then restore your original settings file on exit. This means that all changes you make to org.eclipse.jdt.ui.prefs should be made while Eclipse is not running.
Comparing this file while Eclipse is running to the version while Eclipse is not running will help you identify the changes you need to make to preserve your colors.
Use your preferred version control system to manage these files. This will ensure that you don't lose them in the future and will help you see how Eclipse is changing your preferences when it starts. I will use Mercurial below.
Exit Eclipse and put the core runtime settings under version control:
cd [eclipse workspace]/.metadata/.plugins/org.eclipse.core.runtime/.settings
hg init
hg add .
hg ci -m "before dark"
Start Eclipse and switch to the Dark theme and then Exit Eclipse.
Verify that only the theme changed and save the changes to a branch:
hg diff
hg branch dark
hg ci -m "after dark"
Start Eclipse again and while Eclipse is running, compare the files to what you just checked in. You will see the new overriddenByCSS value which will reference all of the values that were added by Eclipse on startup. Do a diff and keep note of what was changed and before you exit Eclipse, save these overrides.
hg diff
hg ci -m "eclipse overrides"
Exit Eclipse and you will notice that the changes are gone. Restore the changes it made when it was running:
hg revert .
Edit org.eclipse.jdt.ui.prefs and remove the line that starts with overriddenByCSS
. This will make the other overrides values stick. Save these changes.
hg ci -m "the overrides are now mine"
Start and Exit Eclipse and verify that Eclipse didn't make any changes to your file.
hg diff
Now that the overrides are yours, you are free to change them. For the example you mentioned, enums in italic, edit org.eclipse.jdt.ui.prefs and set semanticHighlighting.enum.italic=false
If you ever want to go back to your default before you started this, you can switch between branches using:
hg up -r default
hg up -r dark
Important note: If you change syntax color preferences using Eclipse, you'll notice that the overriddenByCSS
value comes back when Eclipse is running and your preferences will disappear. Periodically monitor your preference files for changes and commit them when you like them. Revert them when you don't.
Upvotes: 9