mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 09:00:26 +00:00
More reformat
This commit is contained in:
parent
6b7ce70cd7
commit
35dfb9cb8f
40 changed files with 112 additions and 25 deletions
|
@ -2,8 +2,8 @@ package io.xpipe.app.browser;
|
||||||
|
|
||||||
import io.xpipe.app.browser.icon.DirectoryType;
|
import io.xpipe.app.browser.icon.DirectoryType;
|
||||||
import io.xpipe.app.browser.icon.FileType;
|
import io.xpipe.app.browser.icon.FileType;
|
||||||
import io.xpipe.core.store.FileNames;
|
|
||||||
import io.xpipe.core.store.FileKind;
|
import io.xpipe.core.store.FileKind;
|
||||||
|
import io.xpipe.core.store.FileNames;
|
||||||
import io.xpipe.core.store.FileSystem;
|
import io.xpipe.core.store.FileSystem;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,9 @@ import io.xpipe.app.fxcomps.util.PlatformThread;
|
||||||
import io.xpipe.app.util.BooleanScope;
|
import io.xpipe.app.util.BooleanScope;
|
||||||
import io.xpipe.app.util.HumanReadableFormat;
|
import io.xpipe.app.util.HumanReadableFormat;
|
||||||
import io.xpipe.app.util.ThreadHelper;
|
import io.xpipe.app.util.ThreadHelper;
|
||||||
import io.xpipe.core.store.FileNames;
|
|
||||||
import io.xpipe.core.process.OsType;
|
import io.xpipe.core.process.OsType;
|
||||||
import io.xpipe.core.store.FileKind;
|
import io.xpipe.core.store.FileKind;
|
||||||
|
import io.xpipe.core.store.FileNames;
|
||||||
import io.xpipe.core.store.FileSystem;
|
import io.xpipe.core.store.FileSystem;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
|
|
|
@ -33,6 +33,7 @@ public class BrowserSelectionListComp extends SimpleComp {
|
||||||
|
|
||||||
ObservableList<FileSystem.FileEntry> list;
|
ObservableList<FileSystem.FileEntry> list;
|
||||||
Function<FileSystem.FileEntry, ObservableValue<String>> nameTransformation;
|
Function<FileSystem.FileEntry, ObservableValue<String>> nameTransformation;
|
||||||
|
|
||||||
public BrowserSelectionListComp(ObservableList<FileSystem.FileEntry> list) {
|
public BrowserSelectionListComp(ObservableList<FileSystem.FileEntry> list) {
|
||||||
this(list, entry -> new SimpleStringProperty(FileNames.getFileName(entry.getPath())));
|
this(list, entry -> new SimpleStringProperty(FileNames.getFileName(entry.getPath())));
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,9 +35,12 @@ public class OpenFileSystemSavedState {
|
||||||
|
|
||||||
private static final Timer TIMEOUT_TIMER = new Timer(true);
|
private static final Timer TIMEOUT_TIMER = new Timer(true);
|
||||||
private static final int STORED = 10;
|
private static final int STORED = 10;
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
private OpenFileSystemModel model;
|
private OpenFileSystemModel model;
|
||||||
|
|
||||||
private String lastDirectory;
|
private String lastDirectory;
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private ObservableList<RecentEntry> recentDirectories;
|
private ObservableList<RecentEntry> recentDirectories;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,10 @@ import java.io.BufferedReader;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public interface DirectoryType {
|
public interface DirectoryType {
|
||||||
|
|
|
@ -21,6 +21,7 @@ public class LoadingOverlayComp extends Comp<CompStructure<StackPane>> {
|
||||||
private final Comp<?> comp;
|
private final Comp<?> comp;
|
||||||
private final ObservableValue<Boolean> showLoading;
|
private final ObservableValue<Boolean> showLoading;
|
||||||
private final ObservableValue<Number> progress;
|
private final ObservableValue<Number> progress;
|
||||||
|
|
||||||
public LoadingOverlayComp(Comp<?> comp, ObservableValue<Boolean> loading, ObservableValue<Number> progress) {
|
public LoadingOverlayComp(Comp<?> comp, ObservableValue<Boolean> loading, ObservableValue<Number> progress) {
|
||||||
this.comp = comp;
|
this.comp = comp;
|
||||||
this.showLoading = PlatformThread.sync(loading);
|
this.showLoading = PlatformThread.sync(loading);
|
||||||
|
|
|
@ -29,6 +29,7 @@ public class OsLogoComp extends SimpleComp {
|
||||||
public OsLogoComp(StoreEntryWrapper wrapper) {
|
public OsLogoComp(StoreEntryWrapper wrapper) {
|
||||||
this(wrapper, new SimpleObjectProperty<>(SystemStateComp.State.SUCCESS));
|
this(wrapper, new SimpleObjectProperty<>(SystemStateComp.State.SUCCESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
public OsLogoComp(StoreEntryWrapper wrapper, ObservableValue<SystemStateComp.State> state) {
|
public OsLogoComp(StoreEntryWrapper wrapper, ObservableValue<SystemStateComp.State> state) {
|
||||||
this.wrapper = wrapper;
|
this.wrapper = wrapper;
|
||||||
this.state = state;
|
this.state = state;
|
||||||
|
|
|
@ -32,6 +32,7 @@ public class TileButtonComp extends Comp<TileButtonComp.Structure> {
|
||||||
private final ObservableValue<String> description;
|
private final ObservableValue<String> description;
|
||||||
private final ObservableValue<String> icon;
|
private final ObservableValue<String> icon;
|
||||||
private final Consumer<ActionEvent> action;
|
private final Consumer<ActionEvent> action;
|
||||||
|
|
||||||
public TileButtonComp(String nameKey, String descriptionKey, String icon, Consumer<ActionEvent> action) {
|
public TileButtonComp(String nameKey, String descriptionKey, String icon, Consumer<ActionEvent> action) {
|
||||||
this.name = AppI18n.observable(nameKey);
|
this.name = AppI18n.observable(nameKey);
|
||||||
this.description = AppI18n.observable(descriptionKey);
|
this.description = AppI18n.observable(descriptionKey);
|
||||||
|
|
|
@ -65,8 +65,7 @@ public class StoreCategoryWrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean contains(StoreEntryWrapper entry) {
|
public boolean contains(StoreEntryWrapper entry) {
|
||||||
return entry.getEntry().getCategoryUuid().equals(category.getUuid())
|
return entry.getEntry().getCategoryUuid().equals(category.getUuid()) || containedEntries.contains(entry);
|
||||||
|| containedEntries.contains(entry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void select() {
|
public void select() {
|
||||||
|
@ -124,7 +123,11 @@ public class StoreCategoryWrapper {
|
||||||
containedEntries.setAll(StoreViewState.get().getAllEntries().stream()
|
containedEntries.setAll(StoreViewState.get().getAllEntries().stream()
|
||||||
.filter(entry -> {
|
.filter(entry -> {
|
||||||
return entry.getEntry().getCategoryUuid().equals(category.getUuid())
|
return entry.getEntry().getCategoryUuid().equals(category.getUuid())
|
||||||
|| (AppPrefs.get().showChildCategoriesInParentCategory().get() && children.stream().anyMatch(storeCategoryWrapper -> storeCategoryWrapper.contains(entry)));
|
|| (AppPrefs.get()
|
||||||
|
.showChildCategoriesInParentCategory()
|
||||||
|
.get()
|
||||||
|
&& children.stream()
|
||||||
|
.anyMatch(storeCategoryWrapper -> storeCategoryWrapper.contains(entry)));
|
||||||
})
|
})
|
||||||
.toList());
|
.toList());
|
||||||
children.setAll(StoreViewState.get().getCategories().stream()
|
children.setAll(StoreViewState.get().getCategories().stream()
|
||||||
|
|
|
@ -173,7 +173,10 @@ public class StoreCreationComp extends DialogComp {
|
||||||
e -> {
|
e -> {
|
||||||
try {
|
try {
|
||||||
DataStorage.get().addStoreEntryIfNotPresent(e);
|
DataStorage.get().addStoreEntryIfNotPresent(e);
|
||||||
if (e.getProvider().shouldHaveChildren() && AppPrefs.get().openConnectionSearchWindowOnConnectionCreation().get()) {
|
if (e.getProvider().shouldHaveChildren()
|
||||||
|
&& AppPrefs.get()
|
||||||
|
.openConnectionSearchWindowOnConnectionCreation()
|
||||||
|
.get()) {
|
||||||
ScanAlert.showAsync(e);
|
ScanAlert.showAsync(e);
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|
|
@ -48,6 +48,7 @@ public abstract class StoreEntryComp extends SimpleComp {
|
||||||
App.getApp().getStage().widthProperty().divide(2.2).add(-200);
|
App.getApp().getStage().widthProperty().divide(2.2).add(-200);
|
||||||
protected final StoreEntryWrapper wrapper;
|
protected final StoreEntryWrapper wrapper;
|
||||||
protected final Comp<?> content;
|
protected final Comp<?> content;
|
||||||
|
|
||||||
public StoreEntryComp(StoreEntryWrapper wrapper, Comp<?> content) {
|
public StoreEntryComp(StoreEntryWrapper wrapper, Comp<?> content) {
|
||||||
this.wrapper = wrapper;
|
this.wrapper = wrapper;
|
||||||
this.content = content;
|
this.content = content;
|
||||||
|
|
|
@ -24,6 +24,7 @@ public class StoreSection {
|
||||||
ObservableList<StoreSection> shownChildren;
|
ObservableList<StoreSection> shownChildren;
|
||||||
int depth;
|
int depth;
|
||||||
ObservableBooleanValue showDetails;
|
ObservableBooleanValue showDetails;
|
||||||
|
|
||||||
public StoreSection(
|
public StoreSection(
|
||||||
StoreEntryWrapper wrapper,
|
StoreEntryWrapper wrapper,
|
||||||
ObservableList<StoreSection> allChildren,
|
ObservableList<StoreSection> allChildren,
|
||||||
|
|
|
@ -32,6 +32,7 @@ public class StoreSectionMiniComp extends Comp<CompStructure<VBox>> {
|
||||||
private static final PseudoClass ODD = PseudoClass.getPseudoClass("odd-depth");
|
private static final PseudoClass ODD = PseudoClass.getPseudoClass("odd-depth");
|
||||||
private static final PseudoClass EVEN = PseudoClass.getPseudoClass("even-depth");
|
private static final PseudoClass EVEN = PseudoClass.getPseudoClass("even-depth");
|
||||||
private final StoreSection section;
|
private final StoreSection section;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private final BiConsumer<StoreSection, Comp<CompStructure<Button>>> augment = (section1, buttonComp) -> {};
|
private final BiConsumer<StoreSection, Comp<CompStructure<Button>>> augment = (section1, buttonComp) -> {};
|
||||||
|
|
||||||
|
|
|
@ -25,14 +25,18 @@ public class StoreViewState {
|
||||||
|
|
||||||
private static StoreViewState INSTANCE;
|
private static StoreViewState INSTANCE;
|
||||||
private final StringProperty filter = new SimpleStringProperty();
|
private final StringProperty filter = new SimpleStringProperty();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final ObservableList<StoreEntryWrapper> allEntries =
|
private final ObservableList<StoreEntryWrapper> allEntries =
|
||||||
FXCollections.observableList(new CopyOnWriteArrayList<>());
|
FXCollections.observableList(new CopyOnWriteArrayList<>());
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final ObservableList<StoreCategoryWrapper> categories =
|
private final ObservableList<StoreCategoryWrapper> categories =
|
||||||
FXCollections.observableList(new CopyOnWriteArrayList<>());
|
FXCollections.observableList(new CopyOnWriteArrayList<>());
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final Property<StoreCategoryWrapper> activeCategory = new SimpleObjectProperty<>();
|
private final Property<StoreCategoryWrapper> activeCategory = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private StoreSection currentTopLevelSection;
|
private StoreSection currentTopLevelSection;
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,13 @@ import java.util.List;
|
||||||
public class AppLayoutModel {
|
public class AppLayoutModel {
|
||||||
|
|
||||||
private static AppLayoutModel INSTANCE;
|
private static AppLayoutModel INSTANCE;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final SavedState savedState;
|
private final SavedState savedState;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final List<Entry> entries;
|
private final List<Entry> entries;
|
||||||
|
|
||||||
private final Property<Entry> selected;
|
private final Property<Entry> selected;
|
||||||
private final ObservableValue<Entry> selectedWrapper;
|
private final ObservableValue<Entry> selectedWrapper;
|
||||||
|
|
||||||
|
|
|
@ -207,8 +207,10 @@ public class AppTheme {
|
||||||
public static final List<Theme> ALL =
|
public static final List<Theme> ALL =
|
||||||
List.of(PRIMER_LIGHT, PRIMER_DARK, NORD_LIGHT, NORD_DARK, CUPERTINO_LIGHT, CUPERTINO_DARK, DRACULA);
|
List.of(PRIMER_LIGHT, PRIMER_DARK, NORD_LIGHT, NORD_DARK, CUPERTINO_LIGHT, CUPERTINO_DARK, DRACULA);
|
||||||
protected final String id;
|
protected final String id;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
protected final String cssId;
|
protected final String cssId;
|
||||||
|
|
||||||
protected final atlantafx.base.theme.Theme theme;
|
protected final atlantafx.base.theme.Theme theme;
|
||||||
|
|
||||||
static Theme getDefaultLightTheme() {
|
static Theme getDefaultLightTheme() {
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class ChoiceComp<T> extends Comp<CompStructure<ComboBox<T>>> {
|
||||||
Property<T> value;
|
Property<T> value;
|
||||||
ObservableValue<Map<T, ObservableValue<String>>> range;
|
ObservableValue<Map<T, ObservableValue<String>>> range;
|
||||||
boolean includeNone;
|
boolean includeNone;
|
||||||
|
|
||||||
public ChoiceComp(Property<T> value, Map<T, ObservableValue<String>> range, boolean includeNone) {
|
public ChoiceComp(Property<T> value, Map<T, ObservableValue<String>> range, boolean includeNone) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
this.range = new SimpleObjectProperty<>(range);
|
this.range = new SimpleObjectProperty<>(range);
|
||||||
|
|
|
@ -19,6 +19,7 @@ public class TextAreaComp extends Comp<TextAreaComp.Structure> {
|
||||||
private final Property<String> currentValue;
|
private final Property<String> currentValue;
|
||||||
private final Property<String> lastAppliedValue;
|
private final Property<String> lastAppliedValue;
|
||||||
private final boolean lazy;
|
private final boolean lazy;
|
||||||
|
|
||||||
public TextAreaComp(Property<String> value) {
|
public TextAreaComp(Property<String> value) {
|
||||||
this(value, false);
|
this(value, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ public class ErrorEvent {
|
||||||
|
|
||||||
private static final Map<Throwable, ErrorEventBuilder> EVENT_BASES = new ConcurrentHashMap<>();
|
private static final Map<Throwable, ErrorEventBuilder> EVENT_BASES = new ConcurrentHashMap<>();
|
||||||
private static final Set<Throwable> HANDLED = new CopyOnWriteArraySet<>();
|
private static final Set<Throwable> HANDLED = new CopyOnWriteArraySet<>();
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private final boolean omitted = false;
|
private final boolean omitted = false;
|
||||||
|
|
||||||
|
@ -23,14 +24,19 @@ public class ErrorEvent {
|
||||||
private final boolean reportable = true;
|
private final boolean reportable = true;
|
||||||
|
|
||||||
private final Throwable throwable;
|
private final Throwable throwable;
|
||||||
|
|
||||||
@Singular
|
@Singular
|
||||||
private final List<ErrorAction> customActions;
|
private final List<ErrorAction> customActions;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
private boolean terminal;
|
private boolean terminal;
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
private boolean shouldSendDiagnostics;
|
private boolean shouldSendDiagnostics;
|
||||||
|
|
||||||
@Singular
|
@Singular
|
||||||
private List<Path> attachments;
|
private List<Path> attachments;
|
||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
private String userReport;
|
private String userReport;
|
||||||
private boolean unhandled;
|
private boolean unhandled;
|
||||||
|
|
|
@ -33,6 +33,7 @@ public class LauncherCommand implements Callable<Integer> {
|
||||||
|
|
||||||
@CommandLine.Parameters(paramLabel = "<input>")
|
@CommandLine.Parameters(paramLabel = "<input>")
|
||||||
final List<String> inputs = List.of();
|
final List<String> inputs = List.of();
|
||||||
|
|
||||||
@CommandLine.Option(
|
@CommandLine.Option(
|
||||||
names = {"--mode"},
|
names = {"--mode"},
|
||||||
description = "The mode to launch the daemon in or switch too",
|
description = "The mode to launch the daemon in or switch too",
|
||||||
|
|
|
@ -106,22 +106,29 @@ public class AppPrefs {
|
||||||
bindDeveloperTrue(developerDisableGuiRestrictions);
|
bindDeveloperTrue(developerDisableGuiRestrictions);
|
||||||
private final ObjectProperty<SupportedLocale> language =
|
private final ObjectProperty<SupportedLocale> language =
|
||||||
map(new SimpleObjectProperty<>(SupportedLocale.ENGLISH), "language", SupportedLocale.class);
|
map(new SimpleObjectProperty<>(SupportedLocale.ENGLISH), "language", SupportedLocale.class);
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final Property<InPlaceSecretValue> lockPassword = new SimpleObjectProperty<>();
|
private final Property<InPlaceSecretValue> lockPassword = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final StringProperty lockCrypt =
|
private final StringProperty lockCrypt =
|
||||||
mapVaultSpecific(new SimpleStringProperty(), "workspaceLock", String.class);
|
mapVaultSpecific(new SimpleStringProperty(), "workspaceLock", String.class);
|
||||||
|
|
||||||
private final IntegerProperty editorReloadTimeout =
|
private final IntegerProperty editorReloadTimeout =
|
||||||
map(new SimpleIntegerProperty(1000), "editorReloadTimeout", Integer.class);
|
map(new SimpleIntegerProperty(1000), "editorReloadTimeout", Integer.class);
|
||||||
private final BooleanProperty confirmDeletions =
|
private final BooleanProperty confirmDeletions =
|
||||||
map(new SimpleBooleanProperty(true), "confirmDeletions", Boolean.class);
|
map(new SimpleBooleanProperty(true), "confirmDeletions", Boolean.class);
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final List<AppPrefsCategory> categories;
|
private final List<AppPrefsCategory> categories;
|
||||||
|
|
||||||
private final AppPrefsStorageHandler globalStorageHandler = new AppPrefsStorageHandler(
|
private final AppPrefsStorageHandler globalStorageHandler = new AppPrefsStorageHandler(
|
||||||
AppProperties.get().getDataDir().resolve("settings").resolve("preferences.json"));
|
AppProperties.get().getDataDir().resolve("settings").resolve("preferences.json"));
|
||||||
private final Map<Mapping<?>, Comp<?>> customEntries = new LinkedHashMap<>();
|
private final Map<Mapping<?>, Comp<?>> customEntries = new LinkedHashMap<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final Property<AppPrefsCategory> selectedCategory;
|
private final Property<AppPrefsCategory> selectedCategory;
|
||||||
|
|
||||||
private final PrefsHandler extensionHandler = new PrefsHandlerImpl();
|
private final PrefsHandler extensionHandler = new PrefsHandlerImpl();
|
||||||
|
|
||||||
private AppPrefs() {
|
private AppPrefs() {
|
||||||
|
|
|
@ -33,13 +33,11 @@ public class AppearanceCategory extends AppPrefsCategory {
|
||||||
.nameAndDescription("condenseConnectionDisplay")
|
.nameAndDescription("condenseConnectionDisplay")
|
||||||
.addToggle(prefs.condenseConnectionDisplay)
|
.addToggle(prefs.condenseConnectionDisplay)
|
||||||
.nameAndDescription("showChildCategoriesInParentCategory")
|
.nameAndDescription("showChildCategoriesInParentCategory")
|
||||||
.addToggle(prefs.showChildCategoriesInParentCategory)
|
.addToggle(prefs.showChildCategoriesInParentCategory))
|
||||||
)
|
|
||||||
.addTitle("workflow")
|
.addTitle("workflow")
|
||||||
.sub(new OptionsBuilder()
|
.sub(new OptionsBuilder()
|
||||||
.nameAndDescription("openConnectionSearchWindowOnConnectionCreation")
|
.nameAndDescription("openConnectionSearchWindowOnConnectionCreation")
|
||||||
.addToggle(prefs.openConnectionSearchWindowOnConnectionCreation)
|
.addToggle(prefs.openConnectionSearchWindowOnConnectionCreation))
|
||||||
)
|
|
||||||
.addTitle("windowOptions")
|
.addTitle("windowOptions")
|
||||||
.sub(new OptionsBuilder()
|
.sub(new OptionsBuilder()
|
||||||
.nameAndDescription("windowOpacity")
|
.nameAndDescription("windowOpacity")
|
||||||
|
|
|
@ -84,13 +84,13 @@ public abstract class ExternalApplicationType implements PrefsChoiceValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSelectable() {
|
public boolean isAvailable() {
|
||||||
return OsType.getLocal().equals(OsType.MACOS);
|
return getApplicationPath().isPresent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAvailable() {
|
public boolean isSelectable() {
|
||||||
return getApplicationPath().isPresent();
|
return OsType.getLocal().equals(OsType.MACOS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,11 +173,6 @@ public abstract class ExternalApplicationType implements PrefsChoiceValue {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isSelectable() {
|
|
||||||
return OsType.getLocal().equals(OsType.WINDOWS);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAvailable() {
|
public boolean isAvailable() {
|
||||||
var path = determineFromPath();
|
var path = determineFromPath();
|
||||||
|
@ -188,5 +183,10 @@ public abstract class ExternalApplicationType implements PrefsChoiceValue {
|
||||||
var installation = determineInstallation();
|
var installation = determineInstallation();
|
||||||
return installation.isPresent() && Files.exists(installation.get());
|
return installation.isPresent() && Files.exists(installation.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSelectable() {
|
||||||
|
return OsType.getLocal().equals(OsType.WINDOWS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,6 +127,7 @@ public interface ExternalEditorType extends PrefsChoiceValue {
|
||||||
List.of(VSCODIUM_LINUX, VSCODE_LINUX, KATE, GEDIT, PLUMA, LEAFPAD, MOUSEPAD, GNOME);
|
List.of(VSCODIUM_LINUX, VSCODE_LINUX, KATE, GEDIT, PLUMA, LEAFPAD, MOUSEPAD, GNOME);
|
||||||
List<ExternalEditorType> MACOS_EDITORS = List.of(BBEDIT, VSCODIUM_MACOS, VSCODE_MACOS, SUBLIME_MACOS, TEXT_EDIT);
|
List<ExternalEditorType> MACOS_EDITORS = List.of(BBEDIT, VSCODIUM_MACOS, VSCODE_MACOS, SUBLIME_MACOS, TEXT_EDIT);
|
||||||
List<ExternalEditorType> CROSS_PLATFORM_EDITORS = List.of(FLEET, INTELLIJ, PYCHARM, WEBSTORM, CLION);
|
List<ExternalEditorType> CROSS_PLATFORM_EDITORS = List.of(FLEET, INTELLIJ, PYCHARM, WEBSTORM, CLION);
|
||||||
|
|
||||||
@SuppressWarnings("TrivialFunctionalExpressionUsage")
|
@SuppressWarnings("TrivialFunctionalExpressionUsage")
|
||||||
List<ExternalEditorType> ALL = ((Supplier<List<ExternalEditorType>>) () -> {
|
List<ExternalEditorType> ALL = ((Supplier<List<ExternalEditorType>>) () -> {
|
||||||
var all = new ArrayList<ExternalEditorType>();
|
var all = new ArrayList<ExternalEditorType>();
|
||||||
|
|
|
@ -847,12 +847,12 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSelectable() {
|
public boolean isAvailable() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAvailable() {
|
public boolean isSelectable() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,10 @@ import io.xpipe.app.core.mode.OperationMode;
|
||||||
import io.xpipe.app.fxcomps.Comp;
|
import io.xpipe.app.fxcomps.Comp;
|
||||||
import io.xpipe.app.issue.ErrorEvent;
|
import io.xpipe.app.issue.ErrorEvent;
|
||||||
import io.xpipe.app.issue.UserReportComp;
|
import io.xpipe.app.issue.UserReportComp;
|
||||||
import io.xpipe.app.util.*;
|
import io.xpipe.app.util.DesktopHelper;
|
||||||
|
import io.xpipe.app.util.FileOpener;
|
||||||
|
import io.xpipe.app.util.OptionsBuilder;
|
||||||
|
import io.xpipe.app.util.TerminalLauncher;
|
||||||
import io.xpipe.core.process.OsType;
|
import io.xpipe.core.process.OsType;
|
||||||
import io.xpipe.core.store.FileNames;
|
import io.xpipe.core.store.FileNames;
|
||||||
import io.xpipe.core.store.LocalStore;
|
import io.xpipe.core.store.LocalStore;
|
||||||
|
|
|
@ -16,6 +16,7 @@ import java.util.regex.Matcher;
|
||||||
public class ContextualFileReference {
|
public class ContextualFileReference {
|
||||||
|
|
||||||
private static String lastDataDir;
|
private static String lastDataDir;
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private final String path;
|
private final String path;
|
||||||
|
|
||||||
|
|
|
@ -40,17 +40,25 @@ public abstract class DataStorage {
|
||||||
|
|
||||||
private static DataStorage INSTANCE;
|
private static DataStorage INSTANCE;
|
||||||
protected final Path dir;
|
protected final Path dir;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
protected final List<DataStoreCategory> storeCategories;
|
protected final List<DataStoreCategory> storeCategories;
|
||||||
|
|
||||||
protected final Map<DataStoreEntry, DataStoreEntry> storeEntries;
|
protected final Map<DataStoreEntry, DataStoreEntry> storeEntries;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
protected final Set<DataStoreEntry> storeEntriesSet;
|
protected final Set<DataStoreEntry> storeEntriesSet;
|
||||||
|
|
||||||
protected final ReentrantLock busyIo = new ReentrantLock();
|
protected final ReentrantLock busyIo = new ReentrantLock();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final List<StorageListener> listeners = new CopyOnWriteArrayList<>();
|
private final List<StorageListener> listeners = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
private final Map<DataStoreEntry, DataStoreEntry> storeEntriesInProgress = new ConcurrentHashMap<>();
|
private final Map<DataStoreEntry, DataStoreEntry> storeEntriesInProgress = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
protected boolean loaded;
|
protected boolean loaded;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
protected DataStoreCategory selectedCategory;
|
protected DataStoreCategory selectedCategory;
|
||||||
|
|
|
@ -26,26 +26,35 @@ import java.util.stream.Collectors;
|
||||||
public class DataStoreEntry extends StorageElement {
|
public class DataStoreEntry extends StorageElement {
|
||||||
|
|
||||||
Map<String, Object> storeCache = new LinkedHashMap<>();
|
Map<String, Object> storeCache = new LinkedHashMap<>();
|
||||||
|
|
||||||
@NonFinal
|
@NonFinal
|
||||||
Validity validity;
|
Validity validity;
|
||||||
|
|
||||||
@NonFinal
|
@NonFinal
|
||||||
@Setter
|
@Setter
|
||||||
JsonNode storeNode;
|
JsonNode storeNode;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@NonFinal
|
@NonFinal
|
||||||
DataStore store;
|
DataStore store;
|
||||||
|
|
||||||
@NonFinal
|
@NonFinal
|
||||||
Configuration configuration;
|
Configuration configuration;
|
||||||
|
|
||||||
@NonFinal
|
@NonFinal
|
||||||
boolean expanded;
|
boolean expanded;
|
||||||
|
|
||||||
@NonFinal
|
@NonFinal
|
||||||
boolean inRefresh;
|
boolean inRefresh;
|
||||||
|
|
||||||
@NonFinal
|
@NonFinal
|
||||||
@Setter
|
@Setter
|
||||||
boolean observing;
|
boolean observing;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@NonFinal
|
@NonFinal
|
||||||
DataStoreProvider provider;
|
DataStoreProvider provider;
|
||||||
|
|
||||||
@NonFinal
|
@NonFinal
|
||||||
UUID categoryUuid;
|
UUID categoryUuid;
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ public class DataStoreSecret {
|
||||||
|
|
||||||
InPlaceSecretValue internalSecret;
|
InPlaceSecretValue internalSecret;
|
||||||
String usedPasswordLockCrypt;
|
String usedPasswordLockCrypt;
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@NonFinal
|
@NonFinal
|
||||||
TreeNode originalNode;
|
TreeNode originalNode;
|
||||||
|
|
|
@ -6,7 +6,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
import io.xpipe.app.core.AppProperties;
|
import io.xpipe.app.core.AppProperties;
|
||||||
import io.xpipe.app.util.ScriptHelper;
|
import io.xpipe.app.util.ScriptHelper;
|
||||||
import io.xpipe.app.util.TerminalLauncher;
|
import io.xpipe.app.util.TerminalLauncher;
|
||||||
import io.xpipe.core.process.*;
|
import io.xpipe.core.process.OsType;
|
||||||
|
import io.xpipe.core.process.ShellDialects;
|
||||||
import io.xpipe.core.store.FileNames;
|
import io.xpipe.core.store.FileNames;
|
||||||
import io.xpipe.core.store.LocalStore;
|
import io.xpipe.core.store.LocalStore;
|
||||||
import io.xpipe.core.util.XPipeInstallation;
|
import io.xpipe.core.util.XPipeInstallation;
|
||||||
|
|
|
@ -23,10 +23,13 @@ public enum XPipeDistributionType {
|
||||||
CHOCO("choco", true, () -> new ChocoUpdater());
|
CHOCO("choco", true, () -> new ChocoUpdater());
|
||||||
|
|
||||||
private static XPipeDistributionType type;
|
private static XPipeDistributionType type;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final String id;
|
private final String id;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final boolean supportsUrls;
|
private final boolean supportsUrls;
|
||||||
|
|
||||||
private final Supplier<UpdateHandler> updateHandlerSupplier;
|
private final Supplier<UpdateHandler> updateHandlerSupplier;
|
||||||
private UpdateHandler updateHandler;
|
private UpdateHandler updateHandler;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,10 @@ import io.xpipe.core.store.ShellStore;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.*;
|
import java.util.Collection;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class XPipeInstanceHelper {
|
public class XPipeInstanceHelper {
|
||||||
|
|
|
@ -10,6 +10,7 @@ public class BooleanScope implements AutoCloseable {
|
||||||
private boolean invert;
|
private boolean invert;
|
||||||
private boolean forcePlatform;
|
private boolean forcePlatform;
|
||||||
private boolean wait;
|
private boolean wait;
|
||||||
|
|
||||||
public BooleanScope(BooleanProperty prop) {
|
public BooleanScope(BooleanProperty prop) {
|
||||||
this.prop = prop;
|
this.prop = prop;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,15 @@ import java.util.function.Function;
|
||||||
public class CommandBuilder {
|
public class CommandBuilder {
|
||||||
|
|
||||||
private final List<Element> elements = new ArrayList<>();
|
private final List<Element> elements = new ArrayList<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private final Map<String, Element> environmentVariables = new LinkedHashMap<>();
|
private final Map<String, Element> environmentVariables = new LinkedHashMap<>();
|
||||||
|
|
||||||
private final List<FailableConsumer<ShellControl, Exception>> setup = new ArrayList<>();
|
private final List<FailableConsumer<ShellControl, Exception>> setup = new ArrayList<>();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private CountDown countDown;
|
private CountDown countDown;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private UUID uuid;
|
private UUID uuid;
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,10 @@ public class CountDown {
|
||||||
|
|
||||||
private long lastMillis = -1;
|
private long lastMillis = -1;
|
||||||
private long millisecondsLeft;
|
private long millisecondsLeft;
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
private boolean active;
|
private boolean active;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private long maxMillis;
|
private long maxMillis;
|
||||||
|
|
||||||
|
|
|
@ -81,13 +81,17 @@ public interface FileSystem extends Closeable, AutoCloseable {
|
||||||
Boolean executable;
|
Boolean executable;
|
||||||
long size;
|
long size;
|
||||||
String mode;
|
String mode;
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
FileKind kind;
|
FileKind kind;
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@NonFinal
|
@NonFinal
|
||||||
String path;
|
String path;
|
||||||
|
|
||||||
@NonFinal
|
@NonFinal
|
||||||
String extension;
|
String extension;
|
||||||
|
|
||||||
@NonFinal
|
@NonFinal
|
||||||
String name;
|
String name;
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ public class SecretReference {
|
||||||
|
|
||||||
UUID secretId;
|
UUID secretId;
|
||||||
int subId;
|
int subId;
|
||||||
|
|
||||||
public SecretReference(Object store) {
|
public SecretReference(Object store) {
|
||||||
this.secretId = UuidHelper.generateFromObject(store);
|
this.secretId = UuidHelper.generateFromObject(store);
|
||||||
this.subId = 0;
|
this.subId = 0;
|
||||||
|
|
|
@ -64,6 +64,7 @@ public enum PredefinedScriptStore {
|
||||||
private final String name;
|
private final String name;
|
||||||
private final Supplier<ScriptStore> scriptStore;
|
private final Supplier<ScriptStore> scriptStore;
|
||||||
private final UUID uuid;
|
private final UUID uuid;
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
private DataStoreEntryRef<ScriptStore> entry;
|
private DataStoreEntryRef<ScriptStore> entry;
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,10 @@ import java.util.*;
|
||||||
public abstract class ScriptStore extends JacksonizedValue implements DataStore, StatefulDataStore<ScriptStore.State> {
|
public abstract class ScriptStore extends JacksonizedValue implements DataStore, StatefulDataStore<ScriptStore.State> {
|
||||||
|
|
||||||
protected final DataStoreEntryRef<ScriptGroupStore> group;
|
protected final DataStoreEntryRef<ScriptGroupStore> group;
|
||||||
|
|
||||||
@Singular
|
@Singular
|
||||||
protected final List<DataStoreEntryRef<ScriptStore>> scripts;
|
protected final List<DataStoreEntryRef<ScriptStore>> scripts;
|
||||||
|
|
||||||
protected final String description;
|
protected final String description;
|
||||||
|
|
||||||
public static ShellControl controlWithDefaultScripts(ShellControl pc) {
|
public static ShellControl controlWithDefaultScripts(ShellControl pc) {
|
||||||
|
|
Loading…
Reference in a new issue