package org.richfaces.component;

import java.io.Serializable;

/**
 * 
 * @author glory
 *
 */

public class DialogActionState implements Serializable {
	private static final long serialVersionUID = 1L;
	
	public static final String SERVER_MODE = "server";
	public static final String AJAX_MODE = "ajax";

    private boolean immediate = false;
    private boolean immediateSet = false;
    private String mode = AJAX_MODE;
    
    public DialogActionState() {}

    public boolean isImmediate() {
    	return immediate;
    }

    public boolean isImmediateSet() {
    	return immediateSet;
    }

    public void setImmediate(boolean immediate) {
    	if (immediate != this.immediate) {
    		this.immediate = immediate;
    	}
    	this.immediateSet = true;
    }

	public String getMode() {
		return mode;
	}
	
	public void setMode(String mode) {
		this.mode = mode;
	}
	
	public boolean isServerMode() {
		return SERVER_MODE.equals(mode);
	}

}
