Code cleanup

This commit is contained in:
0xboobface 2020-03-16 14:27:48 +01:00
parent 30a8a50402
commit 6f278b6c49
4 changed files with 21 additions and 23 deletions

View File

@ -16,7 +16,7 @@ import javafx.scene.Node;
import javafx.scene.control.TableView;
public class EditNotesAction {
private static final transient Logger LOG = LoggerFactory.getLogger(EditNotesAction.class);
private static final Logger LOG = LoggerFactory.getLogger(EditNotesAction.class);
private Node source;
private Model model;
@ -30,8 +30,7 @@ public class EditNotesAction {
public void execute() {
source.setCursor(Cursor.WAIT);
new Thread(() -> {
Platform.runLater(() -> {
new Thread(() -> Platform.runLater(() -> {
String notes = Config.getInstance().getSettings().modelNotes.getOrDefault(model.getUrl(), "");
Optional<String> newNotes = Dialogs.showTextInput(source.getScene(), "Model Notes", "Notes for " + model.getName(), notes);
newNotes.ifPresent(n -> {
@ -48,7 +47,6 @@ public class EditNotesAction {
});
table.refresh();
source.setCursor(Cursor.DEFAULT);
});
}).start();
})).start();
}
}

View File

@ -35,7 +35,7 @@ public class ModelMassEditAction {
}
public void execute() {
execute((m) -> {});
execute(m -> {});
}
public void execute(Consumer<Model> callback) {

View File

@ -12,7 +12,7 @@ public class PauseAction extends ModelMassEditAction {
public PauseAction(Node source, List<? extends Model> models, Recorder recorder) {
super(source, models);
action = (m) -> {
action = m -> {
try {
recorder.suspendRecording(m);
} catch(Exception e) {

View File

@ -12,7 +12,7 @@ public class ResumeAction extends ModelMassEditAction {
public ResumeAction(Node source, List<? extends Model> models, Recorder recorder) {
super(source, models);
action = (m) -> {
action = m -> {
try {
recorder.resumeRecording(m);
} catch(Exception e) {