Index: topia2/src/java/org/codelutin/topia/event/TopiaEntityListener.java diff -u topia2/src/java/org/codelutin/topia/event/TopiaEntityListener.java:1.2 topia2/src/java/org/codelutin/topia/event/TopiaEntityListener.java:1.3 --- topia2/src/java/org/codelutin/topia/event/TopiaEntityListener.java:1.2 Thu Jan 5 04:50:47 2006 +++ topia2/src/java/org/codelutin/topia/event/TopiaEntityListener.java Mon Jan 30 14:38:53 2006 @@ -23,10 +23,10 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ * - * Mise a jour: $Date: 2006/01/05 04:50:47 $ - * par : $Author: bpoussin $ + * Mise a jour: $Date: 2006/01/30 14:38:53 $ + * par : $Author: thimel $ */ package org.codelutin.topia.event; @@ -36,11 +36,6 @@ public interface TopiaEntityListener extends EventListener { /** - * Appelé lorsqu'une ou plusieurs entités ont été chargées - */ - public void entityLoaded(TopiaEntityEvent event); - - /** * Appelé lorsqu'une ou plusieurs entités ont été créées */ public void entityCreated(TopiaEntityEvent event); Index: topia2/src/java/org/codelutin/topia/event/TopiaVetoableEntityListener.java diff -u topia2/src/java/org/codelutin/topia/event/TopiaVetoableEntityListener.java:1.1 topia2/src/java/org/codelutin/topia/event/TopiaVetoableEntityListener.java:1.2 --- topia2/src/java/org/codelutin/topia/event/TopiaVetoableEntityListener.java:1.1 Thu Jan 5 04:51:23 2006 +++ topia2/src/java/org/codelutin/topia/event/TopiaVetoableEntityListener.java Mon Jan 30 14:38:53 2006 @@ -23,10 +23,10 @@ * * @author Benjamin Poussin * Copyright Code Lutin - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ * - * Mise a jour: $Date: 2006/01/05 04:51:23 $ - * par : $Author: bpoussin $ + * Mise a jour: $Date: 2006/01/30 14:38:53 $ + * par : $Author: thimel $ */ package org.codelutin.topia.event; @@ -36,11 +36,6 @@ public interface TopiaVetoableEntityListener extends EventListener { /** - * Appelé lorsqu'une ou plusieurs entités ont été chargées - */ - public void loadEntity(TopiaVetoableEntityEvent event); - - /** * Appelé lorsqu'une ou plusieurs entités ont été créées */ public void createEntity(TopiaVetoableEntityEvent event); Index: topia2/src/java/org/codelutin/topia/event/TopiaVetoableEntityLoadListener.java diff -u /dev/null topia2/src/java/org/codelutin/topia/event/TopiaVetoableEntityLoadListener.java:1.1 --- /dev/null Mon Jan 30 14:38:58 2006 +++ topia2/src/java/org/codelutin/topia/event/TopiaVetoableEntityLoadListener.java Mon Jan 30 14:38:53 2006 @@ -0,0 +1,45 @@ +/* *##% +* Copyright (C) 2002, 2003, 2004, 2005 Code Lutin, +* Cédric Pineau, Benjamin Poussin, +* +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* TopiaVetoableEntityLoadListener.java +* +* Created: 30 janv. 2006 +* +* @author Arnaud Thimel +* @version $Revision$ +* +* Mise a jour: $Date$ +* par : $Author$ +*/ + + +package org.codelutin.topia.event; + +import java.util.EventListener; + +public interface TopiaVetoableEntityLoadListener extends EventListener { + + /** + * Appelé lorsqu'une ou plusieurs entités ont été chargées + */ + public void loadEntity(TopiaVetoableEntityLoadEvent event); + +} //TopiaVetoableEntityLoadListener Index: topia2/src/java/org/codelutin/topia/event/TopiaEntityLoadEvent.java diff -u /dev/null topia2/src/java/org/codelutin/topia/event/TopiaEntityLoadEvent.java:1.1 --- /dev/null Mon Jan 30 14:38:58 2006 +++ topia2/src/java/org/codelutin/topia/event/TopiaEntityLoadEvent.java Mon Jan 30 14:38:53 2006 @@ -0,0 +1,90 @@ +/* *##% +* Copyright (C) 2002, 2003, 2004, 2005 Code Lutin, +* Cédric Pineau, Benjamin Poussin, +* +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* TopiaEntityLoadEvent.java +* +* Created: 30 janv. 2006 +* +* @author Arnaud Thimel +* @version $Revision$ +* +* Mise a jour: $Date$ +* par : $Author$ +*/ + +package org.codelutin.topia.event; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.EventObject; + +public class TopiaEntityLoadEvent extends EventObject { + + /** */ + private static final long serialVersionUID = 1L; + + protected long date = 0; + protected Collection entities = null; + + /** + * @param source l'objet d'ou provient l'event + * @param entity l'entity sur lequel porte l'event + */ + public TopiaEntityLoadEvent(Object source, Object entity){ + super(source); + date = System.currentTimeMillis(); + ArrayList tmp = new ArrayList(); + tmp.add(entity); + this.entities = Collections.unmodifiableList(tmp); + } + + /** + * @param source l'objet d'ou provient l'event + * @param entities la liste des entitées sur lequel porte l'event + */ + public TopiaEntityLoadEvent(Object source, Collection entities){ + super(source); + date = System.currentTimeMillis(); + // on fait une copie pour que l'on ne soit pas affecté par des + // changement fait sur la collection passé en parametre + ArrayList tmp = new ArrayList(); + tmp.addAll(entities); + this.entities = Collections.unmodifiableCollection(tmp); + } + + /** + * Retourne la liste des entitées sur lequel porte l'event + * @return une liste non modifiable d'entité + */ + public Collection getTopiaEntities(){ + return entities; + } + + /** + * Le moment ou l'event a ete créé. + */ + public Date getCreationDate(){ + return new Date(date); + } + +} //TopiaEntityLoadEvent Index: topia2/src/java/org/codelutin/topia/event/TopiaVetoableEntityLoadEvent.java diff -u /dev/null topia2/src/java/org/codelutin/topia/event/TopiaVetoableEntityLoadEvent.java:1.1 --- /dev/null Mon Jan 30 14:38:58 2006 +++ topia2/src/java/org/codelutin/topia/event/TopiaVetoableEntityLoadEvent.java Mon Jan 30 14:38:53 2006 @@ -0,0 +1,83 @@ +/* *##% +* Copyright (C) 2002, 2003, 2004, 2005 Code Lutin, +* Cédric Pineau, Benjamin Poussin, +* +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* TopiaVetoableEntityLoadEvent.java +* +* Created: 30 janv. 2006 +* +* @author Arnaud Thimel +* @version $Revision$ +* +* Mise a jour: $Date$ +* par : $Author$ +*/ + + +package org.codelutin.topia.event; + +import java.util.Date; +import java.util.EventObject; + +public class TopiaVetoableEntityLoadEvent extends EventObject { + + /** */ + private static final long serialVersionUID = 1L; + + protected long date = 0; + protected Class entityClass; + protected Object id = null; + + /** + * @param source l'objet d'ou provient l'event + * @param entity l'entity sur lequel porte l'event + */ + public TopiaVetoableEntityLoadEvent(Object source, Class entityClass, Object id){ + super(source); + this.entityClass = entityClass; + this.id = id; + date = System.currentTimeMillis(); + } + + + /** + * @return Returns the entityClass. + */ + public Class getEntityClass() { + return this.entityClass; + } + + /** + * L'identifiant ou null si on a pas pu avoir d'identifiant, cela arrive + * par exemple pour un create ou l'objet peu ne pas encore avoir d'idenfiant + * @return l'idenfiant s'il y en a un + */ + public Object getId(){ + return id; + } + + /** + * Le moment ou l'event a ete créé. + */ + public Date getCreationDate(){ + return new Date(date); + } + +} //TopiaVetoableEntityLoadEvent Index: topia2/src/java/org/codelutin/topia/event/TopiaEntityLoadListener.java diff -u /dev/null topia2/src/java/org/codelutin/topia/event/TopiaEntityLoadListener.java:1.1 --- /dev/null Mon Jan 30 14:38:58 2006 +++ topia2/src/java/org/codelutin/topia/event/TopiaEntityLoadListener.java Mon Jan 30 14:38:53 2006 @@ -0,0 +1,45 @@ +/* *##% +* Copyright (C) 2002, 2003, 2004, 2005 Code Lutin, +* Cédric Pineau, Benjamin Poussin, +* +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*##%*/ + +/* * +* TopiaEntityLoadEvent.java +* +* Created: 30 janv. 2006 +* +* @author Arnaud Thimel +* @version $Revision$ +* +* Mise a jour: $Date$ +* par : $Author$ +*/ + + +package org.codelutin.topia.event; + +import java.util.EventListener; + +public interface TopiaEntityLoadListener extends EventListener { + + /** + * Appelé lorsqu'une ou plusieurs entités ont été chargées + */ + public void entityLoaded(TopiaEntityLoadEvent event); + +} //TopiaEntityLoadEvent