1 19 20 package org.netbeans.modules.editor.lib2.highlighting; 21 22 import java.util.Collection ; 23 import java.util.List ; 24 import javax.swing.text.Document ; 25 import javax.swing.text.JTextComponent ; 26 import org.netbeans.spi.editor.highlighting.HighlightsLayer; 27 import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory; 28 import org.openide.util.TopologicalSortException; 29 30 34 public abstract class HighlightingSpiPackageAccessor { 35 36 private static HighlightingSpiPackageAccessor ACCESSOR = null; 37 38 public static synchronized void register(HighlightingSpiPackageAccessor accessor) { 39 assert ACCESSOR == null : "Can't register two package accessors!"; 40 ACCESSOR = accessor; 41 } 42 43 public static synchronized HighlightingSpiPackageAccessor get() { 44 try { 46 Class clazz = Class.forName(HighlightsLayer.class.getName()); 47 } catch (ClassNotFoundException e) { 48 } 50 51 assert ACCESSOR != null : "There is no package accessor available!"; 52 return ACCESSOR; 53 } 54 55 56 protected HighlightingSpiPackageAccessor() { 57 } 58 59 public abstract HighlightsLayerFactory.Context createFactoryContext(Document document, JTextComponent component); 60 61 public abstract List <? extends HighlightsLayer> sort(Collection <? extends HighlightsLayer> layers) throws TopologicalSortException; 62 63 public abstract HighlightsLayerAccessor getHighlightsLayerAccessor(HighlightsLayer layer); 64 } 65 | Popular Tags |