You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by ge...@apache.org on 2018/05/10 07:54:26 UTC

[incubator-netbeans] branch master updated: [NETBEANS-713] Have HighlightingManager properly respond to changes in excludes/includes client property. (#514)

This is an automated email from the ASF dual-hosted git repository.

geertjan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new 11832fc  [NETBEANS-713] Have HighlightingManager properly respond to changes in excludes/includes client property. (#514)
11832fc is described below

commit 11832fc10ccf4c68e15db3ca8e8b558d020f74e0
Author: Eirik Bakke <eb...@alumni.princeton.edu>
AuthorDate: Thu May 10 03:54:24 2018 -0400

    [NETBEANS-713] Have HighlightingManager properly respond to changes in excludes/includes client property. (#514)
    
    * [NETBEANS-713] Have HighlightingManager properly respond to changes in excludes/includes client property.
    
    * [NETBEANS-713 revised] Synchronize HighlightingManager.Highlighting.pane.paneFilter.
---
 .../modules/editor/lib2/highlighting/HighlightingManager.java     | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/HighlightingManager.java b/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/HighlightingManager.java
index 32ab8ed..f72f053 100644
--- a/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/HighlightingManager.java
+++ b/editor.lib2/src/org/netbeans/modules/editor/lib2/highlighting/HighlightingManager.java
@@ -197,11 +197,15 @@ public final class HighlightingManager {
         public Highlighting(HighlightingManager manager, JTextComponent pane) {
             this.manager = manager;
             this.pane = pane;
-            this.paneFilter = new RegExpFilter(pane.getClientProperty(PROP_HL_INCLUDES), pane.getClientProperty(PROP_HL_EXCLUDES));
+            updatePaneFilter();
             this.pane.addPropertyChangeListener(WeakListeners.propertyChange(this, pane));
             rebuildAll();
         }
         
+        private synchronized void updatePaneFilter() {
+            paneFilter = new RegExpFilter(pane.getClientProperty(PROP_HL_INCLUDES), pane.getClientProperty(PROP_HL_EXCLUDES));
+        }
+
         synchronized HighlightsContainer bottomHighlights() {
             return bottomHighlights;
         }
@@ -241,6 +245,7 @@ public final class HighlightingManager {
 
         public @Override void propertyChange(PropertyChangeEvent evt) {
             if (evt.getPropertyName() == null || PROP_DOCUMENT.equals(evt.getPropertyName())) {
+                updatePaneFilter();
                 Document doc = pane.getDocument();
                 if (doc != null) {
                     doc.render(new Runnable() {
@@ -253,6 +258,7 @@ public final class HighlightingManager {
             }
 
             if (PROP_HL_INCLUDES.equals(evt.getPropertyName()) || PROP_HL_EXCLUDES.equals(evt.getPropertyName())) {
+                updatePaneFilter();
                 rebuildAllLayers();
             }
         }

-- 
To stop receiving notification emails like this one, please contact
geertjan@apache.org.

---------------------------------------------------------------------
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