Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2005-08-24 18:44:10 +0000
committerMichael Valenta2005-08-24 18:44:10 +0000
commit86d793de3cd4132321dbce5b6e08fa6b5037ff98 (patch)
treebd02cc1664b3d36d91373145f3f2efaa7eb5e7ac
parent9417e06b1b3c7864d0c9f0f1977f631611b497fa (diff)
downloadeclipse.platform.team-86d793de3cd4132321dbce5b6e08fa6b5037ff98.tar.gz
eclipse.platform.team-86d793de3cd4132321dbce5b6e08fa6b5037ff98.tar.xz
eclipse.platform.team-86d793de3cd4132321dbce5b6e08fa6b5037ff98.zip
Decorators working with GMF example
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberLocalChangeDeterminationContext.java16
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java6
2 files changed, 15 insertions, 7 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberLocalChangeDeterminationContext.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberLocalChangeDeterminationContext.java
index b90a666ab..5dea01a1c 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberLocalChangeDeterminationContext.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/subscribers/SubscriberLocalChangeDeterminationContext.java
@@ -10,10 +10,16 @@
*******************************************************************************/
package org.eclipse.team.internal.core.subscribers;
-import org.eclipse.core.internal.resources.mapping.ChangeDeterminationResourceMappingContext;
+import org.eclipse.core.internal.resources.mapping.RemoteResourceMappingContext;
import org.eclipse.core.internal.resources.mapping.ResourceTraversal;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.Subscriber;
@@ -27,7 +33,7 @@ import org.eclipse.team.internal.core.TeamPlugin;
/**
* A change determination context for comparing the local resource state against the base state.
*/
-public class SubscriberLocalChangeDeterminationContext extends ChangeDeterminationResourceMappingContext {
+public class SubscriberLocalChangeDeterminationContext extends RemoteResourceMappingContext {
private final SyncInfoFilter contentDiffFilter = new SyncInfoFilter() {
public boolean select(SyncInfo info, IProgressMonitor monitor) {
@@ -84,7 +90,7 @@ public class SubscriberLocalChangeDeterminationContext extends ChangeDeterminati
return base.getStorage(monitor);
return null;
}
- throw new CoreException(new Status(IStatus.ERROR, TeamPlugin.ID, CONTENTS_NOT_CACHED, NLS.bind("The contents for file {0} are not available.", new String[] { file.getFullPath().toString() }), null));
+ throw new CoreException(new Status(IStatus.ERROR, TeamPlugin.ID, SERVER_CONTACT_PROHIBITED, NLS.bind("The contents for file {0} are not available.", new String[] { file.getFullPath().toString() }), null));
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
index 3a7a2a8fe..7215d42bb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java
@@ -93,7 +93,7 @@ public class CVSLightweightDecorator extends LabelProvider implements ILightweig
protected void processEvent(Event event, IProgressMonitor monitor) throws CoreException {
if (event instanceof ResourceMappingEvent) {
ResourceMappingEvent rme = (ResourceMappingEvent)event;
- rme.setChangeState(rme.getMapping().calculateChangeState(getLocalChangeDeterminationContext(true /* can contect server */) , true, monitor));
+ rme.setChangeState(rme.getMapping().calculateChangeState(getLocalChangeDeterminationContext(true /* can contect server */) , monitor));
result.add(rme);
}
}
@@ -219,6 +219,8 @@ public class CVSLightweightDecorator extends LabelProvider implements ILightweig
* will be ignored by the decorator.
*/
private CVSTeamProvider getCVSProviderFor(IResource resource) {
+ if (resource == null)
+ return null;
RepositoryProvider p =
RepositoryProvider.getProvider(
resource.getProject(),
@@ -345,7 +347,7 @@ public class CVSLightweightDecorator extends LabelProvider implements ILightweig
if (event != null) {
return event.getChangeState();
}
- return mapping.calculateChangeState(getLocalChangeDeterminationContext(false), false, new NullProgressMonitor());
+ return mapping.calculateChangeState(getLocalChangeDeterminationContext(false), new NullProgressMonitor());
}
private SubscriberLocalChangeDeterminationContext getLocalChangeDeterminationContext(boolean canContectServer) {

Back to the top