Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.team.cvs.ui/icons/full/ovr16/merged_ov.gifbin0 -> 114 bytes
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java33
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java1
4 files changed, 29 insertions, 6 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/icons/full/ovr16/merged_ov.gif b/bundles/org.eclipse.team.cvs.ui/icons/full/ovr16/merged_ov.gif
new file mode 100644
index 000000000..25765a163
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/icons/full/ovr16/merged_ov.gif
Binary files differ
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
index feddd13d1..e930eea39 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java
@@ -46,6 +46,7 @@ public class CVSDecorationRunnable implements Runnable {
private ImageDescriptor dirty;
private ImageDescriptor checkedIn;
private ImageDescriptor checkedOut;
+ private ImageDescriptor merged;
// Provides resources to be decorated and is notified when decoration has been calculated
private IDecorationNotifier notifier;
@@ -69,11 +70,10 @@ public class CVSDecorationRunnable implements Runnable {
/* package */
CVSDecorationRunnable(IDecorationNotifier notifier) {
-
dirty = new CachedImageDescriptor(TeamUIPlugin.getPlugin().getImageDescriptor(ISharedImages.IMG_DIRTY_OVR));
checkedIn = new CachedImageDescriptor(TeamUIPlugin.getPlugin().getImageDescriptor(ISharedImages.IMG_CHECKEDIN_OVR));
checkedOut = new CachedImageDescriptor(TeamUIPlugin.getPlugin().getImageDescriptor(ISharedImages.IMG_CHECKEDOUT_OVR));
-
+ merged = new CachedImageDescriptor(CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_MERGED));
this.notifier = notifier;
}
@@ -196,16 +196,36 @@ public class CVSDecorationRunnable implements Runnable {
boolean showHasRemote = store.getBoolean(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION);
boolean showAdded = store.getBoolean(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION);
+ if (showAdded && resource.getType() == IResource.FILE) {
+ try {
+ IPath location = resource.getLocation();
+ if(location!=null) {
+ ICVSFile cvsFile = new LocalFile(location.toFile());
+ ResourceSyncInfo info = cvsFile.getSyncInfo();
+ // show merged icon if file has been merged but has not been edited (e.g. on commit it will be ignored)
+ if(info!=null && info.isNeedsMerge(cvsFile.getTimeStamp())) {
+ overlays.add(merged);
+ // show added icon if file has been added locally.
+ } else if(info!=null && info.isAdded()) {
+ overlays.add(checkedOut);
+ }
+ }
+ } catch (CVSException e) {
+ CVSUIPlugin.log(e.getStatus());
+ return null;
+ }
+ }
+
+ // show outgoing arrow
if(showDirty && isDirty) {
overlays.add(dirty);
}
+ // show remote icon
if (showHasRemote && provider.hasRemote(resource)) {
overlays.add(checkedIn);
}
- if (showAdded && resource.getType() == IResource.FILE && provider.isCheckedOut(resource)) {
- overlays.add(checkedOut);
- }
+
if(overlays.isEmpty()) {
return null;
} else {
@@ -246,8 +266,9 @@ public class CVSDecorationRunnable implements Runnable {
}
}
if (!cvsResource.isFolder()) {
+ ResourceSyncInfo info = cvsResource.getSyncInfo();
+ // file is dirty or file has been merged by an update
if (((ICVSFile) cvsResource).isModified()) {
- // file has changed, show as dirty
throw DECORATOR_EXCEPTION;
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
index 112c14f79..ab57f7f73 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java
@@ -146,6 +146,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
createImageDescriptor(ICVSUIConstants.IMG_WIZBAN_SHARE, baseURL);
createImageDescriptor(ICVSUIConstants.IMG_MERGEABLE_CONFLICT, baseURL);
createImageDescriptor(ICVSUIConstants.IMG_QUESTIONABLE, baseURL);
+ createImageDescriptor(ICVSUIConstants.IMG_MERGED, baseURL);
}
/**
* Convenience method for logging statuses to the plugin log
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
index 0c15f00de..7f286b5a0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java
@@ -15,6 +15,7 @@ public interface ICVSUIConstants {
// overlays
public final String IMG_MERGEABLE_CONFLICT = "ovr16/confauto_ov.gif";
public final String IMG_QUESTIONABLE = "ovr16/question_ov.gif";
+ public final String IMG_MERGED = "ovr16/merged_ov.gif";
// objects
public final String IMG_REPOSITORY = "obj16/repository_rep.gif";

Back to the top