package editor.menubar.actionlisteners;

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

import javax.swing.JFileChooser;
import javax.swing.JFrame;

import xml.Element;
import xml.ElementEvent;
import xml.ElementJSONDeserializer;
import editor.ElementTreeData;

public class OpenActionListener implements ActionListener {
    private ElementTreeData data;
    
    public OpenActionListener(ElementTreeData data) {
        this.data = data;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        Element root = null;
        String fileName = null;
        
        JFrame openFrame = new JFrame();
        JFileChooser fc = new JFileChooser();
        fc.showOpenDialog(openFrame);
        fileName = fc.getSelectedFile().getAbsolutePath();
        
        ElementJSONDeserializer deserializer;
        deserializer = new ElementJSONDeserializer();
        root = deserializer.deserializeFromFile(fileName);
        
        data.setRoot(root);
    }

}

@@ -193,33 +193,8 @@
 nt;%0A
-import xml.ElementEvent;%0A
 impo

Remove unnecessary import