Skip to content

Commit

Permalink
feat: require java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
teletha committed Jan 27, 2024
1 parent a5cf483 commit 68ec5c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
14 changes: 1 addition & 13 deletions src/main/java/viewtify/Viewtify.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import java.util.function.BooleanSupplier;
Expand Down Expand Up @@ -116,18 +115,7 @@ public final class Viewtify {
public static final Disposable Terminator = Disposable.empty();

/** The thread pool. */
private static final ExecutorService pool = Executors.newCachedThreadPool(new ThreadFactory() {

/**
* {@inheritDoc}
*/
@Override
public Thread newThread(Runnable runnable) {
Thread thread = new Thread(runnable);
thread.setDaemon(true);
return thread;
}
});
private static final ExecutorService pool = Executors.newVirtualThreadPerTaskExecutor();

/** Executor for UI Thread. */
public static final Consumer<Runnable> UIThread = Viewtify::inUI;
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/viewtify/ui/UITableColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableColumn.CellDataFeatures;
import javafx.util.Callback;

import kiss.Disposable;
import kiss.I;
import kiss.Signal;
Expand Down Expand Up @@ -134,7 +135,10 @@ public <T extends RowV> UITableColumn<RowV, ColumnV> modelByProperty(Class<T> ty
*/
public UITableColumn<RowV, ColumnV> modelBySignal(WiseFunction<RowV, Signal<ColumnV>> mapper) {
if (mapper != null) {
modelByProperty(v -> mapper.apply(v).to(new SmartProperty(), SmartProperty::set));
modelByProperty(v -> mapper.apply(v)
.subscribeOn(Viewtify.WorkerThread)
.on(Viewtify.UIThread)
.to(new SmartProperty(), SmartProperty::set));
}
return this;
}
Expand Down
2 changes: 1 addition & 1 deletion src/project/java/viewtify/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class Project extends bee.api.Project {
* Browser manipulation
""");

require(SourceVersion.RELEASE_19, SourceVersion.RELEASE_17);
require(SourceVersion.RELEASE_21, SourceVersion.RELEASE_17);

require("com.github.teletha", "altfx");
require("com.github.teletha", "sinobu");
Expand Down

0 comments on commit 68ec5c7

Please sign in to comment.