From 0b31eed2a565c3a9e2496f5499a908d00b54ea36 Mon Sep 17 00:00:00 2001 From: crschnick Date: Sat, 29 Jul 2023 12:36:04 +0000 Subject: [PATCH] [stage] [noannounce] --- .../main/java/io/xpipe/api/DataSource.java | 24 +- .../io/xpipe/api/DataTableAccumulator.java | 10 +- .../java/io/xpipe/api/impl/DataRawImpl.java | 4 +- .../io/xpipe/api/impl/DataSourceImpl.java | 14 +- .../io/xpipe/api/impl/DataStructureImpl.java | 4 +- .../api/impl/DataTableAccumulatorImpl.java | 4 +- .../java/io/xpipe/api/impl/DataTableImpl.java | 4 +- .../java/io/xpipe/api/impl/DataTextImpl.java | 4 +- .../java/io/xpipe/api/test/DataTableTest.java | 4 +- app/build.gradle | 3 +- .../app/browser/BrowserBreadcrumbBar.java | 5 +- .../app/browser/BrowserFileListCompEntry.java | 2 +- .../app/browser/BrowserFileListModel.java | 2 +- .../app/browser/BrowserFileOverviewComp.java | 2 +- .../io/xpipe/app/browser/BrowserNavBar.java | 8 +- .../xpipe/app/browser/BrowserWelcomeComp.java | 4 + .../xpipe/app/browser/OpenFileSystemComp.java | 2 +- .../app/browser/OpenFileSystemModel.java | 12 +- .../io/xpipe/app/comp/base/ButtonComp.java | 10 +- .../io/xpipe/app/comp/base/MarkdownComp.java | 6 +- .../io/xpipe/app/comp/base/OsLogoComp.java | 59 + .../xpipe/app/comp/base/SideMenuBarComp.java | 4 +- .../xpipe/app/comp/base/SystemStateComp.java | 21 +- .../storage/store/StandardStoreEntryComp.java | 4 +- app/src/main/java/io/xpipe/app/core/App.java | 3 - .../io/xpipe/app/core/AppAntivirusAlert.java | 61 + .../io/xpipe/app/core/AppFileWatcher.java | 10 + .../java/io/xpipe/app/core/AppImages.java | 4 + .../io/xpipe/app/core/AppLayoutModel.java | 4 + .../java/io/xpipe/app/core/AppProperties.java | 12 +- .../main/java/io/xpipe/app/core/AppTheme.java | 9 - .../java/io/xpipe/app/core/mode/BaseMode.java | 15 +- .../java/io/xpipe/app/core/mode/GuiMode.java | 7 +- .../io/xpipe/app/core/mode/OperationMode.java | 50 +- .../io/xpipe/app/core/mode/PlatformMode.java | 59 +- .../java/io/xpipe/app/core/mode/TrayMode.java | 7 +- .../app/exchange/LaunchExchangeImpl.java | 2 +- .../app/exchange/MessageExchangeImpl.java | 13 + .../xpipe/app/exchange/ReadExchangeImpl.java | 7 - .../app/exchange/cli/DrainExchangeImpl.java | 30 + .../exchange/cli/ListStoresExchangeImpl.java | 7 +- .../exchange/cli/ReadDrainExchangeImpl.java | 28 - .../app/exchange/cli/SinkExchangeImpl.java | 29 + .../io/xpipe/app/ext/DataSourceTarget.java | 6 +- .../io/xpipe/app/ext/DataStoreProvider.java | 16 +- .../io/xpipe/app/ext/DataStoreProviders.java | 5 +- .../app/fxcomps/impl/ChoicePaneComp.java | 3 +- .../app/fxcomps/impl/FileStoreChoiceComp.java | 2 +- .../xpipe/app/fxcomps/impl/OptionsComp.java | 9 +- .../app/fxcomps/impl/PrettyImageComp.java | 33 +- .../app/fxcomps/impl/SecretFieldComp.java | 7 + .../xpipe/app/fxcomps/impl/TextAreaComp.java | 6 + .../xpipe/app/issue/SentryErrorHandler.java | 1 + .../xpipe/app/launcher/LauncherCommand.java | 5 +- .../io/xpipe/app/prefs/AppPreferencesFx.java | 2 + .../java/io/xpipe/app/prefs/AppPrefs.java | 173 +- .../io/xpipe/app/prefs/CustomValidators.java | 5 +- .../app/prefs/ExternalApplicationType.java | 56 +- .../xpipe/app/prefs/ExternalEditorType.java | 47 +- .../xpipe/app/prefs/ExternalTerminalType.java | 95 +- .../io/xpipe/app/storage/DataStorage.java | 36 + .../io/xpipe/app/storage/StandardStorage.java | 10 +- .../io/xpipe/app/update/UpdateHandler.java | 8 + .../io/xpipe/app/util/ApplicationHelper.java | 5 + .../java/io/xpipe/app/util/AskpassAlert.java | 62 + .../java/io/xpipe/app/util/DesktopHelper.java | 10 + .../io/xpipe/app/util/DesktopShortcuts.java | 10 +- .../io/xpipe/app/util/OptionsBuilder.java | 76 +- .../java/io/xpipe/app/util/PlatformState.java | 76 + .../java/io/xpipe/app/util/ScriptHelper.java | 22 +- .../app/util/SecretRetrievalStrategy.java | 130 + .../util/SecretRetrievalStrategyHelper.java | 105 + .../java/io/xpipe/app/util/ThreadHelper.java | 4 +- .../java/io/xpipe/app/util/Validator.java | 2 +- app/src/main/java/module-info.java | 2 + .../app/resources/img/os/alpine-color.svg | 1 + .../app/resources/img/os/amazon-color.svg | 1 + .../xpipe/app/resources/img/os/apple-dark.svg | 1 + .../io/xpipe/app/resources/img/os/apple.svg | 1 + .../xpipe/app/resources/img/os/arch-color.svg | 1 + .../app/resources/img/os/centos-color.svg | 1 + .../app/resources/img/os/debian-color.svg | 1 + .../app/resources/img/os/fedora-color.svg | 1 + .../app/resources/img/os/gentoo-color.svg | 1 + .../app/resources/img/os/kubuntu-color.svg | 1 + .../io/xpipe/app/resources/img/os/linux.svg | 3409 +++++++++++++++++ .../app/resources/img/os/manjaro-color.svg | 1 + .../xpipe/app/resources/img/os/mint-color.svg | 1 + .../app/resources/img/os/opensuse-color.svg | 1 + .../xpipe/app/resources/img/os/pop-color.svg | 1 + .../app/resources/img/os/redhat-color.svg | 1 + .../app/resources/img/os/rockylinux-color.svg | 1 + .../app/resources/img/os/ubuntu-color.svg | 1 + .../app/resources/img/os/windows-color.svg | 1 + .../resources/lang/preferences_en.properties | 6 +- .../resources/lang/translations_en.properties | 6 + .../io/xpipe/app/resources/misc/antivirus.md | 16 + .../io/xpipe/app/resources/style/style.css | 4 +- .../resources/web/github-markdown-dark.css | 1006 +++++ ...markdown.css => github-markdown-light.css} | 0 .../beacon/exchange/AddSourceExchange.java | 6 +- .../xpipe/beacon/exchange/DrainExchange.java | 34 + .../xpipe/beacon/exchange/EditExchange.java | 4 +- .../xpipe/beacon/exchange/LaunchExchange.java | 3 +- .../exchange/QueryDataSourceExchange.java | 4 +- .../xpipe/beacon/exchange/ReadExchange.java | 4 +- .../xpipe/beacon/exchange/SinkExchange.java | 34 + .../beacon/exchange/cli/ConvertExchange.java | 4 +- .../exchange/cli/ReadDrainExchange.java | 4 - .../exchange/cli/RemoveEntryExchange.java | 4 +- .../exchange/cli/RenameEntryExchange.java | 4 +- .../beacon/exchange/data/StoreListEntry.java | 4 +- beacon/src/main/java/module-info.java | 2 + build.gradle | 2 +- .../java/io/xpipe/core/impl/FileNames.java | 5 +- .../java/io/xpipe/core/impl/LocalStore.java | 12 + .../io/xpipe/core/impl/SinkDrainStore.java | 167 - .../io/xpipe/core/process/CommandBuilder.java | 93 +- .../core/process/ProcessOutputException.java | 2 +- .../io/xpipe/core/process/ShellControl.java | 32 +- .../io/xpipe/core/process/ShellDialect.java | 2 +- .../io/xpipe/core/process/ShellDialects.java | 2 + .../io/xpipe/core/source/DataSourceId.java | 101 - .../core/source/DataSourceReference.java | 26 +- .../io/xpipe/core/source/DataStoreId.java | 84 + .../core/test/DataSourceReferenceTest.java | 6 +- ...SourceIdTest.java => DataStoreIdTest.java} | 28 +- dist/changelogs/1.5.0.md | 71 + dist/debug/debug_arguments.txt | 2 +- .../ext/base/SinkDrainStoreProvider.java | 109 - .../ext/base/browser/FollowLinkAction.java | 2 +- .../ext/base/browser/OpenDirectoryAction.java | 2 +- .../browser/OpenNativeFileDetailsAction.java | 12 +- ext/base/src/main/java/module-info.java | 1 - version | 2 +- 135 files changed, 6046 insertions(+), 895 deletions(-) create mode 100644 app/src/main/java/io/xpipe/app/comp/base/OsLogoComp.java create mode 100644 app/src/main/java/io/xpipe/app/core/AppAntivirusAlert.java create mode 100644 app/src/main/java/io/xpipe/app/exchange/cli/DrainExchangeImpl.java create mode 100644 app/src/main/java/io/xpipe/app/exchange/cli/SinkExchangeImpl.java create mode 100644 app/src/main/java/io/xpipe/app/util/AskpassAlert.java create mode 100644 app/src/main/java/io/xpipe/app/util/SecretRetrievalStrategy.java create mode 100644 app/src/main/java/io/xpipe/app/util/SecretRetrievalStrategyHelper.java create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/alpine-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/amazon-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/apple-dark.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/apple.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/arch-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/centos-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/debian-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/fedora-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/gentoo-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/kubuntu-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/linux.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/manjaro-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/mint-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/opensuse-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/pop-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/redhat-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/rockylinux-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/ubuntu-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/img/os/windows-color.svg create mode 100644 app/src/main/resources/io/xpipe/app/resources/misc/antivirus.md create mode 100644 app/src/main/resources/io/xpipe/app/resources/web/github-markdown-dark.css rename app/src/main/resources/io/xpipe/app/resources/web/{github-markdown.css => github-markdown-light.css} (100%) create mode 100644 beacon/src/main/java/io/xpipe/beacon/exchange/DrainExchange.java create mode 100644 beacon/src/main/java/io/xpipe/beacon/exchange/SinkExchange.java delete mode 100644 core/src/main/java/io/xpipe/core/impl/SinkDrainStore.java delete mode 100644 core/src/main/java/io/xpipe/core/source/DataSourceId.java create mode 100644 core/src/main/java/io/xpipe/core/source/DataStoreId.java rename core/src/test/java/io/xpipe/core/test/{DataSourceIdTest.java => DataStoreIdTest.java} (63%) create mode 100644 dist/changelogs/1.5.0.md delete mode 100644 ext/base/src/main/java/io/xpipe/ext/base/SinkDrainStoreProvider.java diff --git a/api/src/main/java/io/xpipe/api/DataSource.java b/api/src/main/java/io/xpipe/api/DataSource.java index b81f8233b..62cc8d65c 100644 --- a/api/src/main/java/io/xpipe/api/DataSource.java +++ b/api/src/main/java/io/xpipe/api/DataSource.java @@ -1,7 +1,7 @@ package io.xpipe.api; import io.xpipe.api.impl.DataSourceImpl; -import io.xpipe.core.source.DataSourceId; +import io.xpipe.core.source.DataStoreId; import io.xpipe.core.source.DataSourceReference; import io.xpipe.core.source.DataSourceType; import io.xpipe.core.store.DataStore; @@ -96,16 +96,16 @@ public interface DataSource { } /** - * Wrapper for {@link #create(DataSourceId, String, InputStream)} that creates an anonymous data source. + * Wrapper for {@link #create(DataStoreId, String, InputStream)} that creates an anonymous data source. */ static DataSource createAnonymous(String type, Path path) { return create(null, type, path); } /** - * Wrapper for {@link #create(DataSourceId, String, InputStream)}. + * Wrapper for {@link #create(DataStoreId, String, InputStream)}. */ - static DataSource create(DataSourceId id, String type, Path path) { + static DataSource create(DataStoreId id, String type, Path path) { try (var in = Files.newInputStream(path)) { return create(id, type, in); } catch (IOException e) { @@ -114,16 +114,16 @@ public interface DataSource { } /** - * Wrapper for {@link #create(DataSourceId, String, InputStream)} that creates an anonymous data source. + * Wrapper for {@link #create(DataStoreId, String, InputStream)} that creates an anonymous data source. */ static DataSource createAnonymous(String type, URL url) { return create(null, type, url); } /** - * Wrapper for {@link #create(DataSourceId, String, InputStream)}. + * Wrapper for {@link #create(DataStoreId, String, InputStream)}. */ - static DataSource create(DataSourceId id, String type, URL url) { + static DataSource create(DataStoreId id, String type, URL url) { try (var in = url.openStream()) { return create(id, type, in); } catch (IOException e) { @@ -132,7 +132,7 @@ public interface DataSource { } /** - * Wrapper for {@link #create(DataSourceId, String, InputStream)} that creates an anonymous data source. + * Wrapper for {@link #create(DataStoreId, String, InputStream)} that creates an anonymous data source. */ static DataSource createAnonymous(String type, InputStream in) { return create(null, type, in); @@ -146,7 +146,7 @@ public interface DataSource { * @param in the input stream to read * @return a {@link DataSource} instances that can be used to access the underlying data */ - static DataSource create(DataSourceId id, String type, InputStream in) { + static DataSource create(DataStoreId id, String type, InputStream in) { return DataSourceImpl.create(id, type, in); } @@ -156,7 +156,7 @@ public interface DataSource { * @param id the data source id * @return a {@link DataSource} instances that can be used to access the underlying data */ - static DataSource create(DataSourceId id, io.xpipe.core.source.DataSource source) { + static DataSource create(DataStoreId id, io.xpipe.core.source.DataSource source) { return DataSourceImpl.create(id, source); } @@ -169,7 +169,7 @@ public interface DataSource { * @param in the data store to add * @return a {@link DataSource} instances that can be used to access the underlying data */ - static DataSource create(DataSourceId id, String type, DataStore in) { + static DataSource create(DataStoreId id, String type, DataStore in) { return DataSourceImpl.create(id, type, in); } @@ -182,7 +182,7 @@ public interface DataSource { /** * Returns the id of this data source. */ - DataSourceId getId(); + DataStoreId getId(); /** * Returns the type of this data source. diff --git a/api/src/main/java/io/xpipe/api/DataTableAccumulator.java b/api/src/main/java/io/xpipe/api/DataTableAccumulator.java index 5b8897946..768037193 100644 --- a/api/src/main/java/io/xpipe/api/DataTableAccumulator.java +++ b/api/src/main/java/io/xpipe/api/DataTableAccumulator.java @@ -4,14 +4,14 @@ import io.xpipe.api.impl.DataTableAccumulatorImpl; import io.xpipe.core.data.node.DataStructureNode; import io.xpipe.core.data.node.DataStructureNodeAcceptor; import io.xpipe.core.data.type.TupleType; -import io.xpipe.core.source.DataSourceId; +import io.xpipe.core.source.DataStoreId; /** * An accumulator for table data. *

* This class can be used to construct new table data sources by * accumulating the rows using {@link #add(DataStructureNode)} or {@link #acceptor()} and then calling - * {@link #finish(DataSourceId)} to complete the construction process and create a new data source. + * {@link #finish(DataStoreId)} to complete the construction process and create a new data source. */ public interface DataTableAccumulator { @@ -20,10 +20,10 @@ public interface DataTableAccumulator { } /** - * Wrapper for {@link #finish(DataSourceId)}. + * Wrapper for {@link #finish(DataStoreId)}. */ default DataTable finish(String id) { - return finish(DataSourceId.fromString(id)); + return finish(DataStoreId.fromString(id)); } /** @@ -31,7 +31,7 @@ public interface DataTableAccumulator { * * @param id the data source id to assign */ - DataTable finish(DataSourceId id); + DataTable finish(DataStoreId id); /** * Adds a row to the table. diff --git a/api/src/main/java/io/xpipe/api/impl/DataRawImpl.java b/api/src/main/java/io/xpipe/api/impl/DataRawImpl.java index d9059ee02..4f63432f1 100644 --- a/api/src/main/java/io/xpipe/api/impl/DataRawImpl.java +++ b/api/src/main/java/io/xpipe/api/impl/DataRawImpl.java @@ -2,7 +2,7 @@ package io.xpipe.api.impl; import io.xpipe.api.DataRaw; import io.xpipe.api.DataSourceConfig; -import io.xpipe.core.source.DataSourceId; +import io.xpipe.core.source.DataStoreId; import io.xpipe.core.source.DataSourceType; import java.io.InputStream; @@ -10,7 +10,7 @@ import java.io.InputStream; public class DataRawImpl extends DataSourceImpl implements DataRaw { public DataRawImpl( - DataSourceId sourceId, DataSourceConfig sourceConfig, io.xpipe.core.source.DataSource internalSource) { + DataStoreId sourceId, DataSourceConfig sourceConfig, io.xpipe.core.source.DataSource internalSource) { super(sourceId, sourceConfig, internalSource); } diff --git a/api/src/main/java/io/xpipe/api/impl/DataSourceImpl.java b/api/src/main/java/io/xpipe/api/impl/DataSourceImpl.java index 4d3b904be..e43af2464 100644 --- a/api/src/main/java/io/xpipe/api/impl/DataSourceImpl.java +++ b/api/src/main/java/io/xpipe/api/impl/DataSourceImpl.java @@ -4,7 +4,7 @@ import io.xpipe.api.DataSource; import io.xpipe.api.DataSourceConfig; import io.xpipe.api.connector.XPipeApiConnection; import io.xpipe.beacon.exchange.*; -import io.xpipe.core.source.DataSourceId; +import io.xpipe.core.source.DataStoreId; import io.xpipe.core.source.DataSourceReference; import io.xpipe.core.store.DataStore; import io.xpipe.core.store.StreamDataStore; @@ -13,12 +13,12 @@ import java.io.InputStream; public abstract class DataSourceImpl implements DataSource { - private final DataSourceId sourceId; + private final DataStoreId sourceId; private final DataSourceConfig config; private final io.xpipe.core.source.DataSource internalSource; public DataSourceImpl( - DataSourceId sourceId, DataSourceConfig config, io.xpipe.core.source.DataSource internalSource) { + DataStoreId sourceId, DataSourceConfig config, io.xpipe.core.source.DataSource internalSource) { this.sourceId = sourceId; this.config = config; this.internalSource = internalSource; @@ -48,7 +48,7 @@ public abstract class DataSourceImpl implements DataSource { }); } - public static DataSource create(DataSourceId id, io.xpipe.core.source.DataSource source) { + public static DataSource create(DataStoreId id, io.xpipe.core.source.DataSource source) { var startReq = AddSourceExchange.Request.builder().source(source).target(id).build(); var returnedId = XPipeApiConnection.execute(con -> { @@ -60,7 +60,7 @@ public abstract class DataSourceImpl implements DataSource { return get(ref); } - public static DataSource create(DataSourceId id, String type, DataStore store) { + public static DataSource create(DataStoreId id, String type, DataStore store) { if (store instanceof StreamDataStore s && s.isContentExclusivelyAccessible()) { store = XPipeApiConnection.execute(con -> { var internal = con.createInternalStreamStore(); @@ -94,7 +94,7 @@ public abstract class DataSourceImpl implements DataSource { return get(ref); } - public static DataSource create(DataSourceId id, String type, InputStream in) { + public static DataSource create(DataStoreId id, String type, InputStream in) { var store = XPipeApiConnection.execute(con -> { var internal = con.createInternalStreamStore(); var req = WriteStreamExchange.Request.builder() @@ -152,7 +152,7 @@ public abstract class DataSourceImpl implements DataSource { } @Override - public DataSourceId getId() { + public DataStoreId getId() { return sourceId; } diff --git a/api/src/main/java/io/xpipe/api/impl/DataStructureImpl.java b/api/src/main/java/io/xpipe/api/impl/DataStructureImpl.java index d21a37e14..f1e2f8ca1 100644 --- a/api/src/main/java/io/xpipe/api/impl/DataStructureImpl.java +++ b/api/src/main/java/io/xpipe/api/impl/DataStructureImpl.java @@ -3,13 +3,13 @@ package io.xpipe.api.impl; import io.xpipe.api.DataSourceConfig; import io.xpipe.api.DataStructure; import io.xpipe.core.data.node.DataStructureNode; -import io.xpipe.core.source.DataSourceId; +import io.xpipe.core.source.DataStoreId; import io.xpipe.core.source.DataSourceType; public class DataStructureImpl extends DataSourceImpl implements DataStructure { DataStructureImpl( - DataSourceId sourceId, DataSourceConfig sourceConfig, io.xpipe.core.source.DataSource internalSource) { + DataStoreId sourceId, DataSourceConfig sourceConfig, io.xpipe.core.source.DataSource internalSource) { super(sourceId, sourceConfig, internalSource); } diff --git a/api/src/main/java/io/xpipe/api/impl/DataTableAccumulatorImpl.java b/api/src/main/java/io/xpipe/api/impl/DataTableAccumulatorImpl.java index 1a9a65838..cf89065d9 100644 --- a/api/src/main/java/io/xpipe/api/impl/DataTableAccumulatorImpl.java +++ b/api/src/main/java/io/xpipe/api/impl/DataTableAccumulatorImpl.java @@ -16,7 +16,7 @@ import io.xpipe.core.data.node.TupleNode; import io.xpipe.core.data.type.TupleType; import io.xpipe.core.data.typed.TypedDataStreamWriter; import io.xpipe.core.impl.InternalStreamStore; -import io.xpipe.core.source.DataSourceId; +import io.xpipe.core.source.DataStoreId; import io.xpipe.core.source.DataSourceReference; import java.io.IOException; @@ -51,7 +51,7 @@ public class DataTableAccumulatorImpl implements DataTableAccumulator { } @Override - public synchronized DataTable finish(DataSourceId id) { + public synchronized DataTable finish(DataStoreId id) { try { bodyOutput.close(); } catch (IOException e) { diff --git a/api/src/main/java/io/xpipe/api/impl/DataTableImpl.java b/api/src/main/java/io/xpipe/api/impl/DataTableImpl.java index 436ac3167..4862964c6 100644 --- a/api/src/main/java/io/xpipe/api/impl/DataTableImpl.java +++ b/api/src/main/java/io/xpipe/api/impl/DataTableImpl.java @@ -5,7 +5,7 @@ import io.xpipe.api.DataTable; import io.xpipe.core.data.node.ArrayNode; import io.xpipe.core.data.node.DataStructureNode; import io.xpipe.core.data.node.TupleNode; -import io.xpipe.core.source.DataSourceId; +import io.xpipe.core.source.DataStoreId; import io.xpipe.core.source.DataSourceType; import java.util.ArrayList; @@ -15,7 +15,7 @@ import java.util.stream.Stream; public class DataTableImpl extends DataSourceImpl implements DataTable { - DataTableImpl(DataSourceId id, DataSourceConfig sourceConfig, io.xpipe.core.source.DataSource internalSource) { + DataTableImpl(DataStoreId id, DataSourceConfig sourceConfig, io.xpipe.core.source.DataSource internalSource) { super(id, sourceConfig, internalSource); } diff --git a/api/src/main/java/io/xpipe/api/impl/DataTextImpl.java b/api/src/main/java/io/xpipe/api/impl/DataTextImpl.java index c4c72f22a..19658e9ce 100644 --- a/api/src/main/java/io/xpipe/api/impl/DataTextImpl.java +++ b/api/src/main/java/io/xpipe/api/impl/DataTextImpl.java @@ -2,7 +2,7 @@ package io.xpipe.api.impl; import io.xpipe.api.DataSourceConfig; import io.xpipe.api.DataText; -import io.xpipe.core.source.DataSourceId; +import io.xpipe.core.source.DataStoreId; import io.xpipe.core.source.DataSourceType; import java.util.List; @@ -12,7 +12,7 @@ import java.util.stream.Stream; public class DataTextImpl extends DataSourceImpl implements DataText { DataTextImpl( - DataSourceId sourceId, DataSourceConfig sourceConfig, io.xpipe.core.source.DataSource internalSource) { + DataStoreId sourceId, DataSourceConfig sourceConfig, io.xpipe.core.source.DataSource internalSource) { super(sourceId, sourceConfig, internalSource); } diff --git a/api/src/test/java/io/xpipe/api/test/DataTableTest.java b/api/src/test/java/io/xpipe/api/test/DataTableTest.java index e8138be46..95ef63d3b 100644 --- a/api/src/test/java/io/xpipe/api/test/DataTableTest.java +++ b/api/src/test/java/io/xpipe/api/test/DataTableTest.java @@ -1,7 +1,7 @@ package io.xpipe.api.test; import io.xpipe.api.DataSource; -import io.xpipe.core.source.DataSourceId; +import io.xpipe.core.source.DataStoreId; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -10,7 +10,7 @@ public class DataTableTest extends ApiTest { @BeforeAll public static void setupStorage() throws Exception { DataSource.create( - DataSourceId.fromString(":usernames"), "csv", DataTableTest.class.getResource("username.csv")); + DataStoreId.fromString(":usernames"), "csv", DataTableTest.class.getResource("username.csv")); } @Test diff --git a/app/build.gradle b/app/build.gradle index 24d0a9d3d..f4049fdbb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -156,11 +156,12 @@ run { // systemProperty "io.xpipe.beacon.localProxy", "true" - systemProperties System.getProperties() systemProperty 'java.library.path', "./lib" + workingDir = rootDir } task runAttachedDebugger(type: JavaExec) { + workingDir = rootDir classpath = run.classpath mainModule = 'io.xpipe.app' mainClass = 'io.xpipe.app.Main' diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserBreadcrumbBar.java b/app/src/main/java/io/xpipe/app/browser/BrowserBreadcrumbBar.java index e955e76cf..5b8b55a1f 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserBreadcrumbBar.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserBreadcrumbBar.java @@ -4,6 +4,7 @@ import atlantafx.base.controls.Breadcrumbs; import io.xpipe.app.fxcomps.SimpleComp; import io.xpipe.app.fxcomps.util.PlatformThread; import io.xpipe.app.fxcomps.util.SimpleChangeListener; +import io.xpipe.app.util.ThreadHelper; import io.xpipe.core.impl.FileNames; import javafx.scene.Node; import javafx.scene.control.Button; @@ -80,7 +81,9 @@ public class BrowserBreadcrumbBar extends SimpleComp { } breadcrumbs.selectedCrumbProperty().addListener((obs, old, val) -> { - model.cd(val != null ? val.getValue() : null); + ThreadHelper.runFailableAsync(() -> { + model.cdSync(val != null ? val.getValue() : null); + }); }); return breadcrumbs; diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserFileListCompEntry.java b/app/src/main/java/io/xpipe/app/browser/BrowserFileListCompEntry.java index b6ef2b4b4..5514c1cfd 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserFileListCompEntry.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserFileListCompEntry.java @@ -200,7 +200,7 @@ public class BrowserFileListCompEntry { return; } - model.getFileSystemModel().cd(item.getRawFileEntry().getPath()); + model.getFileSystemModel().cdSync(item.getRawFileEntry().getPath()); } }; DROP_TIMER.schedule(activeTask, 1000); diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserFileListModel.java b/app/src/main/java/io/xpipe/app/browser/BrowserFileListModel.java index 1b05d7074..c9af527b5 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserFileListModel.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserFileListModel.java @@ -128,7 +128,7 @@ public final class BrowserFileListModel { } if (entry.getRawFileEntry().resolved().getKind() == FileKind.DIRECTORY) { - fileSystemModel.cd(entry.getRawFileEntry().resolved().getPath()); + fileSystemModel.cdSync(entry.getRawFileEntry().resolved().getPath()); } } } diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserFileOverviewComp.java b/app/src/main/java/io/xpipe/app/browser/BrowserFileOverviewComp.java index 0bb081633..bb35dd139 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserFileOverviewComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserFileOverviewComp.java @@ -31,7 +31,7 @@ public class BrowserFileOverviewComp extends SimpleComp { var icon = BrowserIcons.createIcon(entry); var l = new Button(entry.getPath(), icon.createRegion()); l.setOnAction(event -> { - model.cd(entry.getPath()); + model.cdSync(entry.getPath()); event.consume(); }); l.setAlignment(Pos.CENTER_LEFT); diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserNavBar.java b/app/src/main/java/io/xpipe/app/browser/BrowserNavBar.java index 89880b896..457d154fb 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserNavBar.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserNavBar.java @@ -11,6 +11,8 @@ import io.xpipe.app.fxcomps.impl.PrettyImageComp; import io.xpipe.app.fxcomps.impl.StackComp; import io.xpipe.app.fxcomps.impl.TextFieldComp; import io.xpipe.app.fxcomps.util.SimpleChangeListener; +import io.xpipe.app.util.ThreadHelper; +import javafx.application.Platform; import javafx.beans.binding.Bindings; import javafx.beans.property.SimpleStringProperty; import javafx.css.PseudoClass; @@ -42,8 +44,10 @@ public class BrowserNavBar extends SimpleComp { path.set(newValue); }); path.addListener((observable, oldValue, newValue) -> { - var changed = model.cdOrRetry(newValue, true); - changed.ifPresent(path::set); + ThreadHelper.runFailableAsync(() -> { + var changed = model.cdSyncOrRetry(newValue, true); + changed.ifPresent(s -> Platform.runLater(() -> path.set(s))); + }); }); var pathBar = new TextFieldComp(path, true) 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 2a5316821..38a2b2531 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserWelcomeComp.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserWelcomeComp.java @@ -57,6 +57,10 @@ public class BrowserWelcomeComp extends SimpleComp { return; } + if (!entry.get().getState().isUsable()) { + return; + } + var graphic = entry.get().getProvider().getDisplayIconFileName(entry.get().getStore()); var view = new PrettyImageComp(new SimpleStringProperty(graphic), 45, 45); diff --git a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemComp.java b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemComp.java index 1977fb5d3..e44efd795 100644 --- a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemComp.java +++ b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemComp.java @@ -43,7 +43,7 @@ public class OpenFileSystemComp extends SimpleComp { private Region createContent() { var overview = new Button(null, new FontIcon("mdi2m-monitor")); - overview.setOnAction(e -> model.cd(null)); + overview.setOnAction(e -> model.cdSync(null)); overview.disableProperty().bind(model.getInOverview()); overview.setAccessibleText("System overview"); diff --git a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java index a8b528117..bd4051973 100644 --- a/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java +++ b/app/src/main/java/io/xpipe/app/browser/OpenFileSystemModel.java @@ -107,11 +107,11 @@ public final class OpenFileSystemModel { return new FileSystem.FileEntry(fileSystem, currentPath.get(), null, false, false, 0, null, FileKind.DIRECTORY); } - public void cd(String path) { - cdOrRetry(path, false).ifPresent(s -> cdOrRetry(s, false)); + public void cdSync(String path) { + cdSyncOrRetry(path, false).ifPresent(s -> cdSyncOrRetry(s, false)); } - public Optional cdOrRetry(String path, boolean allowCommands) { + public Optional cdSyncOrRetry(String path, boolean allowCommands) { if (Objects.equals(path, currentPath.get())) { return Optional.empty(); } @@ -179,16 +179,12 @@ public final class OpenFileSystemModel { try { FileSystemHelper.validateDirectoryPath(this, resolvedPath); + cdSyncWithoutCheck(path); } catch (Exception ex) { ErrorEvent.fromThrowable(ex).handle(); return Optional.ofNullable(currentPath.get()); } - ThreadHelper.runFailableAsync(() -> { - try (var ignored = new BusyProperty(busy)) { - cdSyncWithoutCheck(path); - } - }); return Optional.empty(); } diff --git a/app/src/main/java/io/xpipe/app/comp/base/ButtonComp.java b/app/src/main/java/io/xpipe/app/comp/base/ButtonComp.java index 5b85b5fc2..cd6136a8e 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/ButtonComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/ButtonComp.java @@ -11,8 +11,10 @@ import javafx.css.Size; import javafx.css.SizeUnits; import javafx.scene.Node; import javafx.scene.control.Button; +import lombok.Getter; import org.kordamp.ikonli.javafx.FontIcon; +@Getter public class ButtonComp extends Comp> { private final ObservableValue name; @@ -31,10 +33,6 @@ public class ButtonComp extends Comp> { this.listener = listener; } - public ObservableValue getName() { - return name; - } - public Node getGraphic() { return graphic.get(); } @@ -43,10 +41,6 @@ public class ButtonComp extends Comp> { return graphic; } - public Runnable getListener() { - return listener; - } - @Override public CompStructure