package devopsdistilled.operp.client.items.panes.models.impl;

import devopsdistilled.operp.client.abstracts.AbstractPaneModel;
import devopsdistilled.operp.client.items.panes.models.EditItemPaneModel;
import devopsdistilled.operp.client.items.panes.models.observers.EditItemPaneModelObserver;
import devopsdistilled.operp.server.data.entity.items.Item;

public class EditItemPaneModelImpl extends
		AbstractPaneModel<EditItemPaneModelObserver> implements
		EditItemPaneModel {

	private Item item;

	public EditItemPaneModelImpl() {
		title = "Edit Item";
	}

	@Override
	public Item getItem() {
		return item;
	}

	@Override
	public String getTitle() {
		return title;
	}

	@Override
	public void setItem(Item item) {
		this.item = item;
		for (EditItemPaneModelObserver observer : observers) {
			observer.updateItem(this.item);
		}
	}

	/*
	 * Configure to "item" to notify observers along with pre-configured
	 * attributes in super.
	 */
	@Override
	public void update() {
		super.update();
		setItem(getItem());
	}
}

@@ -102,32 +102,42 @@
 stracts.Abstract
+EditEntity
 PaneModel;%0Aimpor
@@ -411,16 +411,26 @@
 Abstract
+EditEntity
 PaneMode
@@ -431,16 +431,22 @@
 neModel%3C
+Item, 
 EditItem
@@ -503,548 +503,69 @@
 %7B%0A%0A%09
-private Item item;%0A%0A%09public EditItemPaneModelImpl() %7B%0A%09%09title = %22Edit Item%22;%0A%09%7D%0A%0A%09@Override%0A%09public Item getItem() %7B%0A%09%09return item;%0A%09%7D%0A%0A%09@Override%0A%09public String getTitle() %7B%0A%09%09return title;%0A%09%7D%0A%0A%09@Override%0A%09public void setItem(Item item) %7B%0A%09%09this.item = item;%0A%09%09for (EditItemPaneModelObserver observer : observers) %7B%0A%09%09%09observer.updateItem(this.item)
+@Override%0A%09public String getTitle() %7B%0A%09%09return %22Edit Item%22
 ;%0A
-%09
 %09%7D%0A
-%09%7D%0A%0A%09/*%0A%09 * Configure to %22item%22 to notify observers along with pre-configured%0A%09 * attributes in super.%0A%09 */%0A%09@Override%0A%09public void update() %7B%0A%09%09super.update();%0A%09%09setItem(getItem());%0A%09%7D%0A%7D
 %0A
+%7D

Extend AbstractEditEntityPaneModel