All Downloads are FREE. Search and download functionalities are using the official Maven repository.

griffon.javafx.UIThreadAwareBindingsExtension.groovy Maven / Gradle / Ivy

/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * Copyright 2008-2021 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 griffon.javafx

import griffon.javafx.beans.binding.UIThreadAwareBindings
import groovy.transform.CompileStatic
import javafx.beans.InvalidationListener
import javafx.beans.Observable
import javafx.beans.binding.BooleanBinding
import javafx.beans.binding.DoubleBinding
import javafx.beans.binding.FloatBinding
import javafx.beans.binding.IntegerBinding
import javafx.beans.binding.LongBinding
import javafx.beans.binding.ObjectBinding
import javafx.beans.binding.StringBinding
import javafx.beans.property.BooleanProperty
import javafx.beans.property.DoubleProperty
import javafx.beans.property.FloatProperty
import javafx.beans.property.IntegerProperty
import javafx.beans.property.ListProperty
import javafx.beans.property.LongProperty
import javafx.beans.property.MapProperty
import javafx.beans.property.ObjectProperty
import javafx.beans.property.Property
import javafx.beans.property.SetProperty
import javafx.beans.property.StringProperty
import javafx.beans.value.ChangeListener
import javafx.beans.value.ObservableBooleanValue
import javafx.beans.value.ObservableDoubleValue
import javafx.beans.value.ObservableFloatValue
import javafx.beans.value.ObservableIntegerValue
import javafx.beans.value.ObservableLongValue
import javafx.beans.value.ObservableStringValue
import javafx.beans.value.ObservableValue
import javafx.collections.ListChangeListener
import javafx.collections.MapChangeListener
import javafx.collections.ObservableList
import javafx.collections.ObservableMap
import javafx.collections.ObservableSet
import javafx.collections.SetChangeListener

import javax.annotation.Nonnull
import java.util.function.Consumer

/**
 * @author Andres Almiray
 * @since 2.13.0
 */
@CompileStatic
final class UIThreadAwareBindingsExtension {
    @Nonnull
    static  ChangeListener uiThreadAwareBind(
        @Nonnull Property property, @Nonnull ObservableValue observable) {
        UIThreadAwareBindings.uiThreadAwareBind(property, observable)
    }

    @Nonnull
    static  ChangeListener uiThreadAwareChangeListener(
        @Nonnull ObservableValue observable, @Nonnull ChangeListener listener) {
        UIThreadAwareBindings.uiThreadAwareChangeListener(observable, listener)
    }

    @Nonnull
    static  ChangeListener uiThreadAwareChangeListener(@Nonnull ChangeListener listener) {
        UIThreadAwareBindings.uiThreadAwareChangeListener(listener)
    }

    @Nonnull
    static  ChangeListener uiThreadAwareChangeListener(
        @Nonnull ObservableValue observable, @Nonnull Consumer consumer) {
        UIThreadAwareBindings.uiThreadAwareChangeListener(observable, consumer)
    }

    @Nonnull
    static  ChangeListener uiThreadAwareChangeListener(@Nonnull Consumer consumer) {
        UIThreadAwareBindings.uiThreadAwareChangeListener(consumer)
    }

    @Nonnull
    static  ChangeListener uiThreadAwareChangeListener(
        @Nonnull ObservableValue observable, @Nonnull Runnable runnable) {
        UIThreadAwareBindings.uiThreadAwareChangeListener(observable, runnable)
    }

    @Nonnull
    static  ChangeListener uiThreadAwareChangeListener(@Nonnull Runnable runnable) {
        UIThreadAwareBindings.uiThreadAwareChangeListener(runnable)
    }

    @Nonnull
    static InvalidationListener uiThreadAwareInvalidationListener(
        @Nonnull Observable observable, @Nonnull InvalidationListener listener) {
        UIThreadAwareBindings.uiThreadAwareInvalidationListener(observable, listener)
    }

    @Nonnull
    static InvalidationListener uiThreadAwareInvalidationListener(@Nonnull InvalidationListener listener) {
        UIThreadAwareBindings.uiThreadAwareInvalidationListener(listener)
    }

    @Nonnull
    static InvalidationListener uiThreadAwareInvalidationListener(
        @Nonnull Observable observable, @Nonnull Consumer consumer) {
        UIThreadAwareBindings.uiThreadAwareInvalidationListener(observable, consumer)
    }

    @Nonnull
    static InvalidationListener uiThreadAwareInvalidationListener(@Nonnull Consumer consumer) {
        UIThreadAwareBindings.uiThreadAwareInvalidationListener(consumer)
    }

    @Nonnull
    static InvalidationListener uiThreadAwareInvalidationListener(
        @Nonnull Observable observable, @Nonnull Runnable runnable) {
        UIThreadAwareBindings.uiThreadAwareInvalidationListener(observable, runnable)
    }

    @Nonnull
    static InvalidationListener uiThreadAwareInvalidationListener(@Nonnull Runnable runnable) {
        UIThreadAwareBindings.uiThreadAwareInvalidationListener(runnable)
    }

    @Nonnull
    static  ListChangeListener uiThreadAwareListChangeListener(
        @Nonnull ObservableList observable, @Nonnull ListChangeListener listener) {
        UIThreadAwareBindings.uiThreadAwareListChangeListener(observable, listener)
    }

    @Nonnull
    static  ListChangeListener uiThreadAwareListChangeListener(@Nonnull ListChangeListener listener) {
        UIThreadAwareBindings.uiThreadAwareListChangeListener(listener)
    }

    @Nonnull
    static  ListChangeListener uiThreadAwareListChangeListener(
        @Nonnull ObservableList observable, @Nonnull Consumer> consumer) {
        UIThreadAwareBindings.uiThreadAwareListChangeListener(observable, consumer)
    }

    @Nonnull
    static  ListChangeListener uiThreadAwareListChangeListener(
        @Nonnull Consumer> consumer) {
        UIThreadAwareBindings.uiThreadAwareListChangeListener(consumer)
    }

    @Nonnull
    static  ListChangeListener uiThreadAwareListChangeListener(
        @Nonnull ObservableList observable, @Nonnull Runnable runnable) {
        UIThreadAwareBindings.uiThreadAwareListChangeListener(observable, runnable)
    }

    @Nonnull
    static  ListChangeListener uiThreadAwareListChangeListener(@Nonnull Runnable runnable) {
        UIThreadAwareBindings.uiThreadAwareListChangeListener(runnable)
    }

    @Nonnull
    static  MapChangeListener uiThreadAwareMapChangeListener(
        @Nonnull ObservableMap observable, @Nonnull MapChangeListener listener) {
        UIThreadAwareBindings.uiThreadAwareMapChangeListener(observable, listener)
    }

    @Nonnull
    static  MapChangeListener uiThreadAwareMapChangeListener(@Nonnull MapChangeListener listener) {
        UIThreadAwareBindings.uiThreadAwareMapChangeListener(listener)
    }

    @Nonnull
    static  MapChangeListener uiThreadAwareMapChangeListener(
        @Nonnull ObservableMap observable,
        @Nonnull Consumer> consumer) {
        UIThreadAwareBindings.uiThreadAwareMapChangeListener(observable, consumer)
    }

    @Nonnull
    static  MapChangeListener uiThreadAwareMapChangeListener(
        @Nonnull Consumer> consumer) {
        UIThreadAwareBindings.uiThreadAwareMapChangeListener(consumer)
    }

    @Nonnull
    static  MapChangeListener uiThreadAwareMapChangeListener(
        @Nonnull ObservableMap observable, @Nonnull Runnable runnable) {
        UIThreadAwareBindings.uiThreadAwareMapChangeListener(observable, runnable)
    }

    @Nonnull
    static  MapChangeListener uiThreadAwareMapChangeListener(@Nonnull Runnable runnable) {
        UIThreadAwareBindings.uiThreadAwareMapChangeListener(runnable)
    }

    @Nonnull
    static  SetChangeListener uiThreadAwareSetChangeListener(
        @Nonnull ObservableSet observable, @Nonnull SetChangeListener listener) {
        UIThreadAwareBindings.uiThreadAwareSetChangeListener(observable, listener)
    }

    @Nonnull
    static  SetChangeListener uiThreadAwareSetChangeListener(@Nonnull SetChangeListener listener) {
        UIThreadAwareBindings.uiThreadAwareSetChangeListener(listener)
    }

    @Nonnull
    static  SetChangeListener uiThreadAwareSetChangeListener(
        @Nonnull ObservableSet observable, @Nonnull Consumer> consumer) {
        UIThreadAwareBindings.uiThreadAwareSetChangeListener(observable, consumer)
    }

    @Nonnull
    static  SetChangeListener uiThreadAwareSetChangeListener(
        @Nonnull Consumer> consumer) {
        UIThreadAwareBindings.uiThreadAwareSetChangeListener(consumer)
    }

    @Nonnull
    static  SetChangeListener uiThreadAwareSetChangeListener(
        @Nonnull ObservableSet observable, @Nonnull Runnable runnable) {
        UIThreadAwareBindings.uiThreadAwareSetChangeListener(observable, runnable)
    }

    @Nonnull
    static  SetChangeListener uiThreadAwareSetChangeListener(@Nonnull Runnable runnable) {
        UIThreadAwareBindings.uiThreadAwareSetChangeListener(runnable)
    }

    @Nonnull
    static BooleanProperty uiThreadAware(@Nonnull BooleanProperty observable) {
        UIThreadAwareBindings.uiThreadAwareBooleanProperty(observable)
    }

    @Nonnull
    static IntegerProperty uiThreadAware(@Nonnull IntegerProperty observable) {
        UIThreadAwareBindings.uiThreadAwareIntegerProperty(observable)
    }

    @Nonnull
    static LongProperty uiThreadAware(@Nonnull LongProperty observable) {
        UIThreadAwareBindings.uiThreadAwareLongProperty(observable)
    }

    @Nonnull
    static FloatProperty uiThreadAware(@Nonnull FloatProperty observable) {
        UIThreadAwareBindings.uiThreadAwareFloatProperty(observable)
    }

    @Nonnull
    static DoubleProperty uiThreadAware(@Nonnull DoubleProperty observable) {
        UIThreadAwareBindings.uiThreadAwareDoubleProperty(observable)
    }

    @Nonnull
    static StringProperty uiThreadAware(@Nonnull StringProperty observable) {
        UIThreadAwareBindings.uiThreadAwareStringProperty(observable)
    }

    @Nonnull
    static Property uiThreadAwarePropertyBoolean(@Nonnull Property observable) {
        UIThreadAwareBindings.uiThreadAwarePropertyBoolean(observable)
    }

    @Nonnull
    static Property uiThreadAwarePropertyInteger(@Nonnull Property observable) {
        UIThreadAwareBindings.uiThreadAwarePropertyInteger(observable)
    }

    @Nonnull
    static Property uiThreadAwarePropertyLong(@Nonnull Property observable) {
        UIThreadAwareBindings.uiThreadAwarePropertyLong(observable)
    }

    @Nonnull
    static Property uiThreadAwarePropertyFloat(@Nonnull Property observable) {
        UIThreadAwareBindings.uiThreadAwarePropertyFloat(observable)
    }

    @Nonnull
    static Property uiThreadAwarePropertyDouble(@Nonnull Property observable) {
        UIThreadAwareBindings.uiThreadAwarePropertyDouble(observable)
    }

    @Nonnull
    static Property uiThreadAwarePropertyString(@Nonnull Property observable) {
        UIThreadAwareBindings.uiThreadAwarePropertyString(observable)
    }

    @Nonnull
    static  ObjectProperty uiThreadAware(@Nonnull ObjectProperty observable) {
        UIThreadAwareBindings.uiThreadAwareObjectProperty(observable)
    }

    @Nonnull
    static  ListProperty uiThreadAware(@Nonnull ListProperty observable) {
        UIThreadAwareBindings.uiThreadAwareListProperty(observable)
    }

    @Nonnull
    static  SetProperty uiThreadAware(@Nonnull SetProperty observable) {
        UIThreadAwareBindings.uiThreadAwareSetProperty(observable)
    }

    @Nonnull
    static  MapProperty uiThreadAware(@Nonnull MapProperty observable) {
        UIThreadAwareBindings.uiThreadAwareMapProperty(observable)
    }

    @Nonnull
    static  ObservableValue uiThreadAware(@Nonnull ObservableValue observable) {
        UIThreadAwareBindings.uiThreadAwareObservable(observable)
    }

    @Nonnull
    static ObservableStringValue uiThreadAware(@Nonnull ObservableStringValue observable) {
        UIThreadAwareBindings.uiThreadAwareObservableString(observable)
    }

    @Nonnull
    static ObservableBooleanValue uiThreadAware(@Nonnull ObservableBooleanValue observable) {
        UIThreadAwareBindings.uiThreadAwareObservableBoolean(observable)
    }

    @Nonnull
    static ObservableIntegerValue uiThreadAware(@Nonnull ObservableIntegerValue observable) {
        UIThreadAwareBindings.uiThreadAwareObservableInteger(observable)
    }

    @Nonnull
    static ObservableLongValue uiThreadAware(@Nonnull ObservableLongValue observable) {
        UIThreadAwareBindings.uiThreadAwareObservableLong(observable)
    }

    @Nonnull
    static ObservableFloatValue uiThreadAware(@Nonnull ObservableFloatValue observable) {
        UIThreadAwareBindings.uiThreadAwareObservableFloat(observable)
    }

    @Nonnull
    static ObservableDoubleValue uiThreadAware(@Nonnull ObservableDoubleValue observable) {
        UIThreadAwareBindings.uiThreadAwareObservableDouble(observable)
    }

    @Nonnull
    static BooleanBinding uiThreadAware(@Nonnull BooleanBinding observable) {
        UIThreadAwareBindings.uiThreadAwareBooleanBinding(observable)
    }

    @Nonnull
    static IntegerBinding uiThreadAware(@Nonnull IntegerBinding observable) {
        UIThreadAwareBindings.uiThreadAwareIntegerBinding(observable)
    }

    @Nonnull
    static LongBinding uiThreadAware(@Nonnull LongBinding observable) {
        UIThreadAwareBindings.uiThreadAwareLongBinding(observable)
    }

    @Nonnull
    static FloatBinding uiThreadAware(@Nonnull FloatBinding observable) {
        UIThreadAwareBindings.uiThreadAwareFloatBinding(observable)
    }

    @Nonnull
    static DoubleBinding uiThreadAware(@Nonnull DoubleBinding observable) {
        UIThreadAwareBindings.uiThreadAwareDoubleBinding(observable)
    }

    @Nonnull
    static StringBinding uiThreadAware(@Nonnull StringBinding observable) {
        UIThreadAwareBindings.uiThreadAwareStringBinding(observable)
    }

    @Nonnull
    static  ObjectBinding uiThreadAware(@Nonnull ObjectBinding observable) {
        UIThreadAwareBindings.uiThreadAwareObjectBinding(observable)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy