1 19 package org.netbeans.modules.editor.highlights.spi; 20 21 import java.util.Collection ; 22 import java.util.ArrayList ; 23 import org.netbeans.modules.editor.highlights.HighlighterImpl; 24 import org.openide.filesystems.FileObject; 25 import org.openide.util.RequestProcessor; 26 27 31 public final class Highlighter { 32 33 private static final Highlighter INSTANCE = new Highlighter(); 34 35 public static Highlighter getDefault() { 36 return INSTANCE; 37 } 38 39 private RequestProcessor WORKER = new RequestProcessor("Highlighter worker"); 40 41 42 private Highlighter() { 43 } 44 45 public void setHighlights(final FileObject fo, final String type, Collection highlights) { 46 final Collection highlightsCopy = new ArrayList (highlights); 47 WORKER.post(new Runnable () { 48 public void run() { 49 HighlighterImpl.getDefault().setHighlights(fo, type, highlightsCopy); 50 } 51 }); 52 } 53 54 } 55 | Popular Tags |