Author: tchemit Date: 2008-02-11 20:33:28 +0000 (Mon, 11 Feb 2008) New Revision: 823 Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/SynchronizeTabModel.java Log: le model de l'onglet synchronize Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/SynchronizeTabModel.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/SynchronizeTabModel.java 2008-02-11 20:33:00 UTC (rev 822) +++ trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/SynchronizeTabModel.java 2008-02-11 20:33:28 UTC (rev 823) @@ -1,5 +1,5 @@ /* -* \#\#% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, +* ##% Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Code Lutin, * Tony Chemit, Gabriel Landais * * This program is free software; you can redistribute it and/or @@ -15,13 +15,14 @@ * 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. -* \#\#% */ +* ##% */ package fr.cemagref.simexplorer.is.ui.swing.model; -import fr.cemagref.simexplorer.is.entities.metadata.MetaData; import fr.cemagref.simexplorer.is.ui.swing.SimExplorerTab; import jaxx.runtime.builder.TabModel; +import java.beans.PropertyChangeListener; + /** * Le model pour un Tab contenant 2 listes d'applications * @@ -34,44 +35,55 @@ /** flag pour savoir si la source est remote ou non */ protected boolean remote; - protected MetaData[] listLocal; - protected MetaData[] listRemote; + /** le model de l'arbre local */ + protected DetailTabModel localModel; + /** le model de l'arbre distant */ + protected DetailTabModel remoteModel; + private static final long serialVersionUID = -3623331875470531459L; public String getName() { return tab.name(); } - public SimExplorerTab getTab() { - return tab; - } - public boolean isRemote() { return remote; } - public MetaData[] getListLocal() { - return listLocal; + public DetailTabModel getLocalModel() { + return localModel; } - public MetaData[] getListRemote() { - return listRemote; + public DetailTabModel getRemoteModel() { + return remoteModel; } public void setName(String name) { this.tab = SimExplorerTab.valueOf(name); } - public void setListLocal(MetaData[] listLocal) { - this.listLocal = listLocal; + public void setRemote(boolean remote) { + this.remote = remote; } - public void setListRemote(MetaData[] listRemote) { - this.listRemote = listRemote; + public synchronized void removePropertyChangeListeners() { + if (localModel!=null) { + localModel.removePropertyChangeListeners(); + } + if (remoteModel!=null) { + remoteModel.removePropertyChangeListeners(); + } } - - public void setRemote(boolean remote) { - this.remote = remote; + public synchronized void addPropertyChangeListener(DetailTabModel.Properties propertyName, PropertyChangeListener listener) { + if (listener == null) { + return; + } + if (localModel!=null) { + localModel.addPropertyChangeListener(propertyName,listener); + } + if (remoteModel!=null) { + remoteModel.addPropertyChangeListener(propertyName,listener); + } } } \ No newline at end of file