1 19 20 package org.netbeans.modules.exceptions.settings; 21 22 import java.beans.PropertyChangeListener ; 23 import java.beans.PropertyChangeSupport ; 24 import javax.swing.JComponent ; 25 import org.netbeans.spi.options.OptionsPanelController; 26 import org.openide.util.HelpCtx; 27 import org.openide.util.Lookup; 28 29 final class ExceptionsOptionsPanelController extends OptionsPanelController { 30 31 private ExceptionsPanel panel; 32 private final PropertyChangeSupport pcs = new PropertyChangeSupport (this); 33 private boolean changed; 34 35 public void update() { 36 getPanel().load(); 37 changed = false; 38 } 39 40 public void applyChanges() { 41 getPanel().store(); 42 changed = false; 43 } 44 45 public void cancel() { 46 } 48 49 public boolean isValid() { 50 return getPanel().valid(); 51 } 52 53 public boolean isChanged() { 54 return changed; 55 } 56 57 public HelpCtx getHelpCtx() { 58 return null; } 60 61 public JComponent getComponent(Lookup masterLookup) { 62 return getPanel(); 63 } 64 65 public void addPropertyChangeListener(PropertyChangeListener pcl) { 66 pcs.addPropertyChangeListener(pcl); 67 } 68 69 public void removePropertyChangeListener(PropertyChangeListener pcl) { 70 pcs.removePropertyChangeListener(pcl); 71 } 72 73 private ExceptionsPanel getPanel() { 74 if (panel == null) { 75 panel = new ExceptionsPanel(); 76 } 77 return panel; 78 } 79 80 void doChanged() { 81 if (!changed) { 82 changed = true; 83 pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); 84 } 85 pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); 86 } 87 88 } 89 | Popular Tags |