/** 
 * This script is being run when a skin is selected
 * The script produces a simple custom user interface.
 * Please look at the "ShowOff" skin for a full blown example
 * Author David Ekholm
 */
 
import se.datadosen.component.*;
import se.datadosen.util.*;
engine.processBeanShellFile(new File(programDirectory, "includes/printing.bsh"));

// Read localized strings to use in user interface
SmartResourceBundle texts = SmartResourceBundle.getBundle(new File(skinDirectory, "texts"), "texts");

// Controls that are to be imported into JAlbum as variables
ControlPanel ui = new ControlPanel() {

	JTextField copyright = new JTextField("");
	JComboBox language = new JComboBox(new Object[]
	 {"ca", "cs", "da", "de", "en", "es", "fi", "fr", "is", "it", "nl", "no", "pl", "pt", "sk", "sv", "zh"}
	);
	JComboBox printing = getPrintingComboBox();
};

// Layout controls easily similar to how text is added in a word processor
ui.add("p", new JLabel(texts.getString("ui.language"))); // Language
ui.add("tab", ui.language);

ControlPanel orderPrints = new ControlPanel(texts.getString("ui.printOrderingFrame")); // On-line print ordering
orderPrints.add(new JLabel(texts.getString("ui.printOrderingText1")));
orderPrints.add(ui.printing);
orderPrints.add(new JLabel(texts.getString("ui.printOrderingText2"))); // printing service
orderPrints.add("p", new JLabel(" " + texts.getString("ui.printOrderingDescription1") + " "));  // Each slide...
orderPrints.add("br", new JLabel(" " + texts.getString("ui.printOrderingDescription2") + " ")); // Shortly after...
orderPrints.add("br", new JLabel(" " +texts.getString("ui.printOrderingDescription3") + " ")); // Shutterfly will...

ui.add("p", orderPrints);

// Allow other languages than specified in list
ui.language.setEditable(true);

// Set default language
ui.language.setSelectedItem(System.getProperty("user.language"));

// Finally install components into JAlbum
window.setSkinUI(ui);
