1 19 package org.netbeans.spi.editor.hints; 20 21 import java.util.Collection ; 22 import java.util.ArrayList ; 23 import javax.swing.text.Document ; 24 import org.netbeans.modules.editor.hints.HintsControllerImpl; 25 import org.openide.filesystems.FileObject; 26 import org.openide.util.RequestProcessor; 27 28 32 public final class HintsController { 33 34 35 private HintsController() { 36 } 37 38 46 public static void setErrors(final Document doc, final String layer, Collection <? extends ErrorDescription> errors) { 47 final Collection <? extends ErrorDescription> errorsCopy = new ArrayList <ErrorDescription>(errors); 48 49 WORKER.post(new Runnable () { 50 public void run() { 51 HintsControllerImpl.setErrors(doc, layer, errorsCopy); 52 } 53 }); 54 } 55 56 63 public static void setErrors(final FileObject file, final String layer, Collection <? extends ErrorDescription> errors) { 64 final Collection <? extends ErrorDescription> errorsCopy = new ArrayList <ErrorDescription>(errors); 65 66 WORKER.post(new Runnable () { 67 public void run() { 68 HintsControllerImpl.setErrors(file, layer, errorsCopy); 69 } 70 }); 71 } 72 73 private static RequestProcessor WORKER = new RequestProcessor("HintsController worker"); 74 75 } 76 | Popular Tags |