1 19 20 package org.netbeans.modules.options.keymap; 21 22 import java.beans.PropertyChangeListener ; 23 import javax.swing.JComponent ; 24 import org.netbeans.spi.options.OptionsPanelController; 25 import org.openide.util.HelpCtx; 26 import org.openide.util.Lookup; 27 import org.openide.util.lookup.Lookups; 28 29 30 35 public final class KeymapPanelController extends OptionsPanelController { 36 37 38 public void update () { 39 getKeymapPanel ().update (); 40 } 41 42 public void applyChanges () { 43 getKeymapPanel ().applyChanges (); 44 } 45 46 public void cancel () { 47 getKeymapPanel ().cancel (); 48 } 49 50 public boolean isValid () { 51 return getKeymapPanel ().dataValid (); 52 } 53 54 public boolean isChanged () { 55 return getKeymapPanel ().isChanged (); 56 } 57 58 public HelpCtx getHelpCtx () { 59 return new HelpCtx ("netbeans.optionsDialog.keymaps"); 60 } 61 62 public Lookup getLookup () { 63 return Lookups.singleton (getKeymapPanel ().getModel ()); 64 } 65 66 public JComponent getComponent (Lookup masterLookup) { 67 return getKeymapPanel (); 68 } 69 70 public void addPropertyChangeListener (PropertyChangeListener l) { 71 getKeymapPanel ().addPropertyChangeListener (l); 72 } 73 74 public void removePropertyChangeListener (PropertyChangeListener l) { 75 getKeymapPanel ().removePropertyChangeListener (l); 76 } 77 78 79 private KeymapPanel keymapPanel; 80 81 private KeymapPanel getKeymapPanel () { 82 if (keymapPanel == null) 83 keymapPanel = new KeymapPanel (); 84 return keymapPanel; 85 } 86 } 87 | Popular Tags |