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

net.vectorpublish.desktop.vp.api.ui.Dialog Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) 2016, Peter Rader. All rights reserved.
 *  ___ ___               __                 ______         __     __  __         __
 * |   |   |.-----..----.|  |_ .-----..----.|   __ \.--.--.|  |--.|  ||__|.-----.|  |--.
 * |   |   ||  -__||  __||   _||  _  ||   _||    __/|  |  ||  _  ||  ||  ||__ --||     |
 *  \_____/ |_____||____||____||_____||__|  |___|   |_____||_____||__||__||_____||__|__|
 *
 * http://www.gnu.org/licenses/gpl-3.0.html
 */
package net.vectorpublish.desktop.vp.api.ui;

import java.io.File;
import java.util.concurrent.Future;

import org.springframework.scheduling.annotation.Async;

import net.vectorpublish.desktop.vp.ui.Namespace;

public interface Dialog {
	@Async
	 Future ask(Namespace contextNamespace, String question, A... proposal);

	/**
	 * Asks the user for confirmation.
	 *
	 * @param ns
	 *            The namespace of the confirmatino-dialog.
	 * @param title
	 *            The title of the window.
	 * @param question
	 *            The question the user has to answer.
	 * @param yesLabel
	 *            The label of the yes-button.
	 * @param noLabel
	 *            The label of the no-button.
	 * @return true when the user pressed the yes-button or
	 *         false when the user pressed the no-button.
	 */
	@Async
	Future confirm(Namespace ns, String title, String question, String yesLabel, String noLabel);

	File showOpenFile(String fileExtension, String fileFormatDescription);

	/**
	 * Asks for a file to save to.
	 *
	 * @param fileExtension
	 *            The extension of the file without a dot, i.e.: "txt", never
	 *            null.
	 * @param fileFormatDescription
	 *            The description of the fileformat to show in the dropdown,
	 *            i.e.:"Textfile", never null.
	 * @return The file or null if the user has canceled the
	 *         dialog.
	 */
	File showSaveFile(String fileExtension, String fileFormatDescription);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy