All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dua3.utility.fx.controls.InputPane Maven / Gradle / Ivy

There is a newer version: 15.0.2
Show newest version
package com.dua3.utility.fx.controls;

import javafx.scene.Node;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Collections;
import java.util.Map;


/**
 * The InputPane class extends InputDialogPane to provide a customized input dialog pane containing an InputGrid.
 * It initializes the input grid and ensures data retrieval and validation status binding.
 */
public class InputPane extends InputDialogPane> {

    protected static final Logger LOG = LogManager.getLogger(InputPane.class);

    private final InputGrid inputGrid;

    /**
     * Constructs an InputPane with the specified InputGrid.
     * This constructor initializes the InputGrid, binds its validation property,
     * and sets it as the content of the InputPane.
     *
     * @param inputGrid the InputGrid instance to be used in the InputPane
     */
    public InputPane(InputGrid inputGrid) {
        this.inputGrid = inputGrid;
        valid.bind(inputGrid.validProperty());
        setContent(inputGrid);
    }

    @Override
    public Map get() {
        Node content = getContent();
        if (content instanceof InputGrid) {
            return ((InputGrid) content).get();
        } else {
            return Collections.emptyMap();
        }
    }

    @Override
    public void init() {
        inputGrid.init();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy