From b801a89bcc36f171ec090eb3ff8c2c812c0c55db Mon Sep 17 00:00:00 2001 From: crschnick Date: Sun, 28 Dec 2025 23:01:31 +0000 Subject: [PATCH] Reformat --- .../io/xpipe/app/beacon/AppBeaconServer.java | 1 - .../java/io/xpipe/app/beacon/BlobManager.java | 1 - .../app/beacon/impl/AskpassExchangeImpl.java | 4 +- .../app/browser/BrowserSessionTabsComp.java | 2 +- .../app/browser/file/BrowserContextMenu.java | 3 +- .../browser/file/BrowserFileDuplicates.java | 3 +- .../app/browser/file/BrowserFileListComp.java | 6 +- .../file/BrowserFileListFilterComp.java | 10 +-- .../browser/file/BrowserFileListNameCell.java | 2 +- .../file/BrowserFileSystemTabComp.java | 10 +-- .../browser/file/BrowserHistoryTabComp.java | 3 +- .../app/browser/file/BrowserNavBarComp.java | 63 ++++++++++--------- .../file/BrowserQuickAccessContextMenu.java | 6 +- .../browser/file/BrowserTransferModel.java | 1 - .../browser/menu/BrowserMenuLeafProvider.java | 3 - .../OpenTerminalInDirectoryMenuProvider.java | 5 +- .../browser/menu/impl/PasteMenuProvider.java | 3 +- app/src/main/java/io/xpipe/app/comp/Comp.java | 5 -- .../io/xpipe/app/comp/CompDescriptor.java | 32 ++++++---- .../io/xpipe/app/comp/base/ChoiceComp.java | 1 - .../app/comp/base/IntComboFieldComp.java | 1 - .../xpipe/app/comp/base/ModalOverlayComp.java | 1 - .../io/xpipe/app/comp/base/OptionsComp.java | 28 ++++++--- .../xpipe/app/comp/base/SecretFieldComp.java | 6 +- .../xpipe/app/comp/base/SideMenuBarComp.java | 3 - .../xpipe/app/comp/base/ToggleSwitchComp.java | 16 +++-- .../io/xpipe/app/comp/base/TooltipHelper.java | 3 - .../app/core/AppConfigurationDialog.java | 2 +- .../java/io/xpipe/app/core/AppLocalTemp.java | 3 +- .../java/io/xpipe/app/core/AppResources.java | 4 +- .../java/io/xpipe/app/core/AppRestart.java | 7 +-- .../xpipe/app/core/check/AppShellChecker.java | 3 +- .../xpipe/app/core/window/AppMainWindow.java | 1 - .../xpipe/app/core/window/AppWindowStyle.java | 1 - .../xpipe/app/ext/ShellControlFunction.java | 1 - .../io/xpipe/app/ext/WrapperFileSystem.java | 2 - .../app/hub/comp/StandardStoreEntryComp.java | 2 - .../xpipe/app/hub/comp/StoreCategoryComp.java | 5 +- .../xpipe/app/hub/comp/StoreChoiceComp.java | 11 +++- .../app/hub/comp/StoreChoicePopover.java | 1 - .../xpipe/app/hub/comp/StoreCreationComp.java | 6 +- .../xpipe/app/hub/comp/StoreCreationMenu.java | 9 +-- .../io/xpipe/app/hub/comp/StoreEntryComp.java | 11 +++- .../hub/comp/StoreEntryListBatchBarComp.java | 2 +- .../hub/comp/StoreEntryListOverviewComp.java | 2 - .../xpipe/app/hub/comp/StoreEntryWrapper.java | 28 ++++----- .../io/xpipe/app/hub/comp/StoreNotesComp.java | 3 +- .../app/hub/comp/StoreProviderChoiceComp.java | 18 ++++-- .../hub/comp/StoreQuickAccessButtonComp.java | 5 +- .../io/xpipe/app/issue/ErrorEventFactory.java | 3 +- .../io/xpipe/app/issue/UserReportComp.java | 2 +- .../io/xpipe/app/platform/MenuHelper.java | 6 +- .../io/xpipe/app/prefs/AboutCategory.java | 16 +++-- .../java/io/xpipe/app/prefs/AppPrefs.java | 1 - .../xpipe/app/prefs/AppPrefsSidebarComp.java | 3 +- .../io/xpipe/app/prefs/DisplayCategory.java | 32 +++------- .../xpipe/app/prefs/ExternalEditorType.java | 3 +- .../io/xpipe/app/prefs/LinksCategory.java | 21 ++++--- .../app/prefs/PersonalizationCategory.java | 5 +- .../prefs/ThirdPartyDependencyListComp.java | 5 +- .../xpipe/app/prefs/TroubleshootCategory.java | 24 ++++--- .../io/xpipe/app/prefs/VaultCategory.java | 5 +- .../java/io/xpipe/app/process/ShellTemp.java | 7 --- .../app/pwman/PasswordManagerCommand.java | 1 - .../io/xpipe/app/rdp/ExternalRdpClient.java | 1 - .../app/storage/DataStorageGroupStrategy.java | 15 +++-- .../app/storage/DataStorageUserHandler.java | 2 +- .../app/terminal/MobaXTermTerminalType.java | 1 - .../terminal/ScreenTerminalMultiplexer.java | 6 +- .../app/terminal/TmuxTerminalMultiplexer.java | 15 +++-- .../terminal/ZellijTerminalMultiplexer.java | 39 +++++++----- .../io/xpipe/app/update/AppInstaller.java | 3 +- .../app/update/UpdateChangelogDialog.java | 14 +++-- .../java/io/xpipe/app/util/FileBridge.java | 1 - .../app/util/GithubReleaseDownloader.java | 1 - .../java/io/xpipe/app/util/RemminaHelper.java | 1 - .../java/io/xpipe/beacon/BeaconConfig.java | 11 ++-- .../ext/base/host/HostAddressChoiceComp.java | 2 +- .../base/identity/IdentityChoiceBuilder.java | 43 ++++++++----- .../base/identity/ssh/InPlaceKeyStrategy.java | 5 +- 80 files changed, 347 insertions(+), 296 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/beacon/AppBeaconServer.java b/app/src/main/java/io/xpipe/app/beacon/AppBeaconServer.java index af3ed562f..ecad2e0f5 100644 --- a/app/src/main/java/io/xpipe/app/beacon/AppBeaconServer.java +++ b/app/src/main/java/io/xpipe/app/beacon/AppBeaconServer.java @@ -4,7 +4,6 @@ import io.xpipe.app.beacon.mcp.AppMcpServer; import io.xpipe.app.core.AppLocalTemp; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.issue.TrackEvent; -import io.xpipe.app.process.ShellTemp; import io.xpipe.app.util.DocumentationLink; import io.xpipe.beacon.BeaconConfig; import io.xpipe.beacon.BeaconInterface; diff --git a/app/src/main/java/io/xpipe/app/beacon/BlobManager.java b/app/src/main/java/io/xpipe/app/beacon/BlobManager.java index f7fe62b10..e5c2acd1c 100644 --- a/app/src/main/java/io/xpipe/app/beacon/BlobManager.java +++ b/app/src/main/java/io/xpipe/app/beacon/BlobManager.java @@ -2,7 +2,6 @@ package io.xpipe.app.beacon; import io.xpipe.app.core.AppLocalTemp; import io.xpipe.app.issue.ErrorEventFactory; -import io.xpipe.app.process.ShellTemp; import io.xpipe.beacon.BeaconClientException; import org.apache.commons.io.FileUtils; diff --git a/app/src/main/java/io/xpipe/app/beacon/impl/AskpassExchangeImpl.java b/app/src/main/java/io/xpipe/app/beacon/impl/AskpassExchangeImpl.java index e27393238..e463873db 100644 --- a/app/src/main/java/io/xpipe/app/beacon/impl/AskpassExchangeImpl.java +++ b/app/src/main/java/io/xpipe/app/beacon/impl/AskpassExchangeImpl.java @@ -52,7 +52,9 @@ public class AskpassExchangeImpl extends AskpassExchange { if (msg.getRequest() == null) { var r = AskpassAlert.queryRaw(prompt, null, true); - return Response.builder().value(r.getState() == SecretQueryState.NORMAL ? r.getSecret() : InPlaceSecretValue.of("")).build(); + return Response.builder() + .value(r.getState() == SecretQueryState.NORMAL ? r.getSecret() : InPlaceSecretValue.of("")) + .build(); } var found = msg.getSecretId() != null diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserSessionTabsComp.java b/app/src/main/java/io/xpipe/app/browser/BrowserSessionTabsComp.java index 36bbb1c3c..21776b624 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserSessionTabsComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserSessionTabsComp.java @@ -8,8 +8,8 @@ import io.xpipe.app.comp.base.StackComp; import io.xpipe.app.core.App; import io.xpipe.app.core.AppFontSizes; import io.xpipe.app.core.AppI18n; -import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.platform.LabelGraphic; +import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.platform.PlatformThread; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.util.BooleanScope; diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserContextMenu.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserContextMenu.java index 73ee899e9..0c200de8e 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserContextMenu.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserContextMenu.java @@ -5,9 +5,8 @@ import io.xpipe.app.browser.menu.BrowserMenuCategory; import io.xpipe.app.browser.menu.BrowserMenuItemProvider; import io.xpipe.app.core.AppFontSizes; import io.xpipe.app.platform.InputHelper; - import io.xpipe.app.prefs.AppPrefs; -import io.xpipe.app.update.AppDistributionType; + import javafx.scene.control.ContextMenu; import javafx.scene.control.SeparatorMenuItem; import javafx.scene.input.KeyEvent; diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileDuplicates.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileDuplicates.java index 34790f506..d8839d3c6 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileDuplicates.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileDuplicates.java @@ -33,6 +33,7 @@ public class BrowserFileDuplicates { } var ext = target.getExtension(); - return FilePath.of(target.removeTrailingSlash().getBaseName() + "_" + 1 + (ext.isPresent() ? "." + ext.get() : "")); + return FilePath.of( + target.removeTrailingSlash().getBaseName() + "_" + 1 + (ext.isPresent() ? "." + ext.get() : "")); } } diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java index a8d9bc3a9..0f1019f4d 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListComp.java @@ -145,7 +145,11 @@ public final class BrowserFileListComp extends SimpleComp { var table = new TableView(); table.setSkin(new TableViewSkin<>(table)); - CompDescriptor.builder().nameKey("directoryContents").showTooltips(false).build().apply(table); + CompDescriptor.builder() + .nameKey("directoryContents") + .showTooltips(false) + .build() + .apply(table); var placeholder = new Label(); var placeholderText = Bindings.createStringBinding( diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListFilterComp.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListFilterComp.java index 452b58987..0f209a21d 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListFilterComp.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListFilterComp.java @@ -3,10 +3,7 @@ package io.xpipe.app.browser.file; import io.xpipe.app.comp.Comp; import io.xpipe.app.comp.CompDescriptor; import io.xpipe.app.comp.CompStructure; -import io.xpipe.app.comp.base.ButtonComp; import io.xpipe.app.comp.base.TextFieldComp; -import io.xpipe.app.comp.base.TooltipHelper; -import io.xpipe.app.core.AppI18n; import io.xpipe.app.platform.InputHelper; import io.xpipe.app.platform.PlatformThread; @@ -15,7 +12,6 @@ import javafx.beans.property.SimpleBooleanProperty; import javafx.geometry.Pos; import javafx.scene.control.Button; import javafx.scene.control.TextField; -import javafx.scene.control.Tooltip; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import javafx.scene.input.KeyCombination; @@ -39,7 +35,11 @@ public class BrowserFileListFilterComp extends Comp { if (!expanded.get()) { diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListNameCell.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListNameCell.java index 3ca5b9869..ed5b06544 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListNameCell.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileListNameCell.java @@ -3,8 +3,8 @@ package io.xpipe.app.browser.file; import io.xpipe.app.comp.base.LazyTextFieldComp; import io.xpipe.app.comp.base.PrettyImageHelper; import io.xpipe.app.ext.FileKind; -import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.platform.InputHelper; +import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.platform.PlatformThread; import io.xpipe.app.util.BooleanScope; import io.xpipe.app.util.ThreadHelper; diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabComp.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabComp.java index 83d4d89f6..3c4ca878a 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabComp.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileSystemTabComp.java @@ -9,9 +9,7 @@ import io.xpipe.app.comp.SimpleCompStructure; import io.xpipe.app.comp.augment.ContextMenuAugment; import io.xpipe.app.comp.base.*; import io.xpipe.app.core.AppFontSizes; -import io.xpipe.app.core.AppI18n; import io.xpipe.app.platform.InputHelper; -import io.xpipe.app.platform.LabelGraphic; import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.platform.PlatformThread; import io.xpipe.app.util.GlobalTimer; @@ -22,8 +20,6 @@ import javafx.beans.property.ReadOnlyBooleanWrapper; import javafx.beans.property.SimpleBooleanProperty; import javafx.geometry.Pos; import javafx.scene.control.Button; -import javafx.scene.control.MenuButton; -import javafx.scene.control.Tooltip; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCodeCombination; import javafx.scene.input.KeyCombination; @@ -61,7 +57,11 @@ public class BrowserFileSystemTabComp extends SimpleComp { root.setMinWidth(190); var overview = new Button(null, new FontIcon("mdi2m-monitor")); overview.setOnAction(e -> model.cdAsync((FilePath) null)); - CompDescriptor.builder().nameKey("overview").shortcut(new KeyCodeCombination(KeyCode.HOME, KeyCombination.ALT_DOWN)).build().apply(overview); + CompDescriptor.builder() + .nameKey("overview") + .shortcut(new KeyCodeCombination(KeyCode.HOME, KeyCombination.ALT_DOWN)) + .build() + .apply(overview); overview.disableProperty().bind(model.getInOverview()); InputHelper.onKeyCombination( root, new KeyCodeCombination(KeyCode.HOME, KeyCombination.ALT_DOWN), true, keyEvent -> { diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserHistoryTabComp.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserHistoryTabComp.java index 77fe05e80..1bc523a95 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserHistoryTabComp.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserHistoryTabComp.java @@ -154,7 +154,8 @@ public class BrowserHistoryTabComp extends SimpleComp { }); }) .minWidth(300) - .descriptor(d -> d.name(new ReadOnlyStringWrapper(DataStorage.get().getStoreEntryDisplayName(entry.get())))) + .descriptor( + d -> d.name(new ReadOnlyStringWrapper(DataStorage.get().getStoreEntryDisplayName(entry.get())))) .disable(disable) .styleClass("entry-button") .styleClass(Styles.LEFT_PILL) diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserNavBarComp.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserNavBarComp.java index d6f0a212a..f122e2f3b 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserNavBarComp.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserNavBarComp.java @@ -8,8 +8,8 @@ import io.xpipe.app.comp.base.ButtonComp; import io.xpipe.app.comp.base.PrettyImageHelper; import io.xpipe.app.comp.base.TextFieldComp; import io.xpipe.app.core.AppFontSizes; -import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.platform.LabelGraphic; +import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.platform.PlatformThread; import io.xpipe.app.util.BooleanScope; import io.xpipe.app.util.ThreadHelper; @@ -59,16 +59,20 @@ public class BrowserNavBarComp extends Comp { .descriptor(d -> d.nameKey("directoryOptions")) .apply(new ContextMenuAugment<>(event -> event.getButton() == MouseButton.PRIMARY, null, () -> { return model.getInOverview().get() ? null : new BrowserContextMenu(model, null, false); - })).createRegion(); + })) + .createRegion(); homeButton.getStyleClass().add(Styles.LEFT_PILL); homeButton.getStyleClass().add("path-graphic-button"); AppFontSizes.sm(homeButton); var historyButton = new ButtonComp(null, new LabelGraphic.IconGraphic("mdi2h-history"), null) - .descriptor(d -> d.nameKey("history").shortcut(new KeyCodeCombination(KeyCode.H, KeyCombination.ALT_DOWN))) - .styleClass(Styles.RIGHT_PILL) - .apply(new ContextMenuAugment<>(event -> event.getButton() == MouseButton.PRIMARY, null, this::createContextMenu)) - .createStructure().get(); + .descriptor( + d -> d.nameKey("history").shortcut(new KeyCodeCombination(KeyCode.H, KeyCombination.ALT_DOWN))) + .styleClass(Styles.RIGHT_PILL) + .apply(new ContextMenuAugment<>( + event -> event.getButton() == MouseButton.PRIMARY, null, this::createContextMenu)) + .createStructure() + .get(); AppFontSizes.xs(historyButton); var breadcrumbs = new BrowserBreadcrumbBar(model); @@ -156,35 +160,34 @@ public class BrowserNavBarComp extends Comp { new TextFieldComp(path, true).styleClass(Styles.CENTER_PILL).styleClass("path-text"); pathBar.descriptor(d -> d.nameKey("currentPath")); pathBar.apply(struc -> { - struc.get().focusedProperty().subscribe(val -> { - struc.get() - .pseudoClassStateChanged( - INVISIBLE, - !val && !model.getInOverview().get()); + struc.get().focusedProperty().subscribe(val -> { + struc.get() + .pseudoClassStateChanged( + INVISIBLE, !val && !model.getInOverview().get()); - if (val) { - Platform.runLater(() -> { - struc.get().end(); - }); - } + if (val) { + Platform.runLater(() -> { + struc.get().end(); }); + } + }); - struc.get().addEventHandler(KeyEvent.KEY_PRESSED, ke -> { - if (ke.getCode().equals(KeyCode.ENTER)) { - ke.consume(); - } - }); + struc.get().addEventHandler(KeyEvent.KEY_PRESSED, ke -> { + if (ke.getCode().equals(KeyCode.ENTER)) { + ke.consume(); + } + }); - model.getInOverview().subscribe(val -> { - // Pseudo classes do not apply if set instantly before shown - // If we start a new tab with a directory set, we have to set the pseudo class one pulse later - Platform.runLater(() -> { - struc.get() - .pseudoClassStateChanged( - INVISIBLE, !val && !struc.get().isFocused()); - }); - }); + model.getInOverview().subscribe(val -> { + // Pseudo classes do not apply if set instantly before shown + // If we start a new tab with a directory set, we have to set the pseudo class one pulse later + Platform.runLater(() -> { + struc.get() + .pseudoClassStateChanged( + INVISIBLE, !val && !struc.get().isFocused()); }); + }); + }); return pathBar; } 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 636b0ebce..c80fb3bfe 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 @@ -3,21 +3,17 @@ package io.xpipe.app.browser.file; import io.xpipe.app.browser.icon.BrowserIconManager; import io.xpipe.app.comp.base.ModalOverlay; import io.xpipe.app.comp.base.PrettyImageHelper; -import io.xpipe.app.core.AppFontSizes; import io.xpipe.app.core.window.AppDialog; import io.xpipe.app.ext.FileEntry; import io.xpipe.app.ext.FileKind; import io.xpipe.app.platform.BooleanAnimationTimer; import io.xpipe.app.platform.InputHelper; import io.xpipe.app.prefs.AppPrefs; -import io.xpipe.app.update.AppDistributionType; import io.xpipe.app.util.BooleanScope; import io.xpipe.app.util.ThreadHelper; import javafx.application.Platform; import javafx.beans.property.SimpleBooleanProperty; -import javafx.beans.value.ChangeListener; -import javafx.beans.value.ObservableValue; import javafx.collections.ListChangeListener; import javafx.geometry.Side; import javafx.scene.Node; @@ -82,7 +78,7 @@ public class BrowserQuickAccessContextMenu extends ContextMenu { showingProperty().addListener((observable, oldValue, newValue) -> { if (newValue) { AppDialog.getModalOverlays().addListener(modalListener); - } else { + } else { AppDialog.getModalOverlays().removeListener(modalListener); } }); diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserTransferModel.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserTransferModel.java index c40a5fa64..e586d0c31 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserTransferModel.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserTransferModel.java @@ -8,7 +8,6 @@ import io.xpipe.app.core.mode.AppOperationMode; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.process.OsFileSystem; -import io.xpipe.app.process.ShellTemp; import io.xpipe.app.storage.DataStorage; import io.xpipe.app.util.BooleanScope; import io.xpipe.app.util.DesktopHelper; diff --git a/app/src/main/java/io/xpipe/app/browser/menu/BrowserMenuLeafProvider.java b/app/src/main/java/io/xpipe/app/browser/menu/BrowserMenuLeafProvider.java index 19b9cb85e..ec003da53 100644 --- a/app/src/main/java/io/xpipe/app/browser/menu/BrowserMenuLeafProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/menu/BrowserMenuLeafProvider.java @@ -7,14 +7,11 @@ import io.xpipe.app.browser.action.BrowserActionProviders; import io.xpipe.app.browser.file.BrowserEntry; import io.xpipe.app.browser.file.BrowserFileSystemTabModel; import io.xpipe.app.comp.CompDescriptor; -import io.xpipe.app.comp.base.ButtonComp; -import io.xpipe.app.comp.base.TooltipHelper; import io.xpipe.app.hub.action.StoreAction; import io.xpipe.app.storage.DataStoreEntryRef; import javafx.scene.control.Button; import javafx.scene.control.MenuItem; -import javafx.scene.control.Tooltip; import javafx.scene.input.KeyEvent; import javafx.scene.layout.Region; diff --git a/app/src/main/java/io/xpipe/app/browser/menu/impl/OpenTerminalInDirectoryMenuProvider.java b/app/src/main/java/io/xpipe/app/browser/menu/impl/OpenTerminalInDirectoryMenuProvider.java index f7ec4b706..c1eb2d6fa 100644 --- a/app/src/main/java/io/xpipe/app/browser/menu/impl/OpenTerminalInDirectoryMenuProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/menu/impl/OpenTerminalInDirectoryMenuProvider.java @@ -32,7 +32,10 @@ public class OpenTerminalInDirectoryMenuProvider implements BrowserMenuLeafProvi for (var dir : dirs) { var name = model.getFileSystem().supportsTerminalWorkingDirectory() && dir != null ? dir.toString() : null; model.openTerminalAsync( - name, model.getFileSystem().supportsTerminalWorkingDirectory() ? dir : null, model.getFileSystem().getRawShellControl().orElseThrow(), dirs.size() == 1); + name, + model.getFileSystem().supportsTerminalWorkingDirectory() ? dir : null, + model.getFileSystem().getRawShellControl().orElseThrow(), + dirs.size() == 1); } } diff --git a/app/src/main/java/io/xpipe/app/browser/menu/impl/PasteMenuProvider.java b/app/src/main/java/io/xpipe/app/browser/menu/impl/PasteMenuProvider.java index c3b14883f..088b3e3f1 100644 --- a/app/src/main/java/io/xpipe/app/browser/menu/impl/PasteMenuProvider.java +++ b/app/src/main/java/io/xpipe/app/browser/menu/impl/PasteMenuProvider.java @@ -35,7 +35,8 @@ public class PasteMenuProvider implements BrowserMenuLeafProvider { } var isDuplication = files.size() == 1 - && model.getFileSystem().equals(files.getFirst().getRawFileEntry().getFileSystem()) + && model.getFileSystem() + .equals(files.getFirst().getRawFileEntry().getFileSystem()) && target.getPath() .equals(files.getFirst().getRawFileEntry().getPath().getParent()); if (isDuplication) { diff --git a/app/src/main/java/io/xpipe/app/comp/Comp.java b/app/src/main/java/io/xpipe/app/comp/Comp.java index 04b9ff395..072e2bdbc 100644 --- a/app/src/main/java/io/xpipe/app/comp/Comp.java +++ b/app/src/main/java/io/xpipe/app/comp/Comp.java @@ -1,21 +1,16 @@ package io.xpipe.app.comp; import io.xpipe.app.comp.augment.Augment; -import io.xpipe.app.comp.base.TooltipHelper; -import io.xpipe.app.core.AppI18n; import io.xpipe.app.platform.BindingsHelper; import io.xpipe.app.platform.PlatformThread; import javafx.application.Platform; import javafx.beans.binding.Bindings; -import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.value.ObservableValue; import javafx.geometry.Insets; import javafx.geometry.Orientation; import javafx.scene.Node; import javafx.scene.control.Separator; -import javafx.scene.control.Tooltip; -import javafx.scene.input.KeyCombination; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.Region; diff --git a/app/src/main/java/io/xpipe/app/comp/CompDescriptor.java b/app/src/main/java/io/xpipe/app/comp/CompDescriptor.java index 7a0673f7b..5571b540a 100644 --- a/app/src/main/java/io/xpipe/app/comp/CompDescriptor.java +++ b/app/src/main/java/io/xpipe/app/comp/CompDescriptor.java @@ -2,14 +2,15 @@ package io.xpipe.app.comp; import io.xpipe.app.comp.base.TooltipHelper; import io.xpipe.app.core.AppI18n; + import javafx.application.Platform; import javafx.beans.binding.Bindings; import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.value.ObservableValue; import javafx.scene.control.Tooltip; -import javafx.scene.input.KeyCodeCombination; import javafx.scene.input.KeyCombination; import javafx.scene.layout.Region; + import lombok.Builder; import lombok.Value; @@ -21,27 +22,34 @@ public class CompDescriptor { ObservableValue description; KeyCombination shortcut; FocusTraversal focusTraversal; + @Builder.Default boolean showTooltips = true; public static enum FocusTraversal { - DISABLED, ENABLED_FOR_ACCESSIBILITY, ENABLED; } public void apply(Region r) { - var accessibleText = getName() != null ? Bindings.createStringBinding(() -> { - var s = getName().getValue() + "\n\n"; - if (getShortcut() != null) { - s += AppI18n.get("shortcut") + ": " + getShortcut().getDisplayText(); - } - return s; - }, AppI18n.activeLanguage(), getName()) : null; + var accessibleText = getName() != null + ? Bindings.createStringBinding( + () -> { + var s = getName().getValue() + "\n\n"; + if (getShortcut() != null) { + s += AppI18n.get("shortcut") + ": " + + getShortcut().getDisplayText(); + } + return s; + }, + AppI18n.activeLanguage(), + getName()) + : null; if (showTooltips) { - var tooltipText = Bindings.createStringBinding(() -> { + var tooltipText = Bindings.createStringBinding( + () -> { var s = ""; if (getName() != null) { s += getName().getValue() + "\n\n"; @@ -56,7 +64,9 @@ public class CompDescriptor { s += AppI18n.get("shortcut") + ": " + getShortcut().getDisplayText(); } return s.strip(); - }, AppI18n.activeLanguage(), getName() != null ? getName() : new ReadOnlyObjectWrapper<>(), + }, + AppI18n.activeLanguage(), + getName() != null ? getName() : new ReadOnlyObjectWrapper<>(), getDescription() != null ? getDescription() : new ReadOnlyObjectWrapper<>()); var tt = TooltipHelper.create(tooltipText); diff --git a/app/src/main/java/io/xpipe/app/comp/base/ChoiceComp.java b/app/src/main/java/io/xpipe/app/comp/base/ChoiceComp.java index ac42cd427..01e1bd2b4 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/ChoiceComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/ChoiceComp.java @@ -13,7 +13,6 @@ import javafx.beans.property.SimpleObjectProperty; import javafx.beans.value.ObservableValue; import javafx.collections.FXCollections; import javafx.scene.control.ComboBox; -import javafx.scene.control.skin.ComboBoxListViewSkin; import javafx.util.StringConverter; import lombok.AccessLevel; diff --git a/app/src/main/java/io/xpipe/app/comp/base/IntComboFieldComp.java b/app/src/main/java/io/xpipe/app/comp/base/IntComboFieldComp.java index 5a65ab5e0..c4aab59b4 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/IntComboFieldComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/IntComboFieldComp.java @@ -10,7 +10,6 @@ import javafx.beans.property.Property; import javafx.beans.value.ChangeListener; import javafx.collections.FXCollections; import javafx.scene.control.ComboBox; -import javafx.scene.control.skin.ComboBoxListViewSkin; import javafx.scene.input.KeyEvent; import lombok.AccessLevel; diff --git a/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java b/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java index e3d8c8f3f..0bc12da47 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/ModalOverlayComp.java @@ -17,7 +17,6 @@ import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleDoubleProperty; import javafx.beans.value.ObservableDoubleValue; import javafx.geometry.Pos; -import javafx.scene.AccessibleAttribute; import javafx.scene.control.Button; import javafx.scene.input.KeyCode; import javafx.scene.input.KeyEvent; diff --git a/app/src/main/java/io/xpipe/app/comp/base/OptionsComp.java b/app/src/main/java/io/xpipe/app/comp/base/OptionsComp.java index 6233e7c78..76b66c614 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/OptionsComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/OptionsComp.java @@ -12,7 +12,6 @@ import io.xpipe.app.util.Hyperlinks; import javafx.application.Platform; import javafx.beans.Observable; import javafx.beans.binding.Bindings; -import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.property.SimpleStringProperty; import javafx.beans.value.ObservableValue; import javafx.geometry.Insets; @@ -106,11 +105,16 @@ public class OptionsComp extends Comp> { }, name.managedProperty())); - vbox.focusTraversableProperty().bind(Platform.accessibilityActiveProperty().and(compRegion.visibleProperty())); + vbox.focusTraversableProperty() + .bind(Platform.accessibilityActiveProperty().and(compRegion.visibleProperty())); vbox.setAccessibleRole(AccessibleRole.TEXT); - var joined = Bindings.createStringBinding(() -> { - return entry.name.getValue() + "\n\n" + entry.description().getValue(); - }, entry.name(), entry.description()); + var joined = Bindings.createStringBinding( + () -> { + return entry.name.getValue() + "\n\n" + + entry.description().getValue(); + }, + entry.name(), + entry.description()); vbox.accessibleTextProperty().bind(joined); if (entry.documentationLink() != null) { @@ -119,9 +123,14 @@ public class OptionsComp extends Comp> { link.getStyleClass().add(Styles.BUTTON_OUTLINED); link.getStyleClass().add(Styles.ACCENT); link.getStyleClass().add("long-description"); - link.accessibleTextProperty().bind(Bindings.createStringBinding(() -> { - return AppI18n.get("helpButton", entry.name().getValue()); - }, AppI18n.activeLanguage(), entry.name())); + link.accessibleTextProperty() + .bind(Bindings.createStringBinding( + () -> { + return AppI18n.get( + "helpButton", entry.name().getValue()); + }, + AppI18n.activeLanguage(), + entry.name())); AppFontSizes.xl(link); link.setOnAction(e -> { Hyperlinks.open(entry.documentationLink()); @@ -169,7 +178,8 @@ public class OptionsComp extends Comp> { name.prefHeightProperty().bind(line.heightProperty()); name.setMinWidth(Region.USE_PREF_SIZE); name.setAlignment(Pos.CENTER_LEFT); - name.focusTraversableProperty().bind(Platform.accessibilityActiveProperty().and(compRegion.visibleProperty())); + name.focusTraversableProperty() + .bind(Platform.accessibilityActiveProperty().and(compRegion.visibleProperty())); name.setAccessibleRole(AccessibleRole.TEXT); name.accessibleTextProperty().bind(entry.name()); if (compRegion != null) { diff --git a/app/src/main/java/io/xpipe/app/comp/base/SecretFieldComp.java b/app/src/main/java/io/xpipe/app/comp/base/SecretFieldComp.java index 9db797b9a..9c8099ba0 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/SecretFieldComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/SecretFieldComp.java @@ -66,8 +66,10 @@ public class SecretFieldComp extends Comp { @Override public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) { switch (attribute) { - case TEXT: return getAccessibleText(); - default: return super.queryAccessibleAttribute(attribute, parameters); + case TEXT: + return getAccessibleText(); + default: + return super.queryAccessibleAttribute(attribute, parameters); } } }; diff --git a/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java b/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java index 2fc121c92..3c3184dfc 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java @@ -16,17 +16,14 @@ import io.xpipe.app.util.ThreadHelper; import javafx.application.Platform; import javafx.beans.binding.Bindings; import javafx.beans.property.Property; -import javafx.beans.property.ReadOnlyStringWrapper; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; import javafx.css.PseudoClass; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.Button; -import javafx.scene.control.Tooltip; import javafx.scene.layout.*; import javafx.scene.paint.Color; -import javafx.util.Duration; import lombok.AllArgsConstructor; diff --git a/app/src/main/java/io/xpipe/app/comp/base/ToggleSwitchComp.java b/app/src/main/java/io/xpipe/app/comp/base/ToggleSwitchComp.java index ef8f11185..81b419952 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/ToggleSwitchComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/ToggleSwitchComp.java @@ -37,13 +37,17 @@ public class ToggleSwitchComp extends Comp> { event.consume(); } }); - s.accessibleTextProperty().bind(Bindings.createStringBinding(() -> { - if (name != null && name.getValue() != null) { - return name.getValue(); - } + s.accessibleTextProperty() + .bind(Bindings.createStringBinding( + () -> { + if (name != null && name.getValue() != null) { + return name.getValue(); + } - return AppI18n.get("toggleButton"); - }, name != null ? name : new ReadOnlyObjectWrapper<>(), AppI18n.activeLanguage())); + return AppI18n.get("toggleButton"); + }, + name != null ? name : new ReadOnlyObjectWrapper<>(), + AppI18n.activeLanguage())); s.setAlignment(Pos.CENTER); s.getStyleClass().add("toggle-switch-comp"); s.setSelected(selected.getValue() != null ? selected.getValue() : false); diff --git a/app/src/main/java/io/xpipe/app/comp/base/TooltipHelper.java b/app/src/main/java/io/xpipe/app/comp/base/TooltipHelper.java index 759a0e677..c1d878f9f 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/TooltipHelper.java +++ b/app/src/main/java/io/xpipe/app/comp/base/TooltipHelper.java @@ -1,12 +1,9 @@ package io.xpipe.app.comp.base; import io.xpipe.app.core.AppFontSizes; -import io.xpipe.app.core.AppI18n; -import javafx.beans.binding.Bindings; import javafx.beans.value.ObservableValue; import javafx.scene.control.Tooltip; -import javafx.scene.input.KeyCombination; import javafx.stage.Window; public class TooltipHelper { diff --git a/app/src/main/java/io/xpipe/app/core/AppConfigurationDialog.java b/app/src/main/java/io/xpipe/app/core/AppConfigurationDialog.java index 861a1c4bc..5c3212cf8 100644 --- a/app/src/main/java/io/xpipe/app/core/AppConfigurationDialog.java +++ b/app/src/main/java/io/xpipe/app/core/AppConfigurationDialog.java @@ -5,8 +5,8 @@ import io.xpipe.app.comp.base.ModalOverlay; import io.xpipe.app.comp.base.ScrollComp; import io.xpipe.app.core.window.AppDialog; import io.xpipe.app.platform.OptionsBuilder; -import io.xpipe.app.prefs.PersonalizationCategory; import io.xpipe.app.prefs.EditorCategory; +import io.xpipe.app.prefs.PersonalizationCategory; import io.xpipe.app.prefs.TerminalCategory; import io.xpipe.app.util.DocumentationLink; diff --git a/app/src/main/java/io/xpipe/app/core/AppLocalTemp.java b/app/src/main/java/io/xpipe/app/core/AppLocalTemp.java index 6554776ca..c3c0cd594 100644 --- a/app/src/main/java/io/xpipe/app/core/AppLocalTemp.java +++ b/app/src/main/java/io/xpipe/app/core/AppLocalTemp.java @@ -11,7 +11,8 @@ import java.nio.file.attribute.PosixFilePermissions; public class AppLocalTemp { public static Path getLocalTempDataDirectory() { - var temp = AppSystemInfo.ofCurrent().getTemp().resolve(AppNames.ofCurrent().getKebapName()); + var temp = + AppSystemInfo.ofCurrent().getTemp().resolve(AppNames.ofCurrent().getKebapName()); // On Windows and macOS, we already have user specific temp directories // Even on macOS as root we will have a unique directory (in contrast to shell controls) if (OsType.ofLocal() == OsType.LINUX) { diff --git a/app/src/main/java/io/xpipe/app/core/AppResources.java b/app/src/main/java/io/xpipe/app/core/AppResources.java index 20f1d7088..be65d257e 100644 --- a/app/src/main/java/io/xpipe/app/core/AppResources.java +++ b/app/src/main/java/io/xpipe/app/core/AppResources.java @@ -14,7 +14,6 @@ import java.nio.file.Path; import java.util.HashMap; import java.util.Map; import java.util.Optional; -import java.util.concurrent.ConcurrentHashMap; public class AppResources { @@ -59,7 +58,8 @@ public class AppResources { } try { - var fs = (ModuleFileSystem) FileSystems.newFileSystem(URI.create("module:/" + module), Map.of("layer", layer)); + var fs = (ModuleFileSystem) + FileSystems.newFileSystem(URI.create("module:/" + module), Map.of("layer", layer)); if (AppExtensionManager.getInstance() != null) { fileSystems.put(module, fs); } diff --git a/app/src/main/java/io/xpipe/app/core/AppRestart.java b/app/src/main/java/io/xpipe/app/core/AppRestart.java index fa348999f..5d9346fdb 100644 --- a/app/src/main/java/io/xpipe/app/core/AppRestart.java +++ b/app/src/main/java/io/xpipe/app/core/AppRestart.java @@ -70,16 +70,15 @@ public class AppRestart { public static String getBackgroundRestartCommand(String user, ShellDialect dialect) { var dataDir = AppProperties.get().getDataDir(); var l = new ArrayList(); - l.addAll(List.of("-Dio.xpipe.app.mode=gui", + l.addAll(List.of( + "-Dio.xpipe.app.mode=gui", "-Dio.xpipe.app.acceptEula=true", "-Dio.xpipe.app.dataDir=\"" + dataDir + "\"", "-Dio.xpipe.app.restarted=true")); if (user != null) { l.add("-Dio.xpipe.app.login=\"" + user + "\""); } - var exec = createBackgroundLaunchCommand( - l, - dialect); + var exec = createBackgroundLaunchCommand(l, dialect); return exec; } diff --git a/app/src/main/java/io/xpipe/app/core/check/AppShellChecker.java b/app/src/main/java/io/xpipe/app/core/check/AppShellChecker.java index 2bbc4ebc1..33e55375b 100644 --- a/app/src/main/java/io/xpipe/app/core/check/AppShellChecker.java +++ b/app/src/main/java/io/xpipe/app/core/check/AppShellChecker.java @@ -23,7 +23,8 @@ public abstract class AppShellChecker { var originalErr = selfTestErrorCheck(); if (originalErr.isPresent() - && (shouldAttemptFallbackForProcessStartFail() || !originalErr.get().isProcessSpawnIssue())) { + && (shouldAttemptFallbackForProcessStartFail() + || !originalErr.get().isProcessSpawnIssue())) { var msg = formatMessage(originalErr.get().getMessage()); ErrorEventFactory.fromThrowable(new IllegalStateException(msg)) .documentationLink(DocumentationLink.LOCAL_SHELL_WARNING) diff --git a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java index 79c37e1fe..014f39b36 100644 --- a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java +++ b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java @@ -375,7 +375,6 @@ public class AppMainWindow { var h = Math.min(780, screen.getBounds().getHeight() - 10); stage.setWidth(w); stage.setHeight(h); - } private void saveState() { diff --git a/app/src/main/java/io/xpipe/app/core/window/AppWindowStyle.java b/app/src/main/java/io/xpipe/app/core/window/AppWindowStyle.java index 5a03ca2d6..c824dcea6 100644 --- a/app/src/main/java/io/xpipe/app/core/window/AppWindowStyle.java +++ b/app/src/main/java/io/xpipe/app/core/window/AppWindowStyle.java @@ -16,7 +16,6 @@ import javafx.stage.Stage; import java.time.Duration; import java.time.Instant; import java.util.List; -import java.util.function.Consumer; public class AppWindowStyle { diff --git a/app/src/main/java/io/xpipe/app/ext/ShellControlFunction.java b/app/src/main/java/io/xpipe/app/ext/ShellControlFunction.java index ef57a03d9..802200837 100644 --- a/app/src/main/java/io/xpipe/app/ext/ShellControlFunction.java +++ b/app/src/main/java/io/xpipe/app/ext/ShellControlFunction.java @@ -1,7 +1,6 @@ package io.xpipe.app.ext; import io.xpipe.app.process.ShellControl; -import io.xpipe.app.util.LicensedFeature; public interface ShellControlFunction { diff --git a/app/src/main/java/io/xpipe/app/ext/WrapperFileSystem.java b/app/src/main/java/io/xpipe/app/ext/WrapperFileSystem.java index 7a5a448bd..736dc4f70 100644 --- a/app/src/main/java/io/xpipe/app/ext/WrapperFileSystem.java +++ b/app/src/main/java/io/xpipe/app/ext/WrapperFileSystem.java @@ -4,8 +4,6 @@ import io.xpipe.app.process.ShellControl; import io.xpipe.core.FailableConsumer; import io.xpipe.core.FilePath; -import lombok.Getter; - import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StandardStoreEntryComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StandardStoreEntryComp.java index f5ed7b754..b9472d149 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StandardStoreEntryComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StandardStoreEntryComp.java @@ -2,10 +2,8 @@ package io.xpipe.app.hub.comp; import io.xpipe.app.comp.Comp; import io.xpipe.app.core.AppFontSizes; -import io.xpipe.app.core.AppI18n; import io.xpipe.core.OsType; -import javafx.beans.binding.Bindings; import javafx.geometry.HPos; import javafx.geometry.Insets; import javafx.geometry.Pos; diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryComp.java index 197c222af..ffed1ba93 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreCategoryComp.java @@ -7,8 +7,8 @@ import io.xpipe.app.comp.base.*; import io.xpipe.app.core.AppFontSizes; import io.xpipe.app.core.AppI18n; import io.xpipe.app.platform.ClipboardHelper; -import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.platform.LabelGraphic; +import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.storage.DataStorage; import io.xpipe.app.storage.DataStoreCategory; @@ -134,7 +134,8 @@ public class StoreCategoryComp extends SimpleComp { count.minWidth(Region.USE_PREF_SIZE); var showStatus = hover.or(new SimpleBooleanProperty(DataStorage.get().supportsSync())) - .or(showing).or(focus); + .or(showing) + .or(focus); var h = new HorizontalComp(List.of( expandButton, Comp.hspacer(category.getCategory().getParentCategory() == null ? 3 : 0), diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreChoiceComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreChoiceComp.java index 07099a96a..4e769bb16 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreChoiceComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreChoiceComp.java @@ -66,9 +66,14 @@ public class StoreChoiceComp extends SimpleComp { }, selected), () -> {}); - button.descriptor(d -> d.name(Bindings.createStringBinding(() -> { - return selected.getValue() != null ? toName(selected.getValue().get()) : AppI18n.get("selectConnection"); - }, selected, AppI18n.activeLanguage()))); + button.descriptor(d -> d.name(Bindings.createStringBinding( + () -> { + return selected.getValue() != null + ? toName(selected.getValue().get()) + : AppI18n.get("selectConnection"); + }, + selected, + AppI18n.activeLanguage()))); button.apply(struc -> { struc.get().setMaxWidth(20000); struc.get().setAlignment(Pos.CENTER_LEFT); diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreChoicePopover.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreChoicePopover.java index 8a0d65ddf..51511e354 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreChoicePopover.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreChoicePopover.java @@ -22,7 +22,6 @@ import javafx.beans.property.SimpleStringProperty; import javafx.collections.ListChangeListener; import javafx.geometry.Insets; import javafx.scene.Node; -import javafx.scene.control.MenuButton; import javafx.scene.layout.Region; import javafx.scene.layout.VBox; diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationComp.java index 05c03e6f9..e07e57468 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationComp.java @@ -4,7 +4,6 @@ import io.xpipe.app.comp.base.*; import io.xpipe.app.core.AppI18n; import io.xpipe.app.ext.GuiDialog; import io.xpipe.app.platform.OptionsBuilder; -import io.xpipe.app.platform.SimpleValidator; import io.xpipe.app.platform.Validator; import io.xpipe.app.storage.DataStorage; import io.xpipe.app.util.ThreadHelper; @@ -15,7 +14,6 @@ import javafx.beans.value.ObservableValue; import javafx.geometry.Insets; import javafx.scene.control.*; import javafx.scene.control.skin.ScrollPaneSkin; -import javafx.scene.layout.BorderPane; import javafx.scene.layout.Priority; import javafx.scene.layout.Region; import javafx.scene.layout.VBox; @@ -71,7 +69,6 @@ public class StoreCreationComp extends ModalOverlayContentComp { } layout.getChildren().add(new Region()); - var activeDialog = new SimpleObjectProperty(); model.getProvider().subscribe(n -> { if (n != null) { @@ -109,8 +106,7 @@ public class StoreCreationComp extends ModalOverlayContentComp { full.sub(propOptions); var comp = full.buildComp(); - var region = - comp.styleClass("store-creator-options").createRegion(); + var region = comp.styleClass("store-creator-options").createRegion(); valSp.getChildren().add(region); var sp = new ScrollPane(valSp); diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationMenu.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationMenu.java index 6047d93ef..b24cb8db1 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationMenu.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreCreationMenu.java @@ -4,8 +4,6 @@ import io.xpipe.app.action.AbstractAction; import io.xpipe.app.comp.base.PrettyImageHelper; import io.xpipe.app.core.AppI18n; import io.xpipe.app.ext.*; -import io.xpipe.app.prefs.AppPrefs; -import io.xpipe.app.update.AppDistributionType; import io.xpipe.app.util.ScanDialog; import javafx.application.Platform; @@ -136,8 +134,11 @@ public class StoreCreationMenu { Platform.runLater(() -> { if (defaultProvider != null) { - providers.stream().filter(dataStoreProvider -> dataStoreProvider.getId().equals(defaultProvider)).findFirst().ifPresent( - dataStoreProvider -> { + providers.stream() + .filter(dataStoreProvider -> + dataStoreProvider.getId().equals(defaultProvider)) + .findFirst() + .ifPresent(dataStoreProvider -> { var index = providers.indexOf(dataStoreProvider); menu.getItems().get(index).fire(); }); diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryComp.java index 19131d7fd..cfd5e8866 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryComp.java @@ -136,7 +136,12 @@ public abstract class StoreEntryComp extends SimpleComp { button.setPadding(Insets.EMPTY); button.setMaxWidth(5000); button.setFocusTraversable(true); - CompDescriptor.builder().name(getWrapper().getShownName()).description(getWrapper().getShownDescription()).showTooltips(false).build().apply(button); + CompDescriptor.builder() + .name(getWrapper().getShownName()) + .description(getWrapper().getShownDescription()) + .showTooltips(false) + .build() + .apply(button); button.setOnAction(event -> { if (getWrapper().getRenaming().get()) { return; @@ -536,8 +541,8 @@ public abstract class StoreEntryComp extends SimpleComp { tags.getItems().add(new SeparatorMenuItem()); } - var index = - MenuHelper.createMenuItem(new LabelGraphic.IconGraphic("mdi2t-tag-plus-outline"), "createTag"); + var index = MenuHelper.createMenuItem( + new LabelGraphic.IconGraphic("mdi2t-tag-plus-outline"), "createTag"); index.setOnAction(event -> { var tagName = new SimpleStringProperty(); var modal = ModalOverlay.of( diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryListBatchBarComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryListBatchBarComp.java index f54448c05..60eacbd80 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryListBatchBarComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryListBatchBarComp.java @@ -8,8 +8,8 @@ import io.xpipe.app.comp.base.*; import io.xpipe.app.core.AppI18n; import io.xpipe.app.ext.DataStore; import io.xpipe.app.hub.action.BatchHubProvider; -import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.platform.DerivedObservableList; +import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.storage.DataStoreEntryRef; import javafx.beans.binding.Bindings; diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryListOverviewComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryListOverviewComp.java index 703017804..8c4ab5972 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryListOverviewComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryListOverviewComp.java @@ -1,7 +1,6 @@ package io.xpipe.app.hub.comp; import io.xpipe.app.comp.Comp; -import io.xpipe.app.comp.CompDescriptor; import io.xpipe.app.comp.SimpleComp; import io.xpipe.app.comp.base.CountComp; import io.xpipe.app.comp.base.FilterComp; @@ -20,7 +19,6 @@ import javafx.geometry.Insets; import javafx.geometry.Orientation; import javafx.geometry.Pos; import javafx.scene.control.Label; -import javafx.scene.control.MenuButton; import javafx.scene.control.Separator; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryWrapper.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryWrapper.java index 45a297956..f0e0e2905 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryWrapper.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreEntryWrapper.java @@ -101,20 +101,20 @@ public class StoreEntryWrapper { AppPrefs.get().censorMode(), summary); this.shownDescription = Bindings.createStringBinding( - () -> { - var summaryValue = shownSummary.getValue(); - if (summaryValue != null) { - return summaryValue; - } else { - var provider = getEntry().getProvider(); - if (provider != null) { - return AppI18n.get(provider.getId() + ".displayName"); - } else { - return null; - } - } - }, - shownSummary); + () -> { + var summaryValue = shownSummary.getValue(); + if (summaryValue != null) { + return summaryValue; + } else { + var provider = getEntry().getProvider(); + if (provider != null) { + return AppI18n.get(provider.getId() + ".displayName"); + } else { + return null; + } + } + }, + shownSummary); this.shownInformation = new SimpleObjectProperty<>(); this.notes = new SimpleObjectProperty<>(new StoreNotes(entry.getNotes(), entry.getNotes())); diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreNotesComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreNotesComp.java index 18828c636..1612de0ec 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreNotesComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreNotesComp.java @@ -38,7 +38,8 @@ public class StoreNotesComp extends Comp { var n = wrapper.getNotes(); var button = new IconButtonComp("mdi2n-note-text-outline") .apply(struc -> AppFontSizes.xs(struc.get())) - .descriptor(d -> d.nameKey("notes").focusTraversal(CompDescriptor.FocusTraversal.ENABLED_FOR_ACCESSIBILITY)) + .descriptor( + d -> d.nameKey("notes").focusTraversal(CompDescriptor.FocusTraversal.ENABLED_FOR_ACCESSIBILITY)) .styleClass("notes-button") .hide(BindingsHelper.map(n, s -> s.getCommited() == null && s.getCurrent() == null)) .createStructure() diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreProviderChoiceComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreProviderChoiceComp.java index e26abbfce..1f37e7527 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreProviderChoiceComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreProviderChoiceComp.java @@ -8,9 +8,8 @@ import io.xpipe.app.core.AppI18n; import io.xpipe.app.ext.DataStoreProvider; import io.xpipe.app.ext.DataStoreProviders; import io.xpipe.app.platform.JfxHelper; - import io.xpipe.app.platform.MenuHelper; -import io.xpipe.app.process.ShellDialect; + import javafx.beans.binding.Bindings; import javafx.beans.property.Property; import javafx.scene.control.ComboBox; @@ -77,9 +76,18 @@ public class StoreProviderChoiceComp extends Comp { - return provider.getValue() != null ? provider.getValue().displayName().getValue() : null; - }, provider, AppI18n.activeLanguage())).build().apply(cb); + CompDescriptor.builder() + .nameKey("chooseConnectionType") + .description(Bindings.createStringBinding( + () -> { + return provider.getValue() != null + ? provider.getValue().displayName().getValue() + : null; + }, + provider, + AppI18n.activeLanguage())) + .build() + .apply(cb); cb.setOnKeyPressed(event -> { if (!event.getCode().equals(KeyCode.ENTER)) { return; diff --git a/app/src/main/java/io/xpipe/app/hub/comp/StoreQuickAccessButtonComp.java b/app/src/main/java/io/xpipe/app/hub/comp/StoreQuickAccessButtonComp.java index 6af19d800..100f8edac 100644 --- a/app/src/main/java/io/xpipe/app/hub/comp/StoreQuickAccessButtonComp.java +++ b/app/src/main/java/io/xpipe/app/hub/comp/StoreQuickAccessButtonComp.java @@ -4,11 +4,10 @@ import io.xpipe.app.comp.Comp; import io.xpipe.app.comp.CompStructure; import io.xpipe.app.comp.base.IconButtonComp; import io.xpipe.app.comp.base.PrettyImageHelper; -import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.platform.LabelGraphic; - +import io.xpipe.app.platform.MenuHelper; import io.xpipe.app.prefs.AppPrefs; -import io.xpipe.app.update.AppDistributionType; + import javafx.geometry.Side; import javafx.scene.control.Button; import javafx.scene.control.ContextMenu; diff --git a/app/src/main/java/io/xpipe/app/issue/ErrorEventFactory.java b/app/src/main/java/io/xpipe/app/issue/ErrorEventFactory.java index bd1248ab2..2a4a3dfb5 100644 --- a/app/src/main/java/io/xpipe/app/issue/ErrorEventFactory.java +++ b/app/src/main/java/io/xpipe/app/issue/ErrorEventFactory.java @@ -61,7 +61,8 @@ public class ErrorEventFactory { b = ErrorEvent.builder().throwable(t); } - if (t instanceof SSLHandshakeException || (t.getClass().getName().equals("sun.security.provider.certpath.SunCertPathBuilderException"))) { + if (t instanceof SSLHandshakeException + || (t.getClass().getName().equals("sun.security.provider.certpath.SunCertPathBuilderException"))) { if (b.getLink() == null) { b.documentationLink(DocumentationLink.TLS_DECRYPTION); } 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 d737635b6..c18f9ad73 100644 --- a/app/src/main/java/io/xpipe/app/issue/UserReportComp.java +++ b/app/src/main/java/io/xpipe/app/issue/UserReportComp.java @@ -3,8 +3,8 @@ package io.xpipe.app.issue; import io.xpipe.app.comp.Comp; import io.xpipe.app.comp.base.*; import io.xpipe.app.core.*; - import io.xpipe.app.prefs.AppPrefs; + import javafx.beans.property.*; import javafx.collections.FXCollections; import javafx.geometry.Orientation; diff --git a/app/src/main/java/io/xpipe/app/platform/MenuHelper.java b/app/src/main/java/io/xpipe/app/platform/MenuHelper.java index 77de3694b..749096d72 100644 --- a/app/src/main/java/io/xpipe/app/platform/MenuHelper.java +++ b/app/src/main/java/io/xpipe/app/platform/MenuHelper.java @@ -2,9 +2,8 @@ package io.xpipe.app.platform; import io.xpipe.app.core.AppFontSizes; import io.xpipe.app.core.AppI18n; - import io.xpipe.app.prefs.AppPrefs; -import io.xpipe.app.update.AppDistributionType; + import javafx.application.Platform; import javafx.geometry.Side; import javafx.scene.Node; @@ -14,9 +13,8 @@ import javafx.scene.control.skin.ComboBoxPopupControl; import javafx.scene.control.skin.MenuButtonSkin; import javafx.scene.control.skin.MenuButtonSkinBase; import javafx.scene.layout.Region; -import lombok.SneakyThrows; -import java.util.function.Function; +import lombok.SneakyThrows; public class MenuHelper { diff --git a/app/src/main/java/io/xpipe/app/prefs/AboutCategory.java b/app/src/main/java/io/xpipe/app/prefs/AboutCategory.java index cbc837cee..bdb3edb54 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AboutCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/AboutCategory.java @@ -63,18 +63,22 @@ public class AboutCategory extends AppPrefsCategory { .addComp(title, null) .addComp(Comp.vspacer(10)) .name("build") - .addComp(new LabelComp(AppProperties.get().getBuild()) - .descriptor(d -> d.focusTraversal(CompDescriptor.FocusTraversal.ENABLED_FOR_ACCESSIBILITY)), null) + .addComp( + new LabelComp(AppProperties.get().getBuild()) + .descriptor( + d -> d.focusTraversal(CompDescriptor.FocusTraversal.ENABLED_FOR_ACCESSIBILITY)), + null) .name("distribution") .addComp(new LabelComp(AppDistributionType.get().toTranslatedString()) .descriptor(d -> d.focusTraversal(CompDescriptor.FocusTraversal.ENABLED_FOR_ACCESSIBILITY))) .name("virtualMachine") .addComp( new LabelComp(System.getProperty("java.vm.vendor") + " " - + System.getProperty("java.vm.name") - + " " - + System.getProperty("java.vm.version")) - .descriptor(d -> d.focusTraversal(CompDescriptor.FocusTraversal.ENABLED_FOR_ACCESSIBILITY)), + + System.getProperty("java.vm.name") + + " " + + System.getProperty("java.vm.version")) + .descriptor( + d -> d.focusTraversal(CompDescriptor.FocusTraversal.ENABLED_FOR_ACCESSIBILITY)), null) .buildComp(); return section.styleClass("properties-comp"); 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 00e89b5cd..2ee3ef633 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java @@ -14,7 +14,6 @@ import io.xpipe.app.process.ShellScript; import io.xpipe.app.pwman.PasswordManager; import io.xpipe.app.rdp.ExternalRdpClient; import io.xpipe.app.storage.DataStorage; -import io.xpipe.app.storage.DataStorageGroupStrategy; import io.xpipe.app.storage.DataStorageUserHandler; import io.xpipe.app.terminal.ExternalTerminalType; import io.xpipe.app.terminal.TerminalMultiplexer; diff --git a/app/src/main/java/io/xpipe/app/prefs/AppPrefsSidebarComp.java b/app/src/main/java/io/xpipe/app/prefs/AppPrefsSidebarComp.java index c823b95d4..1a4617f0b 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefsSidebarComp.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefsSidebarComp.java @@ -46,7 +46,8 @@ public class AppPrefsSidebarComp extends SimpleComp { PseudoClass.getPseudoClass("selected"), appPrefsCategory.equals(val)); }); - }).maxWidth(2000); + }) + .maxWidth(2000); }) .collect(Collectors.toCollection(ArrayList::new)); diff --git a/app/src/main/java/io/xpipe/app/prefs/DisplayCategory.java b/app/src/main/java/io/xpipe/app/prefs/DisplayCategory.java index 1acae0f2d..2e71f54e9 100644 --- a/app/src/main/java/io/xpipe/app/prefs/DisplayCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/DisplayCategory.java @@ -1,30 +1,16 @@ package io.xpipe.app.prefs; +import io.xpipe.app.comp.Comp; +import io.xpipe.app.comp.base.IntFieldComp; +import io.xpipe.app.platform.LabelGraphic; +import io.xpipe.app.platform.OptionsBuilder; +import io.xpipe.core.OsType; + +import javafx.beans.property.SimpleBooleanProperty; +import javafx.scene.control.Slider; + import atlantafx.base.controls.ProgressSliderSkin; import atlantafx.base.theme.Styles; -import io.xpipe.app.comp.Comp; -import io.xpipe.app.comp.base.ButtonComp; -import io.xpipe.app.comp.base.ChoiceComp; -import io.xpipe.app.comp.base.HorizontalComp; -import io.xpipe.app.comp.base.IntFieldComp; -import io.xpipe.app.core.AppI18n; -import io.xpipe.app.core.AppTheme; -import io.xpipe.app.platform.LabelGraphic; -import io.xpipe.app.platform.OptionsBuilder; -import io.xpipe.app.util.Hyperlinks; -import io.xpipe.core.OsType; -import javafx.beans.property.SimpleBooleanProperty; -import javafx.geometry.Pos; -import javafx.scene.control.ListCell; -import javafx.scene.control.Slider; -import javafx.scene.layout.StackPane; -import javafx.scene.paint.Color; -import javafx.scene.shape.Rectangle; -import org.kordamp.ikonli.javafx.FontIcon; - -import java.util.Arrays; -import java.util.List; -import java.util.function.Supplier; public class DisplayCategory extends AppPrefsCategory { diff --git a/app/src/main/java/io/xpipe/app/prefs/ExternalEditorType.java b/app/src/main/java/io/xpipe/app/prefs/ExternalEditorType.java index fe24778df..61f8913b7 100644 --- a/app/src/main/java/io/xpipe/app/prefs/ExternalEditorType.java +++ b/app/src/main/java/io/xpipe/app/prefs/ExternalEditorType.java @@ -512,7 +512,8 @@ public interface ExternalEditorType extends PrefsChoiceValue { new LinuxType("app.mousepad", "mousepad", "https://docs.xfce.org/apps/mousepad/start", "org.xfce.mousepad"); LinuxPathType PLUMA = new LinuxPathType("app.pluma", "pluma", "https://github.com/mate-desktop/pluma"); - LinuxPathType WESTON_EDITOR = new LinuxPathType("app.westonEditor", "weston-editor", "https://wayland.pages.freedesktop.org/weston/"); + LinuxPathType WESTON_EDITOR = + new LinuxPathType("app.westonEditor", "weston-editor", "https://wayland.pages.freedesktop.org/weston/"); ExternalEditorType TEXT_EDIT = new MacOsEditor("app.textEdit", "TextEdit", "https://support.apple.com/en-gb/guide/textedit/welcome/mac"); ExternalEditorType BBEDIT = new MacOsEditor("app.bbedit", "BBEdit", "https://www.barebones.com/products/bbedit/"); diff --git a/app/src/main/java/io/xpipe/app/prefs/LinksCategory.java b/app/src/main/java/io/xpipe/app/prefs/LinksCategory.java index d6bd1caf1..146acb806 100644 --- a/app/src/main/java/io/xpipe/app/prefs/LinksCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/LinksCategory.java @@ -18,32 +18,37 @@ public class LinksCategory extends AppPrefsCategory { new TileButtonComp("discord", "discordDescription", "bi-discord", e -> { Hyperlinks.open(Hyperlinks.DISCORD); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null) .addComp( new TileButtonComp("reddit", "redditDescription", "mdi2r-reddit", e -> { Hyperlinks.open(Hyperlinks.REDDIT); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null) .addComp( new TileButtonComp( "documentation", "documentationDescription", "mdi2b-book-open-variant", e -> { Hyperlinks.open(DocumentationLink.getRoot()); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null) .addComp( new TileButtonComp("tryPtb", "tryPtbDescription", "mdoal-insights", e -> { Hyperlinks.open(Hyperlinks.GITHUB_PTB); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null) .addComp( new TileButtonComp("privacy", "privacyDescription", "mdomz-privacy_tip", e -> { DocumentationLink.PRIVACY.open(); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null) .addComp( new TileButtonComp("thirdParty", "thirdPartyDescription", "mdi2o-open-source-initiative", e -> { @@ -52,12 +57,14 @@ public class LinksCategory extends AppPrefsCategory { .styleClass("open-source-notices"); var modal = ModalOverlay.of("openSourceNotices", comp); modal.show(); - }).maxWidth(2000)) + }) + .maxWidth(2000)) .addComp( new TileButtonComp("eula", "eulaDescription", "mdi2c-card-text-outline", e -> { DocumentationLink.EULA.open(); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null) .addComp(Comp.vspacer(40)) .buildComp(); diff --git a/app/src/main/java/io/xpipe/app/prefs/PersonalizationCategory.java b/app/src/main/java/io/xpipe/app/prefs/PersonalizationCategory.java index 131ccdd77..e2d5ae0e6 100644 --- a/app/src/main/java/io/xpipe/app/prefs/PersonalizationCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/PersonalizationCategory.java @@ -97,10 +97,7 @@ public class PersonalizationCategory extends AppPrefsCategory { protected Comp create() { return new OptionsBuilder() .addTitle("personalization") - .sub(new OptionsBuilder() - .sub(languageChoice()) - .sub(themeChoice()) - ) + .sub(new OptionsBuilder().sub(languageChoice()).sub(themeChoice())) .buildComp(); } } diff --git a/app/src/main/java/io/xpipe/app/prefs/ThirdPartyDependencyListComp.java b/app/src/main/java/io/xpipe/app/prefs/ThirdPartyDependencyListComp.java index 9bff8f3bf..d863bc668 100644 --- a/app/src/main/java/io/xpipe/app/prefs/ThirdPartyDependencyListComp.java +++ b/app/src/main/java/io/xpipe/app/prefs/ThirdPartyDependencyListComp.java @@ -17,7 +17,10 @@ public class ThirdPartyDependencyListComp extends Comp> { private TitledPane createPane(ThirdPartyDependency t) { var tp = new TitledPane(); - CompDescriptor.builder().name(new ReadOnlyStringWrapper(t.name())).build().apply(tp); + CompDescriptor.builder() + .name(new ReadOnlyStringWrapper(t.name())) + .build() + .apply(tp); tp.setExpanded(false); var link = new Hyperlink(t.name() + " @ " + t.version()); link.setOnAction(e -> { diff --git a/app/src/main/java/io/xpipe/app/prefs/TroubleshootCategory.java b/app/src/main/java/io/xpipe/app/prefs/TroubleshootCategory.java index b457bd3b3..625823442 100644 --- a/app/src/main/java/io/xpipe/app/prefs/TroubleshootCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/TroubleshootCategory.java @@ -64,7 +64,8 @@ public class TroubleshootCategory extends AppPrefsCategory { } UserReportComp.show(event.build()); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null) .addComp( new TileButtonComp("launchDebugMode", "launchDebugModeDescription", "mdmz-refresh", e -> { @@ -78,7 +79,8 @@ public class TroubleshootCategory extends AppPrefsCategory { .launch(); }); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null); if (AppLogs.get().isWriteToFile()) { @@ -92,7 +94,8 @@ public class TroubleshootCategory extends AppPrefsCategory { .resolve(AppNames.ofMain().getKebapName() + ".log") .toString()); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null); } @@ -105,7 +108,8 @@ public class TroubleshootCategory extends AppPrefsCategory { DesktopHelper.browseFile( AppInstallation.ofCurrent().getBaseInstallationPath()); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null) .addComp( new TileButtonComp( @@ -137,7 +141,8 @@ public class TroubleshootCategory extends AppPrefsCategory { }); modal.show(); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null) .addComp( new TileButtonComp("clearCaches", "clearCachesDescription", "mdi2t-trash-can-outline", e -> { @@ -149,13 +154,15 @@ public class TroubleshootCategory extends AppPrefsCategory { }); modal.show(); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null) .addComp( new TileButtonComp("createHeapDump", "createHeapDumpDescription", "mdi2m-memory", e -> { heapDump(); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null); if (OsType.ofLocal() == OsType.MACOS && AppDistributionType.get() == AppDistributionType.NATIVE_INSTALLATION) { @@ -183,7 +190,8 @@ public class TroubleshootCategory extends AppPrefsCategory { .launch(); }); e.consume(); - }).maxWidth(2000), + }) + .maxWidth(2000), null); } diff --git a/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java b/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java index 1a66c79ee..ff28af1a6 100644 --- a/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java +++ b/app/src/main/java/io/xpipe/app/prefs/VaultCategory.java @@ -17,8 +17,8 @@ import io.xpipe.app.util.LicenseProvider; import javafx.application.Platform; import javafx.beans.binding.Bindings; import javafx.beans.property.SimpleBooleanProperty; - import javafx.beans.property.SimpleObjectProperty; + import lombok.SneakyThrows; import java.util.Arrays; @@ -71,7 +71,8 @@ public class VaultCategory extends AppPrefsCategory { authChoice.apply(struc -> struc.get().setOpacity(1.0)); authChoice.maxWidth(600); - var groupStrategy = new SimpleObjectProperty<>(uh.getActiveUser() != null ? uh.getGroupStrategy(uh.getActiveUser()) : null); + var groupStrategy = + new SimpleObjectProperty<>(uh.getActiveUser() != null ? uh.getGroupStrategy(uh.getActiveUser()) : null); groupStrategy.addListener((obs, ov, nv) -> { uh.setCurrentGroupStrategy(nv); }); diff --git a/app/src/main/java/io/xpipe/app/process/ShellTemp.java b/app/src/main/java/io/xpipe/app/process/ShellTemp.java index 8ee24bded..5151cacba 100644 --- a/app/src/main/java/io/xpipe/app/process/ShellTemp.java +++ b/app/src/main/java/io/xpipe/app/process/ShellTemp.java @@ -1,19 +1,12 @@ package io.xpipe.app.process; -import io.xpipe.app.core.AppInstallation; import io.xpipe.app.core.AppNames; import io.xpipe.app.core.AppProperties; -import io.xpipe.app.core.AppSystemInfo; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.core.FilePath; import io.xpipe.core.OsType; -import org.apache.commons.io.FileUtils; - import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.attribute.PosixFilePermissions; public class ShellTemp { diff --git a/app/src/main/java/io/xpipe/app/pwman/PasswordManagerCommand.java b/app/src/main/java/io/xpipe/app/pwman/PasswordManagerCommand.java index 7605c3bd0..c00fc2a0d 100644 --- a/app/src/main/java/io/xpipe/app/pwman/PasswordManagerCommand.java +++ b/app/src/main/java/io/xpipe/app/pwman/PasswordManagerCommand.java @@ -18,7 +18,6 @@ import io.xpipe.core.SecretValue; import javafx.beans.property.Property; import javafx.beans.property.SimpleObjectProperty; -import javafx.scene.control.MenuButton; import javafx.scene.control.MenuItem; import com.fasterxml.jackson.annotation.JsonTypeName; diff --git a/app/src/main/java/io/xpipe/app/rdp/ExternalRdpClient.java b/app/src/main/java/io/xpipe/app/rdp/ExternalRdpClient.java index 1894719fe..3b25ce7ee 100644 --- a/app/src/main/java/io/xpipe/app/rdp/ExternalRdpClient.java +++ b/app/src/main/java/io/xpipe/app/rdp/ExternalRdpClient.java @@ -4,7 +4,6 @@ import io.xpipe.app.core.AppLocalTemp; import io.xpipe.app.ext.PrefsValue; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.process.OsFileSystem; -import io.xpipe.app.process.ShellTemp; import io.xpipe.app.util.*; import io.xpipe.core.OsType; diff --git a/app/src/main/java/io/xpipe/app/storage/DataStorageGroupStrategy.java b/app/src/main/java/io/xpipe/app/storage/DataStorageGroupStrategy.java index c895e48d7..2aaf31425 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStorageGroupStrategy.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStorageGroupStrategy.java @@ -29,7 +29,6 @@ import org.kordamp.ikonli.javafx.FontIcon; import java.io.IOException; import java.net.URI; -import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.nio.file.Files; @@ -190,13 +189,16 @@ public interface DataStorageGroupStrategy { var command = new SimpleObjectProperty<>(p.getValue().getCommand()); return new OptionsBuilder() .nameAndDescription("commandSecretField") - .addComp(IntegratedTextAreaComp.script(new ReadOnlyObjectWrapper<>(DataStorage.get().local().ref()), command), command) + .addComp( + IntegratedTextAreaComp.script( + new ReadOnlyObjectWrapper<>( + DataStorage.get().local().ref()), + command), + command) .nonNull() .bind( () -> { - return Command.builder() - .command(command.get()) - .build(); + return Command.builder().command(command.get()).build(); }, p); } @@ -210,7 +212,8 @@ public interface DataStorageGroupStrategy { @Override public String queryEncryptionSecret() throws Exception { - try (var sc = ProcessControlProvider.get().createLocalProcessControl(true).start()) { + try (var sc = + ProcessControlProvider.get().createLocalProcessControl(true).start()) { try (var cc = sc.command(command).sensitive().start()) { cc.killOnTimeout(CountDown.of().start(10_000)); var out = cc.readStdoutOrThrow(); diff --git a/app/src/main/java/io/xpipe/app/storage/DataStorageUserHandler.java b/app/src/main/java/io/xpipe/app/storage/DataStorageUserHandler.java index ee024d29e..a6f3846e5 100644 --- a/app/src/main/java/io/xpipe/app/storage/DataStorageUserHandler.java +++ b/app/src/main/java/io/xpipe/app/storage/DataStorageUserHandler.java @@ -4,8 +4,8 @@ import io.xpipe.app.comp.Comp; import io.xpipe.app.ext.ProcessControlProvider; import io.xpipe.app.platform.OptionsBuilder; import io.xpipe.app.prefs.VaultAuthentication; + import javafx.beans.property.ObjectProperty; -import javafx.beans.property.Property; import java.io.IOException; import javax.crypto.SecretKey; diff --git a/app/src/main/java/io/xpipe/app/terminal/MobaXTermTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/MobaXTermTerminalType.java index 04e91f6c9..c6e20359f 100644 --- a/app/src/main/java/io/xpipe/app/terminal/MobaXTermTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/MobaXTermTerminalType.java @@ -4,7 +4,6 @@ import io.xpipe.app.core.AppLocalTemp; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.prefs.ExternalApplicationType; import io.xpipe.app.process.CommandBuilder; -import io.xpipe.app.process.ShellTemp; import io.xpipe.app.util.*; import java.nio.file.Files; diff --git a/app/src/main/java/io/xpipe/app/terminal/ScreenTerminalMultiplexer.java b/app/src/main/java/io/xpipe/app/terminal/ScreenTerminalMultiplexer.java index 98ddbc303..6e220066e 100644 --- a/app/src/main/java/io/xpipe/app/terminal/ScreenTerminalMultiplexer.java +++ b/app/src/main/java/io/xpipe/app/terminal/ScreenTerminalMultiplexer.java @@ -36,7 +36,8 @@ public class ScreenTerminalMultiplexer implements TerminalMultiplexer { public ShellScript launchForExistingSession(ShellControl control, TerminalLaunchConfiguration config) throws Exception { var l = new ArrayList(); - var firstCommand = getCommand(control, config.single().getDialectLaunchCommand().buildSimple()); + var firstCommand = + getCommand(control, config.single().getDialectLaunchCommand().buildSimple()); l.addAll(List.of("screen -S xpipe -X screen -t \"" + escape(config.getCleanTitle(), true) + "\" " + escape(firstCommand, false))); return ShellScript.lines(l); @@ -47,7 +48,8 @@ public class ScreenTerminalMultiplexer implements TerminalMultiplexer { var list = new ArrayList(); list.add("for scr in $(screen -ls | grep xpipe | awk '{print $1}'); do screen -S $scr -X quit; done"); - var firstCommand = getCommand(control, config.single().getDialectLaunchCommand().buildSimple()); + var firstCommand = + getCommand(control, config.single().getDialectLaunchCommand().buildSimple()); list.addAll(List.of( "screen -S xpipe -t \"" + escape(config.getCleanTitle(), true) + "\" " + escape(firstCommand, false))); return ShellScript.lines(list); diff --git a/app/src/main/java/io/xpipe/app/terminal/TmuxTerminalMultiplexer.java b/app/src/main/java/io/xpipe/app/terminal/TmuxTerminalMultiplexer.java index 599069f27..3b3f32cd3 100644 --- a/app/src/main/java/io/xpipe/app/terminal/TmuxTerminalMultiplexer.java +++ b/app/src/main/java/io/xpipe/app/terminal/TmuxTerminalMultiplexer.java @@ -36,20 +36,22 @@ public class TmuxTerminalMultiplexer implements TerminalMultiplexer { public ShellScript launchForExistingSession(ShellControl control, TerminalLaunchConfiguration config) throws Exception { var l = new ArrayList(); - var firstCommand = config.getPanes().getFirst().getDialectLaunchCommand().buildSimple(); + var firstCommand = + config.getPanes().getFirst().getDialectLaunchCommand().buildSimple(); l.addAll(List.of("tmux new-window -t xpipe -n \"" + escape(config.getColoredTitle(), true) + "\" " + escape(firstCommand, false))); if (config.getPanes().size() > 1) { for (int i = 1; i < config.getPanes().size(); i++) { - var iCommand = config.getPanes().get(i).getDialectLaunchCommand().buildSimple(); + var iCommand = + config.getPanes().get(i).getDialectLaunchCommand().buildSimple(); l.add("tmux split-window -t xpipe " + escape(iCommand, false)); } var splitStrategy = AppPrefs.get().terminalSplitStrategy().getValue(); - var layoutName = splitStrategy == TerminalSplitStrategy.HORIZONTAL ? - "even-horizontal" : - splitStrategy == TerminalSplitStrategy.VERTICAL ? "even-vertical" : "tiled"; + var layoutName = splitStrategy == TerminalSplitStrategy.HORIZONTAL + ? "even-horizontal" + : splitStrategy == TerminalSplitStrategy.VERTICAL ? "even-vertical" : "tiled"; l.add("tmux select-layout -t xpipe " + layoutName); } @@ -59,7 +61,8 @@ public class TmuxTerminalMultiplexer implements TerminalMultiplexer { @Override public ShellScript launchNewSession(ShellControl control, TerminalLaunchConfiguration config) throws Exception { var l = new ArrayList(); - var firstCommand = config.getPanes().getFirst().getDialectLaunchCommand().buildSimple(); + var firstCommand = + config.getPanes().getFirst().getDialectLaunchCommand().buildSimple(); l.addAll(List.of( "tmux kill-session -t xpipe >/dev/null 2>&1", "tmux new-session -d -s xpipe", diff --git a/app/src/main/java/io/xpipe/app/terminal/ZellijTerminalMultiplexer.java b/app/src/main/java/io/xpipe/app/terminal/ZellijTerminalMultiplexer.java index b700c03cc..b87cfc40f 100644 --- a/app/src/main/java/io/xpipe/app/terminal/ZellijTerminalMultiplexer.java +++ b/app/src/main/java/io/xpipe/app/terminal/ZellijTerminalMultiplexer.java @@ -1,17 +1,14 @@ package io.xpipe.app.terminal; -import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.process.*; +import io.xpipe.app.util.ThreadHelper; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.xpipe.app.util.GlobalTimer; -import io.xpipe.app.util.ThreadHelper; import lombok.Builder; import lombok.SneakyThrows; import lombok.extern.jackson.Jacksonized; -import java.time.Duration; import java.util.ArrayList; import java.util.List; @@ -49,19 +46,25 @@ public class ZellijTerminalMultiplexer implements TerminalMultiplexer { "zellij -s xpipe action clear")); if (config.getPanes().size() > 1) { - var splitIterator = AppPrefs.get().terminalSplitStrategy().getValue().iterator(); + var splitIterator = + AppPrefs.get().terminalSplitStrategy().getValue().iterator(); splitIterator.next(); for (int i = 1; i < config.getPanes().size(); i++) { - var iCommand = config.getPanes().get(i).getDialectLaunchCommand().buildSimple(); + var iCommand = + config.getPanes().get(i).getDialectLaunchCommand().buildSimple(); var direction = splitIterator.getSplitDirection(); - var directionString = direction == TerminalSplitStrategy.SplitDirection.HORIZONTAL ? "--direction right" : "--direction down"; - l.addAll(List.of("zellij -s xpipe action new-pane " + - directionString + - " --name \"" + - escape(config.getPanes().get(i).getTitle(), false, true) + - "\"", "zellij -s xpipe action write-chars -- " + escape(" " + iCommand, true, true) + "\\;exit", - "zellij -s xpipe action write 10", "zellij -s xpipe action clear", + var directionString = direction == TerminalSplitStrategy.SplitDirection.HORIZONTAL + ? "--direction right" + : "--direction down"; + l.addAll(List.of( + "zellij -s xpipe action new-pane " + directionString + + " --name \"" + + escape(config.getPanes().get(i).getTitle(), false, true) + + "\"", + "zellij -s xpipe action write-chars -- " + escape(" " + iCommand, true, true) + "\\;exit", + "zellij -s xpipe action write 10", + "zellij -s xpipe action clear", "zellij -s xpipe action focus-next-pane")); splitIterator.next(); } @@ -82,8 +85,8 @@ public class ZellijTerminalMultiplexer implements TerminalMultiplexer { sc.command("zellij attach --create-background xpipe").executeAndCheck(); var asyncLines = new ArrayList(); - asyncLines.addAll(List.of( - "sleep 0.5", + asyncLines.addAll(List.of( + "sleep 0.5", "zellij -s xpipe action new-tab --name \"" + escape(config.getColoredTitle(), false, true) + "\"", "zellij -s xpipe action write-chars -- " + escape(" " + firstCommand, true, true) + "\\;exit", "zellij -s xpipe action write 10", @@ -93,10 +96,12 @@ public class ZellijTerminalMultiplexer implements TerminalMultiplexer { "zellij -s xpipe action close-tab")); if (config.getPanes().size() > 1) { - var splitIterator = AppPrefs.get().terminalSplitStrategy().getValue().iterator(); + var splitIterator = + AppPrefs.get().terminalSplitStrategy().getValue().iterator(); splitIterator.next(); for (int i = 1; i < config.getPanes().size(); i++) { - var iCommand = config.getPanes().get(i).getDialectLaunchCommand().buildSimple(); + var iCommand = + config.getPanes().get(i).getDialectLaunchCommand().buildSimple(); var direction = splitIterator.getSplitDirection(); var directionString = direction == TerminalSplitStrategy.SplitDirection.HORIZONTAL ? "--direction right" diff --git a/app/src/main/java/io/xpipe/app/update/AppInstaller.java b/app/src/main/java/io/xpipe/app/update/AppInstaller.java index 7b50187b3..9cb1518e4 100644 --- a/app/src/main/java/io/xpipe/app/update/AppInstaller.java +++ b/app/src/main/java/io/xpipe/app/update/AppInstaller.java @@ -59,8 +59,7 @@ public class AppInstaller { public void installLocal(Path file) { var logsDir = AppLogs.get().getSessionLogsDirectory().getParent().toString(); - var logFile = - FilePath.of(logsDir, "installer.log"); + var logFile = FilePath.of(logsDir, "installer.log"); var systemWide = isSystemWide(); var cmdScript = LocalShell.getDialect() == ShellDialects.CMD && !systemWide; var command = cmdScript diff --git a/app/src/main/java/io/xpipe/app/update/UpdateChangelogDialog.java b/app/src/main/java/io/xpipe/app/update/UpdateChangelogDialog.java index b99f2fcff..52d3410c6 100644 --- a/app/src/main/java/io/xpipe/app/update/UpdateChangelogDialog.java +++ b/app/src/main/java/io/xpipe/app/update/UpdateChangelogDialog.java @@ -23,13 +23,15 @@ public class UpdateChangelogDialog { public static void showIfNeeded() { var update = AppDistributionType.get().getUpdateHandler().getPerformedUpdate(); if (update != null && !AppDistributionType.get().getUpdateHandler().isUpdateSucceeded()) { - ErrorEvent.ErrorEventBuilder eventBuilder = ErrorEventFactory.fromMessage(AppI18n.get("updateFail")).documentationLink( - DocumentationLink.UPDATE_FAIL).customAction(ErrorAction.translated("updateFailAction", () -> { - Hyperlinks.open(Hyperlinks.GITHUB_LATEST); - return true; - })); + ErrorEvent.ErrorEventBuilder eventBuilder = ErrorEventFactory.fromMessage(AppI18n.get("updateFail")) + .documentationLink(DocumentationLink.UPDATE_FAIL) + .customAction(ErrorAction.translated("updateFailAction", () -> { + Hyperlinks.open(Hyperlinks.GITHUB_LATEST); + return true; + })); if (OsType.ofLocal() == OsType.WINDOWS) { - var installerLog = AppLogs.get().getSessionLogsDirectory().getParent().resolve("installer.log"); + var installerLog = + AppLogs.get().getSessionLogsDirectory().getParent().resolve("installer.log"); if (Files.exists(installerLog)) { eventBuilder.attachment(installerLog); } diff --git a/app/src/main/java/io/xpipe/app/util/FileBridge.java b/app/src/main/java/io/xpipe/app/util/FileBridge.java index ef53b37a5..e7b8002ab 100644 --- a/app/src/main/java/io/xpipe/app/util/FileBridge.java +++ b/app/src/main/java/io/xpipe/app/util/FileBridge.java @@ -8,7 +8,6 @@ import io.xpipe.app.core.AppLocalTemp; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.issue.TrackEvent; import io.xpipe.app.process.OsFileSystem; -import io.xpipe.app.process.ShellTemp; import io.xpipe.core.FailableFunction; import io.xpipe.core.FailableSupplier; diff --git a/app/src/main/java/io/xpipe/app/util/GithubReleaseDownloader.java b/app/src/main/java/io/xpipe/app/util/GithubReleaseDownloader.java index b458247f4..a3de072b9 100644 --- a/app/src/main/java/io/xpipe/app/util/GithubReleaseDownloader.java +++ b/app/src/main/java/io/xpipe/app/util/GithubReleaseDownloader.java @@ -3,7 +3,6 @@ package io.xpipe.app.util; import io.xpipe.app.core.AppLocalTemp; import io.xpipe.app.process.CommandBuilder; import io.xpipe.app.process.LocalShell; -import io.xpipe.app.process.ShellTemp; import io.xpipe.core.JacksonMapper; import java.io.IOException; diff --git a/app/src/main/java/io/xpipe/app/util/RemminaHelper.java b/app/src/main/java/io/xpipe/app/util/RemminaHelper.java index e3af8ad0f..0de5876c5 100644 --- a/app/src/main/java/io/xpipe/app/util/RemminaHelper.java +++ b/app/src/main/java/io/xpipe/app/util/RemminaHelper.java @@ -4,7 +4,6 @@ import io.xpipe.app.core.AppLocalTemp; import io.xpipe.app.core.window.AppMainWindow; import io.xpipe.app.process.LocalShell; import io.xpipe.app.process.OsFileSystem; -import io.xpipe.app.process.ShellTemp; import io.xpipe.app.rdp.RdpLaunchConfig; import io.xpipe.app.vnc.VncLaunchConfig; import io.xpipe.core.SecretValue; diff --git a/beacon/src/main/java/io/xpipe/beacon/BeaconConfig.java b/beacon/src/main/java/io/xpipe/beacon/BeaconConfig.java index a251ce63c..c061ded22 100644 --- a/beacon/src/main/java/io/xpipe/beacon/BeaconConfig.java +++ b/beacon/src/main/java/io/xpipe/beacon/BeaconConfig.java @@ -1,6 +1,7 @@ package io.xpipe.beacon; import io.xpipe.core.OsType; + import lombok.experimental.UtilityClass; import java.nio.file.Path; @@ -57,11 +58,13 @@ public class BeaconConfig { .map(Boolean::parseBoolean) .orElse(false); if (OsType.ofLocal() == OsType.LINUX) { - return Path.of(System.getProperty("java.io.tmpdir"), staging ? "xpipe-ptb" : "xpipe", - System.getProperty("user.name"), "beacon-auth"); - } else { - return Path.of(System.getProperty("java.io.tmpdir"), staging ? "xpipe-ptb" : "xpipe", + return Path.of( + System.getProperty("java.io.tmpdir"), + staging ? "xpipe-ptb" : "xpipe", + System.getProperty("user.name"), "beacon-auth"); + } else { + return Path.of(System.getProperty("java.io.tmpdir"), staging ? "xpipe-ptb" : "xpipe", "beacon-auth"); } } } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/host/HostAddressChoiceComp.java b/ext/base/src/main/java/io/xpipe/ext/base/host/HostAddressChoiceComp.java index 1096b17d5..ddcfdd062 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/host/HostAddressChoiceComp.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/host/HostAddressChoiceComp.java @@ -4,8 +4,8 @@ import io.xpipe.app.comp.Comp; import io.xpipe.app.comp.CompStructure; import io.xpipe.app.comp.SimpleCompStructure; import io.xpipe.app.comp.base.*; - import io.xpipe.app.platform.MenuHelper; + import javafx.application.Platform; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; diff --git a/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentityChoiceBuilder.java b/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentityChoiceBuilder.java index e5e30d63b..ed955ec34 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentityChoiceBuilder.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/identity/IdentityChoiceBuilder.java @@ -18,8 +18,8 @@ import io.xpipe.ext.base.identity.ssh.SshIdentityStrategyChoiceConfig; import javafx.beans.binding.Bindings; import javafx.beans.property.*; - import javafx.beans.value.ObservableValue; + import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Value; @@ -42,10 +42,15 @@ public class IdentityChoiceBuilder { ObservableValue passwordChoiceTranslationKey; public IdentityChoiceBuilder( - ObjectProperty identity, boolean allowCustomUserInput, boolean requireUserInput, boolean requirePassword, boolean keyInput, + ObjectProperty identity, + boolean allowCustomUserInput, + boolean requireUserInput, + boolean requirePassword, + boolean keyInput, boolean requireKeyInput, - boolean allowAgentForward, String userChoiceTranslationKey, String passwordChoiceTranslationKey - ) { + boolean allowAgentForward, + String userChoiceTranslationKey, + String passwordChoiceTranslationKey) { this.identity = identity; this.allowCustomUserInput = allowCustomUserInput; this.requireUserInput = requireUserInput; @@ -121,12 +126,18 @@ public class IdentityChoiceBuilder { .nameAndDescription(userChoiceTranslationKey) .addComp(new IdentitySelectComp(ref, user, pass, identityStrategy, allowCustomUserInput), user) .nonNullIf(inPlaceSelected.and(new SimpleBooleanProperty(requireUserInput))) - .name(Bindings.createStringBinding(() -> { - return AppI18n.get(passwordChoiceTranslationKey.getValue()); - }, passwordChoiceTranslationKey, AppI18n.activeLanguage())) - .description(Bindings.createStringBinding(() -> { - return AppI18n.get(passwordChoiceTranslationKey.getValue() + "Description"); - }, passwordChoiceTranslationKey, AppI18n.activeLanguage())) + .name(Bindings.createStringBinding( + () -> { + return AppI18n.get(passwordChoiceTranslationKey.getValue()); + }, + passwordChoiceTranslationKey, + AppI18n.activeLanguage())) + .description(Bindings.createStringBinding( + () -> { + return AppI18n.get(passwordChoiceTranslationKey.getValue() + "Description"); + }, + passwordChoiceTranslationKey, + AppI18n.activeLanguage())) .sub(passwordChoice, pass) .nonNullIf(inPlaceSelected.and(new SimpleBooleanProperty(requirePassword))) .hide(refSelected) @@ -155,10 +166,14 @@ public class IdentityChoiceBuilder { // In case of team vaults, identities shouldn't really be specified inline anyway // If they are, we use the vault key to make it accessible for all users var useUserKey = DataStorageUserHandler.getInstance().getUserCount() <= 1; - var p = useUserKey ? EncryptedValue.CurrentKey.of(pass.get()) : EncryptedValue.VaultKey.of(pass.get()); - EncryptedValue i = keyInput ? - (useUserKey ? EncryptedValue.CurrentKey.of(identityStrategy.get()) : EncryptedValue.VaultKey.of(identityStrategy.get())) : - null; + var p = useUserKey + ? EncryptedValue.CurrentKey.of(pass.get()) + : EncryptedValue.VaultKey.of(pass.get()); + EncryptedValue i = keyInput + ? (useUserKey + ? EncryptedValue.CurrentKey.of(identityStrategy.get()) + : EncryptedValue.VaultKey.of(identityStrategy.get())) + : null; if (u == null && p == null && i == null) { return null; } else { diff --git a/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/InPlaceKeyStrategy.java b/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/InPlaceKeyStrategy.java index 81b722b21..9eed8dfd7 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/InPlaceKeyStrategy.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/identity/ssh/InPlaceKeyStrategy.java @@ -175,7 +175,10 @@ public class InPlaceKeyStrategy implements SshIdentityStrategy { } private FilePath getTargetFilePath() { - var temp = AppSystemInfo.ofCurrent().getTemp().resolve("xpipe-" + Math.abs(Objects.hash(this, AppSystemInfo.ofCurrent().getUser())) + ".key"); + var temp = AppSystemInfo.ofCurrent() + .getTemp() + .resolve("xpipe-" + + Math.abs(Objects.hash(this, AppSystemInfo.ofCurrent().getUser())) + ".key"); return FilePath.of(temp); } }