bayern.steinbrecher.wizard.WizardPageController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Wizard Show documentation
Show all versions of Wizard Show documentation
Contains a library to create dynamic and branching JavaFX wizards in an abstract way.
Comes with a predefined collection of typical wizard pages.
package bayern.steinbrecher.wizard;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import org.jetbrains.annotations.NotNull;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.ResourceBundle;
/**
* Represents a controller of a {@link WizardPage}.
*
* @param The type of the result represented by this controller.
* @author Stefan Huber
* @since 1.2
*/
public abstract class WizardPageController> {
/**
* A property indicating whether all input handled by this controller is valid.
*/
private final BooleanProperty valid = new SimpleBooleanProperty(this, "valid", true);
@FXML
private ResourceBundle resources;
/**
* Returns the value behind {@code key} of the resource bundle inserted params.
*
* @param key The key to search for.
* @param params The params to insert.
* @return The value with inserted params.
* @since 1.12
*/
public String getResourceValue(@NotNull String key, @NotNull Object... params) {
Objects.requireNonNull(key);
Objects.requireNonNull(params);
return resources.containsKey(key) ? MessageFormat.format(resources.getString(key), params) : key;
}
/**
* Returns a list of values behind {@code key} of the resource bundle and with inserted params.
*
* @param key The key to search for.
* @param params The list of params to insert each in the value behind {@code key}.
* @return The list of values with inserted params.
* @since 1.12
*/
public List getResourceValues(@NotNull String key, @NotNull List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy