// 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.property.SimpleStringProperty;
import javafx.collections.ObservableList;
import javafx.geometry.Orientation;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.Region;
import tornadofx.util.NodeHelper;
package tornadofx.control;



public abstract class AbstractField extends Pane {

    SimpleStringProperty textProperty = new SimpleStringProperty();

    private boolean forceLabelIndent = false;

    private Label label = new Label();
    private LabelContainer labelContainer = new LabelContainer(label);

    public AbstractField( String text, boolean forceLabelIndent ){
        setText(text);
        this.forceLabelIndent = forceLabelIndent;
        setFocusTraversable(false);
        getStyleClass().add("field");
        label.textProperty().bind(textProperty);
        getChildren().add( labelContainer );

    }

    public String getText(){
        return textProperty.get();
    }

    public void setText(String text ){
        textProperty.set(text);
    }

    public void setForceLabelIndent(boolean forceLabelIndent ){
        this.forceLabelIndent = forceLabelIndent;
    }

    public boolean getForceLabelIndent(){
        return this.forceLabelIndent;
    }

    public Fieldset getFieldSet(){
// 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/AbstractField.java
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.ObservableList;
import javafx.geometry.Orientation;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.Region;
import tornadofx.util.NodeHelper;

package tornadofx.control;



public abstract class AbstractField extends Pane {

    SimpleStringProperty textProperty = new SimpleStringProperty();

    private boolean forceLabelIndent = false;

    private Label label = new Label();
    private LabelContainer labelContainer = new LabelContainer(label);

    public AbstractField( String text, boolean forceLabelIndent ){
        setText(text);
        this.forceLabelIndent = forceLabelIndent;
        setFocusTraversable(false);
        getStyleClass().add("field");
        label.textProperty().bind(textProperty);
        getChildren().add( labelContainer );

    }

    public String getText(){
        return textProperty.get();
    }

    public void setText(String text ){
        textProperty.set(text);
    }

    public void setForceLabelIndent(boolean forceLabelIndent ){
        this.forceLabelIndent = forceLabelIndent;
    }

    public boolean getForceLabelIndent(){
        return this.forceLabelIndent;
    }

    public Fieldset getFieldSet(){
        return NodeHelper.findParentOfType(this,Fieldset.class);