From 6408390535fac2cf782618ca4567c3cdad7abf24 Mon Sep 17 00:00:00 2001 From: crschnick Date: Wed, 1 May 2024 17:16:19 +0000 Subject: [PATCH] Reformat --- .../app/browser/BrowserBookmarkComp.java | 3 +- .../xpipe/app/browser/BrowserWelcomeComp.java | 5 +- .../xpipe/app/browser/action/LeafAction.java | 5 +- .../file/BrowserQuickAccessContextMenu.java | 2 + .../app/browser/fs/OpenFileSystemModel.java | 5 +- .../xpipe/app/comp/base/StoreToggleComp.java | 32 ++++++++---- .../app/comp/store/StoreCreationMenu.java | 6 ++- .../xpipe/app/comp/store/StoreEntryComp.java | 6 +-- .../xpipe/app/core/AppExtensionManager.java | 19 ++++--- .../java/io/xpipe/app/core/AppProperties.java | 4 +- .../io/xpipe/app/core/mode/OperationMode.java | 4 +- .../app/fxcomps/impl/SecretFieldComp.java | 12 +++-- .../xpipe/app/issue/TerminalErrorHandler.java | 2 +- .../io/xpipe/app/issue/UserReportComp.java | 6 ++- .../java/io/xpipe/app/prefs/AppPrefs.java | 31 +++++------ .../app/prefs/ExternalApplicationType.java | 4 +- .../app/prefs/ExternalRdpClientType.java | 6 +-- .../io/xpipe/app/storage/DataStorage.java | 17 ++++--- .../io/xpipe/app/storage/DataStoreEntry.java | 13 ++--- .../app/terminal/ExternalTerminalType.java | 9 ++-- .../xpipe/app/terminal/KittyTerminalType.java | 3 +- .../xpipe/app/terminal/TabbyTerminalType.java | 32 ++++++------ .../xpipe/app/terminal/WezTerminalType.java | 7 ++- .../io/xpipe/app/util/ClipboardHelper.java | 14 +++-- .../io/xpipe/app/util/DataStoreFormatter.java | 4 +- .../java/io/xpipe/app/util/DesktopHelper.java | 51 +++++++++---------- .../io/xpipe/app/util/TerminalLauncher.java | 2 +- .../io/xpipe/app/util/WindowsRegistry.java | 8 +-- .../core/store/SingletonSessionStore.java | 3 +- .../xpipe/core/store/StatefulDataStore.java | 3 +- .../io/xpipe/core/util/CoreJacksonModule.java | 2 +- .../ext/base/action/BrowseStoreAction.java | 6 ++- .../xpipe/ext/base/action/LaunchAction.java | 10 ++-- .../io/xpipe/ext/base/action/ScanAction.java | 6 ++- .../browser/BrowseInNativeManagerAction.java | 4 +- .../ext/base/browser/MultiExecuteAction.java | 1 + .../desktop/DesktopCommandStoreProvider.java | 3 +- .../base/desktop/DesktopEnvironmentStore.java | 6 +-- .../DesktopEnvironmentStoreProvider.java | 4 +- .../base/script/ScriptGroupStoreProvider.java | 22 ++++---- .../script/SimpleScriptStoreProvider.java | 29 ++++++----- 41 files changed, 248 insertions(+), 163 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserBookmarkComp.java b/app/src/main/java/io/xpipe/app/browser/BrowserBookmarkComp.java index 0686523cf..bcd905d08 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserBookmarkComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserBookmarkComp.java @@ -86,8 +86,7 @@ public final class BrowserBookmarkComp extends SimpleComp { selectedCategory) .styleClass(Styles.LEFT_PILL) .minWidth(Region.USE_PREF_SIZE); - var filter = - new FilterComp(filterText).hgrow(); + var filter = new FilterComp(filterText).hgrow(); var top = new HorizontalComp(List.of(category, filter)) .styleClass("categories") diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserWelcomeComp.java b/app/src/main/java/io/xpipe/app/browser/BrowserWelcomeComp.java index cfc974313..6e4cbf724 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserWelcomeComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserWelcomeComp.java @@ -1,6 +1,5 @@ package io.xpipe.app.browser; -import atlantafx.base.theme.Styles; import io.xpipe.app.browser.session.BrowserSessionModel; import io.xpipe.app.comp.base.ButtonComp; import io.xpipe.app.comp.base.ListBoxViewComp; @@ -32,6 +31,7 @@ import javafx.scene.layout.Region; import javafx.scene.layout.VBox; import atlantafx.base.controls.Spacer; +import atlantafx.base.theme.Styles; import java.util.List; @@ -139,7 +139,8 @@ public class BrowserWelcomeComp extends SimpleComp { private Comp entryButton(BrowserSavedState.Entry e, BooleanProperty disable) { var entry = DataStorage.get().getStoreEntryIfPresent(e.getUuid()); - var graphic = entry.get().getProvider().getDisplayIconFileName(entry.get().getStore()); + var graphic = + entry.get().getProvider().getDisplayIconFileName(entry.get().getStore()); var view = PrettyImageHelper.ofFixedSize(graphic, 30, 24); return new ButtonComp( new SimpleStringProperty(DataStorage.get().getStoreDisplayName(entry.get())), diff --git a/app/src/main/java/io/xpipe/app/browser/action/LeafAction.java b/app/src/main/java/io/xpipe/app/browser/action/LeafAction.java index 558f47a76..8e75b43d2 100644 --- a/app/src/main/java/io/xpipe/app/browser/action/LeafAction.java +++ b/app/src/main/java/io/xpipe/app/browser/action/LeafAction.java @@ -8,8 +8,10 @@ import io.xpipe.app.fxcomps.util.Shortcuts; import io.xpipe.app.util.BooleanScope; import io.xpipe.app.util.LicenseProvider; import io.xpipe.app.util.ThreadHelper; + import javafx.scene.control.Button; import javafx.scene.control.MenuItem; + import org.kordamp.ikonli.javafx.FontIcon; import java.util.List; @@ -91,7 +93,8 @@ public interface LeafAction extends BrowserAction { mi.setMnemonicParsing(false); mi.setDisable(!isActive(model, selected)); - if (getProFeatureId() != null && !LicenseProvider.get().getFeature(getProFeatureId()).isSupported()) { + if (getProFeatureId() != null + && !LicenseProvider.get().getFeature(getProFeatureId()).isSupported()) { mi.setDisable(true); } diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserQuickAccessContextMenu.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserQuickAccessContextMenu.java index efa50e98a..fd5336534 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserQuickAccessContextMenu.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserQuickAccessContextMenu.java @@ -8,6 +8,7 @@ import io.xpipe.app.util.InputHelper; import io.xpipe.app.util.ThreadHelper; import io.xpipe.core.store.FileKind; import io.xpipe.core.store.FileSystem; + import javafx.application.Platform; import javafx.beans.property.SimpleBooleanProperty; import javafx.geometry.Side; @@ -19,6 +20,7 @@ import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; import javafx.scene.input.MouseEvent; import javafx.scene.layout.Region; + import lombok.Getter; import java.util.ArrayList; diff --git a/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemModel.java b/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemModel.java index 2a5fdcf2e..878136f41 100644 --- a/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemModel.java +++ b/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemModel.java @@ -22,8 +22,10 @@ import io.xpipe.core.process.ShellDialects; import io.xpipe.core.process.ShellOpenFunction; import io.xpipe.core.store.*; import io.xpipe.core.util.FailableConsumer; + import javafx.beans.binding.Bindings; import javafx.beans.property.*; + import lombok.Getter; import lombok.SneakyThrows; @@ -297,7 +299,8 @@ public final class OpenFileSystemModel extends BrowserSessionTab, Exception> consumer) throws Exception { + public void withFiles(String dir, FailableConsumer, Exception> consumer) + throws Exception { BooleanScope.executeExclusive(busy, () -> { if (dir != null) { startIfNeeded(); diff --git a/app/src/main/java/io/xpipe/app/comp/base/StoreToggleComp.java b/app/src/main/java/io/xpipe/app/comp/base/StoreToggleComp.java index d9c083825..58e2430aa 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/StoreToggleComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/StoreToggleComp.java @@ -6,11 +6,13 @@ import io.xpipe.app.fxcomps.SimpleComp; import io.xpipe.app.storage.DataStoreEntry; import io.xpipe.app.util.ThreadHelper; import io.xpipe.core.store.DataStore; + import javafx.beans.binding.Bindings; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.value.ObservableBooleanValue; import javafx.scene.layout.Region; + import lombok.AllArgsConstructor; import lombok.Setter; @@ -29,17 +31,29 @@ public class StoreToggleComp extends SimpleComp { @Setter private ObservableBooleanValue customVisibility = new SimpleBooleanProperty(true); - public static StoreToggleComp simpleToggle(String nameKey, StoreSection section, Function initial, BiConsumer setter) { - return new StoreToggleComp(nameKey, section,new SimpleBooleanProperty(initial.apply(section.getWrapper().getEntry().getStore().asNeeded())),v -> { - setter.accept(section.getWrapper().getEntry().getStore().asNeeded(),v); - }); + public static StoreToggleComp simpleToggle( + String nameKey, StoreSection section, Function initial, BiConsumer setter) { + return new StoreToggleComp( + nameKey, + section, + new SimpleBooleanProperty( + initial.apply(section.getWrapper().getEntry().getStore().asNeeded())), + v -> { + setter.accept(section.getWrapper().getEntry().getStore().asNeeded(), v); + }); } - public static StoreToggleComp childrenToggle(String nameKey, StoreSection section, Function initial, BiConsumer setter) { - return new StoreToggleComp(nameKey, section,new SimpleBooleanProperty(initial.apply(section.getWrapper().getEntry().getStore().asNeeded())),v -> { - setter.accept(section.getWrapper().getEntry().getStore().asNeeded(),v); - section.getWrapper().refreshChildren(); - }); + public static StoreToggleComp childrenToggle( + String nameKey, StoreSection section, Function initial, BiConsumer setter) { + return new StoreToggleComp( + nameKey, + section, + new SimpleBooleanProperty( + initial.apply(section.getWrapper().getEntry().getStore().asNeeded())), + v -> { + setter.accept(section.getWrapper().getEntry().getStore().asNeeded(), v); + section.getWrapper().refreshChildren(); + }); } public StoreToggleComp(String nameKey, StoreSection section, boolean initial, Consumer onChange) { diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreCreationMenu.java b/app/src/main/java/io/xpipe/app/comp/store/StoreCreationMenu.java index 5af19466a..cdcb3dc25 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreCreationMenu.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreCreationMenu.java @@ -5,10 +5,12 @@ import io.xpipe.app.ext.DataStoreProvider; import io.xpipe.app.ext.DataStoreProviders; import io.xpipe.app.fxcomps.impl.PrettyImageHelper; import io.xpipe.app.util.ScanAlert; + import javafx.scene.control.Menu; import javafx.scene.control.MenuButton; import javafx.scene.control.MenuItem; import javafx.scene.control.SeparatorMenuItem; + import org.kordamp.ikonli.javafx.FontIcon; public class StoreCreationMenu { @@ -83,7 +85,9 @@ public class StoreCreationMenu { category); event.consume(); }); - var providers = sub.stream().sorted((o1, o2) -> -o1.getModuleName().compareTo(o2.getModuleName())).toList(); + var providers = sub.stream() + .sorted((o1, o2) -> -o1.getModuleName().compareTo(o2.getModuleName())) + .toList(); for (int i = 0; i < providers.size(); i++) { var dataStoreProvider = providers.get(i); if (i > 0 && !providers.get(i - 1).getModuleName().equals(dataStoreProvider.getModuleName())) { diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java b/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java index 36d2693b2..abb64a973 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java @@ -116,9 +116,9 @@ public abstract class StoreEntryComp extends SimpleComp { var loading = LoadingOverlayComp.noProgress( Comp.of(() -> button), - wrapper.getEntry().getValidity().isUsable() ? - wrapper.getBusy().or(wrapper.getEntry().getProvider().busy(wrapper)): - wrapper.getBusy()); + wrapper.getEntry().getValidity().isUsable() + ? wrapper.getBusy().or(wrapper.getEntry().getProvider().busy(wrapper)) + : wrapper.getBusy()); return loading.createRegion(); } diff --git a/app/src/main/java/io/xpipe/app/core/AppExtensionManager.java b/app/src/main/java/io/xpipe/app/core/AppExtensionManager.java index e338e998b..81f486949 100644 --- a/app/src/main/java/io/xpipe/app/core/AppExtensionManager.java +++ b/app/src/main/java/io/xpipe/app/core/AppExtensionManager.java @@ -8,6 +8,7 @@ import io.xpipe.core.process.ProcessControlProvider; import io.xpipe.core.util.ModuleHelper; import io.xpipe.core.util.ModuleLayerLoader; import io.xpipe.core.util.XPipeInstallation; + import lombok.Getter; import lombok.Value; @@ -95,12 +96,16 @@ public class AppExtensionManager { } var iv = getLocalInstallVersion(); - var installVersion = AppVersion.parse(iv).orElseThrow(() -> new IllegalArgumentException("Invalid installation version: " + iv)); - var sv = !AppProperties.get().isImage() ? Files.readString(Path.of("version")).trim() : AppProperties.get().getVersion(); - var sourceVersion = AppVersion.parse(sv).orElseThrow(() -> new IllegalArgumentException("Invalid source version: " + sv)); + var installVersion = AppVersion.parse(iv) + .orElseThrow(() -> new IllegalArgumentException("Invalid installation version: " + iv)); + var sv = !AppProperties.get().isImage() + ? Files.readString(Path.of("version")).trim() + : AppProperties.get().getVersion(); + var sourceVersion = AppVersion.parse(sv) + .orElseThrow(() -> new IllegalArgumentException("Invalid source version: " + sv)); if (!installVersion.equals(sourceVersion)) { - throw new IllegalStateException( - "Incompatible development version. Source: " + iv + ", Installation: " + sv + "\n\nPlease try to check out the matching release version in the repository."); + throw new IllegalStateException("Incompatible development version. Source: " + iv + ", Installation: " + + sv + "\n\nPlease try to check out the matching release version in the repository."); } var extensions = XPipeInstallation.getLocalExtensionsDirectory(p); @@ -171,8 +176,8 @@ public class AppExtensionManager { if (loadedExtensions.stream().anyMatch(extension -> dir.equals(extension.dir)) || loadedExtensions.stream() - .anyMatch(extension -> - extension.id.equals(dir.getFileName().toString()))) { + .anyMatch(extension -> + extension.id.equals(dir.getFileName().toString()))) { return Optional.empty(); } diff --git a/app/src/main/java/io/xpipe/app/core/AppProperties.java b/app/src/main/java/io/xpipe/app/core/AppProperties.java index 2b2709837..0d69d5342 100644 --- a/app/src/main/java/io/xpipe/app/core/AppProperties.java +++ b/app/src/main/java/io/xpipe/app/core/AppProperties.java @@ -55,7 +55,9 @@ public class AppProperties { .orElse(UUID.randomUUID()); sentryUrl = System.getProperty("io.xpipe.app.sentryUrl"); arch = System.getProperty("io.xpipe.app.arch"); - languages = Arrays.stream(System.getProperty("io.xpipe.app.languages").split(";")).sorted().toList(); + languages = Arrays.stream(System.getProperty("io.xpipe.app.languages").split(";")) + .sorted() + .toList(); staging = XPipeInstallation.isStaging(); useVirtualThreads = Optional.ofNullable(System.getProperty("io.xpipe.app.useVirtualThreads")) .map(Boolean::parseBoolean) diff --git a/app/src/main/java/io/xpipe/app/core/mode/OperationMode.java b/app/src/main/java/io/xpipe/app/core/mode/OperationMode.java index 44d0308fa..38e737981 100644 --- a/app/src/main/java/io/xpipe/app/core/mode/OperationMode.java +++ b/app/src/main/java/io/xpipe/app/core/mode/OperationMode.java @@ -19,10 +19,11 @@ import io.xpipe.core.process.OsType; import io.xpipe.core.util.FailableRunnable; import io.xpipe.core.util.XPipeDaemonMode; import io.xpipe.core.util.XPipeInstallation; + import javafx.application.Platform; + import lombok.Getter; -import javax.imageio.ImageIO; import java.awt.*; import java.awt.desktop.AppReopenedEvent; import java.awt.desktop.AppReopenedListener; @@ -30,6 +31,7 @@ import java.awt.desktop.SystemEventListener; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; +import javax.imageio.ImageIO; public abstract class OperationMode { diff --git a/app/src/main/java/io/xpipe/app/fxcomps/impl/SecretFieldComp.java b/app/src/main/java/io/xpipe/app/fxcomps/impl/SecretFieldComp.java index d25758f76..7166f6737 100644 --- a/app/src/main/java/io/xpipe/app/fxcomps/impl/SecretFieldComp.java +++ b/app/src/main/java/io/xpipe/app/fxcomps/impl/SecretFieldComp.java @@ -1,18 +1,20 @@ package io.xpipe.app.fxcomps.impl; -import atlantafx.base.layout.InputGroup; import io.xpipe.app.comp.base.ButtonComp; import io.xpipe.app.fxcomps.Comp; import io.xpipe.app.fxcomps.CompStructure; import io.xpipe.app.fxcomps.util.PlatformThread; import io.xpipe.app.util.ClipboardHelper; import io.xpipe.core.util.InPlaceSecretValue; + import javafx.beans.property.Property; import javafx.beans.property.SimpleObjectProperty; import javafx.scene.control.PasswordField; import javafx.scene.control.TextField; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; + +import atlantafx.base.layout.InputGroup; import lombok.AllArgsConstructor; import lombok.Getter; import org.kordamp.ikonli.javafx.FontIcon; @@ -27,6 +29,7 @@ public class SecretFieldComp extends Comp { public static class Structure implements CompStructure { private final InputGroup inputGroup; + @Getter private final TextField field; @@ -85,8 +88,11 @@ public class SecretFieldComp extends Comp { HBox.setHgrow(text, Priority.ALWAYS); var copyButton = new ButtonComp(null, new FontIcon("mdi2c-clipboard-multiple-outline"), () -> { - ClipboardHelper.copyPassword(value.getValue()); - }).grow(false, true).tooltipKey("copyPassword").createRegion(); + ClipboardHelper.copyPassword(value.getValue()); + }) + .grow(false, true) + .tooltipKey("copyPassword") + .createRegion(); var ig = new InputGroup(text); ig.getStyleClass().add("secret-field-comp"); diff --git a/app/src/main/java/io/xpipe/app/issue/TerminalErrorHandler.java b/app/src/main/java/io/xpipe/app/issue/TerminalErrorHandler.java index 0fc67d1d5..c01fbe62c 100644 --- a/app/src/main/java/io/xpipe/app/issue/TerminalErrorHandler.java +++ b/app/src/main/java/io/xpipe/app/issue/TerminalErrorHandler.java @@ -4,8 +4,8 @@ import io.xpipe.app.core.*; import io.xpipe.app.core.mode.OperationMode; import io.xpipe.app.update.XPipeDistributionType; import io.xpipe.app.util.Hyperlinks; - import io.xpipe.app.util.ThreadHelper; + import javafx.scene.control.Alert; import javafx.scene.control.ButtonBar; import javafx.scene.control.ButtonType; diff --git a/app/src/main/java/io/xpipe/app/issue/UserReportComp.java b/app/src/main/java/io/xpipe/app/issue/UserReportComp.java index 8f4ba3f32..693cd02a9 100644 --- a/app/src/main/java/io/xpipe/app/issue/UserReportComp.java +++ b/app/src/main/java/io/xpipe/app/issue/UserReportComp.java @@ -1,7 +1,5 @@ package io.xpipe.app.issue; -import atlantafx.base.controls.Popover; -import atlantafx.base.controls.Spacer; import io.xpipe.app.comp.base.ButtonComp; import io.xpipe.app.comp.base.ListSelectorComp; import io.xpipe.app.comp.base.MarkdownComp; @@ -9,6 +7,7 @@ import io.xpipe.app.comp.base.TitledPaneComp; import io.xpipe.app.core.*; import io.xpipe.app.fxcomps.Comp; import io.xpipe.app.fxcomps.SimpleComp; + import javafx.beans.property.ListProperty; import javafx.beans.property.SimpleListProperty; import javafx.beans.property.SimpleStringProperty; @@ -23,6 +22,9 @@ import javafx.scene.control.TextField; import javafx.scene.layout.*; import javafx.stage.Stage; +import atlantafx.base.controls.Popover; +import atlantafx.base.controls.Spacer; + import java.nio.file.Files; import java.nio.file.Path; diff --git a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java index 0fc60d051..de2e3827a 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java @@ -139,21 +139,22 @@ public class AppPrefs { private AppPrefs() { this.categories = Stream.of( - new AboutCategory(), - new SystemCategory(), - new AppearanceCategory(), - new SyncCategory(), - new VaultCategory(), - new PasswordManagerCategory(), - new TerminalCategory(), - new EditorCategory(), - new RdpCategory(), - new SshCategory(), - new LocalShellCategory(), - new SecurityCategory(), - new TroubleshootCategory(), - new DeveloperCategory()) - .filter(appPrefsCategory -> appPrefsCategory.show()).toList(); + new AboutCategory(), + new SystemCategory(), + new AppearanceCategory(), + new SyncCategory(), + new VaultCategory(), + new PasswordManagerCategory(), + new TerminalCategory(), + new EditorCategory(), + new RdpCategory(), + new SshCategory(), + new LocalShellCategory(), + new SecurityCategory(), + new TroubleshootCategory(), + new DeveloperCategory()) + .filter(appPrefsCategory -> appPrefsCategory.show()) + .toList(); var selected = AppCache.get("selectedPrefsCategory", Integer.class, () -> 0); if (selected == null) { selected = 0; diff --git a/app/src/main/java/io/xpipe/app/prefs/ExternalApplicationType.java b/app/src/main/java/io/xpipe/app/prefs/ExternalApplicationType.java index 87de1c5dc..58ebf9b10 100644 --- a/app/src/main/java/io/xpipe/app/prefs/ExternalApplicationType.java +++ b/app/src/main/java/io/xpipe/app/prefs/ExternalApplicationType.java @@ -46,7 +46,9 @@ public abstract class ExternalApplicationType implements PrefsChoiceValue { public boolean isAvailable() { try (ShellControl pc = LocalShell.getShell().start()) { return pc.command(String.format( - "mdfind -name '%s' -onlyin /Applications -onlyin ~/Applications -onlyin /System/Applications", applicationName)).executeAndCheck(); + "mdfind -name '%s' -onlyin /Applications -onlyin ~/Applications -onlyin /System/Applications", + applicationName)) + .executeAndCheck(); } catch (Exception e) { ErrorEvent.fromThrowable(e).handle(); return false; diff --git a/app/src/main/java/io/xpipe/app/prefs/ExternalRdpClientType.java b/app/src/main/java/io/xpipe/app/prefs/ExternalRdpClientType.java index 9f81fba6c..1abd10f64 100644 --- a/app/src/main/java/io/xpipe/app/prefs/ExternalRdpClientType.java +++ b/app/src/main/java/io/xpipe/app/prefs/ExternalRdpClientType.java @@ -5,8 +5,8 @@ import io.xpipe.app.issue.ErrorEvent; import io.xpipe.app.util.*; import io.xpipe.core.process.CommandBuilder; import io.xpipe.core.process.OsType; - import io.xpipe.core.util.SecretValue; + import lombok.Value; import java.nio.file.Files; @@ -59,8 +59,8 @@ public interface ExternalRdpClientType extends PrefsChoiceValue { private String encrypt(SecretValue password) throws Exception { var ps = LocalShell.getLocalPowershell(); - var cmd = ps.command( - "(\"" + password.getSecretValue() + "\" | ConvertTo-SecureString -AsPlainText -Force) | ConvertFrom-SecureString;"); + var cmd = ps.command("(\"" + password.getSecretValue() + + "\" | ConvertTo-SecureString -AsPlainText -Force) | ConvertFrom-SecureString;"); cmd.setSensitive(); return cmd.readStdoutOrThrow(); } diff --git a/app/src/main/java/io/xpipe/app/storage/DataStorage.java b/app/src/main/java/io/xpipe/app/storage/DataStorage.java index f64506e71..7f813ea78 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStorage.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStorage.java @@ -7,7 +7,9 @@ import io.xpipe.app.util.FixedHierarchyStore; import io.xpipe.app.util.ThreadHelper; import io.xpipe.core.store.*; import io.xpipe.core.util.UuidHelper; + import javafx.util.Pair; + import lombok.Getter; import lombok.NonNull; import lombok.Setter; @@ -311,8 +313,8 @@ public abstract class DataStorage { DataStoreCategory p = category; if (share) { while ((p = DataStorage.get() - .getStoreCategoryIfPresent(p.getParentCategory()) - .orElse(null)) + .getStoreCategoryIfPresent(p.getParentCategory()) + .orElse(null)) != null) { p.setShare(true); } @@ -428,7 +430,8 @@ public abstract class DataStorage { // Children classes might not be the same, the same goes for state classes // This can happen when there are multiple child classes and the ids got switched around if (classMatch) { - DataStore merged = ((FixedChildStore) pair.getKey().getStore()).merge(pair.getValue().getStore().asNeeded()); + DataStore merged = ((FixedChildStore) pair.getKey().getStore()) + .merge(pair.getValue().getStore().asNeeded()); if (merged != pair.getKey().getStore()) { pair.getKey().setStoreInternal(merged, false); } @@ -781,9 +784,11 @@ public abstract class DataStorage { public Optional getStoreEntryIfPresent(@NonNull DataStore store, boolean identityOnly) { return storeEntriesSet.stream() .filter(n -> n.getStore() == store - || (!identityOnly && (n.getStore() != null - && Objects.equals(store.getClass(), n.getStore().getClass()) - && store.equals(n.getStore())))) + || (!identityOnly + && (n.getStore() != null + && Objects.equals( + store.getClass(), n.getStore().getClass()) + && store.equals(n.getStore())))) .findFirst(); } diff --git a/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java b/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java index a1773558d..364edfb4b 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStoreEntry.java @@ -1,17 +1,18 @@ package io.xpipe.app.storage; +import io.xpipe.app.ext.DataStoreProvider; +import io.xpipe.app.ext.DataStoreProviders; +import io.xpipe.app.issue.ErrorEvent; +import io.xpipe.app.util.FixedHierarchyStore; +import io.xpipe.core.store.*; +import io.xpipe.core.util.JacksonMapper; + import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; -import io.xpipe.app.ext.DataStoreProvider; -import io.xpipe.app.ext.DataStoreProviders; -import io.xpipe.app.issue.ErrorEvent; -import io.xpipe.app.util.FixedHierarchyStore; -import io.xpipe.core.store.*; -import io.xpipe.core.util.JacksonMapper; import lombok.*; import lombok.experimental.NonFinal; import org.apache.commons.io.FileUtils; diff --git a/app/src/main/java/io/xpipe/app/terminal/ExternalTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/ExternalTerminalType.java index 206f68fdc..adac91eb5 100644 --- a/app/src/main/java/io/xpipe/app/terminal/ExternalTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/ExternalTerminalType.java @@ -166,7 +166,8 @@ public interface ExternalTerminalType extends PrefsChoiceValue { } @Override - public FailableFunction remoteLaunchCommand(ShellDialect systemDialect) { + public FailableFunction remoteLaunchCommand( + ShellDialect systemDialect) { return launchConfiguration -> { var toExecute = CommandBuilder.of() .add(executable, "-v", "--title") @@ -608,7 +609,8 @@ public interface ExternalTerminalType extends PrefsChoiceValue { } @Override - public FailableFunction remoteLaunchCommand(ShellDialect systemDialect) { + public FailableFunction remoteLaunchCommand( + ShellDialect systemDialect) { return launchConfiguration -> { var toExecute = CommandBuilder.of() .add("open", "-a") @@ -806,7 +808,8 @@ public interface ExternalTerminalType extends PrefsChoiceValue { } @Override - public FailableFunction remoteLaunchCommand(ShellDialect systemDialect) { + public FailableFunction remoteLaunchCommand( + ShellDialect systemDialect) { return launchConfiguration -> { var args = toCommand(launchConfiguration); args.add(0, executable); diff --git a/app/src/main/java/io/xpipe/app/terminal/KittyTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/KittyTerminalType.java index 4a751f47e..6d8b26af3 100644 --- a/app/src/main/java/io/xpipe/app/terminal/KittyTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/KittyTerminalType.java @@ -1,6 +1,5 @@ package io.xpipe.app.terminal; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; import io.xpipe.app.issue.ErrorEvent; import io.xpipe.app.util.CommandSupport; import io.xpipe.app.util.LocalShell; @@ -11,6 +10,8 @@ import io.xpipe.core.process.ShellControl; import io.xpipe.core.store.FilePath; import io.xpipe.core.util.XPipeInstallation; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; + public interface KittyTerminalType extends ExternalTerminalType { ExternalTerminalType KITTY_LINUX = new Linux(); diff --git a/app/src/main/java/io/xpipe/app/terminal/TabbyTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/TabbyTerminalType.java index 77d8f8fa0..9cb36268d 100644 --- a/app/src/main/java/io/xpipe/app/terminal/TabbyTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/TabbyTerminalType.java @@ -36,22 +36,22 @@ public interface TabbyTerminalType extends ExternalTerminalType { @Override default TerminalInitFunction additionalInitCommands() { -// return TerminalInitFunction.of(sc -> { -// if (sc.getShellDialect() == ShellDialects.ZSH) { -// return "export PS1=\"$PS1\\[\\e]1337;CurrentDir=\"'$(pwd)\\a\\]'"; -// } -// if (sc.getShellDialect() == ShellDialects.BASH) { -// return "precmd () { echo -n \"\\x1b]1337;CurrentDir=$(pwd)\\x07\" }"; -// } -// if (sc.getShellDialect() == ShellDialects.FISH) { -// return """ -// function __tabby_working_directory_reporting --on-event fish_prompt -// echo -en "\\e]1337;CurrentDir=$PWD\\x7" -// end -// """; -// } -// return null; -// }); + // return TerminalInitFunction.of(sc -> { + // if (sc.getShellDialect() == ShellDialects.ZSH) { + // return "export PS1=\"$PS1\\[\\e]1337;CurrentDir=\"'$(pwd)\\a\\]'"; + // } + // if (sc.getShellDialect() == ShellDialects.BASH) { + // return "precmd () { echo -n \"\\x1b]1337;CurrentDir=$(pwd)\\x07\" }"; + // } + // if (sc.getShellDialect() == ShellDialects.FISH) { + // return """ + // function __tabby_working_directory_reporting --on-event fish_prompt + // echo -en "\\e]1337;CurrentDir=$PWD\\x7" + // end + // """; + // } + // return null; + // }); return TerminalInitFunction.none(); } diff --git a/app/src/main/java/io/xpipe/app/terminal/WezTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/WezTerminalType.java index 275c75101..55e8ef343 100644 --- a/app/src/main/java/io/xpipe/app/terminal/WezTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/WezTerminalType.java @@ -81,8 +81,11 @@ public interface WezTerminalType extends ExternalTerminalType { @Override public void launch(LaunchConfiguration configuration) throws Exception { - var path = LocalShell.getShell().command(String.format( - "mdfind -name '%s' -onlyin /Applications -onlyin ~/Applications -onlyin /System/Applications 2>/dev/null", applicationName)).readStdoutOrThrow(); + var path = LocalShell.getShell() + .command(String.format( + "mdfind -name '%s' -onlyin /Applications -onlyin ~/Applications -onlyin /System/Applications 2>/dev/null", + applicationName)) + .readStdoutOrThrow(); var c = CommandBuilder.of() .addFile(Path.of(path) .resolve("Contents") diff --git a/app/src/main/java/io/xpipe/app/util/ClipboardHelper.java b/app/src/main/java/io/xpipe/app/util/ClipboardHelper.java index 310b21498..618c204c6 100644 --- a/app/src/main/java/io/xpipe/app/util/ClipboardHelper.java +++ b/app/src/main/java/io/xpipe/app/util/ClipboardHelper.java @@ -2,6 +2,7 @@ package io.xpipe.app.util; import io.xpipe.app.fxcomps.util.PlatformThread; import io.xpipe.core.util.SecretValue; + import javafx.animation.PauseTransition; import javafx.scene.input.Clipboard; import javafx.scene.input.DataFormat; @@ -21,9 +22,16 @@ public class ClipboardHelper { PlatformThread.runLaterIfNeeded(() -> { Clipboard clipboard = Clipboard.getSystemClipboard(); - Map previous = Stream.of(DataFormat.PLAIN_TEXT, DataFormat.URL, DataFormat.RTF, DataFormat.HTML, DataFormat.IMAGE, DataFormat.FILES) - .map(dataFormat -> new AbstractMap.SimpleEntry<>(dataFormat, clipboard.getContent(dataFormat))).filter(o -> o.getValue() != null) - .collect(HashMap::new, (m,v)->m.put(v.getKey(), v.getValue()), HashMap::putAll); + Map previous = Stream.of( + DataFormat.PLAIN_TEXT, + DataFormat.URL, + DataFormat.RTF, + DataFormat.HTML, + DataFormat.IMAGE, + DataFormat.FILES) + .map(dataFormat -> new AbstractMap.SimpleEntry<>(dataFormat, clipboard.getContent(dataFormat))) + .filter(o -> o.getValue() != null) + .collect(HashMap::new, (m, v) -> m.put(v.getKey(), v.getValue()), HashMap::putAll); var withPassword = new HashMap<>(previous); withPassword.put(DataFormat.PLAIN_TEXT, pass.getSecretValue()); diff --git a/app/src/main/java/io/xpipe/app/util/DataStoreFormatter.java b/app/src/main/java/io/xpipe/app/util/DataStoreFormatter.java index 87d3676ae..efbaf5757 100644 --- a/app/src/main/java/io/xpipe/app/util/DataStoreFormatter.java +++ b/app/src/main/java/io/xpipe/app/util/DataStoreFormatter.java @@ -8,6 +8,7 @@ import io.xpipe.core.process.ShellDialects; import io.xpipe.core.process.ShellStoreState; import io.xpipe.core.store.DataStore; import io.xpipe.core.store.ShellStore; + import javafx.beans.value.ObservableValue; import java.util.function.IntFunction; @@ -32,7 +33,8 @@ public class DataStoreFormatter { return null; } - if (s.getShellDialect() != null && !s.getShellDialect().getDumbMode().supportsAnyPossibleInteraction()) { + if (s.getShellDialect() != null + && !s.getShellDialect().getDumbMode().supportsAnyPossibleInteraction()) { if (s.getOsName() != null) { return formattedOsName(s.getOsName()); } diff --git a/app/src/main/java/io/xpipe/app/util/DesktopHelper.java b/app/src/main/java/io/xpipe/app/util/DesktopHelper.java index 6e9040f0b..2594f88e2 100644 --- a/app/src/main/java/io/xpipe/app/util/DesktopHelper.java +++ b/app/src/main/java/io/xpipe/app/util/DesktopHelper.java @@ -29,34 +29,33 @@ public class DesktopHelper { } public static void browsePathRemote(ShellControl sc, String path, FileKind kind) throws Exception { - var d = sc.getShellDialect(); - switch (sc.getOsType()) { - case OsType.Windows windows -> { - // Explorer does not support single quotes, so use normal quotes - if (kind == FileKind.DIRECTORY) { - sc.executeSimpleCommand("explorer " + d.quoteArgument(path)); - } else { - sc.executeSimpleCommand("explorer /select," + d.quoteArgument(path)); - } - } - case OsType.Linux linux -> { - var action = kind == FileKind.DIRECTORY ? - "org.freedesktop.FileManager1.ShowFolders" : - "org.freedesktop.FileManager1.ShowItems"; - var dbus = String.format(""" - dbus-send --session --print-reply --dest=org.freedesktop.FileManager1 --type=method_call /org/freedesktop/FileManager1 %s array:string:"file://%s" string:"" - """, action, path); - sc.executeSimpleCommand(dbus); - } - case OsType.MacOs macOs -> { - sc.executeSimpleCommand( - "open " + (kind == FileKind.DIRECTORY ? "" : "-R ") + d.fileArgument(path)); - } - case OsType.Bsd bsd -> { - } - case OsType.Solaris solaris -> { + var d = sc.getShellDialect(); + switch (sc.getOsType()) { + case OsType.Windows windows -> { + // Explorer does not support single quotes, so use normal quotes + if (kind == FileKind.DIRECTORY) { + sc.executeSimpleCommand("explorer " + d.quoteArgument(path)); + } else { + sc.executeSimpleCommand("explorer /select," + d.quoteArgument(path)); } } + case OsType.Linux linux -> { + var action = kind == FileKind.DIRECTORY + ? "org.freedesktop.FileManager1.ShowFolders" + : "org.freedesktop.FileManager1.ShowItems"; + var dbus = String.format( + """ + dbus-send --session --print-reply --dest=org.freedesktop.FileManager1 --type=method_call /org/freedesktop/FileManager1 %s array:string:"file://%s" string:"" + """, + action, path); + sc.executeSimpleCommand(dbus); + } + case OsType.MacOs macOs -> { + sc.executeSimpleCommand("open " + (kind == FileKind.DIRECTORY ? "" : "-R ") + d.fileArgument(path)); + } + case OsType.Bsd bsd -> {} + case OsType.Solaris solaris -> {} + } } public static void browsePathLocal(Path file) { diff --git a/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java b/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java index 79324188b..502d7359e 100644 --- a/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java +++ b/app/src/main/java/io/xpipe/app/util/TerminalLauncher.java @@ -32,7 +32,7 @@ public class TerminalLauncher { title, type.shouldClear() && AppPrefs.get().clearTerminalOnInit().get(), - TerminalInitFunction.none()), + TerminalInitFunction.none()), true); var config = new ExternalTerminalType.LaunchConfiguration(null, title, title, script, sc.getShellDialect()); type.launch(config); diff --git a/app/src/main/java/io/xpipe/app/util/WindowsRegistry.java b/app/src/main/java/io/xpipe/app/util/WindowsRegistry.java index 996015821..40aee29a3 100644 --- a/app/src/main/java/io/xpipe/app/util/WindowsRegistry.java +++ b/app/src/main/java/io/xpipe/app/util/WindowsRegistry.java @@ -1,11 +1,12 @@ package io.xpipe.app.util; -import com.sun.jna.platform.win32.Advapi32Util; -import com.sun.jna.platform.win32.WinReg; import io.xpipe.app.issue.ErrorEvent; import io.xpipe.core.process.CommandBuilder; import io.xpipe.core.process.ShellControl; +import com.sun.jna.platform.win32.Advapi32Util; +import com.sun.jna.platform.win32.WinReg; + import java.util.Optional; public class WindowsRegistry { @@ -56,7 +57,8 @@ public class WindowsRegistry { } } - public static Optional findRemoteValuesRecursive(ShellControl shellControl, int hkey, String key, String valueName) throws Exception { + public static Optional findRemoteValuesRecursive( + ShellControl shellControl, int hkey, String key, String valueName) throws Exception { var command = CommandBuilder.of() .add("reg", "query") .addQuoted((hkey == HKEY_LOCAL_MACHINE ? "HKEY_LOCAL_MACHINE" : "HKEY_CURRENT_USER") + "\\" + key) diff --git a/core/src/main/java/io/xpipe/core/store/SingletonSessionStore.java b/core/src/main/java/io/xpipe/core/store/SingletonSessionStore.java index 194d51d95..3e6a9d061 100644 --- a/core/src/main/java/io/xpipe/core/store/SingletonSessionStore.java +++ b/core/src/main/java/io/xpipe/core/store/SingletonSessionStore.java @@ -1,7 +1,6 @@ package io.xpipe.core.store; -public interface SingletonSessionStore - extends ExpandedLifecycleStore, InternalCacheDataStore { +public interface SingletonSessionStore extends ExpandedLifecycleStore, InternalCacheDataStore { @Override default void finalizeValidate() throws Exception { diff --git a/core/src/main/java/io/xpipe/core/store/StatefulDataStore.java b/core/src/main/java/io/xpipe/core/store/StatefulDataStore.java index 3fdf73409..ff571c084 100644 --- a/core/src/main/java/io/xpipe/core/store/StatefulDataStore.java +++ b/core/src/main/java/io/xpipe/core/store/StatefulDataStore.java @@ -21,7 +21,8 @@ public interface StatefulDataStore extends DataStore { @SuppressWarnings("unchecked") default T getState() { - return (T) DataStateProvider.get().getState(this, this::createDefaultState).deepCopy(); + return (T) + DataStateProvider.get().getState(this, this::createDefaultState).deepCopy(); } default void setState(T val) { diff --git a/core/src/main/java/io/xpipe/core/util/CoreJacksonModule.java b/core/src/main/java/io/xpipe/core/util/CoreJacksonModule.java index 1b43cd61b..b350b6aa8 100644 --- a/core/src/main/java/io/xpipe/core/util/CoreJacksonModule.java +++ b/core/src/main/java/io/xpipe/core/util/CoreJacksonModule.java @@ -1,6 +1,5 @@ package io.xpipe.core.util; -import com.fasterxml.jackson.databind.*; import io.xpipe.core.dialog.BaseQueryElement; import io.xpipe.core.dialog.BusyElement; import io.xpipe.core.dialog.ChoiceElement; @@ -14,6 +13,7 @@ import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.ObjectIdGenerators; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.jsontype.NamedType; import com.fasterxml.jackson.databind.module.SimpleModule; diff --git a/ext/base/src/main/java/io/xpipe/ext/base/action/BrowseStoreAction.java b/ext/base/src/main/java/io/xpipe/ext/base/action/BrowseStoreAction.java index 5989b7203..1995f8635 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/action/BrowseStoreAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/action/BrowseStoreAction.java @@ -8,8 +8,10 @@ import io.xpipe.app.storage.DataStoreEntry; import io.xpipe.app.storage.DataStoreEntryRef; import io.xpipe.core.process.ShellStoreState; import io.xpipe.core.store.ShellStore; + import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.value.ObservableValue; + import lombok.Value; public class BrowseStoreAction implements ActionProvider { @@ -22,8 +24,8 @@ public class BrowseStoreAction implements ActionProvider { public boolean isApplicable(DataStoreEntryRef o) { var state = o.get().getStorePersistentState(); if (state instanceof ShellStoreState shellStoreState) { - return shellStoreState.getShellDialect() == null || - shellStoreState.getShellDialect().getDumbMode().supportsAnyPossibleInteraction(); + return shellStoreState.getShellDialect() == null + || shellStoreState.getShellDialect().getDumbMode().supportsAnyPossibleInteraction(); } else { return true; } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/action/LaunchAction.java b/ext/base/src/main/java/io/xpipe/ext/base/action/LaunchAction.java index 38f4b4f9d..6f121cbd0 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/action/LaunchAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/action/LaunchAction.java @@ -43,8 +43,9 @@ public class LaunchAction implements ActionProvider { @Override public boolean isApplicable(DataStoreEntryRef o) { - return o.get().getValidity().isUsable() && (o.getStore() instanceof LaunchableStore || o.get().getProvider().launchAction(o.get()) != - null); + return o.get().getValidity().isUsable() + && (o.getStore() instanceof LaunchableStore + || o.get().getProvider().launchAction(o.get()) != null); } @Override @@ -75,8 +76,9 @@ public class LaunchAction implements ActionProvider { @Override public boolean isApplicable(DataStoreEntryRef o) { - return o.get().getValidity().isUsable() && (o.getStore() instanceof LaunchableStore || o.get().getProvider().launchAction(o.get()) != - null); + return o.get().getValidity().isUsable() + && (o.getStore() instanceof LaunchableStore + || o.get().getProvider().launchAction(o.get()) != null); } }; } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/action/ScanAction.java b/ext/base/src/main/java/io/xpipe/ext/base/action/ScanAction.java index cba17a06d..b2a2bbfab 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/action/ScanAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/action/ScanAction.java @@ -7,7 +7,9 @@ import io.xpipe.app.storage.DataStoreEntryRef; import io.xpipe.app.util.ScanAlert; import io.xpipe.core.process.ShellStoreState; import io.xpipe.core.store.ShellStore; + import javafx.beans.value.ObservableValue; + import lombok.Value; public class ScanAction implements ActionProvider { @@ -39,8 +41,8 @@ public class ScanAction implements ActionProvider { var state = o.get().getStorePersistentState(); if (state instanceof ShellStoreState shellStoreState) { - return shellStoreState.getShellDialect() == null || - shellStoreState.getShellDialect().getDumbMode().supportsAnyPossibleInteraction(); + return shellStoreState.getShellDialect() == null + || shellStoreState.getShellDialect().getDumbMode().supportsAnyPossibleInteraction(); } else { return true; } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/browser/BrowseInNativeManagerAction.java b/ext/base/src/main/java/io/xpipe/ext/base/browser/BrowseInNativeManagerAction.java index 522783a09..540b52eb8 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/browser/BrowseInNativeManagerAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/browser/BrowseInNativeManagerAction.java @@ -8,6 +8,7 @@ import io.xpipe.app.util.DesktopHelper; import io.xpipe.app.util.LocalShell; import io.xpipe.core.process.OsType; import io.xpipe.core.process.ShellControl; + import javafx.beans.value.ObservableValue; import java.util.List; @@ -21,7 +22,8 @@ public class BrowseInNativeManagerAction implements LeafAction { var e = entry.getRawFileEntry().getPath(); var localFile = sc.getLocalSystemAccess().translateToLocalSystemPath(e); try (var local = LocalShell.getShell().start()) { - DesktopHelper.browsePathRemote(local,localFile, entry.getRawFileEntry().getKind()); + DesktopHelper.browsePathRemote( + local, localFile, entry.getRawFileEntry().getKind()); } } } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/browser/MultiExecuteAction.java b/ext/base/src/main/java/io/xpipe/ext/base/browser/MultiExecuteAction.java index 852ab0966..bcf71bd9c 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/browser/MultiExecuteAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/browser/MultiExecuteAction.java @@ -9,6 +9,7 @@ import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.util.TerminalLauncher; import io.xpipe.core.process.CommandBuilder; import io.xpipe.core.process.ShellControl; + import javafx.beans.value.ObservableValue; import java.util.List; diff --git a/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopCommandStoreProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopCommandStoreProvider.java index 40bd36d66..0d0eca750 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopCommandStoreProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopCommandStoreProvider.java @@ -74,7 +74,8 @@ public class DesktopCommandStoreProvider implements DataStoreProvider { entry, env, DesktopEnvironmentStore.class, - desktopStoreDataStoreEntryRef -> desktopStoreDataStoreEntryRef.getStore().supportsDesktopAccess(), + desktopStoreDataStoreEntryRef -> + desktopStoreDataStoreEntryRef.getStore().supportsDesktopAccess(), StoreViewState.get().getAllConnectionsCategory()), env) .nonNull() diff --git a/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopEnvironmentStore.java b/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopEnvironmentStore.java index b397213f6..d9bd5aa64 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopEnvironmentStore.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopEnvironmentStore.java @@ -95,9 +95,9 @@ public class DesktopEnvironmentStore extends JacksonizedValue : getMergedInitCommands(null)); var scriptFile = base.getStore().createScript(dialect, toExecute); var launchScriptFile = base.getStore() - .createScript(dialect, dialect.prepareTerminalInitFileOpenCommand(dialect, null, scriptFile.toString())); - var launchConfig = - new ExternalTerminalType.LaunchConfiguration(null, name, name, launchScriptFile, dialect); + .createScript( + dialect, dialect.prepareTerminalInitFileOpenCommand(dialect, null, scriptFile.toString())); + var launchConfig = new ExternalTerminalType.LaunchConfiguration(null, name, name, launchScriptFile, dialect); base.getStore().runDesktopScript(name, launchCommand.apply(launchConfig)); } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopEnvironmentStoreProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopEnvironmentStoreProvider.java index 52f036aaa..c46a8eb01 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopEnvironmentStoreProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/desktop/DesktopEnvironmentStoreProvider.java @@ -127,7 +127,9 @@ public class DesktopEnvironmentStoreProvider implements DataStoreProvider { .nonNull() .nameAndDescription("desktopTerminal") .addComp( - ChoiceComp.ofTranslatable(terminal, ExternalTerminalType.getTypes(st.getUsedOsType(), true, false), true).maxWidth(2000), + ChoiceComp.ofTranslatable( + terminal, ExternalTerminalType.getTypes(st.getUsedOsType(), true, false), true) + .maxWidth(2000), terminal) .nonNull() .nameAndDescription("desktopShellDialect") diff --git a/ext/base/src/main/java/io/xpipe/ext/base/script/ScriptGroupStoreProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/script/ScriptGroupStoreProvider.java index 1a0a952b9..185dd0370 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/script/ScriptGroupStoreProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/script/ScriptGroupStoreProvider.java @@ -29,17 +29,19 @@ public class ScriptGroupStoreProvider implements DataStoreProvider { return new DenseStoreEntryComp(sec.getWrapper(), true, null); } - var def = StoreToggleComp.simpleToggle("base.isDefaultGroup", sec, s -> s.getState().isDefault(), (s, aBoolean) -> { - var state = s.getState(); - state.setDefault(aBoolean); - s.setState(state); - }); + var def = StoreToggleComp.simpleToggle( + "base.isDefaultGroup", sec, s -> s.getState().isDefault(), (s, aBoolean) -> { + var state = s.getState(); + state.setDefault(aBoolean); + s.setState(state); + }); - var bring = StoreToggleComp.simpleToggle("base.bringToShells", sec, s -> s.getState().isBringToShell(), (s, aBoolean) -> { - var state = s.getState(); - state.setBringToShell(aBoolean); - s.setState(state); - }); + var bring = StoreToggleComp.simpleToggle( + "base.bringToShells", sec, s -> s.getState().isBringToShell(), (s, aBoolean) -> { + var state = s.getState(); + state.setBringToShell(aBoolean); + s.setState(state); + }); var dropdown = new DropdownComp(List.of(def, bring)); return new DenseStoreEntryComp(sec.getWrapper(), true, dropdown); diff --git a/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStoreProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStoreProvider.java index 5041961eb..0d6cbb9fb 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStoreProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/script/SimpleScriptStoreProvider.java @@ -54,17 +54,19 @@ public class SimpleScriptStoreProvider implements DataStoreProvider { return new DenseStoreEntryComp(sec.getWrapper(), true, null); } - var def = StoreToggleComp.simpleToggle("base.isDefaultGroup", sec, s -> s.getState().isDefault(), (s, aBoolean) -> { - var state = s.getState(); - state.setDefault(aBoolean); - s.setState(state); - }); + var def = StoreToggleComp.simpleToggle( + "base.isDefaultGroup", sec, s -> s.getState().isDefault(), (s, aBoolean) -> { + var state = s.getState(); + state.setDefault(aBoolean); + s.setState(state); + }); - var bring = StoreToggleComp.simpleToggle("base.bringToShells", sec, s -> s.getState().isBringToShell(), (s, aBoolean) -> { - var state = s.getState(); - state.setBringToShell(aBoolean); - s.setState(state); - }); + var bring = StoreToggleComp.simpleToggle( + "base.bringToShells", sec, s -> s.getState().isBringToShell(), (s, aBoolean) -> { + var state = s.getState(); + state.setBringToShell(aBoolean); + s.setState(state); + }); SimpleScriptStore s = sec.getWrapper().getEntry().getStore().asNeeded(); var groupWrapper = StoreViewState.get().getEntryWrapper(s.getGroup().getEntry()); @@ -136,7 +138,8 @@ public class SimpleScriptStoreProvider implements DataStoreProvider { var group = new SimpleObjectProperty<>(st.getGroup()); Property dialect = new SimpleObjectProperty<>(st.getMinimumDialect()); - var others = new SimpleListProperty<>(FXCollections.observableArrayList(new ArrayList<>(st.getEffectiveScripts()))); + var others = + new SimpleListProperty<>(FXCollections.observableArrayList(new ArrayList<>(st.getEffectiveScripts()))); Property commandProp = new SimpleObjectProperty<>(st.getCommands()); Comp choice = (Comp) Class.forName( @@ -268,9 +271,7 @@ public class SimpleScriptStoreProvider implements DataStoreProvider { @Override public DataStore defaultStore() { - return SimpleScriptStore.builder() - .scripts(List.of()) - .build(); + return SimpleScriptStore.builder().scripts(List.of()).build(); } @Override