Checkstyle Updates

This commit is contained in:
Akshat Bahety
2018-05-24 01:03:44 +05:30
parent 7d5b44cd8a
commit b4b22e96b8
4 changed files with 17 additions and 7 deletions

View File

@ -11,11 +11,13 @@ import java.time.Duration;
import java.util.Date;
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.Category;
import org.reactfx.EventStream;
import org.reactfx.EventStreams;
import javafx.beans.property.SimpleObjectProperty;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
@ -35,6 +37,8 @@ public class EventLogController implements Initializable {
private final DesignerRoot designerRoot;
private final Duration timeDuration = Duration.ofMillis(100);
@FXML
private TableView<LogEntry> eventLogTableView;
@FXML
@ -74,7 +78,7 @@ public class EventLogController implements Initializable {
EventStream<LogEntry> e1 = designerRoot.getLogger().getLog()
.filter(x -> x.getCategory().equals(Category.PARSE_EXCEPTION))
.successionEnds(Duration.ofMillis(1000));
.successionEnds(timeDuration);
EventStream<LogEntry> e2 = designerRoot.getLogger().getLog()
.filter(x -> !x.getCategory().equals(Category.PARSE_EXCEPTION));

View File

@ -55,7 +55,7 @@ public class SourceEditorController implements Initializable, SettingsOwner {
private ASTManager astManager;
private TreeViewWrapper<Node> treeViewWrapper;
private ASTTreeItem selectedTreeItem;
private Duration timeDuration = Duration.ofMillis(100);
public SourceEditorController(DesignerRoot owner, MainDesignerController mainController) {
parent = mainController;
@ -83,7 +83,7 @@ public class SourceEditorController implements Initializable, SettingsOwner {
codeEditorArea.richChanges()
.filter(t -> !t.getInserted().equals(t.getRemoved()))
.successionEnds(Duration.ofMillis(100))
.successionEnds(timeDuration)
.subscribe(richChange -> parent.onRefreshASTClicked());
codeEditorArea.setParagraphGraphicFactory(LineNumberFactory.get(codeEditorArea));

View File

@ -209,7 +209,7 @@ public class XPathPanelController implements Initializable, SettingsOwner {
}
xpathResultListView.refresh();
xpathExpressionArea.requestFocus();
}

View File

@ -17,12 +17,18 @@ import org.reactfx.value.Var;
*/
public class EventLogger {
private Var<LogEntry> latestEvent = Var.newSimpleVar(null);
private final Var<LogEntry> latestEvent = Var.newSimpleVar(null);
public void logEvent(LogEntry event) {
latestEvent.setValue(event);
}
/**
* Gets a Stream of Log Events
*
* @return The Event Stream of Log
*/
public EventStream<LogEntry> getLog() {
return latestEvent.values().filter(Objects::nonNull);
}