-
Notifications
You must be signed in to change notification settings - Fork 877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes several bugs in the editor annotation options. #8231
base: master
Are you sure you want to change the base?
Conversation
5adda61
to
d95f30b
Compare
there is still something weird going on when annotation colors of copied profiles are persisted. Have to take another look. edit: I think I have found the (hopefully) last remaining problem. Fix in progress. |
- Make sure the current editor annotation profile is correctly copied on profile duplication. - Make sure annotation profile settings are correctly persisted and applied on change - All profiles must have annotation color configs to have inherited values work correctly (added missing) - EditorSettings: fix javadoc since the impl never returned null in the last 20 years.
d95f30b
to
86fe0a9
Compare
unfortunately this required more changes than anticipated. But I think the editor annotation color profile options work now as intended I hope. The missing bit is that the inherited colors make only sense if the base theme is well defined. Currently its the "NetBeans" theme which doesn't make a lot of sense for dark themes etc. But fixing this would go beyond the annotations tab. I fear the "Highlighting" tab is also broken, but I need a break from the color settings :) |
/** | ||
* Returns annotations properties for given profile or null, if the | ||
* Returns annotations properties for given profile or an empty Map, if the | ||
* profile is not known. | ||
* | ||
* @param profile a profile name | ||
* @return annotations properties for given profile or null | ||
* @return annotations properties for given profile or an empty map | ||
*/ | ||
public abstract Map<String, AttributeSet> getAnnotations ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the impl never returned null in the last ~20 years. Since it is friend API I decided to change the doc instead of the impl since it seemed to be lower risk.
if (this.kbsi == evt.getSource()) { | ||
kbsChanged = true; | ||
|
||
} else if (evt.getPropertyName() == null) { | ||
} else if (prop == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just reading the diff, though about using switch
over String
in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing against it, but it would reformat a big section which would make reviews more difficult and might risk to hide the change in it. The main reason I extracted the prop name is because it would make the added ||
longer a few lines later.
Fixes several issues with the editor annotation options.
manual test:
options -> fonts & colors -> annotations
fixes #8143 and https://issues.apache.org/jira/browse/NETBEANS-1493