Offer grid row attributes and qualify Archiver folder profile editing

This commit is contained in:
2026-11-25 13:17:24 +01:00
parent ff6ba0a745
commit 9c63b2dd0f
10 changed files with 560 additions and 78 deletions
@@ -19,14 +19,14 @@ public final class FolderActionsTargetProbe {
Thread.ofPlatform().daemon().start(() -> Worker.run(Path.of(dir)));
}
private static final class Worker {
private static <T> T fx(Callable<T> action) throws Exception {
static final class Worker {
static <T> T fx(Callable<T> action) throws Exception {
var task = new FutureTask<>(action);
Platform.runLater(task);
return task.get(10, TimeUnit.SECONDS);
}
private static void await(String description, Callable<Boolean> test) throws Exception {
static void await(String description, Callable<Boolean> test) throws Exception {
long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(22);
while (System.nanoTime() < end) {
if (fx(test)) return;
@@ -35,34 +35,38 @@ public final class FolderActionsTargetProbe {
throw new AssertionError(description);
}
private static void require(boolean value, String message) {
static void require(boolean value, String message) {
if (!value) throw new AssertionError(message);
}
static Stage previewStage() throws Exception {
Stage stage = null;
while (stage == null) {
Thread.sleep(120);
try {
stage =
fx(
() ->
Window.getWindows().stream()
.filter(
w ->
w instanceof Stage s
&& s.isShowing()
&& s.getOpacity() > 0
&& s.getTitle() != null
&& s.getTitle().startsWith("Neitzel preview"))
.map(Stage.class::cast)
.findFirst()
.orElse(null));
} catch (IllegalStateException starting) {
}
}
return stage;
}
private static void run(Path dir) {
try {
Stage stage = null;
while (stage == null) {
Thread.sleep(120);
try {
stage =
fx(
() ->
Window.getWindows().stream()
.filter(
w ->
w instanceof Stage s
&& s.isShowing()
&& s.getOpacity() > 0
&& s.getTitle() != null
&& s.getTitle().startsWith("Neitzel preview"))
.map(Stage.class::cast)
.findFirst()
.orElse(null));
} catch (IllegalStateException starting) {
}
}
Stage shown = stage;
Stage shown = previewStage();
var root =
fx(
() -> {
@@ -140,7 +144,7 @@ public final class FolderActionsTargetProbe {
.orElseThrow();
}
private static boolean visible(Node grid, String column) throws Exception {
static boolean visible(Node grid, String column) throws Exception {
return (boolean)
grid.getClass().getMethod("isColumnVisible", String.class).invoke(grid, column);
}
@@ -283,7 +287,7 @@ public final class FolderActionsTargetProbe {
+ " Dateityp; Kurzansicht restored hidden Dateityp.");
}
private static void image(Node node, Path path) throws Exception {
static void image(Node node, Path path) throws Exception {
var img = node.snapshot(null, null);
int w = (int) img.getWidth(), h = (int) img.getHeight();
var out = new java.awt.image.BufferedImage(w, h, java.awt.image.BufferedImage.TYPE_INT_ARGB);