/** * Report an <code>int</code> bound indexed property update to any registered listeners. * * <p>No event is fired if old and new values are equal and non-null. * * <p>This is merely a convenience wrapper around the more general fireIndexedPropertyChange * method which takes Object values. * * @param propertyName The programmatic name of the property that was changed. * @param index index of the property element that was changed. * @param oldValue The old value of the property. * @param newValue The new value of the property. * @since 1.5 */ public void fireIndexedPropertyChange( String propertyName, int index, int oldValue, int newValue) { if (oldValue == newValue) { return; } fireIndexedPropertyChange(propertyName, index, new Integer(oldValue), new Integer(newValue)); }
/** * Report a <code>boolean</code> bound indexed property update to any registered listeners. * * <p>No event is fired if old and new values are equal and non-null. * * <p>This is merely a convenience wrapper around the more general fireIndexedPropertyChange * method which takes Object values. * * @param propertyName The programmatic name of the property that was changed. * @param index index of the property element that was changed. * @param oldValue The old value of the property. * @param newValue The new value of the property. * @since 1.5 */ public void fireIndexedPropertyChange( String propertyName, int index, boolean oldValue, boolean newValue) { if (oldValue == newValue) { return; } fireIndexedPropertyChange( propertyName, index, Boolean.valueOf(oldValue), Boolean.valueOf(newValue)); }
/** * Creates a <CODE>PropertyChangeEvent</CODE> and fires it. * * @param propertyName The name of the property changed. * @param index The index of the property. * @param oldValue The value of the property before the change. * @param newValue The new value of the property. */ protected void fireIndexedPropertyChange( final String propertyName, final int index, final Object oldValue, final Object newValue) { createPropertyChangeSupport(); if ((!isThreadSafe()) || SwingUtilities.isEventDispatchThread()) propertyChangeSupport.fireIndexedPropertyChange(propertyName, index, oldValue, newValue); else SwingUtilities.invokeLater( new Runnable() { public void run() { propertyChangeSupport.fireIndexedPropertyChange( propertyName, index, oldValue, newValue); } }); }
public String setName(int index, String name) { final String oldName = getName(index); String result = names.set(index, name); bean.fireIndexedPropertyChange("names", index, oldName, name); return result; }