1 19 package org.netbeans.modules.editor.hints.options; 20 import java.beans.PropertyChangeListener ; 21 import java.beans.PropertyChangeSupport ; 22 import javax.swing.JComponent ; 23 import org.netbeans.spi.options.OptionsPanelController; 24 import org.openide.util.HelpCtx; 25 import org.openide.util.Lookup; 26 27 31 public class AdvancedHintsPanel extends OptionsPanelController { 32 33 private JComponent component; 34 private ModelImpl model; 35 private PropertyChangeSupport pcs; 36 37 38 public AdvancedHintsPanel() { 39 model = new ModelImpl(this); 40 pcs = new PropertyChangeSupport (this); 41 } 42 43 public void update() { 44 } 46 47 public synchronized void applyChanges() { 48 model.commit(); 49 } 50 51 public synchronized void cancel() { 52 model.rollBack(); 53 } 54 55 public boolean isValid() { 56 return true; 57 } 58 59 public synchronized boolean isChanged() { 60 return model.isModified(); 61 } 62 63 public synchronized JComponent getComponent(Lookup ignored) { 64 if (component == null) { 65 component = new AdvancedPanelImpl(model); 66 } 67 68 return component; 69 } 70 71 public HelpCtx getHelpCtx() { 72 return HelpCtx.DEFAULT_HELP; 73 } 74 75 public void addPropertyChangeListener(PropertyChangeListener l) { 76 pcs.addPropertyChangeListener(l); 77 } 78 79 public void removePropertyChangeListener(PropertyChangeListener l) { 80 pcs.removePropertyChangeListener(l); 81 } 82 83 void firePropertyChange(String name, Object old, Object nue) { 84 pcs.firePropertyChange(name, old, nue); 85 } 86 87 } 88 | Popular Tags |