modules/base/src/main/java/com/sun/javafx/binding/ExpressionHelper.java

Print this page
rev 9235 : 8134760: Refactor Javafx base module tests for clear separation of tests
Reviewed-by:


  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.javafx.binding;
  27 
  28 import javafx.beans.InvalidationListener;
  29 import javafx.beans.value.ChangeListener;
  30 import javafx.beans.value.ObservableValue;
  31 import sun.util.logging.PlatformLogger;
  32 
  33 import java.util.Arrays;
  34 
  35 /**
  36  * A convenience class for creating implementations of {@link javafx.beans.value.ObservableValue}.
  37  * It contains all of the infrastructure support for value invalidation- and
  38  * change event notification.
  39  * 
  40  * This implementation can handle adding and removing listeners while the
  41  * observers are being notified, but it is not thread-safe.
  42  * 
  43  * 
  44  */
  45 public abstract class ExpressionHelper<T> extends ExpressionHelperBase {
  46 
  47     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  48     // Static methods
  49 
  50     public static <T> ExpressionHelper<T> addListener(ExpressionHelper<T> helper, ObservableValue<T> observable, InvalidationListener listener) {
  51         if ((observable == null) || (listener == null)) {




  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.javafx.binding;
  27 
  28 import javafx.beans.InvalidationListener;
  29 import javafx.beans.value.ChangeListener;
  30 import javafx.beans.value.ObservableValue;

  31 
  32 import java.util.Arrays;
  33 
  34 /**
  35  * A convenience class for creating implementations of {@link javafx.beans.value.ObservableValue}.
  36  * It contains all of the infrastructure support for value invalidation- and
  37  * change event notification.
  38  * 
  39  * This implementation can handle adding and removing listeners while the
  40  * observers are being notified, but it is not thread-safe.
  41  * 
  42  * 
  43  */
  44 public abstract class ExpressionHelper<T> extends ExpressionHelperBase {
  45 
  46     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  47     // Static methods
  48 
  49     public static <T> ExpressionHelper<T> addListener(ExpressionHelper<T> helper, ObservableValue<T> observable, InvalidationListener listener) {
  50         if ((observable == null) || (listener == null)) {