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

com.talk2object.plum.interaction.InteractionManager Maven / Gradle / Ivy

package com.talk2object.plum.interaction;

import java.util.List;

import com.talk2object.plum.interaction.rich.field.InteractiveField;
import com.talk2object.plum.view.component.containers.window.ModalResult;
import com.talk2object.plum.viewgeneration.classexpr.ClassExpr;

/**
 * It provide a abstract interface for interaction (with user), include get
 * input from user. abstract inputs eventually presented as View(GUI/CLI) to
 * user, basically it need a prompt text and can get key(and other source)
 * input.
 * 
 * a InteractionManager can support extended feature, through annotations.
 * 
 * 
 * 
 * support stack-based style interaction; stack-based interaction is not a new
 * thing, widely used as modal dialog in Windows and other window system and
 * rarely used in web application.
 * 
 * 
 * @author jackding
 * 
 */
public interface InteractionManager {

	/**
	 * modal dialog.
	 * 
	 * @param inputs
	 * @return
	 */
	Form scan(List inputs);

	Form scan(String title, List inputs);

	/**
	 * show a notification dialog. user can only read and click OK button.
	 * 
	 * @param title
	 * @param message
	 */
	ModalResult inform(Object message);

	/**
	 * viewClass is any.
	 * 
	 * @param title
	 * @param message
	 * @return
	 */
	ModalResult inform(String title, Object message);

	/**
	 * 
	 * @param title
	 * @param message
	 *            should not be instance of Component.
	 * @param classExpr
	 * @return
	 */
	ModalResult inform(String title, Object message, ClassExpr classExpr);

	ModalResult confirm(String message);

	/**
	 * get the Input object for current form, so that developer can set
	 * validation error messages.
	 * 
	 * @param name
	 * @return
	 */
	Form getCurrentForm();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy