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

jfxtras.internal.scene.control.skin.agenda.icalendar.base24hour.DeleteChoiceDialog Maven / Gradle / Ivy

The newest version!
package jfxtras.internal.scene.control.skin.agenda.icalendar.base24hour;

import java.time.temporal.Temporal;
import java.util.Map;
import java.util.Optional;
import java.util.ResourceBundle;

import javafx.util.Callback;
import javafx.util.Pair;
import jfxtras.scene.control.agenda.icalendar.editors.ChangeDialogOption;

/**
 * Dialog to allow user to choice between ChangeDialogOption (ONE, THIS_AND_FUTURE, and ALL) delete options.
 * The constructor requires a map of matching ChangeDialogOptions and a string of date/time range affected.
 * 
 * @author David Bal
 *
 */
public class DeleteChoiceDialog extends ComponentChangeDialog
{
    /**
     * Callback to produce an edit choice dialog based on the options in the input argument choices.
     * Usually all or some of ONE, THIS_AND_FUTURE, and ALL.
     */
    final static public Callback>, ChangeDialogOption> DELETE_DIALOG_CALLBACK = (choices) ->
    {
        DeleteChoiceDialog dialog = new DeleteChoiceDialog(choices, Settings.resources);                
        Optional result = dialog.showAndWait();
        return (result.isPresent()) ? result.get() : ChangeDialogOption.CANCEL;
    };
    
    /**
     * 
     * @param choiceList - list of ChangeDialogOption representing the date/time range to be affected
     * @param resources
     */
    public DeleteChoiceDialog(Map> choiceList, ResourceBundle resources)
    {
        super(choiceList, resources);
        getDialogPane().setId("deleteChoiceDialog");
        setTitle(resources.getString("dialog.delete.title"));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy