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

ca.odell.glazedlists.swt.CalculationsSWT Maven / Gradle / Ivy

/* Glazed Lists                                                 (c) 2003-2010 */
/* http://publicobject.com/glazedlists/                      publicobject.com,*/
/*                                                     O'Dell Engineering Ltd.*/
package ca.odell.glazedlists.swt;

import ca.odell.glazedlists.calculation.Calculation;
import ca.odell.glazedlists.impl.swt.SWTThreadProxyCalculation;

import org.eclipse.swt.widgets.Display;

/**
 * A factory for creating SWT related calculations.
 *
 * @author Holger Brands
 */
public final class CalculationsSWT {

    private CalculationsSWT() {}

    /**
     * Wraps the source in a {@link Calculation} that fires all of its update
     * events from the SWT event dispatch thread.
     */
    public static  Calculation swtThreadProxyCalculation(Calculation source, Display display) {
        return new SWTThreadProxyCalculation(source, display);
    }

    /**
     * Returns true if calc is a {@link Calculation} that fires
     * all of its update events from the SWT event dispatch thread.
     */
    public static boolean isSWTThreadProxyCalculation(Calculation calc) {
        return calc instanceof SWTThreadProxyCalculation;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy