package smart_gs.reasoning_web.swingui;

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

import javax.swing.JMenuItem;
import javax.swing.JOptionPane;

import smart_gs.reasoning_web.desktop.logical.DeskTopFolder;
import smart_gs.reasoning_web.desktop.logical.DesktopElement;
import smart_gs.swingui.WorkspaceWindow;

public class CreateFolderAction implements ActionListener {
	
	private DeskTopFolder folder;
	
	public CreateFolderAction(DeskTopFolder folder) {
		this.folder = folder;
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		String name = JOptionPane.showInputDialog("input folder name","new folder");
		if(name == null){
			return;
		}
		folder.add(new DeskTopFolder(folder,name));
		WorkspaceWindow.setUpdated(true);
	}

}
