From b0e9a96fc6974ec915ce965bee1df5965954bf46 Mon Sep 17 00:00:00 2001 From: Christopher Schnick Date: Fri, 30 Dec 2022 12:54:53 +0100 Subject: [PATCH] More cleanup --- .../extension/DataSourceActionProvider.java | 26 +-- .../xpipe/extension/DataSourceProvider.java | 8 +- .../xpipe/extension/DataSourceProviders.java | 7 +- .../extension/DataStoreActionProvider.java | 26 +-- .../xpipe/extension/DataStoreProviders.java | 3 +- .../xpipe/extension/ExtensionException.java | 3 +- .../xpipe/extension/event/EventHandler.java | 11 +- .../io/xpipe/extension/event/TrackEvent.java | 18 +-- .../fxcomps/impl/CharChoiceComp.java | 3 +- .../fxcomps/impl/CharsetChoiceComp.java | 7 +- .../extension/fxcomps/impl/ChoiceComp.java | 5 +- .../fxcomps/impl/ChoicePaneComp.java | 8 +- .../extension/fxcomps/impl/CodeSnippet.java | 6 +- .../fxcomps/impl/DynamicOptionsComp.java | 9 +- .../fxcomps/impl/FancyTooltipAugment.java | 148 +++++++++--------- .../extension/fxcomps/impl/IntFieldComp.java | 5 +- .../fxcomps/impl/PrettyImageComp.java | 12 +- .../fxcomps/impl/ShellStoreChoiceComp.java | 6 +- .../xpipe/extension/fxcomps/impl/SvgComp.java | 6 +- .../extension/fxcomps/impl/TabPaneComp.java | 4 +- .../extension/fxcomps/impl/TextAreaComp.java | 2 +- .../fxcomps/impl/ToggleGroupComp.java | 4 +- .../fxcomps/impl/WriteModeChoiceComp.java | 4 +- .../fxcomps/util/BindingsHelper.java | 5 +- .../extension/prefs/PrefsChoiceValue.java | 2 +- .../xpipe/extension/prefs/PrefsHandler.java | 2 +- .../xpipe/extension/prefs/PrefsProvider.java | 10 +- .../extension/util/ChainedValidator.java | 3 +- .../extension/util/CustomComboBoxBuilder.java | 9 +- .../extension/util/DataStoreFormatter.java | 3 +- .../extension/util/DynamicOptionsBuilder.java | 32 ++-- .../extension/util/ExclusiveValidator.java | 3 +- .../extension/util/ExecScriptHelper.java | 4 +- .../xpipe/extension/util/PrettyListView.java | 40 +++-- .../xpipe/extension/util/SimpleValidator.java | 34 ++-- .../xpipe/extension/util/WindowsRegistry.java | 2 +- .../io/xpipe/extension/util/XPipeDaemon.java | 13 +- 37 files changed, 291 insertions(+), 202 deletions(-) diff --git a/extension/src/main/java/io/xpipe/extension/DataSourceActionProvider.java b/extension/src/main/java/io/xpipe/extension/DataSourceActionProvider.java index ffb35b17..bec46f8e 100644 --- a/extension/src/main/java/io/xpipe/extension/DataSourceActionProvider.java +++ b/extension/src/main/java/io/xpipe/extension/DataSourceActionProvider.java @@ -16,16 +16,16 @@ public interface DataSourceActionProvider> { public static void init(ModuleLayer layer) { if (ALL.size() == 0) { ALL.addAll(ServiceLoader.load(layer, DataSourceActionProvider.class).stream() - .map(p -> (DataSourceActionProvider) p.get()) - .filter(provider -> { - try { - return provider.isActive(); - } catch (Exception e) { - ErrorEvent.fromThrowable(e).handle(); - return false; - } - }) - .toList()); + .map(p -> (DataSourceActionProvider) p.get()) + .filter(provider -> { + try { + return provider.isActive(); + } catch (Exception e) { + ErrorEvent.fromThrowable(e).handle(); + return false; + } + }) + .toList()); } } @@ -39,11 +39,13 @@ public interface DataSourceActionProvider> { return true; } - default void applyToRegion(T store, Region region) {} + default void applyToRegion(T store, Region region) { + } ObservableValue getName(T store); String getIcon(T store); - default void execute(T store) throws Exception {} + default void execute(T store) throws Exception { + } } diff --git a/extension/src/main/java/io/xpipe/extension/DataSourceProvider.java b/extension/src/main/java/io/xpipe/extension/DataSourceProvider.java index d49a58f8..eada799d 100644 --- a/extension/src/main/java/io/xpipe/extension/DataSourceProvider.java +++ b/extension/src/main/java/io/xpipe/extension/DataSourceProvider.java @@ -33,7 +33,8 @@ public interface DataSourceProvider> { throw new ExtensionException(); } - default void init() throws Exception {} + default void init() throws Exception { + } default String i18n(String key) { return I18n.get(i18nKey(key)); @@ -64,6 +65,7 @@ public interface DataSourceProvider> { default String queryInformationString(DataStore store, int length) throws Exception { return getDisplayName(); } + default String getDisplayIconFileName() { return getModuleName() + ":" + getId() + "_icon.png"; } @@ -86,14 +88,14 @@ public interface DataSourceProvider> { * Checks whether this provider supports the store in principle. * This method should not perform any further checks, * just check whether it may be possible that the store is supported. - * + *

* This method will be called for validation purposes. */ boolean couldSupportStore(DataStore store); /** * Performs a deep inspection to check whether this provider supports a given store. - * + *

* This functionality will be used in case no preferred provider has been found. */ default boolean supportsStore(DataStore store) { diff --git a/extension/src/main/java/io/xpipe/extension/DataSourceProviders.java b/extension/src/main/java/io/xpipe/extension/DataSourceProviders.java index da6426ee..d6c12c29 100644 --- a/extension/src/main/java/io/xpipe/extension/DataSourceProviders.java +++ b/extension/src/main/java/io/xpipe/extension/DataSourceProviders.java @@ -42,7 +42,7 @@ public class DataSourceProviders { case STRUCTURE -> DataSourceProviders.byId("xpbs"); case TEXT -> DataSourceProviders.byId("text"); case RAW -> DataSourceProviders.byId("binary"); - // TODO + // TODO case COLLECTION -> null; }; } catch (Exception ex) { @@ -126,7 +126,7 @@ public class DataSourceProviders { return ALL.stream() .filter(d -> d.getPossibleNames().stream() - .anyMatch(s -> nameAlternatives(s).stream().anyMatch(s1 -> s1.equalsIgnoreCase(name))) + .anyMatch(s -> nameAlternatives(s).stream().anyMatch(s1 -> s1.equalsIgnoreCase(name))) || d.getId().equalsIgnoreCase(name)) .findAny(); } @@ -139,7 +139,8 @@ public class DataSourceProviders { String.join("-", split), split.stream() .map(s -> s.equals(split.get(0)) ? s : s.substring(0, 1).toUpperCase() + s.substring(1)) - .collect(Collectors.joining())); + .collect(Collectors.joining()) + ); } public static Optional> byPreferredStore(DataStore store, DataSourceType type) { diff --git a/extension/src/main/java/io/xpipe/extension/DataStoreActionProvider.java b/extension/src/main/java/io/xpipe/extension/DataStoreActionProvider.java index 7f1cb58c..b656c0b5 100644 --- a/extension/src/main/java/io/xpipe/extension/DataStoreActionProvider.java +++ b/extension/src/main/java/io/xpipe/extension/DataStoreActionProvider.java @@ -16,16 +16,16 @@ public interface DataStoreActionProvider { public static void init(ModuleLayer layer) { if (ALL.size() == 0) { ALL.addAll(ServiceLoader.load(layer, DataStoreActionProvider.class).stream() - .map(p -> (DataStoreActionProvider) p.get()) - .filter(provider -> { - try { - return provider.isActive(); - } catch (Exception e) { - ErrorEvent.fromThrowable(e).handle(); - return false; - } - }) - .toList()); + .map(p -> (DataStoreActionProvider) p.get()) + .filter(provider -> { + try { + return provider.isActive(); + } catch (Exception e) { + ErrorEvent.fromThrowable(e).handle(); + return false; + } + }) + .toList()); } } @@ -43,11 +43,13 @@ public interface DataStoreActionProvider { return true; } - default void applyToRegion(T store, Region region) {} + default void applyToRegion(T store, Region region) { + } ObservableValue getName(T store); String getIcon(T store); - default void execute(T store) throws Exception {} + default void execute(T store) throws Exception { + } } diff --git a/extension/src/main/java/io/xpipe/extension/DataStoreProviders.java b/extension/src/main/java/io/xpipe/extension/DataStoreProviders.java index b68a3a18..b34cedee 100644 --- a/extension/src/main/java/io/xpipe/extension/DataStoreProviders.java +++ b/extension/src/main/java/io/xpipe/extension/DataStoreProviders.java @@ -52,7 +52,8 @@ public class DataStoreProviders { String.join("-", split), split.stream() .map(s -> s.equals(split.get(0)) ? s : s.substring(0, 1).toUpperCase() + s.substring(1)) - .collect(Collectors.joining())); + .collect(Collectors.joining()) + ); } @SuppressWarnings("unchecked") diff --git a/extension/src/main/java/io/xpipe/extension/ExtensionException.java b/extension/src/main/java/io/xpipe/extension/ExtensionException.java index 2670e8d4..fab3705c 100644 --- a/extension/src/main/java/io/xpipe/extension/ExtensionException.java +++ b/extension/src/main/java/io/xpipe/extension/ExtensionException.java @@ -2,7 +2,8 @@ package io.xpipe.extension; public class ExtensionException extends RuntimeException { - public ExtensionException() {} + public ExtensionException() { + } public ExtensionException(String message) { super(message); diff --git a/extension/src/main/java/io/xpipe/extension/event/EventHandler.java b/extension/src/main/java/io/xpipe/extension/event/EventHandler.java index fe8e9144..1d505d76 100644 --- a/extension/src/main/java/io/xpipe/extension/event/EventHandler.java +++ b/extension/src/main/java/io/xpipe/extension/event/EventHandler.java @@ -23,8 +23,12 @@ public abstract class EventHandler { @Override public void handle(ErrorEvent ee) { - if (ee.getDescription() != null) System.err.println(ee.getDescription()); - if (ee.getThrowable() != null) ee.getThrowable().printStackTrace(); + if (ee.getDescription() != null) { + System.err.println(ee.getDescription()); + } + if (ee.getThrowable() != null) { + ee.getThrowable().printStackTrace(); + } } }; @@ -42,13 +46,12 @@ public abstract class EventHandler { public void handle(ErrorEvent ee) { } }; + private static EventHandler INSTANCE; public static void set(EventHandler handler) { INSTANCE = handler; } - private static EventHandler INSTANCE; - private static void init() { if (INSTANCE == null) { INSTANCE = ServiceLoader.load(EventHandler.class).findFirst().orElse(DEFAULT); diff --git a/extension/src/main/java/io/xpipe/extension/event/TrackEvent.java b/extension/src/main/java/io/xpipe/extension/event/TrackEvent.java index d70e1bc8..22877be4 100644 --- a/extension/src/main/java/io/xpipe/extension/event/TrackEvent.java +++ b/extension/src/main/java/io/xpipe/extension/event/TrackEvent.java @@ -14,22 +14,20 @@ import java.util.stream.Collectors; @Getter public class TrackEvent { - public static TrackEventBuilder storage() { - return TrackEvent.builder().category("storage"); - } - private final Thread thread = Thread.currentThread(); private final Instant instant = Instant.now(); private String type; private String message; private String category; - @Singular private Map tags; - @Singular private List elements; + public static TrackEventBuilder storage() { + return TrackEvent.builder().category("storage"); + } + public static TrackEventBuilder fromMessage(String type, String message) { return builder().type(type).message(message); } @@ -115,10 +113,10 @@ public class TrackEvent { var valueString = e.getValue() != null ? e.getValue().toString() : "null"; var value = valueString.contains("\n") ? "\n" - + (valueString.toString() - .lines() - .map(line -> " | " + line) - .collect(Collectors.joining("\n"))) + + (valueString.toString() + .lines() + .map(line -> " | " + line) + .collect(Collectors.joining("\n"))) : valueString; s.append(" ") .append(e.getKey()) diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CharChoiceComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CharChoiceComp.java index b2fa1b52..9cec677e 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CharChoiceComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CharChoiceComp.java @@ -20,7 +20,8 @@ public class CharChoiceComp extends Comp> { public CharChoiceComp( Property value, Map> range, - ObservableValue customName) { + ObservableValue customName + ) { this.value = value; this.range = range; this.customName = customName; diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CharsetChoiceComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CharsetChoiceComp.java index bf56029f..4bca58ac 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CharsetChoiceComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CharsetChoiceComp.java @@ -22,10 +22,11 @@ public class CharsetChoiceComp extends SimpleComp { charset, streamCharset -> { return new Label(streamCharset.getCharset().displayName() - + (streamCharset.hasByteOrderMark() ? " (BOM)" : "")); + + (streamCharset.hasByteOrderMark() ? " (BOM)" : "")); }, new Label(I18n.get("extension.none")), - null); + null + ); builder.addFilter((charset, filter) -> { return charset.getCharset().displayName().contains(filter); }); @@ -38,7 +39,7 @@ public class CharsetChoiceComp extends SimpleComp { for (var e : StreamCharset.RARE) { builder.add(e); } - var comboBox = builder.build(); + var comboBox = builder.build(); comboBox.setVisibleRowCount(16); return comboBox; } diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ChoiceComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ChoiceComp.java index e8c23254..6cee51b5 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ChoiceComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ChoiceComp.java @@ -18,7 +18,10 @@ import lombok.experimental.FieldDefaults; import java.util.Map; -@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) +@FieldDefaults( + makeFinal = true, + level = AccessLevel.PRIVATE +) public class ChoiceComp extends Comp>> { Property value; diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ChoicePaneComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ChoicePaneComp.java index 8b4a592d..d7d5a2a2 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ChoicePaneComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ChoicePaneComp.java @@ -20,7 +20,10 @@ import lombok.experimental.FieldDefaults; import java.util.List; import java.util.function.Function; -@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) +@FieldDefaults( + makeFinal = true, + level = AccessLevel.PRIVATE +) @AllArgsConstructor public class ChoicePaneComp extends Comp> { @@ -75,5 +78,6 @@ public class ChoicePaneComp extends Comp> { return new SimpleCompStructure<>(vbox); } - public record Entry(ObservableValue name, Comp comp) {} + public record Entry(ObservableValue name, Comp comp) { + } } diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CodeSnippet.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CodeSnippet.java index 791e1833..9bfff371 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CodeSnippet.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/CodeSnippet.java @@ -120,7 +120,9 @@ public record CodeSnippet(List lines) { } } - public record Line(List elements) {} + public record Line(List elements) { + } - public record ColorScheme(Color keyword, Color identifier, Color type, Color string) {} + public record ColorScheme(Color keyword, Color identifier, Color type, Color string) { + } } diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/DynamicOptionsComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/DynamicOptionsComp.java index 0dfde6ae..8e82f1d8 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/DynamicOptionsComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/DynamicOptionsComp.java @@ -104,7 +104,8 @@ public class DynamicOptionsComp extends Comp> { .orElse(0.0); return m; }, - compRegions.stream().map(Region::widthProperty).toList().toArray(new Observable[0])); + compRegions.stream().map(Region::widthProperty).toList().toArray(new Observable[0]) + ); compRegions.forEach(r -> r.prefWidthProperty().bind(compWidthBinding)); } @@ -121,7 +122,8 @@ public class DynamicOptionsComp extends Comp> { .orElse(0.0); return m; }, - nameRegions.stream().map(Region::widthProperty).toList().toArray(new Observable[0])); + nameRegions.stream().map(Region::widthProperty).toList().toArray(new Observable[0]) + ); nameRegions.forEach(r -> r.prefWidthProperty().bind(nameWidthBinding)); } @@ -132,5 +134,6 @@ public class DynamicOptionsComp extends Comp> { return entries; } - public record Entry(String key, ObservableValue name, Comp comp) {} + public record Entry(String key, ObservableValue name, Comp comp) { + } } diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/FancyTooltipAugment.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/FancyTooltipAugment.java index 01d7a20a..d8f87195 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/FancyTooltipAugment.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/FancyTooltipAugment.java @@ -22,6 +22,36 @@ import javafx.util.Duration; public class FancyTooltipAugment> implements Augment { private static final TooltipBehavior BEHAVIOR = new TooltipBehavior(Duration.millis(400), Duration.INDEFINITE, Duration.millis(100)); + private final ObservableValue text; + + public FancyTooltipAugment(ObservableValue text) { + this.text = PlatformThread.sync(text); + } + + public FancyTooltipAugment(String key) { + this.text = I18n.observable(key); + } + + @Override + public void augment(S struc) { + augment(struc.get()); + } + + public void augment(Node region) { + var tt = new JFXTooltip(); + var toDisplay = text.getValue(); + if (Shortcuts.getShortcut((Region) region) != null) { + toDisplay = + toDisplay + " (" + Shortcuts.getShortcut((Region) region).getDisplayText() + ")"; + } + tt.textProperty().setValue(toDisplay); + tt.setStyle("-fx-font-size: 11pt;"); + tt.setWrapText(true); + tt.setMaxWidth(400); + tt.getStyleClass().add("fancy-tooltip"); + + BEHAVIOR.install(region, tt); + } private static class TooltipBehavior { @@ -37,10 +67,40 @@ public class FancyTooltipAugment> implements Augment< * the next tooltip to be shown */ private JFXTooltip nextTooltip; + private final EventHandler exitHandler = (MouseEvent event) -> { + // stop running hover timer as the mouse exited the node + if (hoverTimer.getStatus() == Timeline.Status.RUNNING) { + hoverTimer.stop(); + } else if (visibleTimer.getStatus() == Timeline.Status.RUNNING) { + // if tool tip was already showing, stop the visible timer + // and start the left timer to hide the current tooltip + visibleTimer.stop(); + leftTimer.playFromStart(); + } + hoveredNode = null; + nextTooltip = null; + }; + private final WeakEventHandler weakExitHandler = new WeakEventHandler<>(exitHandler); /** * the current showing tooltip */ private JFXTooltip currentTooltip; + // if mouse is pressed then stop all timers / clear all fields + private final EventHandler pressedHandler = (MouseEvent event) -> { + // stop timers + hoverTimer.stop(); + visibleTimer.stop(); + leftTimer.stop(); + // hide current tooltip + if (currentTooltip != null) { + currentTooltip.hide(); + } + // clear fields + hoveredNode = null; + currentTooltip = null; + nextTooltip = null; + }; + private final WeakEventHandler weakPressedHandler = new WeakEventHandler<>(pressedHandler); private TooltipBehavior(Duration hoverDelay, Duration visibleDuration, Duration leftDelay) { setHoverDelay(hoverDelay); @@ -71,24 +131,7 @@ public class FancyTooltipAugment> implements Augment< private void setVisibleDuration(Duration duration) { visibleTimer.getKeyFrames().setAll(new KeyFrame(duration)); - } - - private void setLeftDelay(Duration duration) { - leftTimer.getKeyFrames().setAll(new KeyFrame(duration)); - } - - private void hideCurrentTooltip() { - currentTooltip.hide(); - currentTooltip = null; - hoveredNode = null; - } - - private void showTooltip(JFXTooltip tooltip) { - // anchors are computed differently for each tooltip - tooltip.show(hoveredNode, -1, -1); - } - - private final EventHandler moveHandler = (MouseEvent event) -> { + } private final EventHandler moveHandler = (MouseEvent event) -> { // if tool tip is already showing, do nothing if (visibleTimer.getStatus() == Timeline.Status.RUNNING) { return; @@ -123,39 +166,21 @@ public class FancyTooltipAugment> implements Augment< uninstall(hoveredNode); } }; - private final WeakEventHandler weakMoveHandler = new WeakEventHandler<>(moveHandler); - private final EventHandler exitHandler = (MouseEvent event) -> { - // stop running hover timer as the mouse exited the node - if (hoverTimer.getStatus() == Timeline.Status.RUNNING) { - hoverTimer.stop(); - } else if (visibleTimer.getStatus() == Timeline.Status.RUNNING) { - // if tool tip was already showing, stop the visible timer - // and start the left timer to hide the current tooltip - visibleTimer.stop(); - leftTimer.playFromStart(); - } - hoveredNode = null; - nextTooltip = null; - }; - private final WeakEventHandler weakExitHandler = new WeakEventHandler<>(exitHandler); + private void setLeftDelay(Duration duration) { + leftTimer.getKeyFrames().setAll(new KeyFrame(duration)); + } private final WeakEventHandler weakMoveHandler = new WeakEventHandler<>(moveHandler); - // if mouse is pressed then stop all timers / clear all fields - private final EventHandler pressedHandler = (MouseEvent event) -> { - // stop timers - hoverTimer.stop(); - visibleTimer.stop(); - leftTimer.stop(); - // hide current tooltip - if (currentTooltip != null) { - currentTooltip.hide(); - } - // clear fields - hoveredNode = null; + private void hideCurrentTooltip() { + currentTooltip.hide(); currentTooltip = null; - nextTooltip = null; - }; - private final WeakEventHandler weakPressedHandler = new WeakEventHandler<>(pressedHandler); + hoveredNode = null; + } + + private void showTooltip(JFXTooltip tooltip) { + // anchors are computed differently for each tooltip + tooltip.show(hoveredNode, -1, -1); + } private void install(Node node, JFXTooltip tooltip) { if (node == null) { @@ -204,36 +229,9 @@ public class FancyTooltipAugment> implements Augment< final Scene scene = node == null ? null : node.getScene(); return scene == null ? null : scene.getWindow(); } - } - private final ObservableValue text; - public FancyTooltipAugment(ObservableValue text) { - this.text = PlatformThread.sync(text); - } - public FancyTooltipAugment(String key) { - this.text = I18n.observable(key); - } - @Override - public void augment(S struc) { - augment(struc.get()); - } - - public void augment(Node region) { - var tt = new JFXTooltip(); - var toDisplay = text.getValue(); - if (Shortcuts.getShortcut((Region) region) != null) { - toDisplay = - toDisplay + " (" + Shortcuts.getShortcut((Region) region).getDisplayText() + ")"; - } - tt.textProperty().setValue(toDisplay); - tt.setStyle("-fx-font-size: 11pt;"); - tt.setWrapText(true); - tt.setMaxWidth(400); - tt.getStyleClass().add("fancy-tooltip"); - - BEHAVIOR.install(region, tt); } } diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/IntFieldComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/IntFieldComp.java index 50e22231..f5dff51a 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/IntFieldComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/IntFieldComp.java @@ -11,7 +11,10 @@ import javafx.scene.input.KeyEvent; import lombok.AccessLevel; import lombok.experimental.FieldDefaults; -@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) +@FieldDefaults( + makeFinal = true, + level = AccessLevel.PRIVATE +) public class IntFieldComp extends Comp> { Property value; diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/PrettyImageComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/PrettyImageComp.java index 0fa1ceb4..e92c0abe 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/PrettyImageComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/PrettyImageComp.java @@ -37,7 +37,8 @@ public class PrettyImageComp extends SimpleComp { return height * aspectRatioProperty.doubleValue(); } }, - aspectRatioProperty); + aspectRatioProperty + ); var heightProperty = Bindings.createDoubleBinding( () -> { boolean widthLimited = width / height < aspectRatioProperty.doubleValue(); @@ -47,7 +48,8 @@ public class PrettyImageComp extends SimpleComp { return height; } }, - aspectRatioProperty); + aspectRatioProperty + ); Node node; @@ -60,7 +62,8 @@ public class PrettyImageComp extends SimpleComp { / storeIcon.getHeight().getValue().doubleValue(); }, storeIcon.getWidth(), - storeIcon.getHeight())); + storeIcon.getHeight() + )); node = storeIcon.createWebview(); ((WebView) node).prefWidthProperty().bind(widthProperty); ((WebView) node).maxWidthProperty().bind(widthProperty); @@ -78,7 +81,8 @@ public class PrettyImageComp extends SimpleComp { aspectRatioProperty.set(image.getWidth() / image.getHeight()); return image; }, - PlatformThread.sync(value))); + PlatformThread.sync(value) + )); storeIcon.fitWidthProperty().bind(widthProperty); storeIcon.fitHeightProperty().bind(heightProperty); storeIcon.setSmooth(true); diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ShellStoreChoiceComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ShellStoreChoiceComp.java index ec04d71f..39387b53 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ShellStoreChoiceComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ShellStoreChoiceComp.java @@ -76,9 +76,9 @@ public class ShellStoreChoiceComp extends SimpleComp { }); var available = XPipeDaemon.getInstance().getNamedStores().stream() - .filter(s -> s != self) - .filter(s -> storeClass.isAssignableFrom(s.getClass()) && applicableCheck.test((T) s)) - .map(s -> (ShellStore) s) + .filter(s -> s != self) + .filter(s -> storeClass.isAssignableFrom(s.getClass()) && applicableCheck.test((T) s)) + .map(s -> (ShellStore) s) .toList(); available.forEach(s -> comboBox.add((T) s)); ComboBox cb = comboBox.build(); diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/SvgComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/SvgComp.java index 5044a4d1..9505ba66 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/SvgComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/SvgComp.java @@ -40,7 +40,8 @@ public class SvgComp { return new Size( Double.parseDouble(string.substring( 0, string.length() - unit.toString().length())), - unit); + unit + ); } } return new Size(Double.parseDouble(string), SizeUnits.PX); @@ -96,7 +97,8 @@ public class SvgComp { return wv.getWidth() / width.getValue().doubleValue(); }, wv.widthProperty(), - width)); + width + )); wv.maxWidthProperty().bind(wv.prefWidthProperty()); wv.maxHeightProperty().bind(wv.prefHeightProperty()); diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/TabPaneComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/TabPaneComp.java index 4e1c9393..53cc0af3 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/TabPaneComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/TabPaneComp.java @@ -20,6 +20,7 @@ public class TabPaneComp extends Comp> { private final Property selected; private final List entries; + public TabPaneComp(Property selected, List entries) { this.selected = selected; this.entries = entries; @@ -59,5 +60,6 @@ public class TabPaneComp extends Comp> { return new SimpleCompStructure<>(tabPane); } - public record Entry(ObservableValue name, String graphic, Comp comp) {} + public record Entry(ObservableValue name, String graphic, Comp comp) { + } } diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/TextAreaComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/TextAreaComp.java index bf64422b..220892e2 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/TextAreaComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/TextAreaComp.java @@ -57,7 +57,7 @@ public class TextAreaComp extends SimpleComp { var isEqual = Bindings.createBooleanBinding(() -> Objects.equals(lazyValue.getValue(), value.getValue()), value, lazyValue); var button = new IconButtonComp("mdi2c-checkbox-marked-outline").hide(isEqual).createRegion(); var anchorPane = new AnchorPane(text, button); - AnchorPane.setBottomAnchor(button, 5.0 ); + AnchorPane.setBottomAnchor(button, 5.0); AnchorPane.setRightAnchor(button, 5.0); text.prefWidthProperty().bind(anchorPane.widthProperty()); diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ToggleGroupComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ToggleGroupComp.java index d7c088d6..d9b6c1fd 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ToggleGroupComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/ToggleGroupComp.java @@ -64,7 +64,9 @@ public class ToggleGroupComp extends Comp> { }); group.selectedToggleProperty().addListener((obsVal, oldVal, newVal) -> { - if (newVal == null) oldVal.setSelected(true); + if (newVal == null) { + oldVal.setSelected(true); + } }); return new SimpleCompStructure<>(box); diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/WriteModeChoiceComp.java b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/WriteModeChoiceComp.java index 0a021c71..47c23d0f 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/impl/WriteModeChoiceComp.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/impl/WriteModeChoiceComp.java @@ -43,13 +43,13 @@ public class WriteModeChoiceComp extends SimpleComp implements Validatable { var a = available; Property>> map = new SimpleObjectProperty<>(new LinkedHashMap>()); for (WriteMode writeMode : a) { - map.getValue().put(writeMode,I18n.observable(writeMode.getId())); + map.getValue().put(writeMode, I18n.observable(writeMode.getId())); } PlatformThread.sync(available).addListener((ListChangeListener) c -> { var newMap = new LinkedHashMap>(); for (WriteMode writeMode : c.getList()) { - newMap.put(writeMode,I18n.observable(writeMode.getId())); + newMap.put(writeMode, I18n.observable(writeMode.getId())); } map.setValue(newMap); diff --git a/extension/src/main/java/io/xpipe/extension/fxcomps/util/BindingsHelper.java b/extension/src/main/java/io/xpipe/extension/fxcomps/util/BindingsHelper.java index a5f17494..9388e3de 100644 --- a/extension/src/main/java/io/xpipe/extension/fxcomps/util/BindingsHelper.java +++ b/extension/src/main/java/io/xpipe/extension/fxcomps/util/BindingsHelper.java @@ -20,8 +20,9 @@ public class BindingsHelper { public static > T persist(T binding) { var dependencies = new HashSet>(); while (dependencies.addAll(binding.getDependencies().stream() - .map(o -> (ObservableValue) o) - .toList())) {} + .map(o -> (ObservableValue) o) + .toList())) { + } dependencies.add(binding); BINDINGS.put(new WeakReference<>(binding), dependencies); return binding; diff --git a/extension/src/main/java/io/xpipe/extension/prefs/PrefsChoiceValue.java b/extension/src/main/java/io/xpipe/extension/prefs/PrefsChoiceValue.java index 12722bfa..d1625a72 100644 --- a/extension/src/main/java/io/xpipe/extension/prefs/PrefsChoiceValue.java +++ b/extension/src/main/java/io/xpipe/extension/prefs/PrefsChoiceValue.java @@ -39,7 +39,7 @@ public interface PrefsChoiceValue extends Translatable { throw new AssertionError(); } - return all.stream().filter(t -> ((PrefsChoiceValue)t).isSupported()).toList(); + return all.stream().filter(t -> ((PrefsChoiceValue) t).isSupported()).toList(); } } diff --git a/extension/src/main/java/io/xpipe/extension/prefs/PrefsHandler.java b/extension/src/main/java/io/xpipe/extension/prefs/PrefsHandler.java index 45fcc0e6..34f118b5 100644 --- a/extension/src/main/java/io/xpipe/extension/prefs/PrefsHandler.java +++ b/extension/src/main/java/io/xpipe/extension/prefs/PrefsHandler.java @@ -6,5 +6,5 @@ import java.util.List; public interface PrefsHandler { - void addSetting(List category, String group, Setting setting, Class c); + void addSetting(List category, String group, Setting setting, Class c); } diff --git a/extension/src/main/java/io/xpipe/extension/prefs/PrefsProvider.java b/extension/src/main/java/io/xpipe/extension/prefs/PrefsProvider.java index 0d2ab0b5..6eb83546 100644 --- a/extension/src/main/java/io/xpipe/extension/prefs/PrefsProvider.java +++ b/extension/src/main/java/io/xpipe/extension/prefs/PrefsProvider.java @@ -9,11 +9,6 @@ import java.util.stream.Collectors; public abstract class PrefsProvider { - protected > T editable(T o, ObservableBooleanValue v) { - o.editableProperty().bind(v); - return o; - } - private static Set ALL; public static void init(ModuleLayer layer) { @@ -33,5 +28,10 @@ public abstract class PrefsProvider { return (T) ALL.stream().filter(prefsProvider -> prefsProvider.getClass().equals(c)).findAny().orElseThrow(); } + protected > T editable(T o, ObservableBooleanValue v) { + o.editableProperty().bind(v); + return o; + } + public abstract void addPrefs(PrefsHandler handler); } diff --git a/extension/src/main/java/io/xpipe/extension/util/ChainedValidator.java b/extension/src/main/java/io/xpipe/extension/util/ChainedValidator.java index 318c6d83..39a55820 100644 --- a/extension/src/main/java/io/xpipe/extension/util/ChainedValidator.java +++ b/extension/src/main/java/io/xpipe/extension/util/ChainedValidator.java @@ -104,6 +104,7 @@ public class ChainedValidator implements Validator { .map(v -> v.createStringBinding(prefix, separator).get()) .collect(Collectors.joining("\n")); }, - observables); + observables + ); } } diff --git a/extension/src/main/java/io/xpipe/extension/util/CustomComboBoxBuilder.java b/extension/src/main/java/io/xpipe/extension/util/CustomComboBoxBuilder.java index 1887c00d..1a6f2914 100644 --- a/extension/src/main/java/io/xpipe/extension/util/CustomComboBoxBuilder.java +++ b/extension/src/main/java/io/xpipe/extension/util/CustomComboBoxBuilder.java @@ -37,7 +37,8 @@ public class CustomComboBoxBuilder { private Node filterNode; public CustomComboBoxBuilder( - Property selected, Function nodeFunction, Node emptyNode, Predicate veto) { + Property selected, Function nodeFunction, Node emptyNode, Predicate veto + ) { this.selected = selected; this.nodeFunction = nodeFunction; this.emptyNode = emptyNode; @@ -122,9 +123,9 @@ public class CustomComboBoxBuilder { var filteredNodes = nodes.stream() .filter(e -> e.equals(cb.getValue()) || !(nodeMap.get(e) != null - && (filterable.contains(nodeMap.get(e)) - && filterString.getValue() != null - && !filterPredicate.test(nodeMap.get(e), c)))) + && (filterable.contains(nodeMap.get(e)) + && filterString.getValue() != null + && !filterPredicate.test(nodeMap.get(e), c)))) .toList(); cb.setItems(FXCollections.observableList(filteredNodes)); }); diff --git a/extension/src/main/java/io/xpipe/extension/util/DataStoreFormatter.java b/extension/src/main/java/io/xpipe/extension/util/DataStoreFormatter.java index 9f9de2d5..87919a1c 100644 --- a/extension/src/main/java/io/xpipe/extension/util/DataStoreFormatter.java +++ b/extension/src/main/java/io/xpipe/extension/util/DataStoreFormatter.java @@ -92,7 +92,8 @@ public class DataStoreFormatter { var lengthShare = (length - 3) / 2; return String.format( "%s.%s", - DataStoreFormatter.cut(name, lengthShare), DataStoreFormatter.cut(region, length - lengthShare)); + DataStoreFormatter.cut(name, lengthShare), DataStoreFormatter.cut(region, length - lengthShare) + ); } return cut(input, length); diff --git a/extension/src/main/java/io/xpipe/extension/util/DynamicOptionsBuilder.java b/extension/src/main/java/io/xpipe/extension/util/DynamicOptionsBuilder.java index 9ed0ac6f..94bab447 100644 --- a/extension/src/main/java/io/xpipe/extension/util/DynamicOptionsBuilder.java +++ b/extension/src/main/java/io/xpipe/extension/util/DynamicOptionsBuilder.java @@ -76,7 +76,8 @@ public class DynamicOptionsBuilder { } public DynamicOptionsBuilder addCharacter( - Property prop, ObservableValue name, Map> names) { + Property prop, ObservableValue name, Map> names + ) { var comp = new CharChoiceComp(prop, names, null); entries.add(new DynamicOptionsComp.Entry(null, name, comp)); props.add(prop); @@ -87,23 +88,28 @@ public class DynamicOptionsBuilder { Property prop, ObservableValue name, Map> names, - ObservableValue customName) { + ObservableValue customName + ) { var comp = new CharChoiceComp(prop, names, customName); entries.add(new DynamicOptionsComp.Entry(null, name, comp)); props.add(prop); return this; } - public DynamicOptionsBuilder addToggle(String nameKey, - Property prop) { - var comp = new ToggleGroupComp<>(prop, new SimpleObjectProperty<>(Map.of(Boolean.TRUE, I18n.observable("extension.yes"), Boolean.FALSE, I18n.observable("extension.no")))); + public DynamicOptionsBuilder addToggle( + String nameKey, + Property prop + ) { + var comp = new ToggleGroupComp<>(prop, new SimpleObjectProperty<>( + Map.of(Boolean.TRUE, I18n.observable("extension.yes"), Boolean.FALSE, I18n.observable("extension.no")))); entries.add(new DynamicOptionsComp.Entry(nameKey, I18n.observable(nameKey), comp)); props.add(prop); return this; } public DynamicOptionsBuilder addToggle( - Property prop, ObservableValue name, Map> names) { + Property prop, ObservableValue name, Map> names + ) { var comp = new ToggleGroupComp<>(prop, new SimpleObjectProperty<>(names)); entries.add(new DynamicOptionsComp.Entry(null, name, comp)); props.add(prop); @@ -180,13 +186,17 @@ public class DynamicOptionsBuilder { public DynamicOptionsBuilder addComp(String nameKey, Comp comp, Property prop) { entries.add(new DynamicOptionsComp.Entry(nameKey, I18n.observable(nameKey), comp)); - if (prop != null) props.add(prop); + if (prop != null) { + props.add(prop); + } return this; } public DynamicOptionsBuilder addComp(ObservableValue name, Comp comp, Property prop) { entries.add(new DynamicOptionsComp.Entry(null, name, comp)); - if (prop != null) props.add(prop); + if (prop != null) { + props.add(prop); + } return this; } @@ -231,7 +241,8 @@ public class DynamicOptionsBuilder { } public final DynamicOptionsBuilder bindChoice( - Supplier> creator, Property toSet) { + Supplier> creator, Property toSet + ) { props.forEach(prop -> { prop.addListener((c, o, n) -> { toSet.unbind(); @@ -247,7 +258,8 @@ public class DynamicOptionsBuilder { entries.add( 0, new DynamicOptionsComp.Entry( - null, null, Comp.of(() -> new Label(title.getValue())).styleClass("title-header"))); + null, null, Comp.of(() -> new Label(title.getValue())).styleClass("title-header")) + ); } return new DynamicOptionsComp(entries, wrap); } diff --git a/extension/src/main/java/io/xpipe/extension/util/ExclusiveValidator.java b/extension/src/main/java/io/xpipe/extension/util/ExclusiveValidator.java index ebe08759..d06d8fe3 100644 --- a/extension/src/main/java/io/xpipe/extension/util/ExclusiveValidator.java +++ b/extension/src/main/java/io/xpipe/extension/util/ExclusiveValidator.java @@ -81,6 +81,7 @@ public final class ExclusiveValidator implements Validator { () -> { return get().createStringBinding(prefix, separator).get(); }, - observables); + observables + ); } } diff --git a/extension/src/main/java/io/xpipe/extension/util/ExecScriptHelper.java b/extension/src/main/java/io/xpipe/extension/util/ExecScriptHelper.java index 3f6ae46f..2cdd6e1d 100644 --- a/extension/src/main/java/io/xpipe/extension/util/ExecScriptHelper.java +++ b/extension/src/main/java/io/xpipe/extension/util/ExecScriptHelper.java @@ -20,6 +20,7 @@ public class ExecScriptHelper { return createExecScript(l, content); } } + @SneakyThrows public static String createExecScript(ShellProcessControl processControl, String content) { var fileName = "exec-" + getConnectionHash(content); @@ -35,7 +36,8 @@ public class ExecScriptHelper { try (var c = processControl.command(processControl.getShellType() .joinCommands( processControl.getShellType().createFileWriteCommand(file), - processControl.getShellType().getMakeExecutableCommand(file))) + processControl.getShellType().getMakeExecutableCommand(file) + )) .start()) { c.discardOut(); c.discardErr(); diff --git a/extension/src/main/java/io/xpipe/extension/util/PrettyListView.java b/extension/src/main/java/io/xpipe/extension/util/PrettyListView.java index cc4dc3cb..4e4b0ce2 100644 --- a/extension/src/main/java/io/xpipe/extension/util/PrettyListView.java +++ b/extension/src/main/java/io/xpipe/extension/util/PrettyListView.java @@ -15,6 +15,7 @@ public class PrettyListView extends ListView { private final ScrollBar vBar = new ScrollBar(); private final ScrollBar hBar = new ScrollBar(); + public PrettyListView() { super(); skinProperty().addListener(it -> { @@ -78,14 +79,16 @@ public class PrettyListView extends ListView { w - prefWidth - insets.getRight(), insets.getTop(), prefWidth, - h - insets.getTop() - insets.getBottom()); + h - insets.getTop() - insets.getBottom() + ); final double prefHeight = hBar.prefHeight(-1); hBar.resizeRelocate( insets.getLeft(), h - prefHeight - insets.getBottom(), w - insets.getLeft() - insets.getRight(), - prefHeight); + prefHeight + ); } public static class NoSelectionModel extends MultipleSelectionModel { @@ -101,31 +104,40 @@ public class PrettyListView extends ListView { } @Override - public void selectIndices(int index, int... indices) {} + public void selectIndices(int index, int... indices) { + } @Override - public void selectAll() {} + public void selectAll() { + } @Override - public void selectFirst() {} + public void selectFirst() { + } @Override - public void selectLast() {} + public void selectLast() { + } @Override - public void clearAndSelect(int index) {} + public void clearAndSelect(int index) { + } @Override - public void select(int index) {} + public void select(int index) { + } @Override - public void select(T obj) {} + public void select(T obj) { + } @Override - public void clearSelection(int index) {} + public void clearSelection(int index) { + } @Override - public void clearSelection() {} + public void clearSelection() { + } @Override public boolean isSelected(int index) { @@ -138,9 +150,11 @@ public class PrettyListView extends ListView { } @Override - public void selectPrevious() {} + public void selectPrevious() { + } @Override - public void selectNext() {} + public void selectNext() { + } } } \ No newline at end of file diff --git a/extension/src/main/java/io/xpipe/extension/util/SimpleValidator.java b/extension/src/main/java/io/xpipe/extension/util/SimpleValidator.java index fc9230dc..19f62868 100644 --- a/extension/src/main/java/io/xpipe/extension/util/SimpleValidator.java +++ b/extension/src/main/java/io/xpipe/extension/util/SimpleValidator.java @@ -22,7 +22,9 @@ public class SimpleValidator implements Validator { new ReadOnlyObjectWrapper<>(new ValidationResult()); private final ReadOnlyBooleanWrapper containsErrorsProperty = new ReadOnlyBooleanWrapper(); - /** Create a check that lives within this checker's domain. + /** + * Create a check that lives within this checker's domain. + * * @return A check object whose dependsOn, decorates, etc. methods can be called */ public Check createCheck() { @@ -31,7 +33,9 @@ public class SimpleValidator implements Validator { return check; } - /** Add another check to the checker. Changes in the check's validationResultProperty will be reflected in the checker. + /** + * Add another check to the checker. Changes in the check's validationResultProperty will be reflected in the checker. + * * @param check The check to add. */ public void add(Check check) { @@ -40,7 +44,9 @@ public class SimpleValidator implements Validator { check.validationResultProperty().addListener(listener); } - /** Removes a check from this validator. + /** + * Removes a check from this validator. + * * @param check The check to remove from this validator. */ public void remove(Check check) { @@ -51,21 +57,27 @@ public class SimpleValidator implements Validator { refreshProperties(); } - /** Retrieves current validation result + /** + * Retrieves current validation result + * * @return validation result */ public ValidationResult getValidationResult() { return validationResultProperty.get(); } - /** Can be used to track validation result changes + /** + * Can be used to track validation result changes + * * @return The Validation result property. */ public ReadOnlyObjectProperty validationResultProperty() { return validationResultProperty.getReadOnlyProperty(); } - /** A read-only boolean property indicating whether any of the checks of this validator emitted an error. */ + /** + * A read-only boolean property indicating whether any of the checks of this validator emitted an error. + */ public ReadOnlyBooleanProperty containsErrorsProperty() { return containsErrorsProperty.getReadOnlyProperty(); } @@ -74,7 +86,9 @@ public class SimpleValidator implements Validator { return containsErrorsProperty().get(); } - /** Run all checks (decorating nodes if appropriate) + /** + * Run all checks (decorating nodes if appropriate) + * * @return true if no errors were found, false otherwise */ public boolean validate() { @@ -97,7 +111,8 @@ public class SimpleValidator implements Validator { containsErrorsProperty.set(hasErrors); } - /** Create a string property that depends on the validation result. + /** + * Create a string property that depends on the validation result. * Each error message will be displayed on a separate line prefixed with a bullet. */ public StringBinding createStringBinding() { @@ -117,6 +132,7 @@ public class SimpleValidator implements Validator { } return str.toString(); }, - validationResultProperty); + validationResultProperty + ); } } diff --git a/extension/src/main/java/io/xpipe/extension/util/WindowsRegistry.java b/extension/src/main/java/io/xpipe/extension/util/WindowsRegistry.java index cdcfe8a1..069b846f 100644 --- a/extension/src/main/java/io/xpipe/extension/util/WindowsRegistry.java +++ b/extension/src/main/java/io/xpipe/extension/util/WindowsRegistry.java @@ -11,7 +11,7 @@ public class WindowsRegistry { public static final int HKEY_LOCAL_MACHINE = 0x80000002; public static Optional readString(int hkey, String key) { - return readString(hkey,key, null); + return readString(hkey, key, null); } public static Optional readString(int hkey, String key, String valueName) { diff --git a/extension/src/main/java/io/xpipe/extension/util/XPipeDaemon.java b/extension/src/main/java/io/xpipe/extension/util/XPipeDaemon.java index 9fce634a..c84f92ad 100644 --- a/extension/src/main/java/io/xpipe/extension/util/XPipeDaemon.java +++ b/extension/src/main/java/io/xpipe/extension/util/XPipeDaemon.java @@ -29,6 +29,7 @@ public interface XPipeDaemon { } void withResource(String module, String file, Charsetter.FailableConsumer con); + List getNamedStores(); String getVersion(); @@ -41,20 +42,24 @@ public interface XPipeDaemon { Property storeProperty, Property> provider, boolean showAnonymous, - boolean showSaved); + boolean showSaved + ); & Validatable> T namedStoreChooser( ObservableValue> filter, Property selected, - DataStoreProvider.Category category); + DataStoreProvider.Category category + ); & Validatable> T namedSourceChooser( ObservableValue>> filter, Property> selected, - DataSourceProvider.Category category); + DataSourceProvider.Category category + ); & Validatable> T sourceProviderChooser( - Property> provider, DataSourceProvider.Category category, DataSourceType filter); + Property> provider, DataSourceProvider.Category category, DataSourceType filter + ); Optional getNamedStore(String name);