1 19 package org.netbeans.modules.gsf; 20 21 import org.netbeans.editor.SettingsNames; 22 import org.netbeans.modules.editor.options.BaseOptions; 23 import org.netbeans.modules.editor.options.OptionSupport; 24 import org.openide.util.HelpCtx; 26 import org.openide.util.NbBundle; 27 28 import java.util.MissingResourceException ; 29 import org.openide.filesystems.FileObject; 30 31 35 public class GsfOptions extends BaseOptions { 36 37 public static String LANGUAGES = "ScriptLanguages"; 39 49 50 public static final GsfOptions create(FileObject fo) { 51 String mimeType = fo.getParent().getPath().substring(8); return new GsfOptions(mimeType); 54 } 55 56 57 private static final String HELP_ID = "editing.editor.php"; 59 60 private String mimeType; 61 62 public GsfOptions(String mimeType) { 63 super(GsfEditorKitFactory.GsfEditorKit.class, LANGUAGES); 64 this.mimeType = mimeType; 65 } 68 69 protected String getContentType() { 70 return mimeType; 71 } 72 73 81 85 89 92 public HelpCtx getHelpCtx() { 93 return new HelpCtx(HELP_ID); 94 } 95 96 100 protected String getString(String key) { 101 try { 102 return NbBundle.getMessage(GsfOptions.class, key); 103 } catch (MissingResourceException e) { 104 return super.getString(key); 105 } 106 } 107 } 108 | Popular Tags |