-
Notifications
You must be signed in to change notification settings - Fork 867
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
Fix: tabs without file objects had null title in tab switcher #8213
Conversation
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.
Thank you very much!
platform/core.multitabs/src/org/netbeans/core/multitabs/impl/DocumentSwitcherTable.java
Show resolved
Hide resolved
found a second issue unfortunately the file2file diff title is broken, trying to fix it |
d8cfe40
to
2c8323c
Compare
fix is to escape the original tab title if:
didn't want to add a dependency to editor utils to get to StringEscapeUtils so I use the XML util which is essentially the same thing plus bonus exception. This reminded me that we should probably put https://github.com/OWASP/owasp-java-encoder/ somewhere. |
@@ -123,8 +125,18 @@ private static String merge( String prefix, String baseText ) { | |||
res.append( prefix ); | |||
res.append( baseText.substring( 6 ) ); | |||
} else { | |||
res.append( prefix ); | |||
res.append( baseText ); | |||
if (prefix.startsWith("<font")) { |
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.
//NOI18N ?
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.
fixed
- example: repo history with parent folder decorator enabled - or diff between two files - regression since ad776db
2c8323c
to
d9d269c
Compare
@neilcsmith-net @eirikbakke pinging for review. IMO: this should not slip through rc2, we should either merge this or merge a revert of #7930. cc @ebarboni |
Adjustments look fine. The handling of Swing HTML formatting is a bit ugly in this class, but bugs here are purely cosmetic in nature. (Swing HTML parsers, or the simplified parsers in NetBeans, do not execute Javascript or such.) |
yeah, what makes it ugly is that it has to support all combinations of html text and plain text for both tab title and prefix. There are many places within NB which have to detect if a string is html or plain. |
In my own NetBeans app I have a dedicated SwingString class for passing, concatenating, and escaping strings that may or may not contain Swing HTML formatting. That way the type checker takes care of tracking and documenting where HTML formatting may be used. Would probably be way too much work to adapt that in NetBeans, though. |
LGTM |
targets delivery