package smart_gs.reasoning_web.swingui;

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

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

public class DeleteSelectionsAction implements ActionListener {

	@Override
	public void actionPerformed(ActionEvent arg0) {
		DesktopPanel desktoppanel = ReasoningWebFrame.getInstance().getDesktopPanel();
		Object[] elements = desktoppanel.getSelectedElements();
		DeskTopFolder desktopfolder = desktoppanel.getCurrentFolder();

		 for (int i = 0; i < elements.length; i++) {
			 desktopfolder.remove((DesktopElement)elements[i]);
		 }
		 desktoppanel.updateAll();
	}
}