This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 103917 - [Fonts&Colors] Changed code highlight colors do not persist over IDE restarts
Summary: [Fonts&Colors] Changed code highlight colors do not persist over IDE restarts
Status: RESOLVED DUPLICATE of bug 103247
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 6.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-14 13:48 UTC by mikepanev
Modified: 2007-11-05 13:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mikepanev 2007-05-14 13:48:15 UTC
During the investigation of #103808 I found that some of the customized syntax
highlighting colors do not persist (i.e. are lost) when the IDE is restarted.

  Following syntax highlighting categories seem to be affected. All of them are
in the Java language category, but other languages may be affected too:

    * Javadoc tag
    * Unused element
    * ... probably others that I have left to their default values in other
languages

  The behavior is the same whether the built-in "Netbeans" color profile is
changed or a new one is created.

  The bug is reproducible in the following way:

    1. Open the Options dialog via Tools -> Options
    2. Go to the Fonts & Colors section
    3. In the Syntax tab, choose the Java language from the drop-down menu
    4. Change the colors of one or more of the aforementioned color categories
(I changed the foreground, maybe others are affected too)
    5. Close the Options dialog with OK
    6. Open a new java editor to see the new values take effect (bug #93969)
    7. Close the IDE and start it again
    8. See the mentioned colors take their default values again, rather than the
colors set in step 4.
Comment 1 Vitezslav Stejskal 2007-05-15 04:08:59 UTC
I am sorry, but it seems to be working fine in my trunk build. I tried changing
javadoc tag (forecolor = orange) and unused field (forecolor = red, effect =
strikethrough, effect-color = red) in Netbeans profile and the changes were
persisted and correctly loaded after the restart. 

Are you sure about the steps? Were there any exceptions? Can you check that
after making a change and OKeying the Tools-Options dialog there is a file in
your userdir with the changes? It should be
<ud>/config/Editors/text/x-java/FontsColors/NetBeans/org-netbeans-modules-editor-settings-CustomFontsColors.xml

Thanks
Comment 2 mikepanev 2007-05-15 12:10:00 UTC
  OK, setting explicit colors seems to work. Setting the values for those
categories to "inherited" (what I actually wanted) definitely does not persist
for me.

  The XML file you mentioned is indeed being written after each change to the
color profile, but looks like it is not interpreted correctly. Setting the said
colors to "inherited" produces:

    <fontcolor default="comment" name="javadoc-tag">
        <font style="bold"/>
    </fontcolor>

    <fontcolor name="mod-unused" waveUnderlined="orange"/>

  Despite that, javadoc tags are bright blue (the default) instead of dark green
(my customized normal comment color). Unused elements are still being
wave-underlined in orange, but have a grey foreground (default) instead of their
normal inherited color. Inheriting, however, does work correctly after the
Options dialog is closed until the IDE is restarted. After a fresh start, the
default colors are reset.

  No exceptions or the like are produced for me.

  Hope this helps you on. 
Comment 3 Vitezslav Stejskal 2007-05-15 22:59:40 UTC
Aha, it's the same problem as in issue #103247. Changes are persisted correctly,
but user defined colorings are incorrectly merged with the default ones when
loading.

*** This issue has been marked as a duplicate of 103247 ***