1 26 package org.nightlabs.editor2d.actions.preferences; 27 28 import org.nightlabs.config.Config; 29 import org.nightlabs.config.ConfigException; 30 import org.nightlabs.editor2d.AbstractEditor; 31 import org.nightlabs.editor2d.actions.AbstractEditorAction; 32 import org.nightlabs.editor2d.config.PreferencesConfigModule; 33 34 37 public class PreferencesAction 38 extends AbstractEditorAction 39 { 40 41 45 public PreferencesAction(AbstractEditor editor, int style) { 46 super(editor, style); 47 initConfigModule(); 48 setChecked(isChecked()); 49 } 50 51 54 public PreferencesAction(AbstractEditor editor) { 55 super(editor); 56 initConfigModule(); 57 setChecked(isChecked()); 58 } 59 60 63 protected boolean calculateEnabled() { 64 return true; 66 } 67 68 protected PreferencesConfigModule prefConfMod = null; 69 protected void initConfigModule() 70 { 71 try { 72 prefConfMod = (PreferencesConfigModule) Config.sharedInstance().createConfigModule(PreferencesConfigModule.class); 73 } catch (ConfigException ce) { 74 throw new RuntimeException (ce); 75 } 76 } 77 78 } 79 | Popular Tags |