List of usage examples for java.beans PropertyChangeSupport PropertyChangeSupport
public PropertyChangeSupport(Object sourceBean)
From source file:biz.wolschon.finance.jgnucash.panels.TaxReportPanel.java
/** * Add a PropertyChangeListener for a specific property. The listener * will be invoked only when a call on firePropertyChange names that * specific property.//from w ww .j a v a2 s . c o m * * @param propertyName The name of the property to listen on. * @param listener The PropertyChangeListener to be added */ @Override public final void addPropertyChangeListener(final String propertyName, final PropertyChangeListener listener) { if (myPropertyChange == null) { myPropertyChange = new PropertyChangeSupport(this); } myPropertyChange.addPropertyChangeListener(propertyName, listener); }
From source file:de.huxhorn.lilith.swing.ApplicationPreferences.java
public ApplicationPreferences() { lastSourceNamesModified = -1;/*from www. j a v a 2 s .co m*/ lastConditionsModified = -1; propertyChangeSupport = new PropertyChangeSupport(this); startupApplicationPath = getApplicationPath(); installedLookAndFeels = new ArrayList<>(); for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { installedLookAndFeels.add(info.getName()); } Collections.sort(installedLookAndFeels); groovyConditionsPath = new File(startupApplicationPath, "conditions"); if (groovyConditionsPath.mkdirs()) { // groovy conditions directory was generated, create examples... installExampleConditions(); } groovyClipboardFormattersPath = new File(startupApplicationPath, "clipboardFormatters"); if (groovyClipboardFormattersPath.mkdirs()) { // groovy clipboardFormatters directory was generated, create examples... installExampleClipboardFormatters(); } }
From source file:biz.wolschon.fileformats.gnucash.baseclasses.SimpleAccount.java
/** * Add a PropertyChangeListener to the listener list. * The listener is registered for all properties. * * @param listener The PropertyChangeListener to be added *//* ww w. ja v a 2 s.c o m*/ public final void addPropertyChangeListener(final PropertyChangeListener listener) { if (myPropertyChange == null) { myPropertyChange = new PropertyChangeSupport(this); } myPropertyChange.addPropertyChangeListener(listener); }
From source file:BeanContainer.java
public Clock() { m_calendar = Calendar.getInstance(); m_helper = new PropertyChangeSupport(this); Border br1 = new EtchedBorder(EtchedBorder.RAISED, Color.white, new Color(128, 0, 0)); Border br2 = new MatteBorder(4, 4, 4, 4, Color.red); setBorder(new CompoundBorder(br1, br2)); setBackground(Color.white); setForeground(Color.black); (new Thread(this)).start(); }/* w ww.j a v a 2 s .c o m*/
From source file:biz.wolschon.fileformats.gnucash.baseclasses.SimpleAccount.java
/** * Add a PropertyChangeListener for a specific property. The listener * will be invoked only when a call on firePropertyChange names that * specific property./* www. java2 s . c o m*/ * * @param propertyName The name of the property to listen on. * @param listener The PropertyChangeListener to be added */ public final void addPropertyChangeListener(final String propertyName, final PropertyChangeListener listener) { if (myPropertyChange == null) { myPropertyChange = new PropertyChangeSupport(this); } myPropertyChange.addPropertyChangeListener(propertyName, listener); }
From source file:de.schlichtherle.xml.GenericCertificate.java
/** * Adds a PropertyChangeListener to the listener list. * * @param l The listener to add./*ww w . ja v a2 s . c om*/ */ public final synchronized void addPropertyChangeListener(PropertyChangeListener l) { if (propertyChangeSupport == null) propertyChangeSupport = new PropertyChangeSupport(this); propertyChangeSupport.addPropertyChangeListener(l); }
From source file:edu.ku.brc.specify.datamodel.DataModelObjBase.java
@Override public void addPropertyChangeListener(PropertyChangeListener listener) { if (changes == null) { changes = new PropertyChangeSupport(this); }//from w w w . j av a2 s .c om changes.addPropertyChangeListener(listener); }
From source file:edu.ku.brc.specify.datamodel.DataModelObjBase.java
@Override public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { if (changes == null) { changes = new PropertyChangeSupport(this); }/*from ww w.j a va 2 s.c om*/ changes.addPropertyChangeListener(propertyName, listener); }
From source file:edu.ku.brc.specify.datamodel.DataModelObjBase.java
/** * Notifies all attached {@link PropertyChangeListener}s of a {@link PropertyChangeEvent}. * See {@link PropertyChangeSupport}.firePropertyChange(PropertyChangeEvent). * //from w w w. j a v a 2 s .c om * @param evt */ public void firePropertyChange(PropertyChangeEvent evt) { if (changes == null) { changes = new PropertyChangeSupport(this); } changes.firePropertyChange(evt); }
From source file:edu.ku.brc.specify.datamodel.DataModelObjBase.java
/** * Notifies all attached {@link PropertyChangeListener}s of a {@link PropertyChangeEvent}. * See {@link PropertyChangeSupport}.firePropertyChange(String,boolean,boolean). * //from w w w. j a va 2 s .co m * @param propertyName the name of the bound property that changed * @param oldValue the old value of the property * @param newValue the new value of the property */ public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) { if (changes == null) { changes = new PropertyChangeSupport(this); } changes.firePropertyChange(propertyName, oldValue, newValue); }