Example usage for java.beans VetoableChangeSupport VetoableChangeSupport

List of usage examples for java.beans VetoableChangeSupport VetoableChangeSupport

Introduction

In this page you can find the example usage for java.beans VetoableChangeSupport VetoableChangeSupport.

Prototype

public VetoableChangeSupport(Object sourceBean) 

Source Link

Document

Constructs a VetoableChangeSupport object.

Usage

From source file:com.anrisoftware.prefdialog.miscswing.filechoosers.OpenFileDialogModel.java

public OpenFileDialogModel() {
    this.vetoableChange = new VetoableChangeSupport(this);
    this.propertySupport = new PropertyChangeSupport(this);
}

From source file:com.anrisoftware.prefdialog.miscswing.filechoosers.SaveFileDialogModel.java

public SaveFileDialogModel() {
    this.vetoableChange = new VetoableChangeSupport(this);
    this.propertySupport = new PropertyChangeSupport(this);
    this.attachFileExtension = true;
}

From source file:org.jfree.data.general.Series.java

/**
 * Creates a new series with the specified key and description.
 *
 * @param key  the series key (<code>null</code> NOT permitted).
 * @param description  the series description (<code>null</code> permitted).
 *///from ww  w .j  a  va  2s  .  c  o  m
protected Series(Comparable key, String description) {
    ParamChecks.nullNotPermitted(key, "key");
    this.key = key;
    this.description = description;
    this.listeners = new EventListenerList();
    this.propertyChangeSupport = new PropertyChangeSupport(this);
    this.vetoableChangeSupport = new VetoableChangeSupport(this);
    this.notify = true;
}

From source file:com.anrisoftware.prefdialog.simpledialog.SimpleDialog.java

/**
 * @see SimpleDialogFactory#create()// ww  w.j a  v a2 s  .  co m
 */
@Inject
protected SimpleDialog() {
    this.vetoableSupport = new VetoableChangeSupport(this);
    this.showApproveButton = true;
    this.showRestoreButton = true;
}

From source file:com.anrisoftware.prefdialog.core.AbstractFieldComponent.java

/**
 * Sets the component of this field.//from  www.  j a va 2 s  .  com
 *
 * @param component
 *            the {@link Component}.
 *
 * @param parentObject
 *            the parent object of this field.
 *
 * @param fieldName
 *            the name of the field in the parent object.
 */
protected AbstractFieldComponent(ComponentType component, Object parentObject, String fieldName) {
    this.component = component;
    this.parentObject = parentObject;
    this.fieldName = fieldName;
    this.childFields = new ArrayList<FieldComponent<?>>();
    this.mnemonic = null;
    this.mnemonicIndex = -1;
    this.vetoableSupport = new VetoableChangeSupport(this);
    this.propertySupport = new PropertyChangeSupport(this);
}

From source file:com.interface21.beans.BeanWrapperImpl.java

public void newWrappedInstance() throws BeansException {
    this.object = BeanUtils.instantiateClass(getWrappedClass());
    vetoableChangeSupport = new VetoableChangeSupport(object);
}

From source file:org.jfree.data.general.Series.java

/**
 * Returns a clone of the series./* w  w  w  . j  a  v a 2 s .  c om*/
 * <P>
 * Notes:
 * <ul>
 * <li>No need to clone the name or description, since String object is
 * immutable.</li>
 * <li>We set the listener list to empty, since the listeners did not
 * register with the clone.</li>
 * <li>Same applies to the PropertyChangeSupport instance.</li>
 * </ul>
 *
 * @return A clone of the series.
 *
 * @throws CloneNotSupportedException  not thrown by this class, but
 *         subclasses may differ.
 */
@Override
public Object clone() throws CloneNotSupportedException {
    Series clone = (Series) super.clone();
    clone.listeners = new EventListenerList();
    clone.propertyChangeSupport = new PropertyChangeSupport(clone);
    clone.vetoableChangeSupport = new VetoableChangeSupport(clone);
    return clone;
}

From source file:de.schlichtherle.xml.GenericCertificate.java

/**
 * Adds a VetoableChangeListener to the listener list.
 *
 * @param l The listener to add./*from  w  ww .j a va2  s.com*/
 */
public final synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener l) {
    if (vetoableChangeSupport == null)
        vetoableChangeSupport = new VetoableChangeSupport(this);
    vetoableChangeSupport.addVetoableChangeListener(l);
}

From source file:com.interface21.beans.BeanWrapperImpl.java

/**
 * Disabling event propagation improves performance.
 * @param flag whether event propagation should be enabled
 *///  www  .  java  2  s.c o m
public void setEventPropagationEnabled(boolean flag) {
    this.eventPropagationEnabled = flag;
    // Lazily initialize support for events if not already initialized
    if (eventPropagationEnabled && (vetoableChangeSupport == null || propertyChangeSupport == null)) {
        vetoableChangeSupport = new VetoableChangeSupport(object);
        propertyChangeSupport = new PropertyChangeSupport(object);
    }
}

From source file:org.apache.beehive.controls.runtime.bean.ControlBean.java

/**
 * This protected version is only available to concrete subclasses that expose bound
 * property support.   This method is synchronized to enable lazy instantiation, in
 * the belief that is a bigger win to avoid allocating when there are no listeners
 * than it is to introduce synchronization overhead on access.
 *//*from   w ww  . j  ava  2  s .  c o m*/
synchronized protected VetoableChangeSupport getVetoableChangeSupport() {
    if (_vetoSupport == null)
        _vetoSupport = new VetoableChangeSupport(this);

    return _vetoSupport;
}