// Path: src/main/java/tornadofx/util/NodeHelper.java
// public class NodeHelper {
// 
//     public static <T> T findParentOfType( Node node, Class<T> type ){
//         if( node == null ) return null;
//         Parent parent = node.getParent();
//         if( parent == null ) return null;
//         if( type.isAssignableFrom(parent.getClass()) ) return (T)parent;
//         return findParentOfType( parent, type );
//     }
// 
//     public static <T> List<T> findChildrenOfType(Pane parent, Class<T> type) {
//         List<T> elements = new ArrayList<>();
//         for (Node node : parent.getChildren()) {
//             if (type.isAssignableFrom(node.getClass())) {
//                 elements.add((T) node);
//             } else if (node instanceof Pane) {
//                 elements.addAll(findChildrenOfType((Pane) node, type));
//             }
//         }
//         return Collections.unmodifiableList(elements);
//     }
// 
//     public static void addPseudoClass( Node node, String className ){
//         PseudoClass pseudoClass = PseudoClass.getPseudoClass( className );
//         node.pseudoClassStateChanged( pseudoClass, true );
//     }
// }


import javafx.beans.DefaultProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.geometry.Orientation;
import javafx.scene.Node;
import javafx.scene.layout.*;
import tornadofx.util.NodeHelper;
package tornadofx.control;


@DefaultProperty("inputs")
public class Field extends AbstractField {

    private Pane inputContainer = null;
    private Orientation orientation;

    public Field() {
        this(null);
    }

    public Field( String text ){
        this( text, Orientation.HORIZONTAL );
    }

    public Field( String text, Orientation orientation ){
        this( text, orientation, false,null );
    }

    public Field( String text, Orientation orientation, Node... inputs ){
        this( text, orientation, false,inputs );
    }

    public Field(String text, Node... inputs){
        this( text, Orientation.HORIZONTAL, false, inputs );
    }

	public Field(String text, Orientation orientation, boolean forceLabelIndent, Node... inputs) {
		super(text, forceLabelIndent);
		this.orientation = orientation;

        getStyleClass().add("field");

        parentProperty().addListener( (obs, oldParent, newParent) -> {
            if( !(oldParent instanceof Fieldset) ) {
                Fieldset oldFieldSet =
// Path: src/main/java/tornadofx/util/NodeHelper.java
// public class NodeHelper {
// 
//     public static <T> T findParentOfType( Node node, Class<T> type ){
//         if( node == null ) return null;
//         Parent parent = node.getParent();
//         if( parent == null ) return null;
//         if( type.isAssignableFrom(parent.getClass()) ) return (T)parent;
//         return findParentOfType( parent, type );
//     }
// 
//     public static <T> List<T> findChildrenOfType(Pane parent, Class<T> type) {
//         List<T> elements = new ArrayList<>();
//         for (Node node : parent.getChildren()) {
//             if (type.isAssignableFrom(node.getClass())) {
//                 elements.add((T) node);
//             } else if (node instanceof Pane) {
//                 elements.addAll(findChildrenOfType((Pane) node, type));
//             }
//         }
//         return Collections.unmodifiableList(elements);
//     }
// 
//     public static void addPseudoClass( Node node, String className ){
//         PseudoClass pseudoClass = PseudoClass.getPseudoClass( className );
//         node.pseudoClassStateChanged( pseudoClass, true );
//     }
// }


// Path: src/main/java/tornadofx/control/Field.java
import javafx.beans.DefaultProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.geometry.Orientation;
import javafx.scene.Node;
import javafx.scene.layout.*;
import tornadofx.util.NodeHelper;

package tornadofx.control;


@DefaultProperty("inputs")
public class Field extends AbstractField {

    private Pane inputContainer = null;
    private Orientation orientation;

    public Field() {
        this(null);
    }

    public Field( String text ){
        this( text, Orientation.HORIZONTAL );
    }

    public Field( String text, Orientation orientation ){
        this( text, orientation, false,null );
    }

    public Field( String text, Orientation orientation, Node... inputs ){
        this( text, orientation, false,inputs );
    }

    public Field(String text, Node... inputs){
        this( text, Orientation.HORIZONTAL, false, inputs );
    }

	public Field(String text, Orientation orientation, boolean forceLabelIndent, Node... inputs) {
		super(text, forceLabelIndent);
		this.orientation = orientation;

        getStyleClass().add("field");

        parentProperty().addListener( (obs, oldParent, newParent) -> {
            if( !(oldParent instanceof Fieldset) ) {
                Fieldset oldFieldSet =
                        NodeHelper.findParentOfType(oldParent, Fieldset.class);