We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic event class are not well generated with GenEvent tag.
Example :
import com.gwtplatform.dispatch.annotation.GenEvent; @GenEvent public class Save<T> { private T savedObject; }
Generate not compilable class SaveEvent (because Class and static methods are not generic) :
import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.GwtEvent; import com.google.web.bindery.event.shared.HandlerRegistration; import com.google.gwt.event.shared.HasHandlers; public class SaveEvent extends GwtEvent<SaveEvent.SaveHandler> { private T savedObject; protected SaveEvent() { // Possibly for serialization. } public SaveEvent(T savedObject) { this.savedObject = savedObject; } public static void fire(HasHandlers source, T savedObject) { SaveEvent eventInstance = new SaveEvent(savedObject); source.fireEvent(eventInstance); } public static void fire(HasHandlers source, SaveEvent eventInstance) { source.fireEvent(eventInstance); } public interface HasSaveHandlers extends HasHandlers { HandlerRegistration addSaveHandler(SaveHandler handler); } public interface SaveHandler extends EventHandler { public void onSave(SaveEvent event); } private static final Type<SaveHandler> TYPE = new Type<SaveHandler>(); public static Type<SaveHandler> getType() { return TYPE; } @Override public Type<SaveHandler> getAssociatedType() { return TYPE; } @Override protected void dispatch(SaveHandler handler) { handler.onSave(this); } public T getSavedObject(){ return savedObject; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SaveEvent other = (SaveEvent) obj; if (savedObject == null) { if (other.savedObject != null) return false; } else if (!savedObject.equals(other.savedObject)) return false; return true; } @Override public int hashCode() { int hashCode = 23; hashCode = (hashCode * 37) + (savedObject == null ? 1 : savedObject.hashCode()); return hashCode; } @Override public String toString() { return "SaveEvent[" + savedObject + "]"; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Generic event class are not well generated with GenEvent tag.
Example :
Generate not compilable class SaveEvent (because Class and static methods are not generic) :
The text was updated successfully, but these errors were encountered: