Commit 2d7087bc authored by Axel Howind's avatar Axel Howind

code cleanup

parent 960d6a6f
Pipeline #53559408 failed with stages
in 16 minutes and 47 seconds
......@@ -14,18 +14,9 @@
package com.dua3.fx.editors.intern;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.URL;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.dua3.fx.editors.EditorSetting;
import com.dua3.fx.editors.EditorSettingsDialog;
import com.dua3.fx.web.WebViews;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.beans.property.StringProperty;
......@@ -37,6 +28,14 @@ import javafx.scene.layout.BorderPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.URL;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
public abstract class EditorBase extends BorderPane {
private static final Logger LOG = Logger.getLogger(EditorBase.class.getName());
......@@ -198,8 +197,8 @@ public abstract class EditorBase extends BorderPane {
}
public void setPromptText(String text) {
promptTextProperty().set(text);;
}
promptTextProperty().set(text);
}
public void cut() {
bridge.executeScript("jCut();");
......
......@@ -129,14 +129,14 @@ public interface InputControl<R> {
}
}
public static SimpleInputControl<TextField, String> stringInput(Supplier<String> dflt, Function<String, Optional<String>> validate) {
static SimpleInputControl<TextField, String> stringInput(Supplier<String> dflt, Function<String, Optional<String>> validate) {
TextField control = new TextField();
StringProperty value = control.textProperty();
SimpleInputControl<TextField, String> inputControl = new SimpleInputControl<>(control, value, dflt, validate);
return inputControl;
}
public static <T> SimpleInputControl<TextField, T> stringInput(Supplier<T> dflt, Function<T, Optional<String>> validate, StringConverter<T> converter) {
static <T> SimpleInputControl<TextField, T> stringInput(Supplier<T> dflt, Function<T, Optional<String>> validate, StringConverter<T> converter) {
TextField control = new TextField();
ObjectProperty<T> value = new SimpleObjectProperty<>();
Bindings.bindBidirectional(control.textProperty(), value, converter);
......@@ -144,7 +144,7 @@ public interface InputControl<R> {
return inputControl;
}
public static SimpleInputControl<TextField, Integer> integerInput(Supplier<Integer> dflt, Function<Integer, Optional<String>> validate) {
static SimpleInputControl<TextField, Integer> integerInput(Supplier<Integer> dflt, Function<Integer, Optional<String>> validate) {
TextField control = new TextField();
StringProperty textProperty = control.textProperty();
IntegerProperty value = new SimpleIntegerProperty();
......@@ -153,7 +153,7 @@ public interface InputControl<R> {
return inputControl;
}
public static SimpleInputControl<TextField, Double> decimalInput(Supplier<Double> dflt, Function<Double, Optional<String>> validate) {
static SimpleInputControl<TextField, Double> decimalInput(Supplier<Double> dflt, Function<Double, Optional<String>> validate) {
TextField control = new TextField();
StringProperty textProperty = control.textProperty();
DoubleProperty value = new SimpleDoubleProperty();
......@@ -162,14 +162,14 @@ public interface InputControl<R> {
return inputControl;
}
public static SimpleInputControl<CheckBox, Boolean> checkBoxInput(Supplier<Boolean> dflt, String text) {
static SimpleInputControl<CheckBox, Boolean> checkBoxInput(Supplier<Boolean> dflt, String text) {
CheckBox control = new CheckBox(text);
BooleanProperty value = control.selectedProperty();
SimpleInputControl<CheckBox,Boolean> inputControl = new SimpleInputControl<>(control, value.asObject(), dflt, r -> Optional.empty());
return inputControl;
}
public static <T> SimpleInputControl<ComboBox<T>, T> comboBoxInput(Collection<T> choices, Supplier<T> dflt) {
static <T> SimpleInputControl<ComboBox<T>, T> comboBoxInput(Collection<T> choices, Supplier<T> dflt) {
ComboBox<T> control = new ComboBox<>(FXCollections.observableArrayList(choices));
ObjectProperty<T> value = control.valueProperty();
SimpleInputControl<ComboBox<T>,T> inputControl = new SimpleInputControl<>(control, value, dflt, r -> Optional.empty());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment