package org.adligo.i.util.client;

/**
 * 
 * Note Hash Code and Equals not implemented 
 * on purpose in this class
 * 
 * it is used in the GWT SystemEventController
 * class and the HashMap would fail the I_Invoker
 * lookups if HashCode and Equals were implemened
 * 
 * @author scott
 *
 */
public class Event  {
	/**
	 * this represents the GUI (view) component that
	 * created the event
	 */
	private Object source = null;
	private Throwable exception = null;
	private Object  value = null;
	
	public Event() {}
	public Event(Object p_source) {
		source = p_source;
	}
	
	public Object clone() {
		Event e = new Event();
		e.source = source;
		e.exception = exception;
		e. value = value;
		return e;
	}
	
	public Event copy() {
		return (Event) this.clone();
	}
	
	public Object getValue() {
		return value;
	}
	
	public void setValue(Object value) {
		this.value = value;
	}
	
	public boolean threwException() {
		if (exception == null) {
			return false;
		}
		return true;
	}
	
	public Throwable getException() {
		return exception;
	}
	public void setException(Throwable exception) {
		this.exception = exception;
	}

	public Object getSource() {
		return source;
	}

	public void setSource(Object source) {
		this.source = source;
	}
	
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("Event [source=");
		if (source == null) {
			sb.append("null");
		} else {
			sb.append(ClassUtils.getClassShortName(source.getClass()));
			sb.append("-HASH-");
			sb.append(source.hashCode());
		}
		sb.append(",value=");
		sb.append(value);
		sb.append(",exception=");
		sb.append(exception);
		sb.append("]");
		return sb.toString();
	}
}

@@ -1401,16 +1401,51 @@
  else %7B%0A
+%09%09%09if (source instanceof Class) %7B%0A%09
 %09%09%09sb.ap
@@ -1449,16 +1449,105 @@
 .append(
+ClassUtils.getClassShortName((Class) source));%0A%09%09%09%7D else %7B%0A%09%09%09%09sb.append(%22 instanceof%22 + 
 ClassUti
@@ -1588,16 +1588,21 @@
 ss()));%0A
+%09%09%09%7D%0A
 %09%09%09sb.ap

class should say which one