1 19 20 package org.netbeans.modules.xml.xam.ui.highlight; 21 22 import java.util.Iterator ; 23 import java.util.List ; 24 import java.util.Map ; 25 import java.util.Set ; 26 27 32 public class DefaultHighlightManager extends HighlightManager { 33 34 37 public DefaultHighlightManager() { 38 } 39 40 protected void hideHighlights(HighlightGroup group) { 41 hideOrShow(group, false); 42 group.setShowing(false); 43 } 44 45 51 private void hideOrShow(HighlightGroup group, boolean show) { 52 Map <Highlighted, List <Highlight>> map = findListeners(group); 53 Set <Map.Entry <Highlighted, List <Highlight>>> entries = map.entrySet(); 54 Iterator <Map.Entry <Highlighted, List <Highlight>>> iter = entries.iterator(); 55 while (iter.hasNext()) { 56 Map.Entry <Highlighted, List <Highlight>> entry = iter.next(); 57 Highlighted listener = entry.getKey(); 58 List <Highlight> lights = entry.getValue(); 59 for (Highlight light : lights) { 60 if (show) { 61 listener.highlightAdded(light); 62 } else { 63 listener.highlightRemoved(light); 64 } 65 } 66 } 67 } 68 69 protected void showHighlights(HighlightGroup group) { 70 group.setShowing(true); 71 hideOrShow(group, true); 72 } 73 74 } 75 | Popular Tags |