Revision: 1455
          http://svn.sourceforge.net/spring-rich-c/?rev=1455&view=rev
Author:   jhoskens
Date:     2006-09-28 00:38:02 -0700 (Thu, 28 Sep 2006)

Log Message:
-----------
refactoring modules: moved interfaces binding and binding.value

Added Paths:
-----------
    trunk/spring-richclient/binding/src/main/java/org/
    trunk/spring-richclient/binding/src/main/java/org/springframework/
    trunk/spring-richclient/binding/src/main/java/org/springframework/binding/
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/MutablePropertyAccessStrategy.java
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/PropertyAccessStrategy.java
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/PropertyMetadataAccessStrategy.java
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/CommitTrigger.java
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/CommitTriggerListener.java
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/DerivedValueModel.java
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/IndexAdapter.java
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/PropertyChangePublisher.java
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/ValueChangeDetector.java
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/ValueModel.java
    
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/package.html

Copied: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/MutablePropertyAccessStrategy.java
 (from rev 1404, 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/MutablePropertyAccessStrategy.java)
===================================================================
--- 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/MutablePropertyAccessStrategy.java
                                (rev 0)
+++ 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/MutablePropertyAccessStrategy.java
        2006-09-28 07:38:02 UTC (rev 1455)
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.binding;
+
+import org.springframework.beans.BeansException;
+import org.springframework.binding.value.ValueModel;
+
+/**
+ * <p>
+ * An extension of the base property access strategy interface that allows for
+ * mutable operations. Specifically, this interface allows:
+ * </p>
+ * <ul>
+ * <li>registering custom property editors for performing type conversions
+ * <li>returning a domain object holder allowing the underlying domain object 
to
+ * be changed and subscribed to for modification, and
+ * <li>adding listeners for changes on particular properties.
+ * </ul>
+ * EXPERIMENTAL - not yet fit for general use
+ * @author Keith Donald
+ */
+public interface MutablePropertyAccessStrategy extends PropertyAccessStrategy {
+
+    public ValueModel getDomainObjectHolder();
+
+    public ValueModel getPropertyValueModel(String propertyPath)
+            throws BeansException;
+
+    public MutablePropertyAccessStrategy getPropertyAccessStrategyForPath(
+            String propertyPath) throws BeansException;
+
+    public MutablePropertyAccessStrategy newPropertyAccessStrategy(ValueModel 
domainObjectHolder);
+
+}
\ No newline at end of file


Property changes on: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/MutablePropertyAccessStrategy.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/PropertyAccessStrategy.java
 (from rev 1404, 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/PropertyAccessStrategy.java)
===================================================================
--- 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/PropertyAccessStrategy.java
                               (rev 0)
+++ 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/PropertyAccessStrategy.java
       2006-09-28 07:38:02 UTC (rev 1455)
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.binding;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.FatalBeanException;
+
+/**
+ * A strategy for accessing a domain object's properties. Different
+ * implementations could access different backing objects such as a javabean
+ * <code>(BeanPropertyAccessStrategy)</code>, hashmap, rowset, or other data
+ * structure.
+ * EXPERIMENTAL - not yet fit for general use
+ * @author Keith Donald
+ */
+public interface PropertyAccessStrategy {
+
+    /**
+     * Get the value of a property.
+     * 
+     * @param propertyPath
+     *            name of the property to get the value of
+     * @return the value of the property
+     * @throws FatalBeanException
+     *             if there is no such property, if the property isn't 
readable,
+     *             or if the property getter throws an exception.
+     */
+    public Object getPropertyValue(String propertyPath) throws BeansException;
+
+    /**
+     * Get a metadata accessor, which can return meta information about
+     * particular properties of the backed domain object.
+     * 
+     * @return The meta accessor.
+     */
+    public PropertyMetadataAccessStrategy getMetadataAccessStrategy();
+
+    /**
+     * Return the target, backing domain object for which property access
+     * requests are targeted against.
+     * 
+     * @return The backing target object.
+     */
+    public Object getDomainObject();
+
+}
\ No newline at end of file


Property changes on: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/PropertyAccessStrategy.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/PropertyMetadataAccessStrategy.java
 (from rev 1404, 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/PropertyMetadataAccessStrategy.java)
===================================================================
--- 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/PropertyMetadataAccessStrategy.java
                               (rev 0)
+++ 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/PropertyMetadataAccessStrategy.java
       2006-09-28 07:38:02 UTC (rev 1455)
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.binding;
+
+import java.util.Map;
+
+/**
+ * Simple interface for accessing metadata about a particular property.
+ * 
+ * EXPERIMENTAL - not yet fit for general use
+ * @author Keith Donald
+ */
+public interface PropertyMetadataAccessStrategy {
+    public boolean isReadable(String propertyName);
+
+    public boolean isWriteable(String propertyName);
+
+    public Class getPropertyType(String propertyName);
+
+    /**
+     * Returns custom metadata that may be associated with the specified
+     * property path. 
+     */
+    Object getUserMetadata(String propertyName, String key);
+
+    /**
+     * Returns all custom metadata associated with the specified property
+     * in the form of a Map.
+     *
+     * @return Map containing String keys - this method may or may not return
+     *         <code>null</code> if there is no custom metadata associated
+     *         with the property.
+     */
+    Map getAllUserMetadata(String propertyName);
+}
\ No newline at end of file


Property changes on: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/PropertyMetadataAccessStrategy.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/CommitTrigger.java
 (from rev 1404, 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/value/CommitTrigger.java)
===================================================================
--- 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/CommitTrigger.java
                          (rev 0)
+++ 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/CommitTrigger.java
  2006-09-28 07:38:02 UTC (rev 1455)
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.binding.value;
+
+import java.util.Iterator;
+
+import org.springframework.richclient.util.EventListenerListHelper;
+
+/**
+ * A class that can be used to trigger an event on a group of objects. Mainly 
+ * intended to be used to trigger flush/revert in 
<code>BufferedValueModel</code>
+ * but is useful in general.
+ *  
+ * @author Keith Donald
+ * @author Oliver Hutchison
+ */
+public class CommitTrigger {
+    
+    private final EventListenerListHelper listeners = new 
EventListenerListHelper(CommitTriggerListener.class);
+
+    /**
+     * Constructs a <code>CommitTrigger</code>. 
+     */
+    public CommitTrigger() {
+    }
+
+    /**
+     * Triggers a commit event.
+     */
+    public void commit() {
+        for (Iterator i = listeners.iterator(); i.hasNext();) {
+            ((CommitTriggerListener)i.next()).commit();            
+        }
+    }
+
+    /**
+     * Triggers a revert event.
+     */
+    public void revert() {
+        for (Iterator i = listeners.iterator(); i.hasNext();) {
+            ((CommitTriggerListener)i.next()).revert();           
+        }
+    }
+    
+    
+    /**
+     * Adds the provided listener to the list of listeners that will be 
notified whenever
+     * a commit or revert event is fired.
+     * @param listener the <code>CommitTriggerListener</code> to add
+     */
+    public void addCommitTriggerListener(CommitTriggerListener listener) {
+        listeners.add(listener);
+    }
+    
+    /**
+     * Removed the provided listener to the list of listeners that will be 
notified whenever
+     * a commit or revert event is fired.
+     * @param listener the <code>CommitTriggerListener</code> to remove
+     */
+    public void removeCommitTriggerListener(CommitTriggerListener listener) {
+        listeners.remove(listener);
+    }
+}
\ No newline at end of file


Property changes on: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/CommitTrigger.java
___________________________________________________________________
Name: svn:eol-style
   + native

Copied: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/CommitTriggerListener.java
 (from rev 1404, 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/value/CommitTriggerListener.java)
===================================================================
--- 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/CommitTriggerListener.java
                          (rev 0)
+++ 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/CommitTriggerListener.java
  2006-09-28 07:38:02 UTC (rev 1455)
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.binding.value;
+
+/**
+ * Interface to be implemented by classes that listen for the commit and 
+ * revert events fired by a <code>CommitTriger</code>.
+ * 
+ * @author Oliver Hutchison
+ * @see CommitTrigger
+ */
+public interface CommitTriggerListener {
+
+    /**
+     * Called when a commit event is fired.
+     */
+    void commit();
+    
+    /**
+     * Called when a revert event is fired.
+     */
+    void revert();
+}


Property changes on: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/CommitTriggerListener.java
___________________________________________________________________
Name: svn:eol-style
   + native

Copied: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/DerivedValueModel.java
 (from rev 1404, 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/value/DerivedValueModel.java)
===================================================================
--- 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/DerivedValueModel.java
                              (rev 0)
+++ 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/DerivedValueModel.java
      2006-09-28 07:38:02 UTC (rev 1455)
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2002-2005 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.binding.value;
+
+/**
+ * A value model that derives its value by applying some transformation to
+ * one or more source value models. 
+ * 
+ * <p>Typical usage would be a type converter or string formatter.
+ *  
+ * @author Oliver Hutchison
+ */
+public interface DerivedValueModel extends ValueModel {
+
+    /**
+     * Returns an array of all values models that are used to derive 
+     * the value represented by this value model.
+     */
+    ValueModel[] getSourceValueModels();
+    
+    /**
+     * Returns true if the implementation does not support calls setValue.
+     */
+    boolean isReadOnly();
+}
\ No newline at end of file


Property changes on: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/DerivedValueModel.java
___________________________________________________________________
Name: svn:eol-style
   + native

Copied: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/IndexAdapter.java
 (from rev 1404, 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/value/IndexAdapter.java)
===================================================================
--- 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/IndexAdapter.java
                           (rev 0)
+++ 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/IndexAdapter.java
   2006-09-28 07:38:02 UTC (rev 1455)
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.binding.value;
+
+
+
+public interface IndexAdapter extends ValueModel {
+    public int getIndex();
+
+    public void setIndex(int index);
+    
+    public void fireIndexedObjectChanged();
+}
\ No newline at end of file


Property changes on: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/IndexAdapter.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/PropertyChangePublisher.java
 (from rev 1404, 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/value/PropertyChangePublisher.java)
===================================================================
--- 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/PropertyChangePublisher.java
                                (rev 0)
+++ 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/PropertyChangePublisher.java
        2006-09-28 07:38:02 UTC (rev 1455)
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2002-2004 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.binding.value;
+
+import java.beans.PropertyChangeListener;
+
+/**
+ * Interface implemented by domain objects that can publish property change
+ * events. Clients can use this interface to subscribe to the object for change
+ * notifications.
+ * 
+ * @author Keith Donald
+ */
+public interface PropertyChangePublisher {
+    public void addPropertyChangeListener(PropertyChangeListener listener);
+
+    public void addPropertyChangeListener(String propertyName,
+            PropertyChangeListener listener);
+
+    public void removePropertyChangeListener(PropertyChangeListener listener);
+
+    public void removePropertyChangeListener(String propertyName,
+            PropertyChangeListener listener);
+}
\ No newline at end of file


Property changes on: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/PropertyChangePublisher.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/ValueChangeDetector.java
 (from rev 1404, 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/value/ValueChangeDetector.java)
===================================================================
--- 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/ValueChangeDetector.java
                            (rev 0)
+++ 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/ValueChangeDetector.java
    2006-09-28 07:38:02 UTC (rev 1455)
@@ -0,0 +1,44 @@
+/**
+ * Copyright 2002-2005 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.binding.value;
+
+/**
+ * Defines the operations for determining if two values (an old and a new 
value) are
+ * different enough to indicate a change in the value model. An implementation 
of this
+ * interface can be registered in the application context configuration. The 
configured
+ * instance is used in several classes to determine if two object values are 
sufficiently
+ * different to trigger further logic, like firing a value changed event, 
updating
+ * conversion values, etc.
+ * 
+ * @author Larry Streepy
+ * @see org.springframework.richclient.application.ApplicationServices
+ * @see org.springframework.binding.value.support.DefaultValueChangeDetector
+ * @see 
org.springframework.binding.value.support.EquivalenceValueChangeDetector
+ */
+public interface ValueChangeDetector {
+
+    /**
+     * Determine if there has been a change between two values (an old and a 
new value).
+     * The definition of <em>different enough</em>, is dependent upon the 
needs of a
+     * ValueModel implementation.
+     * 
+     * @param oldValue Original object value
+     * @param newValue New object value
+     * @return true if the objects are different enough to indicate a change 
in the value
+     *         model
+     */
+    public boolean hasValueChanged(Object oldValue, Object newValue);
+}


Property changes on: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/ValueChangeDetector.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/ValueModel.java
 (from rev 1404, 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/value/ValueModel.java)
===================================================================
--- 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/ValueModel.java
                             (rev 0)
+++ 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/ValueModel.java
     2006-09-28 07:38:02 UTC (rev 1455)
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2002-2005 the original author or authors.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy 
of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.springframework.binding.value;
+
+import java.beans.PropertyChangeListener;
+
+/**
+ * Describes models with a generic access to a single value that allow
+ * to observe value changes. The value can be accessed using the 
+ * <code>#getValue()</code>/<code>#setValue(Object)</code>/ 
+ * <code>#setValueSilently(Object, PropertyChangeListener)</code>
+ * methods. Observers can register instances of 
<code>PropertyChangeListener</code> 
+ * to be notified if the value changes.
+ * 
+ * <p>The listeners registered with this ValueModel using 
#addValueChangeListener
+ * will be invoked only with PropertyChangeEvents that have the name set to 
+ * "value". 
+ * 
+ * <p>AbstractValueModel minimizes the effort required to implement this 
interface. 
+ * It uses the PropertyChangeSupport to fire PropertyChangeEvents, and it adds 
+ * PropertyChangeListeners for the specific property name "value". This ensures
+ * that the constraint mentioned above is met.
+ * 
+ * @see org.springframework.binding.value.support.AbstractValueModel
+ * 
+ * @author Karsten Lentzsch
+ * @author Keith Donald
+ * @author Oliver Hutchison 
+ */
+public interface ValueModel {
+
+    /** 
+     * The name of the bound property <em>value</em>.       
+     */
+    String VALUE_PROPERTY = "value";
+
+    /**
+     * Returns this model's value. In case of a write-only value,
+     * implementers may choose to either reject this operation or 
+     * or return <code>null</code> or any other appropriate value.
+     * 
+     * @return this model's value
+     */
+    Object getValue();
+
+    /**
+     * Sets a new value and if the value has changed notifies any registered 
+     * value change listeners.
+     * 
+     * @param newValue  the value to be set
+     */
+    void setValue(Object newValue);
+
+    /**
+     * Sets a new value and if the value has changed notifies all registered 
+     * value change listeners except for the specified listener to skip. 
+     * 
+     * @param newValue  the value to be set
+     * @param listenerToSkip the <code>PropertyChangeListener</code> that 
should
+     * not be notified of this change (may be <code>null</code>). 
+     */
+    void setValueSilently(Object newValue, PropertyChangeListener 
listenerToSkip);
+
+    /**
+     * Registers the given <code>PropertyChangeListener</code> with this 
+     * ValueModel. The listener will be notified if the value has changed.
+     * The PropertyChangeEvents delivered to the listener must have the name 
+     * set to "value". The latter ensures that all ValueModel implementers
+     * behave like the AbstractValueModel subclasses.<p>
+     * 
+     * To comply with the above specification implementers can use
+     * the PropertyChangeSupport's #addPropertyChangeListener method
+     * that accepts a property name, so that listeners will be invoked only
+     * if that specific property has changed.
+     * 
+     * @param listener the listener to be added
+     * 
+     * @see AbstractValueModel#addValueChangeListener(PropertyChangeListener)
+     */
+    void addValueChangeListener(PropertyChangeListener listener);
+
+    /**
+     * Deregisters the given <code>PropertyChangeListener</code> from this
+     * ValueModel.
+     * 
+     * @param listener the listener to be removed
+     */
+    void removeValueChangeListener(PropertyChangeListener listener);
+
+}
\ No newline at end of file


Property changes on: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/ValueModel.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Copied: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/package.html
 (from rev 1404, 
trunk/spring-richclient/support/src/main/java/org/springframework/binding/value/package.html)
===================================================================
--- 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/package.html
                                (rev 0)
+++ 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/package.html
        2006-09-28 07:38:02 UTC (rev 1455)
@@ -0,0 +1,7 @@
+<html>
+<body>
+<p>
+Supporting value model and value holder implementations.
+</p>
+</body>
+</html>
\ No newline at end of file


Property changes on: 
trunk/spring-richclient/binding/src/main/java/org/springframework/binding/value/package.html
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
spring-rich-c-cvs mailing list
spring-rich-c-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs

Reply via email to