This commit is contained in:
crschnick 2023-10-11 10:15:58 +00:00
parent a37821e22c
commit 09052de9ee
45 changed files with 146 additions and 240 deletions

View file

@ -67,10 +67,9 @@ final class BrowserBookmarkList extends SimpleComp {
.pseudoClassStateChanged(
SELECTED,
newValue != null
&& newValue.getEntry()
&& newValue.getEntry().get()
.equals(s.getWrapper()
.getEntry()
.getStore()));
.getEntry()));
});
struc.get().setOnAction(event -> {
ThreadHelper.runFailableAsync(() -> {

View file

@ -34,7 +34,7 @@ public class BrowserClipboard {
static {
Toolkit.getDefaultToolkit()
.getSystemClipboard()
.addFlavorListener(e -> ThreadHelper.runFailableAsync(new FailableRunnable<Throwable>() {
.addFlavorListener(e -> ThreadHelper.runFailableAsync(new FailableRunnable<>() {
@Override
@SuppressWarnings("unchecked")
public void run() throws Throwable {

View file

@ -19,6 +19,7 @@ import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.control.Tab;
import javafx.scene.layout.*;
import lombok.Getter;
import java.util.List;
@ -28,7 +29,9 @@ public abstract class MultiStepComp extends Comp<CompStructure<VBox>> {
private static final PseudoClass NEXT = PseudoClass.getPseudoClass("next");
private final Property<Boolean> completed = new SimpleBooleanProperty();
private final Property<Step<?>> currentStep = new SimpleObjectProperty<>();
@Getter
private List<Entry> entries;
@Getter
private int currentIndex = 0;
private Step<?> getValue() {
@ -94,10 +97,6 @@ public abstract class MultiStepComp extends Comp<CompStructure<VBox>> {
return entries.indexOf(e) == currentIndex;
}
public int getCurrentIndex() {
return currentIndex;
}
public boolean isFirstPage() {
return currentIndex == 0;
}
@ -260,10 +259,6 @@ public abstract class MultiStepComp extends Comp<CompStructure<VBox>> {
protected abstract void finish();
public List<Entry> getEntries() {
return entries;
}
public ReadOnlyProperty<Boolean> completedProperty() {
return completed;
}

View file

@ -11,7 +11,7 @@ import java.util.stream.Stream;
public interface StoreSortMode {
static StoreSortMode ALPHABETICAL_DESC = new StoreSortMode() {
StoreSortMode ALPHABETICAL_DESC = new StoreSortMode() {
@Override
public String getId() {
return "alphabetical-desc";
@ -19,12 +19,12 @@ public interface StoreSortMode {
@Override
public Comparator<StoreSection> comparator() {
return Comparator.<StoreSection, String>comparing(
return Comparator.comparing(
e -> e.getWrapper().nameProperty().getValue().toLowerCase(Locale.ROOT));
}
};
static StoreSortMode ALPHABETICAL_ASC = new StoreSortMode() {
StoreSortMode ALPHABETICAL_ASC = new StoreSortMode() {
@Override
public String getId() {
return "alphabetical-asc";
@ -38,7 +38,7 @@ public interface StoreSortMode {
}
};
static StoreSortMode DATE_DESC = new StoreSortMode() {
StoreSortMode DATE_DESC = new StoreSortMode() {
@Override
public String getId() {
return "date-desc";
@ -55,7 +55,7 @@ public interface StoreSortMode {
}
};
static StoreSortMode DATE_ASC = new StoreSortMode() {
StoreSortMode DATE_ASC = new StoreSortMode() {
@Override
public String getId() {
return "date-asc";
@ -78,7 +78,7 @@ public interface StoreSortMode {
section.getAllChildren().stream().flatMap(section1 -> flatten(section1)));
}
static List<StoreSortMode> ALL = List.of(ALPHABETICAL_DESC, ALPHABETICAL_ASC, DATE_DESC, DATE_ASC);
List<StoreSortMode> ALL = List.of(ALPHABETICAL_DESC, ALPHABETICAL_ASC, DATE_DESC, DATE_ASC);
static Optional<StoreSortMode> fromId(String id) {
return ALL.stream()

View file

@ -12,10 +12,12 @@ import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import javafx.stage.Stage;
import lombok.Getter;
import javax.imageio.ImageIO;
import java.awt.*;
@Getter
public class App extends Application {
private static App APP;
@ -116,7 +118,4 @@ public class App extends Application {
});
}
public Stage getStage() {
return stage;
}
}

View file

@ -8,6 +8,7 @@ import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.issue.TrackEvent;
import io.xpipe.core.util.ModuleHelper;
import io.xpipe.core.util.XPipeInstallation;
import lombok.Getter;
import lombok.Value;
import java.io.IOException;
@ -28,6 +29,7 @@ public class AppExtensionManager {
private final List<ModuleLayer> leafModuleLayers = new ArrayList<>();
private final List<Path> extensionBaseDirectories = new ArrayList<>();
private ModuleLayer baseLayer = ModuleLayer.boot();
@Getter
private ModuleLayer extendedLayer;
public AppExtensionManager(boolean loadedProviders) {
@ -314,10 +316,6 @@ public class AppExtensionManager {
}
}
public ModuleLayer getExtendedLayer() {
return extendedLayer;
}
@Value
private static class Extension {
Path dir;

View file

@ -3,6 +3,7 @@ package io.xpipe.app.core;
import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.issue.TrackEvent;
import io.xpipe.app.util.ThreadHelper;
import lombok.Getter;
import java.io.IOException;
import java.nio.file.*;
@ -106,6 +107,7 @@ public class AppFileWatcher {
private class WatchedDirectory {
private final BiConsumer<Path, WatchEvent.Kind<Path>> listener;
@Getter
private final Path baseDir;
private WatchedDirectory(Path dir, BiConsumer<Path, WatchEvent.Kind<Path>> listener) {
@ -183,8 +185,5 @@ public class AppFileWatcher {
listener.accept(file, ev.kind());
}
public Path getBaseDir() {
return baseDir;
}
}
}

View file

@ -7,7 +7,6 @@ import javafx.css.SizeUnits;
import javafx.scene.Node;
import javafx.scene.text.Font;
import java.io.IOException;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;

View file

@ -43,7 +43,9 @@ public class AppLogs {
DateTimeFormatter.ofPattern("HH:mm:ss:SSS").withZone(ZoneId.systemDefault());
private static AppLogs INSTANCE;
@Getter
private final PrintStream originalSysOut;
@Getter
private final PrintStream originalSysErr;
private final Path logDir;
@ -299,14 +301,6 @@ public class AppLogs {
}
}
public PrintStream getOriginalSysOut() {
return originalSysOut;
}
public PrintStream getOriginalSysErr() {
return originalSysErr;
}
public Path getLogsDirectory() {
return logDir.getParent();
}

View file

@ -164,7 +164,7 @@ public class AppTheme {
public String toTranslatedString() {
return name;
}
};
}
@AllArgsConstructor
public static class Theme implements PrefsChoiceValue {

View file

@ -6,6 +6,7 @@ import io.xpipe.app.issue.ErrorEvent;
import io.xpipe.app.issue.ErrorHandler;
import io.xpipe.core.process.OsType;
import javafx.application.Platform;
import lombok.Getter;
import lombok.SneakyThrows;
import javax.swing.*;
@ -19,8 +20,9 @@ public class AppTray {
private static AppTray INSTANCE;
private final FXTrayIcon icon;
@Getter
private final ErrorHandler errorHandler;
private TrayIcon privateTrayIcon = null;
private TrayIcon privateTrayIcon;
@SneakyThrows
private AppTray() {
@ -91,7 +93,7 @@ public class AppTray {
if (OsType.getLocal().equals(OsType.LINUX)) {
SwingUtilities.invokeLater(() -> {
try {
Field peerField = null;
Field peerField;
peerField = TrayIcon.class.getDeclaredField("peer");
peerField.setAccessible(true);
var peer = peerField.get(this.privateTrayIcon);
@ -129,10 +131,6 @@ public class AppTray {
}
}
public ErrorHandler getErrorHandler() {
return errorHandler;
}
private class TrayErrorHandler implements ErrorHandler {
private Instant lastErrorShown = Instant.MIN;

View file

@ -60,8 +60,4 @@ public class GuiMode extends PlatformMode {
});
}
@Override
public ErrorHandler getErrorHandler() {
return new SyncErrorHandler(new GuiErrorHandler());
}
}

View file

@ -12,6 +12,7 @@ import io.xpipe.core.util.XPipeDaemonMode;
import io.xpipe.core.util.XPipeInstallation;
import io.xpipe.core.util.XPipeSystemId;
import javafx.application.Platform;
import lombok.Getter;
import java.util.ArrayList;
import java.util.List;
@ -25,8 +26,11 @@ public abstract class OperationMode {
public static final OperationMode GUI = new GuiMode();
private static final Pattern PROPERTY_PATTERN = Pattern.compile("^-[DP](.+)=(.+)$");
private static final List<OperationMode> ALL = List.of(BACKGROUND, TRAY, GUI);
@Getter
private static boolean inStartup;
@Getter
private static boolean inShutdown;
@Getter
private static boolean inShutdownHook;
private static OperationMode CURRENT = null;
@ -116,14 +120,6 @@ public abstract class OperationMode {
DataStoreProviders.postInit(AppExtensionManager.getInstance().getExtendedLayer());
}
public static boolean isInStartup() {
return inStartup;
}
public static boolean isInShutdown() {
return inShutdown;
}
public static void switchToAsync(OperationMode newMode) {
ThreadHelper.createPlatformThread("mode switcher", false, () -> switchTo(newMode)).start();
}
@ -285,10 +281,6 @@ public abstract class OperationMode {
return CURRENT;
}
public static boolean isInShutdownHook() {
return inShutdownHook;
}
public abstract boolean isSupported();
public abstract String getId();

View file

@ -4,12 +4,11 @@ import lombok.Getter;
import java.nio.file.Path;
@Getter
public abstract class ModuleInstall {
@Getter
private final String id;
@Getter
private final String module;
protected ModuleInstall(String id, String module) {

View file

@ -1,9 +1,7 @@
package io.xpipe.app.fxcomps.augment;
import io.xpipe.app.fxcomps.CompStructure;
import javafx.event.EventHandler;
import javafx.scene.Cursor;
import javafx.scene.input.MouseEvent;
public class DraggableAugment<S extends CompStructure<?>> implements Augment<S> {
@ -17,21 +15,14 @@ public class DraggableAugment<S extends CompStructure<?>> implements Augment<S>
public void augment(S struc) {
var circle = struc.get();
var oldDepth = struc.get().getViewOrder();
circle.setOnMousePressed(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent mouseEvent) {
circle.setOnMousePressed(mouseEvent -> {
lastMouseX = mouseEvent.getSceneX();
lastMouseY = mouseEvent.getSceneY();
circle.getScene().setCursor(Cursor.MOVE);
circle.setViewOrder(1000);
}
});
circle.setOnMouseReleased(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent mouseEvent) {
circle.getScene().setCursor(Cursor.HAND);
}
});
circle.setOnMouseDragged(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent mouseEvent) {
circle.setOnMouseReleased(mouseEvent -> circle.getScene().setCursor(Cursor.HAND));
circle.setOnMouseDragged(mouseEvent -> {
final double deltaX = mouseEvent.getSceneX() - lastMouseX;
final double deltaY = mouseEvent.getSceneY() - lastMouseY;
final double initialTranslateX = circle.getTranslateX();
@ -41,21 +32,16 @@ public class DraggableAugment<S extends CompStructure<?>> implements Augment<S>
lastMouseX = mouseEvent.getSceneX();
lastMouseY = mouseEvent.getSceneY();
}
});
circle.setOnMouseEntered(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent mouseEvent) {
circle.setOnMouseEntered(mouseEvent -> {
if (!mouseEvent.isPrimaryButtonDown()) {
circle.getScene().setCursor(Cursor.HAND);
}
}
});
circle.setOnMouseExited(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent mouseEvent) {
circle.setOnMouseExited(mouseEvent -> {
if (!mouseEvent.isPrimaryButtonDown()) {
circle.getScene().setCursor(Cursor.DEFAULT);
}
}
});
}
}

View file

@ -43,11 +43,10 @@ public class DataStoreListChoiceComp<T extends DataStore> extends SimpleComp {
var delete = new IconButtonComp("mdal-delete_outline", () -> {
selectedList.remove(t);
});
var hbox = new HorizontalComp(List.of(label, Comp.hspacer(), delete)).styleClass("entry");
return hbox;
return new HorizontalComp(List.of(label, Comp.hspacer(), delete)).styleClass("entry");
}).padding(new Insets(0)).apply(struc -> struc.get().setMinHeight(0)).apply(struc -> ((VBox) struc.get().getContent()).setSpacing(5));
var selected = new SimpleObjectProperty<DataStoreEntryRef<T>>();
var add = new DataStoreChoiceComp<T>(DataStoreChoiceComp.Mode.OTHER, null, selected, storeClass, applicableCheck, initialCategory);
var add = new DataStoreChoiceComp<>(DataStoreChoiceComp.Mode.OTHER, null, selected, storeClass, applicableCheck, initialCategory);
selected.addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
if (!selectedList.contains(newValue)

View file

@ -18,10 +18,12 @@ import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.*;
import lombok.Getter;
import java.util.ArrayList;
import java.util.List;
@Getter
public class OptionsComp extends Comp<CompStructure<Pane>> {
private final List<OptionsComp.Entry> entries;
@ -46,7 +48,6 @@ public class OptionsComp extends Comp<CompStructure<Pane>> {
pane.getStyleClass().add("options-comp");
var nameRegions = new ArrayList<Region>();
var compRegions = new ArrayList<Region>();
for (var entry : getEntries()) {
Region compRegion = null;
@ -135,7 +136,6 @@ public class OptionsComp extends Comp<CompStructure<Pane>> {
if (compRegion != null) {
compRegion.accessibleTextProperty().bind(name.textProperty());
compRegions.add(compRegion);
line.getChildren().add(compRegion);
HBox.setHgrow(compRegion, Priority.ALWAYS);
}
@ -143,7 +143,6 @@ public class OptionsComp extends Comp<CompStructure<Pane>> {
pane.getChildren().add(line);
} else {
if (compRegion != null) {
compRegions.add(compRegion);
pane.getChildren().add(compRegion);
}
}
@ -165,10 +164,6 @@ public class OptionsComp extends Comp<CompStructure<Pane>> {
return new SimpleCompStructure<>(pane);
}
public List<OptionsComp.Entry> getEntries() {
return entries;
}
public record Entry(
String key,
ObservableValue<String> description,

View file

@ -21,7 +21,7 @@ public class SvgHelper {
}
public static Point2D getDimensions(String val) {
var regularExpression = Pattern.compile("<svg[^>]+?width=\"([^\s]+)\"", Pattern.DOTALL);
var regularExpression = Pattern.compile("<svg[^>]+?width=\"([^ ]+)\"", Pattern.DOTALL);
var matcher = regularExpression.matcher(val);
if (!matcher.find()) {
@ -36,7 +36,7 @@ public class SvgHelper {
}
var width = matcher.group(1);
regularExpression = Pattern.compile("<svg.+?height=\"([^\s]+)\"", Pattern.DOTALL);
regularExpression = Pattern.compile("<svg.+?height=\"([^ ]+)\"", Pattern.DOTALL);
matcher = regularExpression.matcher(val);
matcher.find();
var height = matcher.group(1);

View file

@ -209,7 +209,7 @@ public class BindingsHelper {
public static <V> ObservableList<V> orderedContentBinding(ObservableList<V> l2, Comparator<V> comp, Observable... observables) {
return orderedContentBinding(l2, Bindings.createObjectBinding(() -> {
return new Comparator<V>() {
return new Comparator<>() {
@Override
public int compare(V o1, V o2) {
return comp.compare(o1, o2);
@ -240,7 +240,7 @@ public class BindingsHelper {
public static <V> ObservableList<V> filteredContentBinding(ObservableList<V> l2, Predicate<V> predicate, Observable... observables) {
return filteredContentBinding(l2, Bindings.createObjectBinding(() -> {
return new Predicate<V>() {
return new Predicate<>() {
@Override
public boolean test(V v) {
return predicate.test(v);

View file

@ -125,9 +125,9 @@ public abstract class LauncherInput {
}
}
@Getter
public abstract static class ActionInput extends LauncherInput {
@Getter
private final List<String> args;
protected ActionInput(List<String> args) {

View file

@ -31,6 +31,7 @@ import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import lombok.Getter;
import lombok.SneakyThrows;
import org.kordamp.ikonli.javafx.FontIcon;
@ -127,7 +128,9 @@ public class AppPrefs {
// Lock
// ====
@Getter
private final Property<SecretValue> lockPassword = new SimpleObjectProperty<>();
@Getter
private final StringProperty lockCrypt = typed(new SimpleStringProperty(""), String.class);
// Window opacity
@ -297,14 +300,6 @@ public class AppPrefs {
}
}
public StringProperty getLockCrypt() {
return lockCrypt;
}
public Property<SecretValue> getLockPassword() {
return lockPassword;
}
public final ReadOnlyIntegerProperty editorReloadTimeout() {
return editorReloadTimeout;
}
@ -664,6 +659,7 @@ public class AppPrefs {
name, Arrays.stream(settings).filter(setting -> setting != null).toArray(Setting[]::new));
}
@Getter
private class PrefsHandlerImpl implements PrefsHandler {
private final List<Category> categories;
@ -710,8 +706,5 @@ public class AppPrefs {
categories.add(index, newCategory);
}
public List<Category> getCategories() {
return categories;
}
}
}

View file

@ -507,7 +507,7 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
}
@Value
static class LaunchConfiguration {
class LaunchConfiguration {
DataStoreColor color;
String title;

View file

@ -4,8 +4,7 @@ import com.dlsc.formsfx.model.util.ResourceBundleService;
import io.xpipe.app.core.AppI18n;
import lombok.NonNull;
import java.util.Enumeration;
import java.util.ResourceBundle;
import java.util.*;
public class QuietResourceBundleService extends ResourceBundleService {
@ -17,8 +16,8 @@ public class QuietResourceBundleService extends ResourceBundleService {
}
@Override
public Enumeration<String> getKeys() {
return null;
public @NonNull Enumeration<String> getKeys() {
return Collections.emptyEnumeration();
}
});
}

View file

@ -75,7 +75,7 @@ public class UpdateCheckComp extends SimpleComp {
return "mdi2r-refresh";
},
updateReady);
var button = new TileButtonComp(name, description, graphic, actionEvent -> {
return new TileButtonComp(name, description, graphic, actionEvent -> {
actionEvent.consume();
if (updateReady.getValue()) {
restart();
@ -91,6 +91,5 @@ public class UpdateCheckComp extends SimpleComp {
.disable(PlatformThread.sync(
XPipeDistributionType.get().getUpdateHandler().getBusy()))
.createRegion();
return button;
}
}

View file

@ -62,8 +62,7 @@ public class VaultCategory extends AppPrefsCategory {
BooleanField enable = BooleanField.ofBooleanType(prefs.enableGitStorage)
.editable(pro)
.render(() -> {
var c = new CustomToggleControl();
return c;
return new CustomToggleControl();
});
StringField remote = StringField.ofStringType(prefs.storageGitRemote)
.editable(pro)

View file

@ -45,7 +45,7 @@ public class DataStateProviderImpl extends DataStateProvider {
if (found == null) {
entry.get().setStorePersistentState(def.get());
}
return (T) entry.get().getStorePersistentState();
return entry.get().getStorePersistentState();
}
@Override

View file

@ -8,7 +8,6 @@ public class DataStorageWriter {
public static JsonNode storeToNode(DataStore store) {
var mapper = JacksonMapper.getDefault();
var tree = mapper.valueToTree(store);
return tree;
return mapper.valueToTree(store);
}
}

View file

@ -227,7 +227,7 @@ public class DataStoreEntry extends StorageElement {
}
public <T extends DataStore> DataStoreEntryRef<T> ref() {
return new DataStoreEntryRef<T>(this);
return new DataStoreEntryRef<>(this);
}
public void setStoreCache(String key, Object value) {

View file

@ -15,15 +15,20 @@ import java.util.UUID;
public abstract class StorageElement {
@Getter
protected final UUID uuid;
protected final List<Listener> listeners = new ArrayList<>();
@Getter
protected boolean dirty;
@Getter
protected Path directory;
@Getter
protected String name;
@Getter
protected Instant lastUsed;
@Getter
protected Instant lastModified;
public StorageElement(
@ -67,22 +72,10 @@ public abstract class StorageElement {
return getLastUsed().isAfter(getLastModified()) ? getLastUsed() : getLastModified();
}
public Path getDirectory() {
return directory;
}
public void setDirectory(Path directory) {
this.directory = directory;
}
public UUID getUuid() {
return uuid;
}
public String getName() {
return name;
}
public void setName(String name) {
if (name.equals(this.name)) {
return;
@ -94,14 +87,6 @@ public abstract class StorageElement {
notifyUpdate();
}
public Instant getLastUsed() {
return lastUsed;
}
public Instant getLastModified() {
return lastModified;
}
public interface Listener {
void onUpdate();
}

View file

@ -77,7 +77,7 @@ public class ScanAlert {
@Override
protected List<Entry> setup() {
return List.of(new Entry(AppI18n.observable("a"), new Step<CompStructure<?>>() {
return List.of(new Entry(AppI18n.observable("a"), new Step<>() {
@Override
public CompStructure<?> createBase() {
var b = new OptionsBuilder()
@ -89,7 +89,8 @@ public class ScanAlert {
entry,
ShellStore.class,
store1 -> true,
StoreViewState.get().getAllConnectionsCategory())
StoreViewState.get().getAllConnectionsCategory()
)
.disable(new SimpleBooleanProperty(initialStore != null)))
.name("scanAlertHeader")
.description("scanAlertHeaderDescription")
@ -99,7 +100,7 @@ public class ScanAlert {
.prefHeight(600)
.styleClass("window-content")
.apply(struc -> {
VBox.setVgrow(((VBox) struc.get().getChildren().get(1)), ALWAYS);
VBox.setVgrow(struc.get().getChildren().get(1), ALWAYS);
})
.createStructure()
.get();
@ -132,7 +133,8 @@ public class ScanAlert {
scanOperation ->
AppI18n.get(scanOperation.getNameKey()),
selected,
a.size() > 3)
a.size() > 3
)
.createRegion();
stackPane.getChildren().add(r);
});

View file

@ -6,6 +6,7 @@ import io.xpipe.beacon.util.QuietDialogHandler;
import io.xpipe.core.store.InternalStreamStore;
import io.xpipe.core.util.FailableBiConsumer;
import io.xpipe.core.util.FailableConsumer;
import lombok.Getter;
import java.io.IOException;
import java.io.InputStream;
@ -13,6 +14,7 @@ import java.io.OutputStream;
public abstract class BeaconConnection implements AutoCloseable {
@Getter
protected BeaconClient beaconClient;
private InputStream bodyInput;
@ -20,10 +22,6 @@ public abstract class BeaconConnection implements AutoCloseable {
protected abstract void constructSocket();
public BeaconClient getBeaconClient() {
return beaconClient;
}
@Override
public void close() {
try {

View file

@ -16,7 +16,7 @@ public class MessageExchanges {
if (ALL == null) {
ALL = ServiceLoader.load(MessageExchange.class).stream()
.map(s -> {
return (MessageExchange) s.get();
return s.get();
})
.collect(Collectors.toList());
}

View file

@ -1,6 +1,7 @@
package io.xpipe.core.charsetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import java.util.Arrays;
@ -11,6 +12,7 @@ public enum NewLine {
CRLF("\r\n", "crlf");
private final String newLine;
@Getter
private final String id;
NewLine(String newLine, String id) {
@ -36,7 +38,4 @@ public enum NewLine {
return newLine;
}
public String getId() {
return id;
}
}

View file

@ -13,6 +13,7 @@ import lombok.ToString;
public class BaseQueryElement extends DialogElement {
private final String description;
@Getter
private final boolean newLine;
private final boolean required;
private final boolean secret;
@ -35,10 +36,6 @@ public class BaseQueryElement extends DialogElement {
return required && value == null;
}
public boolean isNewLine() {
return newLine;
}
@Override
public String toDisplayString() {
return description;

View file

@ -14,11 +14,15 @@ import java.util.List;
@Getter
public class ChoiceElement extends DialogElement {
@Getter
private final String description;
@Getter
private final List<Choice> elements;
@Getter
private final boolean required;
private final boolean quiet;
@Getter
private int selected;
@JsonCreator
@ -76,19 +80,4 @@ public class ChoiceElement extends DialogElement {
return false;
}
public List<Choice> getElements() {
return elements;
}
public int getSelected() {
return selected;
}
public String getDescription() {
return description;
}
public boolean isRequired() {
return required;
}
}

View file

@ -2,10 +2,12 @@ package io.xpipe.core.dialog;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import java.util.UUID;
@Getter
@EqualsAndHashCode
@ToString
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@ -27,7 +29,4 @@ public abstract class DialogElement {
throw new UnsupportedOperationException();
}
public String getId() {
return id;
}
}

View file

@ -3,8 +3,10 @@ package io.xpipe.core.dialog;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
@Getter
@JsonTypeName("header")
@EqualsAndHashCode(callSuper = true)
@ToString
@ -27,7 +29,4 @@ public class HeaderElement extends DialogElement {
return true;
}
public String getHeader() {
return header;
}
}

View file

@ -44,7 +44,7 @@ public interface ShellControl extends ProcessControl {
s.setOsName(shellControl.getOsName());
store.setState(s);
});
};
}
default ShellControl withSupportCheckInit(Predicate<ShellControl> predicate, String name) {
return onInit(shellControl -> {
@ -52,7 +52,7 @@ public interface ShellControl extends ProcessControl {
}
});
};
}
default <T extends ShellStoreState> ShellControl withShellStateFail(StatefulDataStore<T> store) {
return onFail(shellControl -> {
@ -60,7 +60,7 @@ public interface ShellControl extends ProcessControl {
s.setRunning(false);
store.setState(s);
});
};
}
ShellControl onExit(Consumer<ShellControl> pc);

View file

@ -1,7 +1,9 @@
package io.xpipe.core.store;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
@Getter
public enum DataFlow {
@JsonProperty("input")
INPUT("Input"),
@ -28,7 +30,4 @@ public enum DataFlow {
return this == OUTPUT || this == INPUT_OUTPUT;
}
public String getDisplayName() {
return displayName;
}
}

View file

@ -8,11 +8,11 @@ import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.StandardCharsets;
@Getter
@SuperBuilder
@EqualsAndHashCode
public abstract class EncryptedSecretValue implements SecretValue {
@Getter
String encryptedValue;
public EncryptedSecretValue(char[] c) {

View file

@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import lombok.Getter;
import java.util.ArrayList;
import java.util.List;
@ -16,6 +17,7 @@ public class JacksonMapper {
private static final ObjectMapper BASE = new ObjectMapper();
private static final ObjectMapper INSTANCE;
@Getter
private static boolean init = false;
public static <T> T parse(String s, Class<T> c) throws JsonProcessingException {
@ -85,7 +87,4 @@ public class JacksonMapper {
return INSTANCE;
}
public static boolean isInit() {
return init;
}
}

View file

@ -8,6 +8,7 @@ import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
@Getter
public enum XPipeDaemonMode {
@JsonProperty("background")
BACKGROUND("background", List.of("base", "background")),
@ -29,10 +30,8 @@ public enum XPipeDaemonMode {
.collect(Collectors.joining(", "))));
}
@Getter
private final String displayName;
@Getter
private final List<String> nameAlternatives;
XPipeDaemonMode(String displayName, List<String> nameAlternatives) {

View file

@ -90,18 +90,21 @@ public class XPipeUrlAction implements ActionProvider {
@Override
public Action createAction(List<String> args) throws Exception {
if (args.get(0).equals("addStore")) {
switch (args.get(0)) {
case "addStore" -> {
var storeString = DefaultSecretValue.builder()
.encryptedValue(args.get(1))
.build();
var store = JacksonMapper.parse(storeString.getSecretValue(), DataStore.class);
return new AddStoreAction(store);
} else if (args.get(0).equals("launch")) {
}
case "launch" -> {
var entry = DataStorage.get()
.getStoreEntryIfPresent(UUID.fromString(args.get(1)))
.orElseThrow();
return new LaunchAction(entry);
} else if (args.get(0).equals("action")) {
}
case "action" -> {
var id = args.get(1);
ActionProvider provider = ActionProvider.ALL.stream().filter(actionProvider -> {
return actionProvider.getDataStoreCallSite() != null && id.equals(actionProvider.getId());
@ -110,10 +113,12 @@ public class XPipeUrlAction implements ActionProvider {
.getStoreEntryIfPresent(UUID.fromString(args.get(2)))
.orElseThrow();
return new CallAction(provider, entry);
} else {
}
default -> {
return null;
}
}
}
};
}
}

View file

@ -2,7 +2,6 @@ package io.xpipe.ext.base.browser;
import io.xpipe.app.browser.BrowserEntry;
import io.xpipe.app.browser.OpenFileSystemModel;
import io.xpipe.app.browser.action.BrowserAction;
import io.xpipe.app.browser.action.LeafAction;
import javafx.scene.Node;
import javafx.scene.input.KeyCode;

View file

@ -54,7 +54,7 @@ public class SimpleScriptStore extends ScriptStore {
}
@Getter
public static enum ExecutionType {
public enum ExecutionType {
@JsonProperty("dumbOnly")
DUMB_ONLY("dumbOnly"),
@JsonProperty("terminalOnly")