/* $Id: CreateMemoAction.java 171 2011-05-23 15:20:31Z minao $ */
package smart_gs.swingui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;

import smart_gs.logical.SmartDocument;
import smart_gs.logical.SpreadDirectory;
import smart_gs.logical.StandardTextDocument;

public class CreateMemoAction implements ActionListener {
	
	private SpreadDirectory parent;
	
	public CreateMemoAction(SpreadDirectory parent){
		this.parent = parent;
	}
	public void actionPerformed(ActionEvent e) {
		SmartDocument document = new StandardTextDocument();
		String name = JOptionPane.showInputDialog(null,"input document name");
		if(name == null){
			return;
		}
		document.setName(name);
		parent.addResource(document);
	}

}
