You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Matthias Bläsing (JIRA)" <ji...@apache.org> on 2018/04/07 19:12:00 UTC

[jira] [Created] (NETBEANS-619) Check/Consolidate manipulation of HTMLEditorKit stylesheet

Matthias Bläsing created NETBEANS-619:
-----------------------------------------

             Summary: Check/Consolidate manipulation of HTMLEditorKit stylesheet
                 Key: NETBEANS-619
                 URL: https://issues.apache.org/jira/browse/NETBEANS-619
             Project: NetBeans
          Issue Type: Improvement
    Affects Versions: 9.0
            Reporter: Matthias Bläsing


There are various places in the netbeans code base, that make use of the HTMLEditorKit to visualize HTML content. In many cases the stylesheet backing the HTMLEditorKit is manipulated. This is the case at least in:
 * autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/wizards/PanelBodyContainer.java
 * autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/DetailsPanel.java
 * code.analysis/src/org/netbeans/modules/analysis/ui/AnalysisResultTopComponent.java
 * editor.completion/src/org/netbeans/modules/editor/completion/HTMLDocView.java
 * java.j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/BrokenPlatformCustomizer.java
 * java.navigation/src/org/netbeans/modules/java/navigation/HTMLDocView.java
 * openide.dialogs/src/org/openide/WizardDescriptor.java
 * openide.explorer/src/org/openide/explorer/propertysheet/DescriptionComponent.java
 * openide.loaders/src/org/openide/loaders/TemplateWizard1.java
 * projectui/src/org/netbeans/modules/project/ui/TemplatesPanelGUI.java

 

This is problematic (as also mentioned in several places in the files above), as the stylesheet is shared by all HTMLEditorKits (think of it as a client style sheet). As a reference this is the implemenation of _HTMLEditorKits#setStylesheet_:

 
{code:java}
    public void setStyleSheet(StyleSheet s) {
        if (s == null) {
            AppContext.getAppContext().remove(DEFAULT_STYLES_KEY);
        } else {
            AppContext.getAppContext().put(DEFAULT_STYLES_KEY, s);
        }
    }
{code}
 

Other users manipulate the document stylesheet and not the global stylesheet:
 * subversion/src/org/netbeans/modules/subversion/util/NotifyHtmlPanel.java
 * subversion/src/org/netbeans/modules/subversion/options/SvnOptionsPanel.java
 * subversion/src/org/netbeans/modules/subversion/client/MissingClientPanel.java
 * openide.awt/src/org/openide/awt/SwingBrowserImpl.java

 

It should be checked if it would be feasible to centralize the modification of the global stylesheet for example in the {{org.netbeans.swing.plaf}} (Look & Feel Customization Library) module.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists