package devopsdistilled.operp.client.commons.panes;

import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;

import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import net.miginfocom.swing.MigLayout;
import devopsdistilled.operp.client.abstracts.SubTaskPane;
import devopsdistilled.operp.client.commons.panes.models.observers.CreateAddressPaneModelObserver;

public class CreateAddressPane extends SubTaskPane implements
		CreateAddressPaneModelObserver {

	private final JPanel pane;
	private final JTextField countryField;
	private final JTextField zoneField;
	private final JTextField districtField;
	private final JTextField cityField;
	private final JTextField streetField;

	public CreateAddressPane() {
		pane = new JPanel();
		pane.setLayout(new MigLayout("", "[][grow]", "[][][][][]"));
		
		JLabel lblCountry = new JLabel("Country");
		pane.add(lblCountry, "cell 0 0,alignx trailing");
		
		countryField = new JTextField();
		countryField.addFocusListener(new FocusAdapter() {
			@Override
			public void focusLost(FocusEvent e) {
				
			}
		});
		pane.add(countryField, "cell 1 0,growx");
		countryField.setColumns(10);
		
		JLabel lblZone = new JLabel("Zone");
		pane.add(lblZone, "cell 0 1,alignx trailing");
		
		zoneField = new JTextField();
		pane.add(zoneField, "cell 1 1,growx");
		zoneField.setColumns(10);
		
		JLabel lblDistrict = new JLabel("District");
		pane.add(lblDistrict, "cell 0 2,alignx trailing");
		
		districtField = new JTextField();
		pane.add(districtField, "cell 1 2,growx");
		districtField.setColumns(10);
		
		JLabel lblCity = new JLabel("City");
		pane.add(lblCity, "cell 0 3,alignx trailing");
		
		cityField = new JTextField();
		pane.add(cityField, "cell 1 3,growx");
		cityField.setColumns(10);
		
		JLabel lblStreet = new JLabel("Street");
		pane.add(lblStreet, "cell 0 4,alignx trailing");
		
		streetField = new JTextField();
		pane.add(streetField, "cell 1 4,growx");
		streetField.setColumns(10);
	}

	@Override
	public JComponent getPane() {
		return pane;
	}

}

@@ -332,16 +332,107 @@
 skPane;%0A
+import devopsdistilled.operp.client.commons.panes.controllers.CreateAddressPaneController;%0A
 import d
@@ -522,16 +522,16 @@
 server;%0A
-
 %0Apublic 
@@ -621,16 +621,66 @@
 rver %7B%0A%0A
+%09private CreateAddressPaneController controller;%0A%0A
 %09private
@@ -1010,19 +1010,17 @@
 %5D%5B%5D%22));%0A
-%09%09
 %0A
+
 %09%09JLabel
@@ -1108,19 +1108,17 @@
 ling%22);%0A
-%09%09
 %0A
+
 %09%09countr
@@ -1255,13 +1255,9 @@
 ) %7B%0A
-%09%09%09%09
 %0A
+
 %09%09%09%7D
@@ -1330,35 +1330,33 @@
 setColumns(10);%0A
-%09%09
 %0A
+
 %09%09JLabel lblZone
@@ -1427,19 +1427,17 @@
 ling%22);%0A
-%09%09
 %0A
+
 %09%09zoneFi
@@ -1521,35 +1521,33 @@
 setColumns(10);%0A
-%09%09
 %0A
+
 %09%09JLabel lblDist
@@ -1630,19 +1630,17 @@
 ling%22);%0A
-%09%09
 %0A
+
 %09%09distri
@@ -1736,35 +1736,33 @@
 setColumns(10);%0A
-%09%09
 %0A
+
 %09%09JLabel lblCity
@@ -1833,19 +1833,17 @@
 ling%22);%0A
-%09%09
 %0A
+
 %09%09cityFi
@@ -1935,19 +1935,17 @@
 ns(10);%0A
-%09%09
 %0A
+
 %09%09JLabel
@@ -2034,11 +2034,9 @@
 %22);%0A
-%09%09
 %0A
+
 %09%09st
@@ -2184,16 +2184,16 @@
 ane() %7B%0A
-
 %09%09return
@@ -2203,10 +2203,194 @@
 ne;%0A%09%7D%0A%0A
+%09public void setController(CreateAddressPaneController controller) %7B%0A%09%09this.controller = controller;%0A%09%7D%0A%0A%09public CreateAddressPaneController getController() %7B%0A%09%09return controller;%0A%09%7D%0A%0A
 %7D%0A

Add controller with getter and setter