This is an automated email from the ASF dual-hosted git repository. neilcsmith pushed a commit to branch delivery in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/delivery by this push: new 4135fe8 [NETBEANS-5304] CSS: Prevent UI blocking on undocumented properties new d3813ac Merge pull request #2722 from matthiasblaesing/nb-css 4135fe8 is described below commit 4135fe82274e848b763001c46d708a31e9278d37 Author: Matthias Bläsing <mblaes...@doppel-helix.eu> AuthorDate: Sun Jan 31 16:39:03 2021 +0100 [NETBEANS-5304] CSS: Prevent UI blocking on undocumented properties When the documentation for the target property could not be found, the whole page of the CSS module was passed as help text. The rendering of the HTML in combination with a popup menu caused problems on hide. The documentation could be rendered, but on hide, the EDT is stuck in a call to: javax.swing.PopupFactory$MediumWeightPopup.hide() Instead of rendering the whole documentation, the information "there is no documenation" is rendered. While not optimal, it at least prevents a heard freeze. --- .../main/StandardPropertiesHelpResolver.java | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/ide/css.editor/src/org/netbeans/modules/css/editor/module/main/StandardPropertiesHelpResolver.java b/ide/css.editor/src/org/netbeans/modules/css/editor/module/main/StandardPropertiesHelpResolver.java index 5490458..e29308f 100644 --- a/ide/css.editor/src/org/netbeans/modules/css/editor/module/main/StandardPropertiesHelpResolver.java +++ b/ide/css.editor/src/org/netbeans/modules/css/editor/module/main/StandardPropertiesHelpResolver.java @@ -57,7 +57,7 @@ public class StandardPropertiesHelpResolver extends HelpResolver { private static final String W3C_SPEC_URL_PREFIX = "http://www.w3.org/TR/"; //NOI18N private static final String MODULE_ARCHIVE_PATH = "www.w3.org/TR/"; //NOI18N private static final String INDEX_HTML_FILE_NAME = "index.html"; //NOI18N - + private static final String NO_HELP_MSG = NbBundle.getMessage(StandardPropertiesHelpResolver.class, "completion-help-no-documentation-found"); @Override @@ -171,24 +171,8 @@ public class StandardPropertiesHelpResolver extends HelpResolver { } else { //no pattern found, likely a bit different source - LOGGER.warning(String.format("No property anchor section pattern found for property '%s'", property.getName())); //NOI18N - - //strip the <style>...</style> section from the source since it causes a garbage in the swingbrowser - int styleSectionStart = urlContent.indexOf("<style type=\"text/css\">"); //NOI18N - if(styleSectionStart >= 0) { - final String styleEndTag = "</style>"; //NOI18N - int styleSectionEnd = urlContent.indexOf(styleEndTag, styleSectionStart); - if(styleSectionEnd >= 0) { - StringBuilder buf = new StringBuilder(); - buf.append(urlContent.subSequence(0, styleSectionStart)); - buf.append(urlContent.subSequence(styleSectionEnd + styleEndTag.length(), urlContent.length())); - - return buf.toString(); - } - } - - - return urlContent; + LOGGER.warning(String.format("No property anchor section pattern found for property '%s'", propertyUrl)); //NOI18N + return NO_HELP_MSG; } } catch (MalformedURLException ex) { LOGGER.log(Level.WARNING, null, ex); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists