1 19 20 package org.netbeans.modules.html.editor; 21 22 import org.netbeans.editor.Settings; 23 import org.netbeans.editor.ext.html.HTMLSettingsInitializer; 24 import org.netbeans.modules.editor.NbLocalizer; 25 import org.netbeans.modules.editor.html.HTMLKit; 26 import org.netbeans.modules.editor.html.NbHTMLSettingsInitializer; 27 import org.netbeans.modules.html.editor.options.HTMLPrintOptions; 28 import org.openide.modules.ModuleInstall; 29 import org.openide.options.SystemOption; 30 import org.openide.text.PrintSettings; 31 import org.openide.util.SharedClassObject; 32 33 38 public class HTMLEditorModule extends ModuleInstall { 39 40 private NbLocalizer optionsLocalizer; 41 42 43 public void restored () { 44 PrintSettings ps = (PrintSettings) SharedClassObject.findObject(PrintSettings.class, true); 45 ps.addOption((SystemOption)SharedClassObject.findObject(HTMLPrintOptions.class, true)); 46 47 Settings.addInitializer(new HTMLSettingsInitializer(HTMLKit.class)); 48 Settings.addInitializer(new NbHTMLSettingsInitializer()); 49 Settings.reset(); 50 } 51 52 53 public void uninstalled() { 54 PrintSettings ps = (PrintSettings) SharedClassObject.findObject(PrintSettings.class, true); 56 ps.removeOption((SystemOption)SharedClassObject.findObject(HTMLPrintOptions.class, true)); 57 58 Settings.removeInitializer(HTMLSettingsInitializer.NAME); 59 Settings.removeInitializer(NbHTMLSettingsInitializer.NAME); 60 Settings.reset(); 61 62 } 63 64 65 } 66 | Popular Tags |