Author: tchemit Date: 2008-02-14 15:33:29 +0000 (Thu, 14 Feb 2008) New Revision: 964 Removed: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/LoggableBean.java Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/LoggableElementTreeNode.java Log: au final, on ne partiera pas sur la voie de l'encapsulation des LoggableElements, on ajoute la provenance des LE dans les noeuds d'abres Deleted: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/LoggableBean.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/LoggableBean.java 2008-02-14 15:32:14 UTC (rev 963) +++ trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/LoggableBean.java 2008-02-14 15:33:29 UTC (rev 964) @@ -1,106 +0,0 @@ -/* -* ##% 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 -* 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. -* ##% */ -package fr.cemagref.simexplorer.is.ui.swing.model; - -import fr.cemagref.simexplorer.is.entities.data.LoggableElement; -import fr.cemagref.simexplorer.is.entities.metadata.MetaData; -import fr.cemagref.simexplorer.is.entities.metadata.Version; -import fr.cemagref.simexplorer.is.attachment.Attachment; - -import java.util.Date; -import java.util.Map; -import java.util.List; - -/** - * Un bean pour encapsuler un LoggableElement et sa provenance (local ou remote) - * - * @author chemit - */ -public class LoggableBean { - - protected boolean remote; - - protected LoggableElement element; - - public LoggableBean(LoggableElement element, boolean remote) { - this.element = element; - this.remote = remote; - } - - public LoggableElement getElement() { - return element; - } - - public boolean isRemote() { - return remote; - } - - public MetaData getMetaData() { - return getElement().getMetaData(); - } - - @Override - public String toString() { - return getElement().toString(); - } - - public String getDescription() { - return getMetaData().getDescription(); - } - - public Date getCreationDate() { - return getMetaData().getCreationDate(); - } - - public String getName() { - return getMetaData().getName(); - } - - public String getType() { - return getMetaData().getType(); - } - - public String getUuid() { - return getMetaData().getUuid(); - } - - public Version getVersion() { - return getMetaData().getVersion(); - } - - public boolean isLatest() { - return getMetaData().isLatest(); - } - - public String getHash() { - return getMetaData().getHash(); - } - - public Map<String, String> getDescriptors() { - return getMetaData().getDescriptors(); - } - - public List<Attachment> getAttachments() { - return getMetaData().getAttachments(); - } - - public Attachment getAttachment(Integer attachmentIndex) { - return getMetaData().getAttachment(attachmentIndex); - } -} Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/LoggableElementTreeNode.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/LoggableElementTreeNode.java 2008-02-14 15:32:14 UTC (rev 963) +++ trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/LoggableElementTreeNode.java 2008-02-14 15:33:29 UTC (rev 964) @@ -44,16 +44,19 @@ protected String text; - public LoggableElementTreeNode(LoggableElementTreeNode parent, Object userObject, boolean allowedChildren) { - this(parent, userObject.toString(), userObject, allowedChildren); + protected boolean remote; + + public LoggableElementTreeNode(LoggableElementTreeNode parent, Object userObject,boolean remote, boolean allowedChildren) { + this(parent, userObject.toString(), userObject, remote,allowedChildren); } - public LoggableElementTreeNode(LoggableElementTreeNode parent, String i18n, Object userObject, boolean allowedChildren) { + public LoggableElementTreeNode(LoggableElementTreeNode parent, String i18n, Object userObject,boolean remote, boolean allowedChildren) { super(userObject, allowedChildren); if (parent != null) { parent.add(this); } text = i18n; + this.remote=remote; log.debug("Parent " + parent + ", userObject : " + userObject + ", type : " + userObject.getClass().getSimpleName()); } @@ -62,6 +65,10 @@ return text; } + public boolean isRemote() { + return remote; + } + public void collaspeAll(JTree tree) { if (isLeaf()) { return;
participants (1)
-
tchemit@users.labs.libre-entreprise.org