// Path: src/main/java/de/hartz/vpn/utilities/UiUtilities.java
// public final class UiUtilities {
// 
//     /**
//      * Shows an error window to inform the user.
//      * https://stackoverflow.com/questions/9119481/how-to-present-a-simple-alert-message-in-java
//      * @param text The text that will be displayed in the window.
//      */
//     public static void showAlert(String text) {
//         // TODO: Respect show gui and maybe write it to the console.
//         Toolkit.getDefaultToolkit().beep();
//         JOptionPane optionPane = new JOptionPane(text,JOptionPane.ERROR_MESSAGE);
//         JDialog dialog = optionPane.createDialog("Error");
//         dialog.setAlwaysOnTop(true);
//         dialog.setVisible(true);
//     }
// 
//     /**
//      * Sets the icon and look and feel of a jframe. Because its needed at serveral places.
//      * @param frame the frame to setup.
//      */
//     public static void setLookAndFeelAndIcon(JFrame frame) {
//         try {
//             File file = GeneralUtilities.getResourceAsFile("icon.png");
//             Image image = ImageIO.read( file );
//             frame.setIconImage(image);
//         } catch (IOException | NullPointerException e) {
//             e.printStackTrace();
//         }
//         try {
//             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
//         } catch (ClassNotFoundException | UnsupportedLookAndFeelException | InstantiationException | IllegalAccessException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     /**
//      * Needed for sizing components.
//      * @param component to respect his size.
//      * @returns the wrapper to simply add.
//      */
//     public static JPanel getComponentWrapper(JComponent component) {
//         JPanel wrapper = new JPanel();
//         wrapper.setLayout(new BoxLayout(wrapper, BoxLayout.Y_AXIS));
//         wrapper.add(component);
//         return wrapper;
//     }
// 
// }


import de.hartz.vpn.utilities.UiUtilities;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
package de.hartz.vpn.main.installation;



/**
 * The gui for the {@link InstallationController}.
 */
public class InstallationFrame extends JFrame implements ActionListener {

    private JPanel content;
    private InstallationPanel currentContentPanel;

    private JButton nextButton;
    private JButton previousButton;

    public InstallationFrame(String title) {
        setTitle(title);
        setMinimumSize(new Dimension(500,500));
        setLocationRelativeTo(null);
        setLayout(new BorderLayout());
        setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);

// Path: src/main/java/de/hartz/vpn/utilities/UiUtilities.java
// public final class UiUtilities {
// 
//     /**
//      * Shows an error window to inform the user.
//      * https://stackoverflow.com/questions/9119481/how-to-present-a-simple-alert-message-in-java
//      * @param text The text that will be displayed in the window.
//      */
//     public static void showAlert(String text) {
//         // TODO: Respect show gui and maybe write it to the console.
//         Toolkit.getDefaultToolkit().beep();
//         JOptionPane optionPane = new JOptionPane(text,JOptionPane.ERROR_MESSAGE);
//         JDialog dialog = optionPane.createDialog("Error");
//         dialog.setAlwaysOnTop(true);
//         dialog.setVisible(true);
//     }
// 
//     /**
//      * Sets the icon and look and feel of a jframe. Because its needed at serveral places.
//      * @param frame the frame to setup.
//      */
//     public static void setLookAndFeelAndIcon(JFrame frame) {
//         try {
//             File file = GeneralUtilities.getResourceAsFile("icon.png");
//             Image image = ImageIO.read( file );
//             frame.setIconImage(image);
//         } catch (IOException | NullPointerException e) {
//             e.printStackTrace();
//         }
//         try {
//             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
//         } catch (ClassNotFoundException | UnsupportedLookAndFeelException | InstantiationException | IllegalAccessException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     /**
//      * Needed for sizing components.
//      * @param component to respect his size.
//      * @returns the wrapper to simply add.
//      */
//     public static JPanel getComponentWrapper(JComponent component) {
//         JPanel wrapper = new JPanel();
//         wrapper.setLayout(new BoxLayout(wrapper, BoxLayout.Y_AXIS));
//         wrapper.add(component);
//         return wrapper;
//     }
// 
// }


// Path: src/main/java/de/hartz/vpn/main/installation/InstallationFrame.java
import de.hartz.vpn.utilities.UiUtilities;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

package de.hartz.vpn.main.installation;



/**
 * The gui for the {@link InstallationController}.
 */
public class InstallationFrame extends JFrame implements ActionListener {

    private JPanel content;
    private InstallationPanel currentContentPanel;

    private JButton nextButton;
    private JButton previousButton;

    public InstallationFrame(String title) {
        setTitle(title);
        setMinimumSize(new Dimension(500,500));
        setLocationRelativeTo(null);
        setLayout(new BorderLayout());
        setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);

        UiUtilities.setLookAndFeelAndIcon(this);