package com.commander4j.launchpad;

/*******************************************************************************
 * Title:        Commander4j
 * Description:  LaunchPad Application for macOS App Bundles
 * Author:       Dave (with ChatGPT assistance)
 * Copyright:    Copyright (C) 2025
 * License:      GNU General Public License
 * 
 * This program is free software: you can redistribute it and/or modify it 
 * under the terms of the GNU General Public License as published by the 
 * Free Software Foundation, either version 3 of the License, or (at your 
 * option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
 * for more details.
 * 
 * You should have received a copy of the GNU General Public License along 
 * with this program. If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
import javax.swing.JToolBar;
import javax.swing.TransferHandler;

import com.commander4j.sys.Common;

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

public class demo extends JFrame
{
	private static final long serialVersionUID = 1L;

	private final JTabbedPane tabs;

	public demo()
	{
		super("Commander4j LaunchPad");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setPreferredSize(new Dimension(1100, 950));
		getContentPane().setLayout(new BorderLayout());

		tabs = new JTabbedPane();
		getContentPane().add(tabs, BorderLayout.CENTER);

		JButton addTabButton = new JButton("Add Tab");
		addTabButton.addActionListener(e -> {
			String name = JOptionPane.showInputDialog(this, "Enter tab name:");
			if (name != null && !name.isBlank())
			{
				LaunchTabPanel panel = new LaunchTabPanel();
				tabs.addTab(name, panel);
				tabs.setSelectedComponent(panel);
			}
		});
		add(addTabButton, BorderLayout.SOUTH);


		pack();
		setLocationRelativeTo(null);
	}

	public static void main(String[] args)
	{
		
		demo lp = new demo();
		lp.setVisible(true);
		
	}
}
