Java Code Examples for org.reactfx.value.Var#fromVal()

The following examples show how to use org.reactfx.value.Var#fromVal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XPathRuleEditorController.java    From pmd-designer with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public Var<String> xpathExpressionProperty() {
    return Var.fromVal(xpathExpressionArea.textProperty(), xpathExpressionArea::replaceText);
}
 
Example 2
Source File: ObservableRuleBuilder.java    From pmd-designer with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public Var<ObservableList<PropertyDescriptorSpec>> rulePropertiesProperty() {
    return Var.fromVal(Val.constant(ruleProperties), this::setRuleProperties);
}
 
Example 3
Source File: ExportXPathWizardController.java    From pmd-designer with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private Var<String> nameProperty() {
    return Var.fromVal(nameField.textProperty(), nameField::setText);
}
 
Example 4
Source File: ExportXPathWizardController.java    From pmd-designer with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private Var<String> messageProperty() {
    return Var.fromVal(messageField.textProperty(), messageField::setText);
}
 
Example 5
Source File: ExportXPathWizardController.java    From pmd-designer with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private Var<String> descriptionProperty() {
    return Var.fromVal(descriptionArea.textProperty(), descriptionArea::setText);
}
 
Example 6
Source File: ExportXPathWizardController.java    From pmd-designer with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public Var<Language> languageProperty() {
    return Var.fromVal(languageChoiceBox.getSelectionModel().selectedItemProperty(), languageChoiceBox.getSelectionModel()::select);
}
 
Example 7
Source File: ExportXPathWizardController.java    From pmd-designer with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private Var<ObservableList<PropertyDescriptorSpec>> rulePropertiesProperty() {
    return Var.fromVal(propertyCollectionView.itemsProperty(), propertyCollectionView::setItems);
}
 
Example 8
Source File: NodeDetailPaneController.java    From pmd-designer with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public Var<Boolean> hideCommonAttributesProperty() {
    return Var.fromVal(hideCommonAttributesToggle.selectedProperty(), hideCommonAttributesToggle::setSelected);
}
 
Example 9
Source File: SourceEditorController.java    From pmd-designer with BSD 2-Clause "Simplified" License 3 votes vote down vote up
@Override
public void afterParentInit() {
    initializeLanguageSelector();

    // languageVersionUiProperty is initialised

    ((ASTManagerImpl) astManager).languageVersionProperty().bind(languageVersionUIProperty.orElse(globalLanguageProperty().map(Language::getDefaultVersion)));

    handleTestOpenRequest(defaultTestCase, defaultTestCase);


    Var<String> areaText = Var.fromVal(
        latestValue(nodeEditionCodeArea.plainTextChanges()
                                       .successionEnds(AST_REFRESH_DELAY)
                                       .map(it -> nodeEditionCodeArea.getText())),
        text -> nodeEditionCodeArea.replaceText(text)
    );

    areaText.bindBidirectional(astManager.sourceCodeProperty());


    nodeEditionCodeArea.moveCaret(0, 0);

    editorTitledPane.errorTypeProperty().setValue("Syntax error");
    initTreeView(astManager, astTreeView, editorTitledPane.errorMessageProperty());

    getDesignerRoot().registerService(DesignerRoot.RICH_TEXT_MAPPER, nodeEditionCodeArea);

    getService(DesignerRoot.TEST_LOADER)
        .messageStream(true, this)
        .subscribe(currentlyOpenTestCase::setValue);


    // this is to hide the toolbar when we're not in test case mode
    currentlyOpenTestCase.map(it -> true).orElseConst(false)
                         .values().distinct()
                         .subscribe(this::toggleTestEditMode);

}