/*
 * 12/21/2008
 *
 * AutoCompleteDemoApp.java - A demo program for the auto-completion library.
 *
 * This library is distributed under a modified BSD license.  See the included
 * LICENSE.md file for details.
 */
package istlab.TestRSyntaxTA.demo;

import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.WindowConstants;

import org.fife.ui.autocomplete.CompletionProvider;


/**
 * A program that demonstrates use of auto-completion.  It creates a simple
 * C source editor with context sensitive auto-completion.
 *
 * @author Robert Futrell
 * @version 1.0
 */
public class AutoCompleteDemoApp extends JFrame {


	/**
	 * Constructor.
	 */
	public AutoCompleteDemoApp() {
		this(null);
	}


	/**
	 * Constructor.
	 *
	 * @param provider The completion provider for the editor to use.
	 */
	public AutoCompleteDemoApp(CompletionProvider provider) {
		setRootPane(new DemoRootPane(provider));
		setTitle("AutoCompletion Demo");
		setSize(new Dimension(500,600));//pack();
		setLocationRelativeTo(null);
		setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
	}


	/**
	 * Program entry point.
	 *
	 * @param args Command line arguments.
	 */
	public static void main(String[] args) {

		SwingUtilities.invokeLater(() -> {
			String laf = UIManager.getSystemLookAndFeelClassName();
			//laf = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
			try {
				UIManager.setLookAndFeel(laf);
			} catch (Exception e) {
				e.printStackTrace();
			}
			AutoCompleteDemoApp frame = new AutoCompleteDemoApp();
			frame.getToolkit().setDynamicLayout(true);
			frame.setVisible(true);
		});

	}


}
