package org.example;
import griffon.core.artifact.GriffonView;
import griffon.inject.MVCMember;
import griffon.metadata.ArtifactProviderFor;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import org.codehaus.griffon.runtime.javafx.artifact.AbstractJavaFXGriffonView;
import java.util.Collections;
import javax.annotation.Nonnull;
@ArtifactProviderFor(GriffonView.class)
public class FormItemView extends AbstractJavaFXGriffonView {
@MVCMember private FormItemController controller;
@MVCMember private FormItemModel model;
@MVCMember private String propertyKey;
@FXML private Label propertyLabel;
@FXML private TextField propertyValue;
@Override
public void initUI() {
Node content = loadFromFXML();
propertyLabel.setText(propertyKey);
model.valueProperty().bindBidirectional(propertyValue.textProperty());
connectActions(content, controller);
connectMessageSource(content);
getMvcGroup().getContext().put(getMvcGroup().getMvcId() + "-rootNode", content);
}
}