package edu.drexel.tm.cs338.textacular;

import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.text.JTextComponent;

import net.miginfocom.swing.MigLayout;

public class LetterPanel extends TemplatePanel {
	private JLabel lblSignature;
	private JLabel lblAddress;
	private JLabel lblTo;
	private JLabel lblOpening;
	private JLabel lblContent;
	private JLabel lblClosing;
	
	private JTextComponent[] textComponents;
	
	private JTextField txtSignature;
	private JTextField txtOpening;
	private JTextField txtClosing;
	
	private JTextArea txtAddress;
	private JTextArea txtTo;
	private JTextArea txtContent;
	
	public LetterPanel() {
		super(new MigLayout("wrap 4"));
		
		lblSignature = new JLabel("Signature");
		lblAddress = new JLabel("Address");
		lblTo = new JLabel("To");
		lblOpening = new JLabel("Opening");
		lblContent = new JLabel("Content");
		lblClosing = new JLabel("Closing");
		
		textComponents = new JTextComponent[] {
				txtSignature = new JTextField(20),
				txtOpening = new JTextField(20),
				txtClosing = new JTextField(20),
				txtAddress = new JTextArea(5, 20),
				txtTo = new JTextArea(5, 20),
				txtContent = new JTextArea(10, 40)
		};
		
		add(lblAddress);
		add(new JScrollPane(txtAddress));
		add(lblTo);
		add(new JScrollPane(txtTo), "wrap");
		add(lblOpening);
		add(txtOpening, "wrap");
		add(lblContent);
		add(new JScrollPane(txtContent), "span");
		add(lblClosing);
		add(txtClosing, "wrap");
		add(lblSignature);
		add(txtSignature, "wrap");
	}

	@Override
	public boolean checkInputs() {
		for (JTextComponent textComponent : textComponents) {
			if (textComponent.getText().length() <= 0) {
				return false;
			}
		}
		
		return true;
	}
}

@@ -239,457 +239,1132 @@
 t;%0A%0A
-public class LetterPanel extends TemplatePanel %7B%0A%09private JLabel lblSignature;%0A%09private JLabel lblAddress;%0A%09private JLabel lblTo;%0A%09private JLabel lblOpening;%0A%09private JLabel lblContent;%0A%09private JLabel lblClosing;%0A%09%0A%09private JTextComponent%5B%5D textComponents;%0A%09%0A%09private JTextField txtSignature;%0A%09private JTextField txtOpening;%0A%09private JTextField txtClosing;%0A%09%0A%09private JTextArea txtAddress;%0A%09private JTextArea txtTo;%0A%09private JTextArea txtContent;%0A%09
+/**%0A * The class LetterPanel.%0A * %0A * Displays inputs pertaining to letter creation%0A * %0A * @author Trevor Maglione %3Ctm@cs.drexel.edu%3E%0A */%0Apublic class LetterPanel extends TemplatePanel %7B%0A%09%0A%09/**%0A%09 * The signature label.%0A%09 */%0A%09private JLabel lblSignature;%0A%09%0A%09/**%0A%09 * The address label.%0A%09 */%0A%09private JLabel lblAddress;%0A%09%0A%09/**%0A%09 * The addressee label.%0A%09 */%0A%09private JLabel lblTo;%0A%09%0A%09/**%0A%09 * The opening label.%0A%09 */%0A%09private JLabel lblOpening;%0A%09%0A%09/**%0A%09 * The content label.%0A%09 */%0A%09private JLabel lblContent;%0A%09%0A%09/**%0A%09 * The closing label.%0A%09 */%0A%09private JLabel lblClosing;%0A%09%0A%09/**%0A%09 * The text components.%0A%09 */%0A%09private JTextComponent%5B%5D textComponents;%0A%09%0A%09/**%0A%09 * The signature text field.%0A%09 */%0A%09private JTextField txtSignature;%0A%09%0A%09/**%0A%09 * The opening text field.%0A%09 */%0A%09private JTextField txtOpening;%0A%09%0A%09/**%0A%09 * The closing text field.%0A%09 */%0A%09private JTextField txtClosing;%0A%09%0A%09/**%0A%09 * The writer address text area.%0A%09 */%0A%09private JTextArea txtAddress;%0A%09%0A%09/**%0A%09 * The addressee text area.%0A%09 */%0A%09private JTextArea txtTo;%0A%09%0A%09/**%0A%09 * The content text area.%0A%09 */%0A%09private JTextArea txtContent;%0A%09%0A%09/**%0A%09 * Instantiate a new LetterPanel.%0A%09 */
 %0A%09pu

Add JavaDoc comments to LetterPanel