X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fstructure%2FSimpleSElement.java;h=9faea935fb28ac7af3927e672985e719abaff436;hb=b784cf3cf0a72b72178fb9d69ccfdacaa2f4c5a6;hp=369f951b6052259104a1e337c4f024d7b90d14d1;hpb=8cbe09762042465e11b32101a8043f8138b3ca08;p=gpl%2Fargeo-slc.git
diff --git a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/SimpleSElement.java b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/SimpleSElement.java
index 369f951b6..9faea935f 100644
--- a/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/SimpleSElement.java
+++ b/org.argeo.slc.core/src/main/java/org/argeo/slc/core/structure/SimpleSElement.java
@@ -3,6 +3,8 @@ package org.argeo.slc.core.structure;
import java.util.Map;
import java.util.TreeMap;
+import javax.swing.tree.TreeSelectionModel;
+
/**
* Basic implementation of StructureElement
.
*
@@ -28,6 +30,12 @@ public class SimpleSElement implements StructureElement {
this(label != null ? label : defaultLabel);
}
+ /** Constructor */
+ public SimpleSElement(SimpleSElement sElement) {
+ setLabel(sElement.getLabel());
+ setTags(new TreeMap(sElement.getTags()));
+ }
+
public String getLabel() {
return label;
}
@@ -55,10 +63,7 @@ public class SimpleSElement implements StructureElement {
@Override
public SimpleSElement clone(){
- SimpleSElement clone = new SimpleSElement();
- clone.setLabel(getLabel());
- clone.setTags(getTags());
- return clone;
+ return new SimpleSElement(this);
}
}