1 19 20 package org.netbeans.modules.editor.impl; 21 22 import java.util.Collections ; 23 import java.util.List ; 24 import org.netbeans.api.editor.mimelookup.MimeLookup; 25 import org.netbeans.api.editor.mimelookup.MimePath; 26 import org.netbeans.spi.editor.mimelookup.Class2LayerFolder; 27 import org.netbeans.spi.editor.mimelookup.InstanceProvider; 28 29 33 public final class GlyphGutterActionsProvider extends ActionsList implements Class2LayerFolder, InstanceProvider { 34 35 public static final String GLYPH_GUTTER_ACTIONS_FOLDER_NAME = "GlyphGutterActions"; 37 public static List getGlyphGutterActions(String mimeType) { 38 MimePath mimePath = MimePath.parse(mimeType); 39 GlyphGutterActionsProvider provider = (GlyphGutterActionsProvider) MimeLookup.getLookup(mimePath).lookup(GlyphGutterActionsProvider.class); 40 return provider == null ? Collections.emptyList() : provider.getActionsOnly(); 41 } 42 43 public GlyphGutterActionsProvider() { 44 super(null); 45 } 46 47 private GlyphGutterActionsProvider(List keys) { 48 super(keys); 49 } 50 51 public Class getClazz(){ 52 return GlyphGutterActionsProvider.class; 53 } 54 55 public String getLayerFolderName(){ 56 return GLYPH_GUTTER_ACTIONS_FOLDER_NAME; 57 } 58 59 public InstanceProvider getInstanceProvider() { 60 return new GlyphGutterActionsProvider(); 61 } 62 63 public Object createInstance(List fileObjectList) { 64 return new GlyphGutterActionsProvider(fileObjectList); 65 } 66 } 67 | Popular Tags |