package application.actions;

import application.editor.Editor;

import javax.swing.*;
import java.awt.event.ActionEvent;

public class NewResourceAction extends AbstractEditorAction {

    private static final long serialVersionUID = -4439207504700741286L;

    public NewResourceAction(Editor editor) {
        super("Resource...", editor);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        String resName = JOptionPane.showInputDialog("Resource Name:");
        if (resName == null) {
            return;
        }
        editor.addResourcePath(null, resName);
    }
}
