This commit is contained in:
Akshat Bahety
2018-05-26 19:14:23 +05:30
parent 1efe2ad87d
commit 46951e362a
4 changed files with 11 additions and 10 deletions

View File

@@ -77,15 +77,15 @@ public class EventLogController implements Initializable {
});
EventStream<LogEntry> e1 = designerRoot.getLogger().getLog()
.filter(x -> x.getCategory().equals(Category.PARSE_EXCEPTION))
.filter(x -> x.getCategory() == Category.PARSE_EXCEPTION)
.successionEnds(PARSE_EXCEPTION_DELAY);
EventStream<LogEntry> e2 = designerRoot.getLogger().getLog()
.filter(x -> !x.getCategory().equals(Category.PARSE_EXCEPTION));
.filter(x -> x.getCategory() != Category.PARSE_EXCEPTION);
EventStream<LogEntry> e3 = designerRoot.getLogger().getLog()
.filter(x -> x.getCategory().equals(Category.XPATH_EVALUATION_EXCEPTION))
.filter(x -> x.getCategory() == Category.XPATH_EVALUATION_EXCEPTION)
.successionEnds(PARSE_EXCEPTION_DELAY);
EventStreams.merge(e1, e2, e3)

View File

@@ -224,11 +224,10 @@ public class MainDesignerController implements Initializable, SettingsOwner {
public void onRefreshASTClicked() {
sourceEditorController.refreshAST();
xpathPanelController.evaluateXPath(sourceEditorController.getCompilationUnit(),
getLanguageVersion());
refreshXPathResults();
}
public void xPathEvaluate() {
public void refreshXPathResults() {
xpathPanelController.evaluateXPath(sourceEditorController.getCompilationUnit(),
getLanguageVersion());
}

View File

@@ -73,7 +73,7 @@ public class XPathPanelController implements Initializable, SettingsOwner {
private final ObservableXPathRuleBuilder ruleBuilder = new ObservableXPathRuleBuilder();
private static final Duration XPATH_REFRESH = Duration.ofMillis(3000);
private static final Duration XPATH_REFRESH = Duration.ofMillis(300);
@FXML
private PropertyTableView propertyView;
@@ -103,6 +103,7 @@ public class XPathPanelController implements Initializable, SettingsOwner {
initGenerateXPathFromStackTrace();
EventStreams.valuesOf(xpathResultListView.getSelectionModel().selectedItemProperty())
.conditionOn(xpathResultListView.focusedProperty())
.filter(Objects::nonNull)
.subscribe(parent::onNodeItemSelected);
@@ -111,7 +112,7 @@ public class XPathPanelController implements Initializable, SettingsOwner {
xpathExpressionArea.richChanges()
.filter(t -> !t.getInserted().equals(t.getRemoved()))
.successionEnds(XPATH_REFRESH)
.subscribe(x -> parent.xPathEvaluate());
.subscribe(x -> parent.refreshXPathResults());
}
private void initGenerateXPathFromStackTrace() {
@@ -217,6 +218,7 @@ public class XPathPanelController implements Initializable, SettingsOwner {
xpathResultListView.refresh();
}

View File

@@ -64,8 +64,8 @@
<bottom>
<ToolBar id="main-toolbar" prefHeight="40.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<items>
<Label text="Java Version"/>
<ChoiceBox fx:id="languageChoiceBox" maxHeight="22.0" prefHeight="22.0" prefWidth="115.0">
<Label text="Language Version"/>
<ChoiceBox fx:id="languageChoiceBox" maxHeight="22.0">
<padding>
<Insets bottom="-3.0" left="-3.0" right="-3.0" top="-3.0" />
</padding>