Checkstyle Updates
This commit is contained in:
@ -11,11 +11,13 @@ import java.time.Duration;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import org.reactfx.EventStream;
|
||||||
|
import org.reactfx.EventStreams;
|
||||||
|
|
||||||
import net.sourceforge.pmd.util.fxdesigner.model.LogEntry;
|
import net.sourceforge.pmd.util.fxdesigner.model.LogEntry;
|
||||||
import net.sourceforge.pmd.util.fxdesigner.model.LogEntry.Category;
|
import net.sourceforge.pmd.util.fxdesigner.model.LogEntry.Category;
|
||||||
|
|
||||||
import org.reactfx.EventStream;
|
|
||||||
import org.reactfx.EventStreams;
|
|
||||||
import javafx.beans.property.SimpleObjectProperty;
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
@ -35,6 +37,8 @@ public class EventLogController implements Initializable {
|
|||||||
|
|
||||||
private final DesignerRoot designerRoot;
|
private final DesignerRoot designerRoot;
|
||||||
|
|
||||||
|
private final Duration timeDuration = Duration.ofMillis(100);
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
private TableView<LogEntry> eventLogTableView;
|
private TableView<LogEntry> eventLogTableView;
|
||||||
@FXML
|
@FXML
|
||||||
@ -74,7 +78,7 @@ public class EventLogController implements Initializable {
|
|||||||
|
|
||||||
EventStream<LogEntry> e1 = designerRoot.getLogger().getLog()
|
EventStream<LogEntry> e1 = designerRoot.getLogger().getLog()
|
||||||
.filter(x -> x.getCategory().equals(Category.PARSE_EXCEPTION))
|
.filter(x -> x.getCategory().equals(Category.PARSE_EXCEPTION))
|
||||||
.successionEnds(Duration.ofMillis(1000));
|
.successionEnds(timeDuration);
|
||||||
|
|
||||||
EventStream<LogEntry> e2 = designerRoot.getLogger().getLog()
|
EventStream<LogEntry> e2 = designerRoot.getLogger().getLog()
|
||||||
.filter(x -> !x.getCategory().equals(Category.PARSE_EXCEPTION));
|
.filter(x -> !x.getCategory().equals(Category.PARSE_EXCEPTION));
|
||||||
|
@ -55,7 +55,7 @@ public class SourceEditorController implements Initializable, SettingsOwner {
|
|||||||
private ASTManager astManager;
|
private ASTManager astManager;
|
||||||
private TreeViewWrapper<Node> treeViewWrapper;
|
private TreeViewWrapper<Node> treeViewWrapper;
|
||||||
private ASTTreeItem selectedTreeItem;
|
private ASTTreeItem selectedTreeItem;
|
||||||
|
private Duration timeDuration = Duration.ofMillis(100);
|
||||||
|
|
||||||
public SourceEditorController(DesignerRoot owner, MainDesignerController mainController) {
|
public SourceEditorController(DesignerRoot owner, MainDesignerController mainController) {
|
||||||
parent = mainController;
|
parent = mainController;
|
||||||
@ -83,7 +83,7 @@ public class SourceEditorController implements Initializable, SettingsOwner {
|
|||||||
|
|
||||||
codeEditorArea.richChanges()
|
codeEditorArea.richChanges()
|
||||||
.filter(t -> !t.getInserted().equals(t.getRemoved()))
|
.filter(t -> !t.getInserted().equals(t.getRemoved()))
|
||||||
.successionEnds(Duration.ofMillis(100))
|
.successionEnds(timeDuration)
|
||||||
.subscribe(richChange -> parent.onRefreshASTClicked());
|
.subscribe(richChange -> parent.onRefreshASTClicked());
|
||||||
|
|
||||||
codeEditorArea.setParagraphGraphicFactory(LineNumberFactory.get(codeEditorArea));
|
codeEditorArea.setParagraphGraphicFactory(LineNumberFactory.get(codeEditorArea));
|
||||||
|
@ -209,7 +209,7 @@ public class XPathPanelController implements Initializable, SettingsOwner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
xpathResultListView.refresh();
|
xpathResultListView.refresh();
|
||||||
xpathExpressionArea.requestFocus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,12 +17,18 @@ import org.reactfx.value.Var;
|
|||||||
*/
|
*/
|
||||||
public class EventLogger {
|
public class EventLogger {
|
||||||
|
|
||||||
private Var<LogEntry> latestEvent = Var.newSimpleVar(null);
|
private final Var<LogEntry> latestEvent = Var.newSimpleVar(null);
|
||||||
|
|
||||||
public void logEvent(LogEntry event) {
|
public void logEvent(LogEntry event) {
|
||||||
latestEvent.setValue(event);
|
latestEvent.setValue(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a Stream of Log Events
|
||||||
|
*
|
||||||
|
* @return The Event Stream of Log
|
||||||
|
*/
|
||||||
|
|
||||||
public EventStream<LogEntry> getLog() {
|
public EventStream<LogEntry> getLog() {
|
||||||
return latestEvent.values().filter(Objects::nonNull);
|
return latestEvent.values().filter(Objects::nonNull);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user