<commit_before>package org.niklas.vaadininvoice.gui;

import com.vaadin.shared.ui.datefield.Resolution;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.DateField;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;


public class InfoPanel extends Panel {
	private TextField companyNameTextField;
	private TextField companyStreetTextField;
	private TextField companyCityTextField;
	private TextField companyPostcodeTextField;
	private TextField customerNameTextField;
	private TextField customerStreetTextField;
	private TextField customerCityTextField;
	private TextField customerPostcodeTextField;
	private DateField dueDateField;
	private TextField referenceNumberField;
	private TextField invoiceNumberField;
	private Label companyLabel;
	private Label customerLabel;
	private Label dueDateLabel;
	
	public InfoPanel() {
		companyNameTextField = new TextField("Name", "Acme Inc.");
		companyStreetTextField = new TextField("Street", "Main Street");
		companyCityTextField = new TextField("City", "El Dorado");
		companyPostcodeTextField = new TextField("Postcode", "31415");
		customerNameTextField = new TextField("Name", "<NAME>");
		customerStreetTextField = new TextField("Street", "Elkroad 52");
		customerCityTextField = new TextField("City", "Atlantis");
		customerPostcodeTextField = new TextField("Postcode", "235711");
		dueDateField = new DateField(" ");
		companyLabel = new Label("<b>Company</b>", ContentMode.HTML);
		customerLabel = new Label("<b>Customer</b>", ContentMode.HTML);
		dueDateLabel = new Label("<b>Due Date</b>", ContentMode.HTML);
		referenceNumberField = new TextField("Reference Number", "000000");
		invoiceNumberField = new TextField("Invoice Number", "00000");
		setLayout();
	}
	
	private void setLayout() {
		VerticalLayout companyLayout = new VerticalLayout();
		companyLayout.addComponent(companyLabel);
		companyLayout.addComponent(companyNameTextField);
		companyLayout.addComponent(companyStreetTextField);
		companyLayout.addComponent(companyCityTextField);
		companyLayout.addComponent(companyPostcodeTextField);
		companyLayout.setSpacing(true);
		companyLayout.setSizeFull();
		
		VerticalLayout customerLayout = new VerticalLayout();
		customerLayout.addComponent(customerLabel);
		customerLayout.addComponent(customerNameTextField);
		customerLayout.addComponent(customerStreetTextField);
		customerLayout.addComponent(customerCityTextField);
		customerLayout.addComponent(customerPostcodeTextField);
		customerLayout.setSpacing(true);
		customerLayout.setSizeFull();
		
		VerticalLayout invoiceInfoLayout = new VerticalLayout();
		dueDateField.setResolution(Resolution.DAY);
		dueDateField.setDateFormat("dd-MM-yyy");
		dueDateField.setValue(new java.util.Date());
		invoiceInfoLayout.addComponent(dueDateLabel);
		invoiceInfoLayout.addComponent(dueDateField);
		invoiceInfoLayout.addComponent(invoiceNumberField);
		invoiceInfoLayout.addComponent(referenceNumberField);
		invoiceInfoLayout.setSizeFull();
		
		
		HorizontalLayout horizontalLayout = new HorizontalLayout();
		horizontalLayout.addComponent(companyLayout);
		horizontalLayout.addComponent(customerLayout);
		horizontalLayout.addComponent(invoiceInfoLayout);
		horizontalLayout.setSizeFull();
		horizontalLayout.setSpacing(true);<commit_msg>Added invoice date to info panel.<commit_after>package org.niklas.vaadininvoice.gui;

import java.util.Calendar;
import java.util.Date;

import com.vaadin.shared.ui.datefield.Resolution;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.DateField;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;


public class InfoPanel extends Panel {
	private TextField companyNameTextField;
	private TextField companyStreetTextField;
	private TextField companyCityTextField;
	private TextField companyPostcodeTextField;
	private TextField customerNameTextField;
	private TextField customerStreetTextField;
	private TextField customerCityTextField;
	private TextField customerPostcodeTextField;
	private DateField invoiceDateField;
	private DateField dueDateField;
	private TextField referenceNumberField;
	private TextField invoiceNumberField;
	private Label companyLabel;
	private Label customerLabel;
	private Label invoiceInfoLabel;
	
	public InfoPanel() {
		companyNameTextField = new TextField("Name", "Acme Inc.");
		companyStreetTextField = new TextField("Street", "Main Street");
		companyCityTextField = new TextField("City", "El Dorado");
		companyPostcodeTextField = new TextField("Postcode", "31415");
		customerNameTextField = new TextField("Name", "<NAME>");
		customerStreetTextField = new TextField("Street", "Elkroad 52");
		customerCityTextField = new TextField("City", "Atlantis");
		customerPostcodeTextField = new TextField("Postcode", "235711");
		invoiceDateField = new DateField("Invoice Date");
		dueDateField = new DateField("Due Date");
		companyLabel = new Label("<b>Company</b>", ContentMode.HTML);
		customerLabel = new Label("<b>Customer</b>", ContentMode.HTML);
		invoiceInfoLabel = new Label("<b>Invoice Information</b>", ContentMode.HTML);
		referenceNumberField = new TextField("Reference Number", "000000");
		invoiceNumberField = new TextField("Invoice Number", "00000");
		setLayout();
	}
	
	private void setLayout() {
		VerticalLayout companyLayout = new VerticalLayout();
		companyLayout.addComponent(companyLabel);
		companyLayout.addComponent(companyNameTextField);
		companyLayout.addComponent(companyStreetTextField);
		companyLayout.addComponent(companyCityTextField);
		companyLayout.addComponent(companyPostcodeTextField);
		companyLayout.setSpacing(true);
		companyLayout.setSizeFull();
		
		VerticalLayout customerLayout = new VerticalLayout();
		customerLayout.addComponent(customerLabel);
		customerLayout.addComponent(customerNameTextField);
		customerLayout.addComponent(customerStreetTextField);
		customerLayout.addComponent(customerCityTextField);
		customerLayout.addComponent(customerPostcodeTextField);
		customerLayout.setSpacing(true);
		customerLayout.setSizeFull();
		
		VerticalLayout invoiceInfoLayout = new VerticalLayout();
		Calendar c = Calendar.getInstance();    
		c.setTime(new Date());
		invoiceDateField.setResolution(Resolution.DAY);
		invoiceDateField.setDateFormat("dd-MM-yyyy");
		invoiceDateField.setValue(c.getTime());
		c.add(Calendar.DATE, 14);
		dueDateField.setResolution(Resolution.DAY);
		dueDateField.setDateFormat("dd-MM-yyyy");
		dueDateField.setValue(c.getTime());
		invoiceInfoLayout.addComponent(invoiceInfoLabel);
		invoiceInfoLayout.addComponent(invoiceDateField);
		invoiceInfoLayout.addComponent(dueDateField);
		invoiceInfoLayout.addComponent(invoiceNumberField);
		invoiceInfoLayout.addComponent(referenceNumberField);
		invoiceInfoLayout.setSpacing(true);
		invoiceInfoLayout.setSizeFull();
		
		
		HorizontalLayout horizontalLayout = new HorizontalLayout();
		horizontalLayout.addComponent(companyLayout);
		horizontalLayout.addComponent(customerLayout);
		horizontalLayout.addComponent(invoiceInfoLayout);
		horizontalLayout.setSizeFull();
		horizontalLayout.setSpacing(true);
{'fraction_non_alphanumeric': 0.10098792535675083, 'fraction_numerical': 0.006860592755214051, 'mean_word_length': 7.426589595375723, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '682590', 'n_tokens_mistral': 2191, 'n_tokens_neox': 1950, 'n_words': 381}