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

com.izforge.izpack.panels.userinput.action.ButtonAction Maven / Gradle / Ivy

There is a newer version: 5.2.3
Show newest version
package com.izforge.izpack.panels.userinput.action;

import com.izforge.izpack.api.handler.Prompt;
import com.izforge.izpack.api.data.InstallData;
import com.izforge.izpack.util.Console;

import java.util.HashMap;
import java.util.Map;

public abstract class ButtonAction
{
    /**
     * Access to installData
     */
    final protected InstallData installData;

    /**
     * Messages available for the button
     */
    protected Map messages = new HashMap();

    public ButtonAction(InstallData installData)
    {
        this.installData = installData;
    }

    /**
     * Give mapping from string name to the actual string value.
     * @param messages
     */
    public void setMessages(Map messages)
    {
        this.messages = messages;
    }

    /**
     * Actual execution logic for the action.
     * @return
     */
    public abstract boolean execute();

    /**
     * Execution method for console.
     * @return
     */
    public abstract boolean execute(Console console);

    /**
     * Execution method for GUI
     * @param prompt
     * @return
     */
    public abstract boolean execute(Prompt prompt);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy