Module is.codion.swing.common.model
Class AbstractRefreshWorker<T>
java.lang.Object
is.codion.common.model.filter.FilterModel.AbstractRefresher<T>
is.codion.swing.common.model.component.list.AbstractRefreshWorker<T>
- Type Parameters:
T- the model row type
- All Implemented Interfaces:
FilterModel.Refresher<T>
A
ProgressWorker based FilterModel.Refresher.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRefreshWorker(@Nullable Supplier<Collection<T>> items, boolean async, @Nullable Consumer<Exception> onException) -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleanprotected final voidrefreshAsync(Consumer<Collection<T>> onResult) Performes an async refreshprotected final voidrefreshSync(Consumer<Collection<T>> onResult) Performs a sync refreshMethods inherited from class is.codion.common.model.filter.FilterModel.AbstractRefresher
active, async, items, notifyResult, processResult, refresh, result, setActive
-
Constructor Details
-
AbstractRefreshWorker
protected AbstractRefreshWorker(@Nullable Supplier<Collection<T>> items, boolean async, @Nullable Consumer<Exception> onException) - Parameters:
items- supplies the itemsasync- true if async refresh should be usedonException- exceptions are rethrown by default, override with this exception handler
-
-
Method Details
-
isUserInterfaceThread
protected final boolean isUserInterfaceThread()- Specified by:
isUserInterfaceThreadin classFilterModel.AbstractRefresher<T>- Returns:
- true if we're running on a UI thread
-
refreshAsync
Description copied from class:FilterModel.AbstractRefresherPerformes an async refresh
This method must be called on the UI thread.
- Specified by:
refreshAsyncin classFilterModel.AbstractRefresher<T>- Parameters:
onResult- if specified will be called on the EDT with the result after a successful refresh
-
refreshSync
Description copied from class:FilterModel.AbstractRefresherPerforms a sync refresh
This method must be called on the UI thread.
- Specified by:
refreshSyncin classFilterModel.AbstractRefresher<T>- Parameters:
onResult- if specified will be called with the result after a successful refresh
-