package snow.showcase;

import javax.script.ScriptException;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

import snow.Snow;

import com.jgoodies.binding.beans.Model;

public class SnowExample extends Model {

	private String property1 = "Initial value";

	public static void main(String[] args) {
		try {
			Snow.evalResource(Snow.class, "/snow/example/example.lisp");
		} catch (ScriptException e) {
			e.printStackTrace();
		}
	}

	public void someAction() {
		JOptionPane.showMessageDialog(null, "Example dialog from Java");
	}

	public String getProperty1() {
		return property1;
	}

	public void setProperty1(String property) {
		String oldValue = property1;
		property1 = property;
		firePropertyChange("property1", oldValue, property1);
	}

    private SnowExample nested = null;
    
    public SnowExample getNested() {
	if(nested == null) {
	    nested = new SnowExample();
	}
	return nested;
    }

}
