bayern.steinbrecher.wizard.pages.Selection 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.pages;
import bayern.steinbrecher.wizard.StandaloneWizardPage;
import javafx.scene.control.CheckBox;
import org.jetbrains.annotations.NotNull;
import java.util.Objects;
import java.util.Optional;
import java.util.ResourceBundle;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
/**
* @param The type of the attributes being able to select.
* @author Stefan Huber
* @since 1.4
*/
public class Selection>
extends StandaloneWizardPage>, SelectionController> {
private static final long NUM_TIMEOUT_TICKS = 3;
private static final TimeUnit TIMEOUT_TICK_UNIT = TimeUnit.SECONDS;
private final Supplier> options;
/**
* Creates a new page which represents each given option as selectable {@link CheckBox} and adds a search box which
* allows to filter the visible options.
*/
public Selection(@NotNull Set options) {
this(() -> options);
}
/**
* @since 1.51
*/
public Selection(@NotNull Supplier> options) {
super("Selection.fxml", ResourceBundle.getBundle("bayern.steinbrecher.wizard.pages.Selection"));
this.options = Objects.requireNonNull(options);
}
@Override
protected void afterControllerInitialized() {
getController().setOptions(options.get());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy