Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-09-29 10:07:26 +0000
committerEike Stepper2012-09-29 10:07:26 +0000
commit3f779874bb5ecddc7318ec5111e1ad6f53e810e8 (patch)
tree02d035a806deb888ac9b02b05dca429820796a57 /plugins/org.eclipse.emf.cdo.transfer/src
parente3fb3d351c6c8a8368bf812604d0251e8958adb9 (diff)
downloadcdo-3f779874bb5ecddc7318ec5111e1ad6f53e810e8.tar.gz
cdo-3f779874bb5ecddc7318ec5111e1ad6f53e810e8.tar.xz
cdo-3f779874bb5ecddc7318ec5111e1ad6f53e810e8.zip
[388928] Develop a resource transfer framework
https://bugs.eclipse.org/bugs/show_bug.cgi?id=388928
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.transfer/src')
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java
index c04a480f0b..f45607830d 100644
--- a/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java
+++ b/plugins/org.eclipse.emf.cdo.transfer/src/org/eclipse/emf/cdo/transfer/CDOTransferMappingImpl.java
@@ -39,6 +39,8 @@ class CDOTransferMappingImpl implements CDOTransferMapping
private IPath relativePath;
+ private Status status;
+
public CDOTransferMappingImpl(CDOTransfer transfer, CDOTransferElement source, CDOTransferMapping parent,
IProgressMonitor monitor)
{
@@ -142,6 +144,7 @@ class CDOTransferMappingImpl implements CDOTransferMapping
{
IPath oldPath = relativePath;
relativePath = path;
+ unsetStatusRecursively();
transfer.relativePathChanged(this, oldPath, path);
}
}
@@ -262,6 +265,25 @@ class CDOTransferMappingImpl implements CDOTransferMapping
public Status getStatus()
{
+ if (status == null)
+ {
+ status = calculateStatus();
+ }
+
+ return status;
+ }
+
+ private Status calculateStatus()
+ {
+ if (parent != null)
+ {
+ Status status = parent.getStatus();
+ if (status != Status.MERGE)
+ {
+ return status;
+ }
+ }
+
CDOTransferSystem targetSystem = transfer.getTargetSystem();
IPath fullPath = getFullPath();
@@ -286,6 +308,21 @@ class CDOTransferMappingImpl implements CDOTransferMapping
return Status.MERGE;
}
+ private void unsetStatusRecursively()
+ {
+ if (status != null)
+ {
+ status = null;
+ if (children != null && !children.isEmpty())
+ {
+ for (CDOTransferMapping child : children)
+ {
+ ((CDOTransferMappingImpl)child).unsetStatusRecursively();
+ }
+ }
+ }
+ }
+
public CDOTransferElement getTarget()
{
CDOTransferSystem targetSystem = transfer.getTargetSystem();

Back to the top