package com.spiddekauga.android.util;

/**
 * Base class for object events. Used for add, edit, and remove actions.
 */
public abstract class ObjectEvent {
private final Actions mAction;

protected ObjectEvent(Actions action) {
	mAction = action;
}

/**
 * Get the action to take on the object event
 * @return the action to take on the object event
 */
public Actions getAction() {
	return mAction;
}

/**
 * The different actions
 */
public enum Actions {
	ADD,
	EDIT,
	REMOVE,
}
}

@@ -32,16 +32,68 @@
 .util;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 /**%0A * B
@@ -198,16 +198,28 @@
 ectEvent
+%3CObjectType%3E
  %7B%0Apriva
@@ -243,16 +243,77 @@
 mAction;
+%0Aprivate final List%3CObjectType%3E mObjects = new ArrayList%3C%3E();
 %0A%0Aprotec
@@ -328,16 +328,35 @@
 ctEvent(
+ObjectType object, 
 Actions 
@@ -388,239 +388,970 @@
 on;%0A
-%7D%0A%0A/**%0A * Get the action to take on the object event%0A * @return the action to take on the object event%0A */%0Apublic Actions getAction() %7B%0A%09return mAction;%0A%7D%0A%0A/**%0A * The different actions%0A */%0Apublic enum Actions %7B%0A%09ADD,%0A%09EDIT,%0A%09REMOVE
+%09mObjects.add(object);%0A%7D%0A%0Aprotected ObjectEvent(List%3CObjectType%3E objects, Actions action) %7B%0A%09if (objects.isEmpty()) %7B%0A%09%09throw new IllegalArgumentException(%22objects is empty%22);%0A%09%7D%0A%09%0A%09mAction = action;%0A%09mObjects.addAll(objects);%0A%7D%0A%0A/**%0A * @return all objects in this event%0A */%0Apublic List%3CObjectType%3E getObjects() %7B%0A%09return mObjects;%0A%7D%0A%0A/**%0A * @return the first object in this event%0A */%0Apublic ObjectType getFirstObject() %7B%0A%09return mObjects.get(0);%0A%7D%0A%0A/**%0A * Get the action to take on the object event%0A * @return the action to take on the object event%0A */%0Apublic Actions getAction() %7B%0A%09return mAction;%0A%7D%0A%0A/**%0A * The different actions%0A */%0Apublic enum Actions %7B%0A%09ADD,%0A%09EDIT,%0A%09REMOVE,%0A%09/** Called after %7B@link #ADD%7D, i.e., after an object has been added to the DB */%0A%09ADDED,%0A%09/** Called after %7B@link #EDIT%7D, i.e., after an object has been edited in the DB */%0A%09EDITED,%0A%09/** Called after %7B@link #REMOVED%7D, i.e., after an objects has been removed from the DB */%0A%09REMOVED
 ,%0A%7D%0A

Add ability to store items in the Object