Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-09-30 12:49:31 +0000
committerMichael Valenta2004-09-30 12:49:31 +0000
commitb5c30b9d1cb12a23ee66fbecbec7253cc237af56 (patch)
treed96d9450f587ab29756eebaf8810c9529331ef7f
parent16cb057595fe10ec8388346abcd9b01f258efda3 (diff)
downloadeclipse.platform.team-b5c30b9d1cb12a23ee66fbecbec7253cc237af56.tar.gz
eclipse.platform.team-b5c30b9d1cb12a23ee66fbecbec7253cc237af56.tar.xz
eclipse.platform.team-b5c30b9d1cb12a23ee66fbecbec7253cc237af56.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java54
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetLabelDecorator.java86
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java3
4 files changed, 104 insertions, 43 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
index f86875eeb..4b96f439e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSChangeSetCollector.java
@@ -165,7 +165,7 @@ public class CVSChangeSetCollector extends SyncInfoSetChangeSetCollector {
* @see org.eclipse.team.core.subscribers.ChangeSet#getComment()
*/
public String getComment() {
- return getComment();
+ return entry.getComment();
}
}
@@ -584,7 +584,7 @@ public class CVSChangeSetCollector extends SyncInfoSetChangeSetCollector {
ChangeSet[] sets = getSets();
for (int i = 0; i < sets.length; i++) {
ChangeSet set = sets[i];
- if (set.getComment() == logEntry.getComment()) {
+ if (set.getComment().equals(logEntry.getComment())) {
return set;
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java
index 259e67134..2b749f7e4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java
@@ -11,30 +11,31 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.team.core.subscribers.ActiveChangeSet;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.team.core.synchronize.SyncInfo;
-import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
+import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
+import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
-import org.eclipse.team.internal.ccvs.ui.*;
-import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.team.internal.ui.synchronize.ChangeSetDiffNode;
+import org.eclipse.team.internal.ccvs.ui.CVSDecoration;
+import org.eclipse.team.internal.ccvs.ui.CVSLightweightDecorator;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
-class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyChangeListener, ILabelDecorator, IFontDecorator {
+class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyChangeListener, ILabelDecorator {
private ISynchronizePageConfiguration configuration;
- private Font boldFont;
public CVSParticipantLabelDecorator(ISynchronizePageConfiguration configuration) {
this.configuration = configuration;
@@ -66,12 +67,6 @@ class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyCha
return output.toString();
}
}
- if (element instanceof ChangeSetDiffNode) {
- ActiveChangeSet set = (ActiveChangeSet)((ChangeSetDiffNode)element).getSet();
- if (CVSUIPlugin.getPlugin().getChangeSetManager().isDefault(set)) {
- text = Policy.bind("CommitSetDiffNode.0", text); //$NON-NLS-1$
- }
- }
return text;
} catch (CVSException e) {
return input;
@@ -90,9 +85,6 @@ class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyCha
}
}
public void dispose() {
- if(boldFont != null) {
- boldFont.dispose();
- }
CVSUIPlugin.removePropertyChangeListener(this);
TeamUI.removePropertyChangeListener(this);
}
@@ -133,24 +125,4 @@ class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyCha
}
return null;
}
-
- public Font decorateFont(Object element) {
- if (element instanceof ChangeSetDiffNode) {
- ActiveChangeSet set = (ActiveChangeSet)((ChangeSetDiffNode)element).getSet();
- if (CVSUIPlugin.getPlugin().getChangeSetManager().isDefault(set)) {
- if (boldFont == null) {
- Font defaultFont = JFaceResources.getDefaultFont();
- FontData[] data = defaultFont.getFontData();
- for (int i = 0; i < data.length; i++) {
- data[i].setStyle(SWT.BOLD);
- }
- boldFont = new Font(TeamUIPlugin.getStandardDisplay(), data);
- }
- return boldFont;
- }
- }
- return null;
- }
-
-
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetLabelDecorator.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetLabelDecorator.java
new file mode 100644
index 000000000..614e07db6
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetLabelDecorator.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ui.synchronize;
+
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.IFontDecorator;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.team.core.subscribers.ActiveChangeSet;
+import org.eclipse.team.core.subscribers.ChangeSet;
+import org.eclipse.team.core.subscribers.SubscriberChangeSetCollector;
+import org.eclipse.team.internal.ui.Policy;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
+
+/**
+ * Label decorator that decorates the default active change set.
+ */
+public class ChangeSetLabelDecorator extends LabelProvider implements ILabelDecorator, IFontDecorator{
+
+ private Font boldFont;
+ private SubscriberChangeSetCollector collector;
+
+ public ChangeSetLabelDecorator(ISynchronizePageConfiguration configuration) {
+ this.collector = configuration.getParticipant().getChangeSetCapability().getActiveChangeSetManager();
+ }
+
+ public String decorateText(String input, Object element) {
+ String text = input;
+ if (element instanceof ChangeSetDiffNode) {
+ ChangeSet set = ((ChangeSetDiffNode)element).getSet();
+ if (set instanceof ActiveChangeSet && isDefaultActiveSet((ActiveChangeSet)set)) {
+ text = Policy.bind("CommitSetDiffNode.0", text); //$NON-NLS-1$
+ }
+ }
+ return text;
+ }
+
+ public void dispose() {
+ if(boldFont != null) {
+ boldFont.dispose();
+ }
+ }
+
+ public Font decorateFont(Object element) {
+ if (element instanceof ChangeSetDiffNode) {
+ ChangeSet set = ((ChangeSetDiffNode)element).getSet();
+ if (set instanceof ActiveChangeSet && isDefaultActiveSet((ActiveChangeSet)set)) {
+ if (boldFont == null) {
+ Font defaultFont = JFaceResources.getDefaultFont();
+ FontData[] data = defaultFont.getFontData();
+ for (int i = 0; i < data.length; i++) {
+ data[i].setStyle(SWT.BOLD);
+ }
+ boldFont = new Font(TeamUIPlugin.getStandardDisplay(), data);
+ }
+ return boldFont;
+ }
+ }
+ return null;
+ }
+
+ private boolean isDefaultActiveSet(ActiveChangeSet set) {
+ return collector.isDefault(set);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ILabelDecorator#decorateImage(org.eclipse.swt.graphics.Image, java.lang.Object)
+ */
+ public Image decorateImage(Image image, Object element) {
+ return image;
+ }
+
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java
index e8f560991..447940c4c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangeSetModelManager.java
@@ -62,6 +62,9 @@ public class ChangeSetModelManager extends HierarchicalModelManager implements I
configuration.addPropertyChangeListener(this);
configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, COMMIT_SET_GROUP);
configuration.addActionContribution(new CommitSetActionContribution());
+ if (configuration.getParticipant().getChangeSetCapability().supportsActiveChangeSets()) {
+ configuration.addLabelDecorator(new ChangeSetLabelDecorator(configuration));
+ }
}
/* (non-Javadoc)

Back to the top