package _VisualDVM.Visual.Windows;
import Common.Visual.TextField.StyledTextField;
import Common.Visual.Windows.Dialog.DialogFields;
import Common.Visual.Windows.Dialog.VDirectoryChooser;
import _VisualDVM.Global;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
public class CopyProjectFields implements DialogFields {
    public JTextField tfParent;
    public JTextField tfName;
    public JCheckBox MigrateData;
    VDirectoryChooser directoryChooser = new VDirectoryChooser("Выбор целевой папки для копии проекта");
    private JPanel content;
    private JButton bBrowse;
    public CopyProjectFields() {
        tfName.setText(Global.mainModule.getProject().name + "_copy");
        bBrowse.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                File file = directoryChooser.ShowDialog();
                if (file != null)
                    tfParent.setText(file.getAbsolutePath());
            }
        });
    }
    @Override
    public Component getContent() {
        return content;
    }
    private void createUIComponents() {
        // TODO: place custom component creation code here
        tfParent = new StyledTextField();
        tfName = new StyledTextField();
    }
}
