Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-12-17 16:10:16 +0000
committerMichael Valenta2004-12-17 16:10:16 +0000
commit02c819694c33f5a9e60d1bdb7cf3543eb327d606 (patch)
tree540249a9da42c96543e21df67c6584a00f46f615
parentd392bb2c9f73c4c8a3563daac346008471da37b4 (diff)
downloadeclipse.platform.team-02c819694c33f5a9e60d1bdb7cf3543eb327d606.tar.gz
eclipse.platform.team-02c819694c33f5a9e60d1bdb7cf3543eb327d606.tar.xz
eclipse.platform.team-02c819694c33f5a9e60d1bdb7cf3543eb327d606.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/IFileTypeInfo.java1
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java290
-rw-r--r--bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberChangeSetCollector.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java4
-rw-r--r--bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java44
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.properties38
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml457
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSLightweightDecorator.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSUIPlugin.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CommitCommentArea.java450
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ICVSUIConstants.java18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java1
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java18
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java34
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java15
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java216
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutWizardAction.java33
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CommitAction.java36
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/MergeAction.java9
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SetKeywordSubstitutionAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagLocalAction.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateSilentAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties29
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java38
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CommitOperation.java142
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSActionDelegateWrapper.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantLabelDecorator.java35
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java16
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitAction.java41
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/BranchPromptDialog.java57
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagAsVersionDialog.java20
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagRefreshButtonArea.java65
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionArea.java21
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionDialog.java82
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizard.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardCommitCommentPage.java2
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/MergeWizardPage.java21
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java21
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java30
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DetailsDialog.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties11
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java443
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/RegistryReader.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActionDelegateWrapper.java14
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java134
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java5
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveFromViewAction.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SubscriberActionContribution.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java17
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java15
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java17
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00012.html4
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/00022.html11
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/branch00001.html2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/commit00001.html2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/commit00002.html2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/tags00001.html2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/tags00002.html2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/html/tags00003.html2
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java4
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/toc.xml14
77 files changed, 1968 insertions, 1154 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IFileTypeInfo.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IFileTypeInfo.java
index eaab301ba..2f5889bba 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IFileTypeInfo.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/IFileTypeInfo.java
@@ -15,6 +15,7 @@ package org.eclipse.team.core;
* corresponding file type.
*
* @since 2.0
+ * @deprecated Use the <code>IFileContentManager</code> API instead.
*/
public interface IFileTypeInfo {
/**
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
index 74af21766..229a10f6c 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/Team.java
@@ -25,9 +25,26 @@ import org.eclipse.team.internal.core.*;
* @since 2.0
*/
public final class Team {
+
+ private static class StringMappingWrapper implements IFileTypeInfo {
+
+ private final IStringMapping fMapping;
+
+ public StringMappingWrapper(IStringMapping mapping) {
+ fMapping= mapping;
+ }
+
+ public String getExtension() {
+ return fMapping.getString();
+ }
+
+ public int getType() {
+ return fMapping.getType();
+ }
+
+ }
private static final String PREF_TEAM_IGNORES = "ignore_files"; //$NON-NLS-1$
- private static final String PREF_TEAM_TYPES = "file_types"; //$NON-NLS-1$
private static final String PREF_TEAM_SEPARATOR = "\n"; //$NON-NLS-1$
public static final Status OK_STATUS = new Status(Status.OK, TeamPlugin.ID, Status.OK, Policy.bind("ok"), null); //$NON-NLS-1$
@@ -36,31 +53,22 @@ public final class Team {
public static final int TEXT = 1;
public static final int BINARY = 2;
- // Keys: file extensions. Values: Integers
- private static SortedMap globalTypes, pluginTypes;
// The ignore list that is read at startup from the persisted file
- private static SortedMap globalIgnore, pluginIgnore;
+ protected static SortedMap globalIgnore, pluginIgnore;
private static StringMatcher[] ignoreMatchers;
+
+ private final static FileContentManager fFileContentManager;
+
+ static {
+ fFileContentManager= new FileContentManager();
+ }
- private static class FileTypeInfo implements IFileTypeInfo {
- private String extension;
- private int type;
-
- public FileTypeInfo(String extension, int type) {
- this.extension = extension;
- this.type = type;
- }
- public String getExtension() {
- return extension;
- }
- public int getType() {
- return type;
- }
- }
/**
- * Return the type of the given IStorage.
+ * Return the type of the given IStorage. First, we check whether a mapping has
+ * been defined for the name of the IStorage. If this is not the case, we check for
+ * a mapping with the extension. If no mapping is defined, UNKNOWN is returned.
*
* Valid return values are:
* Team.TEXT
@@ -69,14 +77,11 @@ public final class Team {
*
* @param storage the IStorage
* @return whether the given IStorage is TEXT, BINARY, or UNKNOWN
+ *
+ * @deprecated Use <code>getFileContentManager().getType(IStorage storage)</code> instead.
*/
public static int getType(IStorage storage) {
- String extension = getFileExtension(storage.getName());
- if (extension == null) return UNKNOWN;
- SortedMap table = getFileTypeTable();
- Integer integer = (Integer)table.get(extension);
- if (integer == null) return UNKNOWN;
- return integer.intValue();
+ return fFileContentManager.getType(storage);
}
/**
@@ -118,26 +123,22 @@ public final class Team {
return matchesEnabledIgnore(file);
}
- private static IFileTypeInfo[] getFileTypeInfo(SortedMap map) {
- List result = new ArrayList();
- Iterator e = map.keySet().iterator();
- while (e.hasNext()) {
- String string = (String)e.next();
- int type = ((Integer)map.get(string)).intValue();
- result.add(new FileTypeInfo(string, type));
- }
- return (IFileTypeInfo[])result.toArray(new IFileTypeInfo[result.size()]);
- }
/**
- * Return all known file types.
+ * Return all known file types.
*
* @return all known file types
+ * @deprecated Use <code>getFileContentManager().getExtensionMappings()</code> instead.
*/
public static IFileTypeInfo[] getAllTypes() {
- return getFileTypeInfo(getFileTypeTable());
+ final IStringMapping [] mappings= fFileContentManager.getExtensionMappings();
+ final IFileTypeInfo [] infos= new IFileTypeInfo[mappings.length];
+ for (int i = 0; i < infos.length; i++) {
+ infos[i]= new StringMappingWrapper(mappings[i]);
+ }
+ return infos;
}
-
+
/**
* Returns the list of global ignores.
*/
@@ -169,12 +170,12 @@ public final class Team {
final boolean enabled = ((Boolean)gIgnore.get(pattern)).booleanValue();
result[i++] = new IIgnoreInfo() {
private String p = pattern;
- private boolean e = enabled;
+ private boolean e1 = enabled;
public String getPattern() {
return p;
}
public boolean getEnabled() {
- return e;
+ return e1;
}
};
}
@@ -196,52 +197,27 @@ public final class Team {
return ignoreMatchers;
}
- private synchronized static SortedMap getFileTypeTable() {
- // The types are cached and when the preferences change the
- // cache is cleared. This makes it faster to lookup without having
- // to re-parse the preferences.
- if (globalTypes == null) loadTextState();
- return globalTypes;
- }
/**
- * Set the file type for the give extension to the given type.
+ * Set the file type for the give extensions. This
+ * will replace the existing file types with this new list.
*
* Valid types are:
* Team.TEXT
* Team.BINARY
* Team.UNKNOWN
*
- * @param extension the file extension
- * @param type the file type
+ * @param extensions the file extensions
+ * @param types the file types
+ *
+ * @deprecated Use <code>getFileContentManager().setExtensionMappings()</code> instead.
*/
public static void setAllTypes(String[] extensions, int[] types) {
- if (pluginTypes == null) {
- loadTextState();
- }
- globalTypes = new TreeMap();
- for (int i = 0; i < extensions.length; i++) {
- globalTypes.put(extensions[i], new Integer(types[i]));
- }
- // Now set into preferences
- StringBuffer buf = new StringBuffer();
- Iterator e = globalTypes.keySet().iterator();
- while (e.hasNext()) {
- String extension = (String)e.next();
- boolean isCustom = (!pluginTypes.containsKey(extension)) ||
- !((Integer)pluginTypes.get(extension)).equals(globalTypes.get(extension));
- if (isCustom) {
- buf.append(extension);
- buf.append(PREF_TEAM_SEPARATOR);
- Integer type = (Integer)globalTypes.get(extension);
- buf.append(type);
- buf.append(PREF_TEAM_SEPARATOR);
- }
-
- }
- TeamPlugin.getPlugin().getPluginPreferences().setValue(PREF_TEAM_TYPES, buf.toString());
+ fFileContentManager.addExtensionMappings(extensions, types);
}
-
+
+
+
/**
* Add patterns to the list of global ignores.
*/
@@ -270,129 +246,9 @@ public final class Team {
TeamPlugin.getPlugin().getPluginPreferences().setValue(PREF_TEAM_IGNORES, buf.toString());
}
- /*
- * TEXT
- *
- * Reads the text patterns currently defined by extensions.
- */
- private static void initializePluginPatterns(Map pTypes, Map fTypes) {
- TeamPlugin plugin = TeamPlugin.getPlugin();
- if (plugin != null) {
- IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(TeamPlugin.ID, TeamPlugin.FILE_TYPES_EXTENSION);
- if (extension != null) {
- IExtension[] extensions = extension.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
- for (int j = 0; j < configElements.length; j++) {
- String ext = configElements[j].getAttribute("extension"); //$NON-NLS-1$
- if (ext != null) {
- String type = configElements[j].getAttribute("type"); //$NON-NLS-1$
- // If the extension doesn't already exist, add it.
- if (!fTypes.containsKey(ext)) {
- if (type.equals("text")) { //$NON-NLS-1$
- pTypes.put(ext, new Integer(TEXT));
- fTypes.put(ext, new Integer(TEXT));
- } else if (type.equals("binary")) { //$NON-NLS-1$
- fTypes.put(ext, new Integer(BINARY));
- pTypes.put(ext, new Integer(BINARY));
- }
- }
- }
- }
- }
- }
- }
- }
- /*
- * TEXT
- *
- * Read the saved file type state from the given input stream.
- *
- * @param dis the input stream to read the saved state from
- * @throws IOException if an I/O problem occurs
- */
- private static void readTextState(DataInputStream dis) throws IOException {
- int extensionCount = 0;
- try {
- extensionCount = dis.readInt();
- } catch (EOFException e) {
- // Ignore the exception, it will occur if there are no
- // patterns stored in the state file.
- return;
- }
- for (int i = 0; i < extensionCount; i++) {
- String extension = dis.readUTF();
- int type = dis.readInt();
- globalTypes.put(extension, new Integer(type));
- }
- }
-
- /*
- * TEXT
- *
- * Load the file type registry saved state. This loads the previously saved
- * contents, as well as discovering any values contributed by plug-ins.
- */
- private static void loadTextState() {
- globalTypes = new TreeMap();
- boolean old = loadBackwardCompatibleTextState();
- if (!old) loadTextPreferences();
- pluginTypes = new TreeMap();
- initializePluginPatterns(pluginTypes, globalTypes);
- if (old) TeamPlugin.getPlugin().savePluginPreferences();
- }
- private static void loadTextPreferences() {
- Preferences pref = TeamPlugin.getPlugin().getPluginPreferences();
- if (!pref.contains(PREF_TEAM_TYPES)) return;
- pref.addPropertyChangeListener(new Preferences.IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- // when a property is changed, invalidate our cache so that
- // properties will be recalculated.
- if(event.getProperty().equals(PREF_TEAM_TYPES))
- globalTypes = null;
- }
- });
- String prefTypes = pref.getString(PREF_TEAM_TYPES);
- StringTokenizer tok = new StringTokenizer(prefTypes, PREF_TEAM_SEPARATOR);
- String extension, integer;
- try {
- while (true) {
- extension = tok.nextToken();
- if (extension.length()==0) return;
- integer = tok.nextToken();
- globalTypes.put(extension, Integer.valueOf(integer));
- }
- } catch (NoSuchElementException e) {
- return;
- }
-
- }
- /*
- * If the workspace is an old 2.0 one, read the old file and delete it
- */
- private static boolean loadBackwardCompatibleTextState() {
- // File name of the persisted file type information
- String STATE_FILE = ".fileTypes"; //$NON-NLS-1$
- IPath pluginStateLocation = TeamPlugin.getPlugin().getStateLocation().append(STATE_FILE);
- File f = pluginStateLocation.toFile();
- if (!f.exists()) return false;
- try {
- DataInputStream dis = new DataInputStream(new FileInputStream(f));
- try {
- readTextState(dis);
- } finally {
- dis.close();
- }
- } catch (IOException ex) {
- TeamPlugin.log(Status.ERROR, ex.getMessage(), ex);
- return false;
- }
- f.delete();
- return true;
- }
-
+
/*
* IGNORE
*
@@ -561,15 +417,6 @@ public final class Team {
return null;
}
- private static String getFileExtension(String name) {
- if (name == null) return null;
- int index = name.lastIndexOf('.');
- if (index == -1)
- return null;
- if (index == (name.length() - 1))
- return ""; //$NON-NLS-1$
- return name.substring(index + 1);
- }
/**
* Return the default ignore infos
@@ -586,16 +433,39 @@ public final class Team {
}
/**
+ * TODO: change to file content manager
* Return the default file type bindings
* (i.e. those that are specified in
* plugin manifests).
* @return the default file type bindings
* @since 3.0
+ * @deprecated Use Team.getFileContentManager().getDefaultExtensionMappings() instead.
*/
public static IFileTypeInfo[] getDefaultTypes() {
- SortedMap gTypes = new TreeMap();
- SortedMap pTypes = new TreeMap();
- initializePluginPatterns(pTypes, gTypes);
- return getFileTypeInfo(gTypes);
+ return asFileTypeInfo(getFileContentManager().getDefaultExtensionMappings());
}
+
+ private static IFileTypeInfo [] asFileTypeInfo(IStringMapping [] mappings) {
+ final IFileTypeInfo [] infos= new IFileTypeInfo[mappings.length];
+ for (int i = 0; i < infos.length; i++) {
+ infos[i]= new StringMappingWrapper(mappings[i]);
+ }
+ return infos;
+ }
+
+ /**
+ * Get the file content manager which implements the API for manipulating the mappings between
+ * file names, file extensions and content types.
+ *
+ * @return an instance of IFileContentManager
+ *
+ * @see IFileContentManager
+ *
+ * @since 3.1
+ */
+ public static IFileContentManager getFileContentManager() {
+ return fFileContentManager;
+ }
+
+
}
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberChangeSetCollector.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberChangeSetCollector.java
index 8d065bb8c..7bac6c1b5 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberChangeSetCollector.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/subscribers/SubscriberChangeSetCollector.java
@@ -461,9 +461,7 @@ public class SubscriberChangeSetCollector extends ChangeSetCollector implements
}
private static Preferences getTeamPreferences() {
- IPreferencesService service = Platform.getPreferencesService();
- IEclipsePreferences root = service.getRootNode();
- return root.node(InstanceScope.SCOPE).node(TeamPlugin.getPlugin().getBundle().getSymbolicName());
+ return new InstanceScope().getNode(TeamPlugin.getPlugin().getBundle().getSymbolicName());
}
/**
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java
index e44ac98d8..68a52cace 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/client/Add.java
@@ -87,9 +87,9 @@ public class Add extends Command {
String serverMessage = getServerMessage(line, location);
if (serverMessage != null) {
- if (serverMessage.startsWith("use `cvs commit' to add")) //$NON-NLS-1$
+ if (serverMessage.indexOf("cvs commit") != -1 && serverMessage.indexOf("add") != -1 && serverMessage.indexOf("permanently") != -1) //$NON-NLS-1$
return OK;
- if (serverMessage.startsWith("scheduling file") && serverMessage.endsWith("for addition")) //$NON-NLS-1$ //$NON-NLS-2$
+ if (serverMessage.startsWith("scheduling file") && serverMessage.indexOf("for addition") != -1) //$NON-NLS-1$ //$NON-NLS-2$
return OK;
}
return super.errorLine(line, location, commandRoot, monitor);
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
index 698028300..997d992d7 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java
@@ -108,12 +108,26 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
public static final String AUTH_SCHEME = "";//$NON-NLS-1$
public static final URL FAKE_URL;
+ /*
+ * Fields used to create the EXT command invocation
+ */
public static final String USER_VARIABLE = "{user}"; //$NON-NLS-1$
public static final String PASSWORD_VARIABLE = "{password}"; //$NON-NLS-1$
public static final String HOST_VARIABLE = "{host}"; //$NON-NLS-1$
public static final String PORT_VARIABLE = "{port}"; //$NON-NLS-1$
- private static String extProxy; //$NON-NLS-1$
+ /*
+ * Field that indicates which connection method is to be used for
+ * locations that use the EXT connection method.
+ */
+ private static String extProxy;
+
+ /*
+ * Field that indicates that the last connection attempt made to
+ * this repository location failed. When this is set, subsequent
+ * attempts should prompt before attempting to connect
+ */
+ private boolean previousConnectFailed;
static {
URL temp = null;
@@ -768,11 +782,18 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
}
}
synchronized(hostLock) {
+ boolean connected = false;
try {
// Allow two ticks in case of a retry
monitor.beginTask(Policy.bind("CVSRepositoryLocation.openingConnection", getHost()), 2);//$NON-NLS-1$
ensureLocationCached();
boolean cacheNeedsUpdate = false;
+ // If the previous connection failed, prompt before attempting to connect
+ if (previousConnectFailed) {
+ promptForUserInfo(null);
+ // The authentication information has been change so update the cache
+ cacheNeedsUpdate = true;
+ }
while (true) {
try {
// The following will throw an exception if authentication fails
@@ -790,16 +811,13 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
Connection connection = createConnection(password, monitor);
if (cacheNeedsUpdate)
updateCachedLocation();
+ connected = true;
return connection;
} catch (CVSAuthenticationException ex) {
if (ex.getStatus().getCode() == CVSAuthenticationException.RETRY) {
String message = ex.getMessage();
- IUserAuthenticator authenticator = getAuthenticator();
- if (authenticator == null) {
- throw new CVSAuthenticationException(Policy.bind("Client.noAuthenticator"), CVSAuthenticationException.NO_RETRY);//$NON-NLS-1$
- }
- authenticator.promptForUserInfo(this, this, message);
- // The authentication iformation has been change so update the cache
+ promptForUserInfo(message);
+ // The authentication information has been change so update the cache
cacheNeedsUpdate = true;
} else {
throw ex;
@@ -807,11 +825,23 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit
}
}
} finally {
+ previousConnectFailed = !connected;
monitor.done();
}
}
}
+ /*
+ * Prompt for the user authentication information (i.e. user name and password).
+ */
+ private void promptForUserInfo(String message) throws CVSException {
+ IUserAuthenticator authenticator = getAuthenticator();
+ if (authenticator == null) {
+ throw new CVSAuthenticationException(Policy.bind("Client.noAuthenticator"), CVSAuthenticationException.NO_RETRY);//$NON-NLS-1$
+ }
+ authenticator.promptForUserInfo(this, this, message);
+ }
+
/*
* Ensure that this location is in the known repositories list
* and that the authentication information matches what is in the
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.properties b/bundles/org.eclipse.team.cvs.ui/plugin.properties
index 2f4b128c7..d1a0570d5 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.properties
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.properties
@@ -41,12 +41,15 @@ DecoratorStandard.name=CVS
DecoratorStandard.desc=Shows CVS specific information on resources in projects under CVS control. Information includes the revision number, branch or version name, etc.
AddAction.label=Add to &Version Control
+AddAction.name=Add to Version Control
AddAction.tooltip=Add the Selected Resources to Version Control
MergeAction.label=&Merge...
+MergeAction.name=Merge
MergeAction.tooltip=Merge
BranchAction.label=&Branch...
+BranchAction.name=Branch
BranchAction.tooltip=Branch
CompareRemoteResourcesAction.label=Com&pare
@@ -56,14 +59,23 @@ CompareRemoteWithTagAction.label=Compare &With...
CompareRemoteWithTagAction.tooltip=Compare with a Branch or a Version
CompareWithRemoteAction.label=&Latest from Repository
+CompareWithRemoteAction.name=Compare With Latest from Repository
CompareWithRemoteAction.tooltip=Compare with Content on CVS Server
CompareWithRevisionAction.label=&Revision...
+CompareWithRevisionAction.name=Compare With Revision
CompareWithRevisionAction.tooltip=Compare with Revision on CVS Server
CompareWithTagAction.label=Another &Branch or Version...
+CompareWithTagAction.name=Compare With Another Branch or Version
CompareWithTagAction.tooltip=Compare with a Branch or a Version on the CVS Server
+OverrideAndUpdateAction.name=Override and Update
+OverrideAndUpdateAction.tooltip=Overwrite the local changes with those from the repository.
+
+OverrideAndCommitAction.name=Override and Commit
+OverrideAndCommitAction.tooltip=Overwrite the changes in the repository with the local changes.
+
ContentAction.label=Compare File Contents
ContentAction.tooltip=Use File Contents Instead of Timestamps When Comparing
@@ -74,6 +86,7 @@ CopyRepositoryNameAction.label=&Copy to Clipboard
CopyRepositoryNameAction.tooltip=Copy Repository Names to Clipboard
IgnoreAction.label=A&dd to .cvsignore...
+IgnoreAction.name=Add to .cvsignore
IgnoreAction.tooltip=Ignore the Selected Resources when Synchronizing
RefreshTagsAction.label=Refresh &Branches...
@@ -83,30 +96,38 @@ RemoveRootAction.label=Discard &Location
RemoveRootAction.tooltip=Discard Location
ReplaceWithRevisionAction.label=&Revision...
+ReplaceWithRevisionAction.name=Replace With Revision
ReplaceWithRevisionAction.tooltip=Replace with Revision on CVS Server
ReplaceWithTagAction.label=&Another Branch or Version...
+ReplaceWithTagAction.name=Replace With Another Branch or Version
ReplaceWithTagAction.tooltip=Replace with Branch or Version on the CVS Server
TagAction.label=&Tag as Version...
+TagAction.name=Tag as Version
TagAction.tooltip=Tag the resources with a CVS version tag
TagInRepositoryAction.label=&Tag as Version...
+TagInRepositoryAction.name=Tag as Version
TagInRepositoryAction.tooltip=Tag the resources with a CVS version tag
MoveTagAction.label=Tag with &Existing...
MoveTagAction.tooltip=Tag the selected resources with an existing tag
SetKeywordSubstitutionAction.label=Cha&nge ASCII/Binary Property...
+SetKeywordSubstitutionAction.name=Change ASCII/Binary Property
SetKeywordSubstitutionAction.tooltip=Change whether the selected resources should be treated as ASCII or binary on the CVS Server
UpdateAction.label=&Update
-UpdateAction.tooltip=Update
+UpdateAction.name=Update
+UpdateAction.tooltip=Update resources with new content from the repository
-UpdateActionSwitch.label=S&witch to another branch or version...
-UpdateActionSwitch.tooltip=Switch to another branch or version
+UpdateActionSwitch.label=S&witch to Another Branch or Version...
+UpdateActionSwitch.name=Switch to Another Branch or Version
+UpdateActionSwitch.tooltip=Switch to Another Branch or Version
ReplaceWithAction.label=&Latest from Repository
+ReplaceWithAction.name=Replace With Latest from Repository
ReplaceWithAction.tooltip=Replace with last committed content from CVS Server
ConfigureTags.label=Configure &Branches and Versions...
@@ -116,7 +137,8 @@ AddToBranch.label=Add &to Branch List...
AddToBranch.tooltip=Add the selected remote folder to a branch
CommitAction.label=&Commit...
-CommitAction.tooltip=Commit
+CommitAction.name=Commit
+CommitAction.tooltip=Commit resources to the repository
CheckoutAction.label=&Check Out
CheckoutAction.tooltip=Check out a module from the repository to the workspace
@@ -130,19 +152,23 @@ OpenLogEntryAction.tooltip=Open Remote File
OpenRemoteFileAction.label=&Open
OpenRemoteFileAction.tooltip=Open Remote File
-ShowHistoryAction.label=Show in Resource &History
-ShowHistoryAction.tooltip=Show in Resource History
+ShowHistoryAction.label=Show Resource &History
+ShowHistoryAction.name=Show Resource History
+ShowHistoryAction.tooltip=Show Resource History
ShowAnnotationAction.label=Show &Annotation
+ShowAnnotationAction.name=Show Annotation
ShowAnnotationAction.tooltip=Show Annotation
GenerateDiff.label=Create &Patch...
+GenerateDiff.name=Create Patch
GenerateDiff.tooltip=Compare your workspace contents with the server and generate a diff file that can be used as a patch file.
RefreshFromLocal.label=&Refresh from local CVS state
RefreshFromLocal.tooltip=Refresh the workbench with changes made to CVS projects from outside the workbench.
Synchronize.label=&Synchronize with Repository
+Synchronize.name=Synchronize with Repository
Synchronize.tooltip=Synchronize the workspace resources with those in the repository
EditAction.label=&Edit
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 0d230b48b..bdf9abf62 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -175,46 +175,60 @@
value="org.eclipse.team.core.repository=org.eclipse.team.cvs.core.cvsnature">
</filter>
<action
- label="%ShowEditorsAction.label"
- helpContextId="org.eclipse.team.cvs.ui.team_show_editors_action_context"
- tooltip="%ShowEditorsAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.ShowEditorsAction"
- menubarPath="team.main/group4"
- id="org.eclipse.team.ccvs.ui.showeditors">
+ helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
+ label="%IgnoreAction.label"
+ definitionId="org.eclipse.team.cvs.ui.ignore"
+ tooltip="%IgnoreAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"
+ menubarPath="team.main/group3"
+ id="org.eclipse.team.cvs.ui.ignore">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.team_add_action_context"
+ label="%AddAction.label"
+ definitionId="org.eclipse.team.cvs.ui.add"
+ tooltip="%AddAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.AddAction"
+ menubarPath="team.main/group3"
+ id="org.eclipse.team.cvs.ui.add">
</action>
<action
+ helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
label="%ShowHistoryAction.label"
+ definitionId="org.eclipse.team.cvs.ui.showHistory"
icon="icons/full/etool16/history.gif"
- helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
tooltip="%ShowHistoryAction.tooltip"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
menubarPath="team.main/group2"
- id="org.eclipse.team.ccvs.ui.showHistory">
+ id="org.eclipse.team.cvs.ui.showHistory">
</action>
<action
+ helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
label="%ShowAnnotationAction.label"
+ definitionId="org.eclipse.team.cvs.ui.showAnnotation"
icon="icons/full/etool16/annotate.gif"
- helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
tooltip="%ShowAnnotationAction.tooltip"
class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
menubarPath="team.main/group2"
- id="org.eclipse.team.ccvs.ui.showAnnotation">
+ id="org.eclipse.team.cvs.ui.showAnnotation">
</action>
<action
- label="%CompareWithRevisionAction.label"
helpContextId="org.eclipse.team.cvs.ui.compare_with_revision_action_context"
- tooltip="%CompareWithRevisionAction.tooltip"
+ label="%CompareWithRevisionAction.label"
+ definitionId="org.eclipse.team.cvs.ui.compareWithRevision"
class="org.eclipse.team.internal.ccvs.ui.actions.CompareWithRevisionAction"
+ tooltip="%CompareWithRevisionAction.tooltip"
menubarPath="compareWithMenu/compareWithGroup"
- id="org.eclipse.team.ccvs.ui.compareWithRevision">
+ id="org.eclipse.team.cvs.ui.compareWithRevision">
</action>
<action
- label="%ReplaceWithRevisionAction.label"
helpContextId="org.eclipse.team.cvs.ui.replace_with_revision_action_context"
- tooltip="%ReplaceWithRevisionAction.tooltip"
+ label="%ReplaceWithRevisionAction.label"
+ definitionId="org.eclipse.team.cvs.ui.replaceWithRevision"
class="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithRevisionAction"
+ tooltip="%ReplaceWithRevisionAction.tooltip"
menubarPath="replaceWithMenu/replaceWithGroup"
- id="org.eclipse.team.ccvs.ui.replaceWithRevision">
+ id="org.eclipse.team.cvs.ui.replaceWithRevision">
</action>
<action
label="%EditAction.label"
@@ -234,113 +248,129 @@
</action>
</objectContribution>
<objectContribution
- objectClass="org.eclipse.core.resources.mapping.IResourceMapper"
+ objectClass="org.eclipse.core.resources.mapping.ResourceMapping"
adaptable="true"
id="org.eclipse.team.ccvs.ui.ResourceMapperContributions">
- <filter
+<!-- <filter
name="repositoryId"
value="org.eclipse.team.cvs.core.cvsnature">
- </filter>
+ </filter> -->
<action
- label="%SetKeywordSubstitutionAction.label"
helpContextId="org.eclipse.team.cvs.ui.team_set_keyword_mode_action_context"
- tooltip="%SetKeywordSubstitutionAction.tooltip"
+ label="%SetKeywordSubstitutionAction.label"
+ definitionId="org.eclipse.team.cvs.ui.setKeywordSubstitution"
class="org.eclipse.team.internal.ccvs.ui.actions.SetKeywordSubstitutionAction"
+ tooltip="%SetKeywordSubstitutionAction.tooltip"
menubarPath="team.main/group3"
- id="org.eclipse.team.ccvs.ui.setKeywordSubstitution">
+ id="org.eclipse.team.cvs.ui.setKeywordSubstitution">
</action>
<action
label="%UpdateActionSwitch.label"
- tooltip="%UpdateActionSwitch.tooltip"
+ definitionId="org.eclipse.team.cvs.ui.updateSwitch"
class="org.eclipse.team.internal.ccvs.ui.actions.UpdateAction"
+ tooltip="%UpdateActionSwitch.tooltip"
menubarPath="team.main/group2"
- id="org.eclipse.team.ccvs.ui.updateSwitch">
+ id="org.eclipse.team.cvs.ui.updateSwitch">
</action>
<action
- label="%MergeAction.label"
helpContextId="org.eclipse.team.cvs.ui.team_merge_action_context"
+ label="%MergeAction.label"
+ definitionId="org.eclipse.team.cvs.ui.merge"
tooltip="%MergeAction.tooltip"
class="org.eclipse.team.internal.ccvs.ui.actions.MergeAction"
+ icon="icons/full/obj16/branches_rep.gif"
menubarPath="team.main/group2"
- id="org.eclipse.team.ccvs.ui.merge">
+ id="org.eclipse.team.cvs.ui.merge">
</action>
<action
- label="%BranchAction.label"
helpContextId="org.eclipse.team.cvs.ui.team_branch_action_context"
+ label="%BranchAction.label"
+ definitionId="org.eclipse.team.cvs.ui.branch"
tooltip="%BranchAction.tooltip"
class="org.eclipse.team.internal.ccvs.ui.actions.BranchAction"
+ icon="icons/full/elcl16/newstream_wiz.gif"
menubarPath="team.main/group2"
- id="org.eclipse.team.ccvs.ui.branch">
+ id="org.eclipse.team.cvs.ui.branch">
</action>
<action
- label="%TagAction.label"
helpContextId="org.eclipse.team.cvs.ui.team_tag_as_version_action_context"
+ label="%TagAction.label"
+ definitionId="org.eclipse.team.cvs.ui.tag"
tooltip="%TagAction.tooltip"
class="org.eclipse.team.internal.ccvs.ui.actions.TagLocalAction"
+ icon="icons/full/obj16/versions_rep.gif"
menubarPath="team.main/group2"
- id="org.eclipse.team.ccvs.ui.tag">
+ id="org.eclipse.team.cvs.ui.tag">
</action>
<action
- label="%CompareWithTagAction.label"
helpContextId="org.eclipse.team.cvs.ui.compare_with_tag_action_context"
- tooltip="%CompareWithTagAction.tooltip"
+ label="%CompareWithTagAction.label"
+ definitionId="org.eclipse.team.cvs.ui.compareWithTag"
class="org.eclipse.team.internal.ccvs.ui.actions.CompareWithTagAction"
+ tooltip="%CompareWithTagAction.tooltip"
menubarPath="compareWithMenu/compareWithGroup"
- id="org.eclipse.team.ccvs.ui.compareWithTag">
+ id="org.eclipse.team.cvs.ui.compareWithTag">
</action>
<action
- label="%CompareWithRemoteAction.label"
helpContextId="org.eclipse.team.cvs.ui.compare_with_latest_action_context"
- class="org.eclipse.team.internal.ccvs.ui.actions.CompareWithRemoteAction"
+ label="%CompareWithRemoteAction.label"
+ definitionId="org.eclipse.team.cvs.ui.compareWithRemote"
tooltip="%CompareWithRemoteAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.CompareWithRemoteAction"
menubarPath="compareWithMenu/compareWithGroup"
- id="org.eclipse.team.ccvs.ui.compareWithRemote">
+ id="org.eclipse.team.cvs.ui.compareWithRemote">
</action>
<action
- label="%ReplaceWithTagAction.label"
helpContextId="org.eclipse.team.cvs.ui.replace_with_tag_action_context"
- tooltip="%ReplaceWithTagAction.tooltip"
+ label="%ReplaceWithTagAction.label"
+ definitionId="org.eclipse.team.cvs.ui.replaceWithTag"
class="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithTagAction"
+ tooltip="%ReplaceWithTagAction.tooltip"
menubarPath="replaceWithMenu/replaceWithGroup"
- id="org.eclipse.team.ccvs.ui.replaceWithTag">
+ id="org.eclipse.team.cvs.ui.replaceWithTag">
</action>
<action
- label="%ReplaceWithAction.label"
helpContextId="org.eclipse.team.cvs.ui.replace_with_latest_action_context"
- tooltip="%ReplaceWithAction.tooltip"
+ label="%ReplaceWithAction.label"
+ definitionId="org.eclipse.team.cvs.ui.replace"
class="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithRemoteAction"
+ tooltip="%ReplaceWithAction.tooltip"
menubarPath="replaceWithMenu/replaceWithGroup"
- id="org.eclipse.team.ccvs.ui.replace">
+ id="org.eclipse.team.cvs.ui.replace">
</action>
<action
- label="%GenerateDiff.label"
helpContextId="org.eclipse.team.cvs.ui.team_create_patch_action_context"
- tooltip="%GenerateDiff.tooltip"
+ label="%GenerateDiff.label"
+ definitionId="org.eclipse.team.cvs.ui.GenerateDiff"
class="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction"
+ tooltip="%GenerateDiff.tooltip"
menubarPath="team.main/group1"
- id="org.eclipse.team.ccvs.ui.GenerateDiff">
+ id="org.eclipse.team.cvs.ui.GenerateDiff">
</action>
<action
- label="%UpdateAction.label"
helpContextId="org.eclipse.team.cvs.ui.team_update_action_context"
- tooltip="%UpdateAction.tooltip"
+ label="%UpdateAction.label"
+ definitionId="org.eclipse.team.cvs.ui.update"
class="org.eclipse.team.internal.ccvs.ui.actions.UpdateSilentAction"
+ tooltip="%UpdateAction.tooltip"
menubarPath="team.main/group1"
id="org.eclipse.team.ccvs.ui.update">
</action>
<action
- label="%CommitAction.label"
helpContextId="org.eclipse.team.cvs.ui.team_commit_action_context"
- tooltip="%CommitAction.tooltip"
+ label="%CommitAction.label"
+ definitionId="org.eclipse.team.cvs.ui.commit"
class="org.eclipse.team.internal.ccvs.ui.actions.CommitAction"
+ tooltip="%CommitAction.tooltip"
menubarPath="team.main/group1"
id="org.eclipse.team.ccvs.ui.commit">
</action>
<action
- label="%Synchronize.label"
helpContextId="org.eclipse.team.cvs.ui.team_synchronize_action_context"
- tooltip="%Synchronize.tooltip"
+ label="%Synchronize.label"
+ definitionId="org.eclipse.team.ui.synchronizeLast"
class="org.eclipse.team.internal.ccvs.ui.actions.SyncAction"
+ tooltip="%Synchronize.tooltip"
menubarPath="team.main/group1"
id="org.eclipse.team.ccvs.ui.sync">
</action>
@@ -353,20 +383,22 @@
id="org.eclipse.team.ccvs.ui.restoreFromRepository">
</action>
<action
- label="%IgnoreAction.label"
helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
- tooltip="%IgnoreAction.tooltip"
+ label="%IgnoreAction.label"
+ definitionId="org.eclipse.team.cvs.ui.ignore"
class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"
+ tooltip="%IgnoreAction.tooltip"
menubarPath="team.main/group3"
- id="org.eclipse.team.ccvs.ui.ignore">
+ id="org.eclipse.team.cvs.ui.ignore">
</action>
<action
- label="%AddAction.label"
helpContextId="org.eclipse.team.cvs.ui.team_add_action_context"
- tooltip="%AddAction.tooltip"
+ label="%AddAction.label"
+ definitionId="org.eclipse.team.cvs.ui.add"
class="org.eclipse.team.internal.ccvs.ui.actions.AddAction"
+ tooltip="%AddAction.tooltip"
menubarPath="team.main/group3"
- id="org.eclipse.team.ccvs.ui.add">
+ id="org.eclipse.team.cvs.ui.add">
</action>
</objectContribution>
<!-- ************** Project Menu *************** -->
@@ -840,6 +872,167 @@
toolbarPath="Normal/CVS"
id="org.eclipse.team.cvs.ui.actions.CheckoutAction">
</action>
+ <menu
+ label="%CVS"
+ path="additions"
+ id="cvs.main">
+ <separator
+ name="group1">
+ </separator>
+ <separator
+ name="group2">
+ </separator>
+ <separator
+ name="group3">
+ </separator>
+ <separator
+ name="group4">
+ </separator>
+ <separator
+ name="group5">
+ </separator>
+ <separator
+ name="group6">
+ </separator>
+ <separator
+ name="group7">
+ </separator>
+ <separator
+ name="group8">
+ </separator>
+ <separator
+ name="group9">
+ </separator>
+ <separator
+ name="group10">
+ </separator>
+ <separator
+ name="projectGroup">
+ </separator>
+ </menu>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
+ label="%IgnoreAction.label"
+ definitionId="org.eclipse.team.cvs.ui.ignore"
+ class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"
+ tooltip="%IgnoreAction.tooltip"
+ menubarPath="cvs.main/group3"
+ id="org.eclipse.team.cvs.ui.ignore">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.team_add_action_context"
+ label="%AddAction.label"
+ definitionId="org.eclipse.team.cvs.ui.add"
+ class="org.eclipse.team.internal.ccvs.ui.actions.AddAction"
+ tooltip="%AddAction.tooltip"
+ menubarPath="cvs.main/group3"
+ id="org.eclipse.team.cvs.ui.add">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
+ label="%ShowHistoryAction.label"
+ definitionId="org.eclipse.team.cvs.ui.showHistory"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
+ tooltip="%ShowHistoryAction.tooltip"
+ icon="icons/full/eview16/history_view.gif"
+ menubarPath="cvs.main/group2"
+ id="org.eclipse.team.cvs.ui.showHistory">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
+ label="%ShowAnnotationAction.label"
+ definitionId="org.eclipse.team.cvs.ui.showAnnotation"
+ class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
+ tooltip="%ShowAnnotationAction.tooltip"
+ icon="icons/full/etool16/annotate.gif"
+ menubarPath="cvs.main/group2"
+ id="org.eclipse.team.cvs.ui.showAnnotation">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.team_set_keyword_mode_action_context"
+ label="%SetKeywordSubstitutionAction.label"
+ definitionId="org.eclipse.team.cvs.ui.setKeywordSubstitution"
+ class="org.eclipse.team.internal.ccvs.ui.actions.SetKeywordSubstitutionAction"
+ tooltip="%SetKeywordSubstitutionAction.tooltip"
+ menubarPath="cvs.main/group3"
+ id="org.eclipse.team.cvs.ui.setKeywordSubstitution">
+ </action>
+ <action
+ label="%UpdateActionSwitch.label"
+ definitionId="org.eclipse.team.cvs.ui.updateSwitch"
+ class="org.eclipse.team.internal.ccvs.ui.actions.UpdateAction"
+ tooltip="%UpdateActionSwitch.tooltip"
+ menubarPath="cvs.main/group2"
+ id="org.eclipse.team.cvs.ui.updateSwitch">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.team_merge_action_context"
+ label="%MergeAction.label"
+ icon="icons/full/obj16/branches_rep.gif"
+ tooltip="%MergeAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.MergeAction"
+ definitionId="org.eclipse.team.cvs.ui.merge"
+ menubarPath="cvs.main/group2"
+ id="org.eclipse.team.cvs.ui.merge">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.team_branch_action_context"
+ label="%BranchAction.label"
+ icon="icons/full/elcl16/newstream_wiz.gif"
+ tooltip="%BranchAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.BranchAction"
+ definitionId="org.eclipse.team.cvs.ui.branch"
+ menubarPath="cvs.main/group2"
+ id="org.eclipse.team.cvs.ui.branch">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.team_tag_as_version_action_context"
+ label="%TagAction.label"
+ icon="icons/full/obj16/versions_rep.gif"
+ tooltip="%TagAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.TagLocalAction"
+ definitionId="org.eclipse.team.cvs.ui.tag"
+ menubarPath="cvs.main/group2"
+ id="org.eclipse.team.cvs.ui.tag">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.team_create_patch_action_context"
+ label="%GenerateDiff.label"
+ definitionId="org.eclipse.team.cvs.ui.GenerateDiff"
+ class="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction"
+ tooltip="%GenerateDiff.tooltip"
+ menubarPath="cvs.main/group1"
+ id="org.eclipse.team.cvs.ui.GenerateDiff">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.team_update_action_context"
+ label="%UpdateAction.label"
+ tooltip="%UpdateAction.tooltip"
+ class="org.eclipse.team.internal.ccvs.ui.actions.UpdateSilentAction"
+ definitionId="org.eclipse.team.cvs.ui.update"
+ menubarPath="cvs.main/group1"
+ id="org.eclipse.team.cvs.ui.update">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.team_commit_action_context"
+ allowLabelUpdate="false"
+ retarget="false"
+ label="%CommitAction.label"
+ class="org.eclipse.team.internal.ccvs.ui.actions.CommitAction"
+ definitionId="org.eclipse.team.cvs.ui.commit"
+ tooltip="%CommitAction.tooltip"
+ menubarPath="cvs.main/group1"
+ id="org.eclipse.team.cvs.ui.commit">
+ </action>
+ <action
+ helpContextId="org.eclipse.team.cvs.ui.team_synchronize_action_context"
+ label="%Synchronize.label"
+ definitionId="org.eclipse.team.ui.synchronizeLast"
+ class="org.eclipse.team.internal.ccvs.ui.actions.SyncAction"
+ tooltip="%Synchronize.tooltip"
+ menubarPath="cvs.main/group1"
+ id="org.eclipse.team.ui.synchronizeLast">
+ </action>
</actionSet>
</extension>
<!-- ******************* Action Definitions ******************** -->
@@ -910,6 +1103,156 @@
categoryId="org.eclipse.ui.category.perspectives"
name="%CVSRepositoryExploring"
id="org.eclipse.team.cvs.ui.cvsPerspective"/>
+ <command
+ description="%CommitAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%CommitAction.name"
+ id="org.eclipse.team.cvs.ui.commit"/>
+ <command
+ category="org.eclipse.team.cvs.ui.actionSet"
+ description="%ReplaceWithAction.tooltip"
+ name="%ReplaceWithAction.name"
+ id="org.eclipse.team.cvs.ui.replace"/>
+ <command
+ description="%ReplaceWithTagAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%ReplaceWithTagAction.name"
+ id="org.eclipse.team.cvs.ui.replaceWithTag"/>
+ <command
+ description="%ReplaceWithRevisionAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%ReplaceWithRevisionAction.name"
+ id="org.eclipse.team.cvs.ui.replaceWithRevision"/>
+ <command
+ description="%CompareWithRemoteAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%CompareWithRemoteAction.name"
+ id="org.eclipse.team.cvs.ui.compareWithRemote"/>
+ <command
+ description="%CompareWithTagAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%CompareWithTagAction.name"
+ id="org.eclipse.team.cvs.ui.compareWithTag"/>
+ <command
+ description="%CompareWithRevisionAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%CompareWithRevisionAction.name"
+ id="org.eclipse.team.cvs.ui.compareWithRevision"/>
+ <command
+ description="%UpdateAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%UpdateAction.name"
+ id="org.eclipse.team.cvs.ui.update"/>
+ <command
+ description="%GenerateDiff.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%GenerateDiff.name"
+ id="org.eclipse.team.cvs.ui.GenerateDiff"/>
+ <command
+ description="%TagAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%TagAction.name"
+ id="org.eclipse.team.cvs.ui.tag"/>
+ <command
+ description="%BranchAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%BranchAction.name"
+ id="org.eclipse.team.cvs.ui.branch"/>
+ <command
+ description="%MergeAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%MergeAction.name"
+ id="org.eclipse.team.cvs.ui.merge"/>
+ <command
+ description="%UpdateActionSwitch.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%UpdateActionSwitch.name"
+ id="org.eclipse.team.cvs.ui.updateSwitch"/>
+ <command
+ description="%SetKeywordSubstitutionAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%SetKeywordSubstitutionAction.name"
+ id="org.eclipse.team.cvs.ui.setKeywordSubstitution"/>
+ <command
+ description="%ShowAnnotationAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%ShowAnnotationAction.name"
+ id="org.eclipse.team.cvs.ui.showAnnotation"/>
+ <command
+ description="%ShowHistoryAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%ShowHistoryAction.name"
+ id="org.eclipse.team.cvs.ui.showHistory"/>
+ <command
+ description="%AddAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%AddAction.name"
+ id="org.eclipse.team.cvs.ui.add"/>
+ <command
+ description="%IgnoreAction.tooltip"
+ category="org.eclipse.team.cvs.ui.actionSet"
+ name="%IgnoreAction.name"
+ id="org.eclipse.team.cvs.ui.ignore"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.CommitAction"
+ commandId="org.eclipse.team.cvs.ui.commit"/>
+ <handlerSubmission
+ commandId="org.eclipse.team.cvs.ui.ignore"
+ handler="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"/>
+ <handlerSubmission
+ commandId="org.eclipse.team.cvs.ui.add"
+ handler="org.eclipse.team.internal.ccvs.ui.actions.AddAction"/>
+ <handlerSubmission
+ commandId="org.eclipse.team.cvs.ui.showHistory"
+ handler="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"/>
+ <handlerSubmission
+ commandId="org.eclipse.team.cvs.ui.showAnnotation"
+ handler="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"/>
+ <handlerSubmission
+ commandId="org.eclipse.team.cvs.ui.setKeywordSubstitution"
+ handler="org.eclipse.team.internal.ccvs.ui.actions.SetKeywordSubstitutionAction"/>
+ <handlerSubmission
+ commandId="org.eclipse.team.cvs.ui.updateSwitch"
+ handler="org.eclipse.team.internal.ccvs.ui.actions.UpdateAction"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.MergeAction"
+ commandId="org.eclipse.team.cvs.ui.merge"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.BranchAction"
+ commandId="org.eclipse.team.cvs.ui.branch"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.TagLocalAction"
+ commandId="org.eclipse.team.cvs.ui.tag"/>
+ <handlerSubmission
+ commandId="org.eclipse.team.cvs.ui.GenerateDiff"
+ handler="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.UpdateSilentAction"
+ commandId="org.eclipse.team.cvs.ui.update"/>
+ <handlerSubmission
+ commandId="org.eclipse.team.ui.synchronizeLast"
+ handler="org.eclipse.team.internal.ccvs.ui.actions.SyncAction"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.CheckoutWizardAction"
+ commandId="org.eclipse.team.cvs.ui.checkout"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.CompareWithRevisionAction"
+ commandId="org.eclipse.team.cvs.ui.compareWithRevision"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.CompareWithTagAction"
+ commandId="org.eclipse.team.ccvs.ui.compareWithTag"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.CompareWithRemoteAction"
+ commandId="org.eclipse.team.cvs.ui.compareWithRemote"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithTagAction"
+ commandId="org.eclipse.team.cvs.ui.replaceWithTag"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithRevisionAction"
+ commandId="org.eclipse.team.cvs.ui.replaceWithRevision"/>
+ <handlerSubmission
+ handler="org.eclipse.team.internal.ccvs.ui.actions.ReplaceWithRemoteAction"
+ commandId="org.eclipse.team.cvs.ui.replace"/>
</extension>
<!-- ********** Color and Font Definitions ************** -->
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 1408a89f2..71d315351 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
@@ -243,12 +243,11 @@ public class CVSLightweightDecorator extends LabelProvider implements ILightweig
private static void extractFileProperties(IFile resource, CVSDecoration cvsDecoration) throws CVSException {
ICVSFile file = CVSWorkspaceRoot.getCVSFileFor(resource);
ResourceSyncInfo fileInfo = file.getSyncInfo();
- KSubstOption option = KSubstOption.fromFile((IFile) resource);
+ KSubstOption option = KSubstOption.fromFile(resource);
if (fileInfo != null) {
cvsDecoration.setAdded(fileInfo.isAdded());
cvsDecoration.setRevision(fileInfo.getRevision());
cvsDecoration.setReadOnly(file.isReadOnly());
- ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile) resource);
cvsDecoration.setNeedsMerge(fileInfo.isNeedsMerge(file.getTimeStamp()));
option = fileInfo.getKeywordMode();
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
index d9cba7fbf..815e0de11 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPreferencesPage.java
@@ -59,6 +59,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
private Button determineVersionEnabled;
private Button confirmMoveTag;
private Button debugProtocol;
+ private Button autoRefreshTags;
private Button never;
private Button prompt;
@@ -171,6 +172,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
confirmMoveTag = createCheckBox(composite, Policy.bind("CVSPreferencePage.confirmMoveTag")); //$NON-NLS-1$
debugProtocol = createCheckBox(composite, Policy.bind("CVSPreferencePage.debugProtocol")); //$NON-NLS-1$
usePlatformLineend = createCheckBox(composite, Policy.bind("CVSPreferencePage.lineend")); //$NON-NLS-1$
+ autoRefreshTags = createCheckBox(composite, Policy.bind("CVSPreferencePage.autoRefreshTags")); //$NON-NLS-1$
createLabel(composite, ""); createLabel(composite, ""); //$NON-NLS-1$ //$NON-NLS-2$
@@ -239,6 +241,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
WorkbenchHelp.setHelp(repositoriesAreBinary, IHelpContextIds.PREF_TREAT_NEW_FILE_AS_BINARY);
WorkbenchHelp.setHelp(determineVersionEnabled, IHelpContextIds.PREF_DETERMINE_SERVER_VERSION);
WorkbenchHelp.setHelp(confirmMoveTag, IHelpContextIds.PREF_CONFIRM_MOVE_TAG);
+ WorkbenchHelp.setHelp(autoRefreshTags, IHelpContextIds.PREF_AUTOREFRESH_TAG);
Dialog.applyDialogFont(parent);
return composite;
}
@@ -297,6 +300,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
determineVersionEnabled.setSelection(store.getBoolean(ICVSUIConstants.PREF_DETERMINE_SERVER_VERSION));
confirmMoveTag.setSelection(store.getBoolean(ICVSUIConstants.PREF_CONFIRM_MOVE_TAG));
debugProtocol.setSelection(store.getBoolean(ICVSUIConstants.PREF_DEBUG_PROTOCOL));
+ autoRefreshTags.setSelection(store.getBoolean(ICVSUIConstants.PREF_AUTO_REFRESH_TAGS_IN_TAG_SELECTION_DIALOG));
initializeSaveRadios(store.getInt(ICVSUIConstants.PREF_SAVE_DIRTY_EDITORS));
}
@@ -340,6 +344,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
store.setValue(ICVSUIConstants.PREF_DETERMINE_SERVER_VERSION, determineVersionEnabled.getSelection());
store.setValue(ICVSUIConstants.PREF_CONFIRM_MOVE_TAG, confirmMoveTag.getSelection());
store.setValue(ICVSUIConstants.PREF_DEBUG_PROTOCOL, debugProtocol.getSelection());
+ store.setValue(ICVSUIConstants.PREF_AUTO_REFRESH_TAGS_IN_TAG_SELECTION_DIALOG, autoRefreshTags.getSelection());
CVSProviderPlugin.getPlugin().setReplaceUnmanaged(
store.getBoolean(ICVSUIConstants.PREF_REPLACE_UNMANAGED));
@@ -391,6 +396,7 @@ public class CVSPreferencesPage extends PreferencePage implements IWorkbenchPref
repositoriesAreBinary.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_REPOSITORIES_ARE_BINARY));
confirmMoveTag.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_CONFIRM_MOVE_TAG));
debugProtocol.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_DEBUG_PROTOCOL));
+ autoRefreshTags.setSelection(store.getDefaultBoolean(ICVSUIConstants.PREF_AUTO_REFRESH_TAGS_IN_TAG_SELECTION_DIALOG));
}
private void createSaveCombo(Composite composite) {
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 0818ffb2a..d91cc83f4 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
@@ -606,6 +606,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
store.setDefault(ICVSUIConstants.PREF_SHOW_COMPARE_REVISION_IN_DIALOG, false);
store.setDefault(ICVSUIConstants.PREF_SHOW_AUTHOR_IN_EDITOR, false);
store.setDefault(ICVSUIConstants.PREF_COMMIT_SET_DEFAULT_ENABLEMENT, false);
+ store.setDefault(ICVSUIConstants.PREF_AUTO_REFRESH_TAGS_IN_TAG_SELECTION_DIALOG, false);
PreferenceConverter.setDefault(store, ICVSUIConstants.PREF_CONSOLE_COMMAND_COLOR, new RGB(0, 0, 0));
PreferenceConverter.setDefault(store, ICVSUIConstants.PREF_CONSOLE_MESSAGE_COLOR, new RGB(0, 0, 255));
@@ -634,6 +635,7 @@ public class CVSUIPlugin extends AbstractUIPlugin {
store.setDefault(ICVSUIConstants.PREF_DEFAULT_PERSPECTIVE_FOR_SHOW_ANNOTATIONS, CVSPerspective.ID);
store.setDefault(ICVSUIConstants.PREF_CHANGE_PERSPECTIVE_ON_SHOW_ANNOTATIONS, MessageDialogWithToggle.PROMPT);
+ store.setDefault(ICVSUIConstants.PREF_ALLOW_EMPTY_COMMIT_COMMENTS, MessageDialogWithToggle.PROMPT);
// Set the watch/edit preferences defaults and values
store.setDefault(ICVSUIConstants.PREF_CHECKOUT_READ_ONLY, corePrefs.getDefaultBoolean(CVSProviderPlugin.READ_ONLY));
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CommitCommentArea.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CommitCommentArea.java
index 6bc55702a..abe0d7dea 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CommitCommentArea.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CommitCommentArea.java
@@ -11,225 +11,293 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui;
+import java.util.Observable;
+import java.util.Observer;
+
import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.*;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ui.SWTUtils;
import org.eclipse.team.internal.ui.dialogs.DialogArea;
/**
* This area provides the widgets for providing the CVS commit comment
*/
public class CommitCommentArea extends DialogArea {
+
+ private class TextBox implements ModifyListener, TraverseListener, FocusListener, Observer {
+
+ private final Text fTextField; // updated only by modify events
+ private final String fMessage;
+
+ private String fText;
+
+ public TextBox(Composite composite, String message, String initialText) {
+
+ fMessage= message;
+ fText= initialText;
+
+ fTextField = new Text(composite, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
+ fTextField.setLayoutData(SWTUtils.createHVFillGridData());
+
+ setText(initialText);
+
+ fTextField.addTraverseListener(this);
+ fTextField.addModifyListener(this);
+ fTextField.addFocusListener(this);
+ }
+
+ public void modifyText(ModifyEvent e) {
+ final String old = fText;
+ fText = fTextField.getText();
+ firePropertyChangeChange(COMMENT_MODIFIED, old, fText);
+ }
+
+ public void keyTraversed(TraverseEvent e) {
+ if (e.detail == SWT.TRAVERSE_RETURN && (e.stateMask & SWT.CTRL) != 0) {
+ e.doit = false;
+ firePropertyChangeChange(OK_REQUESTED, null, null);
+ }
+ }
+
+ public void focusGained(FocusEvent e) {
- private static final int WIDTH_HINT = 350;
- private static final int HEIGHT_HINT = 50;
-
- private Text text;
- private Combo previousCommentsCombo;
- private IProject mainProject;
- private String[] comments = new String[0];
- private String comment = ""; //$NON-NLS-1$
-
- public static final String OK_REQUESTED = "OkRequested";//$NON-NLS-1$
- public static final String COMMENT_MODIFIED = "CommentModified";//$NON-NLS-1$
- private String proposedComment;
-
- /**
- * Constructor for CommitCommentArea.
- * @param parentDialog
- * @param settings
- */
- public CommitCommentArea() {
- comments = CVSUIPlugin.getPlugin().getRepositoryManager().getPreviousComments();
- }
-
- /**
- * @see org.eclipse.team.internal.ccvs.ui.DialogArea#createArea(org.eclipse.swt.widgets.Composite)
- */
- public void createArea(Composite parent) {
- Dialog.applyDialogFont(parent);
- Composite composite = createGrabbingComposite(parent, 1);
- initializeDialogUnits(composite);
-
- Label label = new Label(composite, SWT.NULL);
- label.setLayoutData(new GridData());
- label.setText(Policy.bind("ReleaseCommentDialog.enterComment")); //$NON-NLS-1$
-
- text = new Text(composite, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = WIDTH_HINT;
- data.heightHint = HEIGHT_HINT;
-
- text.setLayoutData(data);
- text.selectAll();
- text.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
- if (e.detail == SWT.TRAVERSE_RETURN && (e.stateMask & SWT.CTRL) != 0) {
- e.doit = false;
- CommitCommentArea.this.signalCtrlEnter();
- }
- }
- });
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- String oldComment = comment;
- comment = text.getText();
- CommitCommentArea.this.signalCommentModified(oldComment, comment);
- }
- });
-
-
- label = new Label(composite, SWT.NULL);
- label.setLayoutData(new GridData());
- label.setText(Policy.bind("ReleaseCommentDialog.choosePrevious")); //$NON-NLS-1$
-
- previousCommentsCombo = new Combo(composite, SWT.READ_ONLY);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH;
- previousCommentsCombo.setLayoutData(data);
-
- // Initialize the values before we register any listeners so
- // we don't get any platform specific selection behavior
- // (see bug 32078: http://bugs.eclipse.org/bugs/show_bug.cgi?id=32078)
- initializeValues();
-
- previousCommentsCombo.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- int index = previousCommentsCombo.getSelectionIndex();
- if (index != -1)
- text.setText(comments[index]);
- }
- });
- }
+ if (fText.length() > 0)
+ return;
+
+ fTextField.removeModifyListener(this);
+ try {
+ fTextField.setText(fText);
+ } finally {
+ fTextField.addModifyListener(this);
+ }
+ }
+
+ public void focusLost(FocusEvent e) {
+
+ if (fText.length() > 0)
+ return;
+
+ fTextField.removeModifyListener(this);
+ try {
+ fTextField.setText(fMessage);
+ fTextField.selectAll();
+ } finally {
+ fTextField.addModifyListener(this);
+ }
+ }
+
+ public void setEnabled(boolean enabled) {
+ fTextField.setEnabled(enabled);
+ }
+
+ public void update(Observable o, Object arg) {
+ if (arg instanceof String) {
+ setText((String)arg); // triggers a modify event
+ }
+ }
+
+ public String getText() {
+ return fText;
+ }
+
+ private void setText(String text) {
+ if (text.length() == 0) {
+ fTextField.setText(fMessage);
+ fTextField.selectAll();
+ } else
+ fTextField.setText(text);
+ }
+ public void setFocus() {
+ fTextField.setFocus();
+ }
+ }
+
+ private static class ComboBox extends Observable implements SelectionListener, FocusListener {
+
+ private final String fMessage;
+ private final String [] fComments;
+ private final Combo fCombo;
+
+
+ public ComboBox(Composite composite, String message, String [] options) {
+
+ fMessage= message;
+ fComments= options;
+
+ fCombo = new Combo(composite, SWT.READ_ONLY);
+ fCombo.setLayoutData(SWTUtils.createHFillGridData());
+
+ // populate the previous comment list
+ fCombo.add(fMessage);
+ for (int i = 0; i < fComments.length; i++) {
+ fCombo.add(HistoryView.flattenText(fComments[i]));
+ }
+ fCombo.setText(fMessage);
+
+ // We don't want to have an initial selection
+ // (see bug 32078: http://bugs.eclipse.org/bugs/show_bug.cgi?id=32078)
+ fCombo.addFocusListener(this);
+ fCombo.addSelectionListener(this);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ final int index = fCombo.getSelectionIndex();
+ if (index > 0) {
+ setChanged();
+ notifyObservers(fComments[index - 1]);
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void focusGained(FocusEvent e) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.FocusListener#focusLost(org.eclipse.swt.events.FocusEvent)
+ */
+ public void focusLost(FocusEvent e) {
+ fCombo.removeSelectionListener(this);
+ try {
+ fCombo.setText(fMessage);
+ } finally {
+ fCombo.addSelectionListener(this);
+ }
+ }
+
+ public void setEnabled(boolean enabled) {
+ fCombo.setEnabled(enabled);
+ }
+ }
+
+ private static final String EMPTY_MESSAGE= Policy.bind("CommitCommentArea.0"); //$NON-NLS-1$
+ private static final String COMBO_MESSAGE= Policy.bind("CommitCommentArea.1"); //$NON-NLS-1$
+
+ public static final String OK_REQUESTED = "OkRequested";//$NON-NLS-1$
+ public static final String COMMENT_MODIFIED = "CommentModified";//$NON-NLS-1$
+
+ private TextBox fTextBox;
+ private ComboBox fComboBox;
+
+ private IProject fMainProject;
+ private String fProposedComment;
+ private Composite fComposite;
+
/**
- * Method initializeValues.
- */
- private void initializeValues() {
-
- // populate the previous comment list
- for (int i = 0; i < comments.length; i++) {
- previousCommentsCombo.add(HistoryView.flattenText(comments[i]));
- }
-
- // We don't want to have an initial selection
- // (see bug 32078: http://bugs.eclipse.org/bugs/show_bug.cgi?id=32078)
- previousCommentsCombo.setText(""); //$NON-NLS-1$
-
- // determine the initial comment text
- String initialComment = proposedComment;
- if (initialComment == null) {
- try {
- initialComment = getCommitTemplate();
- } catch (CVSException e) {
- CVSUIPlugin.log(e);
- }
- }
- if (initialComment != null && initialComment.length() != 0) {
- text.setText(initialComment);
- }
- }
-
- /**
- * Method signalCtrlEnter.
- */
- private void signalCtrlEnter() {
- firePropertyChangeChange(OK_REQUESTED, null, null);
- }
-
- protected void signalCommentModified(String oldValue, String comment) {
- firePropertyChangeChange(COMMENT_MODIFIED, oldValue, comment);
+ * @see org.eclipse.team.internal.ccvs.ui.DialogArea#createArea(org.eclipse.swt.widgets.Composite)
+ */
+ public void createArea(Composite parent) {
+ Dialog.applyDialogFont(parent);
+ initializeDialogUnits(parent);
+
+ fComposite = createGrabbingComposite(parent, 1);
+ initializeDialogUnits(fComposite);
+
+ fTextBox= new TextBox(fComposite, EMPTY_MESSAGE, getInitialComment());
+
+ final String [] comments = CVSUIPlugin.getPlugin().getRepositoryManager().getPreviousComments();
+ fComboBox= new ComboBox(fComposite, COMBO_MESSAGE, comments);
+
+ fComboBox.addObserver(fTextBox);
}
+
+ public String getComment(boolean save) {
+ final String comment= fTextBox.getText();
+ if (comment == null)
+ return ""; //$NON-NLS-1$
+
+ final String stripped= strip(comment);
+ if (save && comment.length() > 0)
+ CVSUIPlugin.getPlugin().getRepositoryManager().addComment(comment);
- private String getCommitTemplate() throws CVSException {
- CVSTeamProvider provider = getProvider();
- if (provider == null) return ""; //$NON-NLS-1$
- String template = provider.getCommitTemplate();
- if (template == null) template = ""; //$NON-NLS-1$
- return template;
- }
-
- /**
- * Method getProvider.
- */
- private CVSTeamProvider getProvider() {
- if (mainProject == null) return null;
- return (CVSTeamProvider) RepositoryProvider.getProvider(mainProject, CVSProviderPlugin.getTypeId());
- }
-
- /**
- * Return the entered comment
- *
- * @return the comment
- */
- public String[] getComments() {
- return comments;
- }
-
- /**
- * Returns the comment.
- * @return String
- */
- public String getComment() {
- if (comment != null && comment.length() > 0) finished();
- return comment;
- }
-
- /**
- * Method setProject.
- * @param iProject
- */
- public void setProject(IProject iProject) {
- this.mainProject = iProject;
- }
-
- private void finished() {
- // strip template from the comment entered
- try {
- String commitTemplate = getCommitTemplate();
- if (comment.startsWith(commitTemplate)) {
- comment = comment.substring(commitTemplate.length());
- } else if (comment.endsWith(commitTemplate)) {
- comment = comment.substring(0, comment.length() - commitTemplate.length());
- }
- } catch (CVSException e) {
- // we couldn't get the commit template. Log the error and continue
- CVSUIPlugin.log(e);
- }
- // if there is still a comment, remember it
- if (comment.length() > 0) {
- CVSUIPlugin.getPlugin().getRepositoryManager().addComment(comment);
- }
- }
-
- public void setFocus() {
- if (text != null) {
- text.setFocus();
- }
- }
-
+ return stripped;
+ }
+
+ public void setProject(IProject iProject) {
+ this.fMainProject = iProject;
+ }
+
+ public void setFocus() {
+ if (fTextBox != null) {
+ fTextBox.setFocus();
+ }
+ }
+
public void setProposedComment(String proposedComment) {
- this.proposedComment = proposedComment;
+ if (proposedComment == null || proposedComment.length() == 0) {
+ this.fProposedComment = null;
+ } else {
+ this.fProposedComment = proposedComment;
+ }
}
-
+
public boolean hasCommitTemplate() {
try {
- String commitTemplate = getCommitTemplate();
+ String commitTemplate = getCommitTemplate();
return commitTemplate != null && commitTemplate.length() > 0;
} catch (CVSException e) {
CVSUIPlugin.log(e);
return false;
}
}
+
+ public void setEnabled(boolean enabled) {
+ fTextBox.setEnabled(enabled);
+ fComboBox.setEnabled(enabled);
+ }
+
+ public Composite getComposite() {
+ return fComposite;
+ }
+
+ protected void firePropertyChangeChange(String property, Object oldValue, Object newValue) {
+ super.firePropertyChangeChange(property, oldValue, newValue);
+ }
+
+ private String getInitialComment() {
+ if (fProposedComment != null)
+ return fProposedComment;
+ try {
+ return getCommitTemplate();
+ } catch (CVSException e) {
+ CVSUIPlugin.log(e);
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ private String strip(String comment) {
+ // strip template from the comment entered
+ try {
+ final String commitTemplate = getCommitTemplate();
+ if (comment.startsWith(commitTemplate)) {
+ return comment.substring(commitTemplate.length());
+ } else if (comment.endsWith(commitTemplate)) {
+ return comment.substring(0, comment.length() - commitTemplate.length());
+ }
+ } catch (CVSException e) {
+ // we couldn't get the commit template. Log the error and continue
+ CVSUIPlugin.log(e);
+ }
+ return comment;
+ }
+
+ private CVSTeamProvider getProvider() {
+ if (fMainProject == null) return null;
+ return (CVSTeamProvider) RepositoryProvider.getProvider(fMainProject, CVSProviderPlugin.getTypeId());
+ }
- public void setEnabled(boolean b) {
- text.setEnabled(b);
- previousCommentsCombo.setEnabled(b);
+ private String getCommitTemplate() throws CVSException {
+ CVSTeamProvider provider = getProvider();
+ if (provider == null)
+ return ""; //$NON-NLS-1$
+ final String template = provider.getCommitTemplate();
+ return template != null ? template : ""; //$NON-NLS-1$
}
}
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 8ac63fa4d..b12080467 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
@@ -91,6 +91,7 @@ public interface ICVSUIConstants {
public final String PREF_SHOW_COMPARE_REVISION_IN_DIALOG = "pref_show_compare_revision_in_dialog"; //$NON-NLS-1$
public final String PREF_SHOW_AUTHOR_IN_EDITOR = "pref_show_author_in_editor"; //$NON-NLS-1$
public final String PREF_COMMIT_SET_DEFAULT_ENABLEMENT = "pref_enable_commit_sets"; //$NON-NLS-1$
+ public final String PREF_AUTO_REFRESH_TAGS_IN_TAG_SELECTION_DIALOG = "pref_auto_refresh_tags_in_tag_selection_dialog"; //$NON-NLS-1$
// console preferences
public final String PREF_CONSOLE_COMMAND_COLOR = "pref_console_command_color"; //$NON-NLS-1$
@@ -135,6 +136,8 @@ public interface ICVSUIConstants {
public final String PREF_CHANGE_PERSPECTIVE_ON_SHOW_ANNOTATIONS= "pref_change_perspective_on_show_annotations"; //$NON-NLS-1$
public final String PREF_DEFAULT_PERSPECTIVE_FOR_SHOW_ANNOTATIONS= "pref_default_perspective_for_show_annotations"; //$NON-NLS-1$
+ public final String PREF_ALLOW_EMPTY_COMMIT_COMMENTS= "pref_allow_empty_commit_comment"; //$NON-NLS-1$
+
// Wizard banners
public final String IMG_WIZBAN_SHARE = "wizban/newconnect_wizban.gif"; //$NON-NLS-1$
public final String IMG_WIZBAN_MERGE = "wizban/mergestream_wizban.gif"; //$NON-NLS-1$
@@ -166,5 +169,20 @@ public interface ICVSUIConstants {
public final int OPTION_AUTOMATIC = 3;
public final String OPTION_NO_PERSPECTIVE= "none"; //$NON-NLS-1$
+
+ // Command Ids
+ public final String CMD_COMMIT = "org.eclipse.team.cvs.ui.commit"; //$NON-NLS-1$
+ public final String CMD_SYNCHRONIZE = "org.eclipse.team.ui.synchronizeLast"; //$NON-NLS-1$
+ public final String CMD_UPDATE = "org.eclipse.team.cvs.ui.update"; //$NON-NLS-1$
+ public final String CMD_CREATEPATCH = "org.eclipse.team.cvs.ui.GenerateDiff"; //$NON-NLS-1$
+ public final String CMD_TAGASVERSION = "org.eclipse.team.cvs.ui.tag"; //$NON-NLS-1$
+ public final String CMD_BRANCH = "org.eclipse.team.cvs.ui.branch"; //$NON-NLS-1$
+ public final String CMD_MERGE = "org.eclipse.team.cvs.ui.merge"; //$NON-NLS-1$
+ public final String CMD_UPDATESWITCH = "org.eclipse.team.cvs.ui.updateSwitch"; //$NON-NLS-1$
+ public final String CMD_SETFILETYPE = "org.eclipse.team.cvs.ui.setKeywordSubstitution"; //$NON-NLS-1$
+ public final String CMD_ANNOTATE = "org.eclipse.team.cvs.ui.showAnnotation"; //$NON-NLS-1$
+ public final String CMD_HISTORY = "org.eclipse.team.cvs.ui.showHistory"; //$NON-NLS-1$
+ public final String CMD_ADD = "org.eclipse.team.cvs.ui.add"; //$NON-NLS-1$
+ public final String CMD_IGNORE = "org.eclipse.team.cvs.ui.ignore"; //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java
index 5088907cd..7bedf0720 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/IHelpContextIds.java
@@ -86,6 +86,7 @@ public interface IHelpContextIds {
public static final String PREF_TREAT_NEW_FILE_AS_BINARY = PREFIX + "treat_new_files_as_binary_pref"; //$NON-NLS-1$
public static final String PREF_DETERMINE_SERVER_VERSION = PREFIX + "determine_server_version"; //$NON-NLS-1$
public static final String PREF_CONFIRM_MOVE_TAG = PREFIX + "confirm_move_tag"; //$NON-NLS-1$
+ public static final String PREF_AUTOREFRESH_TAG = PREFIX + "auto_refresh_tag"; //$NON-NLS-1$
public static final String CONSOLE_PREFERENCE_PAGE = PREFIX + "console_preference_page_context"; //$NON-NLS-1$
public static final String EXT_PREFERENCE_PAGE = PREFIX + "ext_preference_page_context"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java
index c92c5b583..9e6164ffb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java
@@ -32,6 +32,9 @@ public class ReleaseCommentDialog extends DetailsDialog {
CommitCommentArea commitCommentArea;
// dialogs settings that are persistent between workbench sessions
private IDialogSettings settings;
+
+ private static final int DEFAULT_WIDTH_IN_CHARS= 80;
+
private static final String HEIGHT_KEY = "width-key"; //$NON-NLS-1$
private static final String WIDTH_KEY = "height-key"; //$NON-NLS-1$
@@ -98,19 +101,18 @@ public class ReleaseCommentDialog extends DetailsDialog {
* @see org.eclipse.jface.window.Window#getInitialSize()
*/
protected Point getInitialSize() {
- int width, height;
try {
- height = settings.getInt(HEIGHT_KEY);
- width = settings.getInt(WIDTH_KEY);
+ return new Point(settings.getInt(WIDTH_KEY), settings.getInt(HEIGHT_KEY));
} catch(NumberFormatException e) {
- return super.getInitialSize();
+ final Point size= super.getInitialSize();
+ size.x= convertWidthInCharsToPixels(DEFAULT_WIDTH_IN_CHARS);
+ size.y += convertHeightInCharsToPixels(8);
+ return size;
}
- Point p = super.getInitialSize();
- return new Point(width, p.y);
}
public String getComment() {
- return commitCommentArea.getComment();
+ return commitCommentArea.getComment(true);
}
public IResource[] getResourcesToCommit() {
@@ -127,7 +129,7 @@ public class ReleaseCommentDialog extends DetailsDialog {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.dialogs.DetailsDialog#updateEnablements()
*/
- protected void updateEnablements() {
+ protected void updateEnablements() {
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java
index b97a9bf55..05a660082 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkInProgressPreferencePage.java
@@ -16,20 +16,14 @@ import java.util.Comparator;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.RadioGroupFieldEditor;
+import org.eclipse.jface.preference.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.team.internal.ui.preferences.ComboFieldEditor;
-import org.eclipse.ui.IPerspectiveDescriptor;
-import org.eclipse.ui.IPerspectiveRegistry;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.*;
public class WorkInProgressPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
@@ -47,8 +41,6 @@ public class WorkInProgressPreferencePage extends FieldEditorPreferencePage impl
}
}
- private RadioGroupFieldEditor synchronizePerspectiveSwitch;
-
public WorkInProgressPreferencePage() {
super(GRID);
setTitle(Policy.bind("WorkInProgressPreferencePage.0")); //$NON-NLS-1$
@@ -61,7 +53,7 @@ public class WorkInProgressPreferencePage extends FieldEditorPreferencePage impl
*/
public void createFieldEditors() {
- synchronizePerspectiveSwitch= new RadioGroupFieldEditor(
+ addField(new RadioGroupFieldEditor(
ICVSUIConstants.PREF_CHANGE_PERSPECTIVE_ON_SHOW_ANNOTATIONS,
Policy.bind("WorkInProgressPreferencePage.7"), //$NON-NLS-1$
3,
@@ -70,8 +62,10 @@ public class WorkInProgressPreferencePage extends FieldEditorPreferencePage impl
{Policy.bind("WorkInProgressPreferencePage.2"), MessageDialogWithToggle.NEVER}, //$NON-NLS-1$
{Policy.bind("WorkInProgressPreferencePage.3"), MessageDialogWithToggle.PROMPT} //$NON-NLS-1$
},
- getFieldEditorParent(), true);
- addField(synchronizePerspectiveSwitch);
+ getFieldEditorParent(), true));
+
+
+
final Group perspectiveGroup = createGroup(
getFieldEditorParent(),
@@ -87,9 +81,21 @@ public class WorkInProgressPreferencePage extends FieldEditorPreferencePage impl
perspectiveGroup);
addField(comboEditor);
- Dialog.applyDialogFont(getFieldEditorParent());
+ addField(new RadioGroupFieldEditor(
+ ICVSUIConstants.PREF_ALLOW_EMPTY_COMMIT_COMMENTS,
+ "&Allow empty commit comments:", //$NON-NLS-1$
+ 3,
+ new String[][] {
+ { "Yes", MessageDialogWithToggle.ALWAYS}, //$NON-NLS-1$
+ { "No", MessageDialogWithToggle.NEVER}, //$NON-NLS-1$
+ { "Prompt", MessageDialogWithToggle.PROMPT} //$NON-NLS-1$
+ },
+ getFieldEditorParent(), true));
+
updateLayout(perspectiveGroup);
getFieldEditorParent().layout(true);
+
+ Dialog.applyDialogFont(getFieldEditorParent());
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java
index ba4c47376..1976d54b8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/WorkbenchUserAuthenticator.java
@@ -65,11 +65,19 @@ public class WorkbenchUserAuthenticator implements IUserAuthenticator {
allowCaching[0] = promptForPassword(location, userinfo.getUsername(), message, userinfo.isUsernameMutable(), result);
} else {
// sync exec in default thread
+ final CVSException[] exception = new CVSException[] { null };
Display.getDefault().syncExec(new Runnable() {
public void run() {
- allowCaching[0] = promptForPassword(location, userinfo.getUsername(), message, userinfo.isUsernameMutable(), result);
+ try {
+ allowCaching[0] = promptForPassword(location, userinfo.getUsername(), message, userinfo.isUsernameMutable(), result);
+ } catch (CVSException e) {
+ exception[0] = e;
+ }
}
});
+ if (exception[0] != null) {
+ throw exception[0];
+ }
}
if (result[0] == null) {
@@ -102,11 +110,12 @@ public class WorkbenchUserAuthenticator implements IUserAuthenticator {
* @param message a message to display to the user
* @param userMutable whether the user can be changed in the dialog
* @param result a String array of length two in which to put the result
+ * @throws CVSException
*/
- private boolean promptForPassword(final ICVSRepositoryLocation location, final String username, final String message, final boolean userMutable, final String[] result) {
+ private boolean promptForPassword(final ICVSRepositoryLocation location, final String username, final String message, final boolean userMutable, final String[] result) throws CVSException {
Shell shell = Utils.findShell();
if(shell == null) {
- return false;
+ throw new CVSException(Policy.bind("WorkbenchUserAuthenticator.0")); //$NON-NLS-1$
}
String domain = location == null ? null : location.getLocation();
UserValidationDialog dialog = new UserValidationDialog(shell, domain, (username==null)?"":username, message);//$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java
index bf6dcc4d4..98b38c44c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/AddAction.java
@@ -18,6 +18,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.operations.AddOperation;
@@ -91,4 +92,10 @@ public class AddAction extends WorkspaceTraversalAction {
return super.isEnabledForCVSResource(cvsResource);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getId()
+ */
+ public String getId() {
+ return ICVSUIConstants.CMD_ADD;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java
index 03a652a07..057fdceea 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/BranchAction.java
@@ -13,6 +13,7 @@ package org.eclipse.team.internal.ccvs.ui.actions;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.jface.action.IAction;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.operations.BranchOperation;
/**
@@ -27,6 +28,12 @@ public class BranchAction extends WorkspaceTraversalAction {
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
new BranchOperation(getTargetPart(), getCVSResourceMappings()).run();
}
-
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getId()
+ */
+ public String getId() {
+ return ICVSUIConstants.CMD_BRANCH;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
index 5a9b337a3..4c02e74f1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java
@@ -11,45 +11,33 @@
package org.eclipse.team.internal.ccvs.ui.actions;
import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
+import java.util.*;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.*;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.dialogs.*;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSStatus;
-import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
-import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
-import org.eclipse.team.internal.ccvs.core.ICVSResource;
-import org.eclipse.team.internal.ccvs.core.ILogEntry;
+import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
-import org.eclipse.team.internal.ccvs.ui.AvoidableMessageDialog;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.actions.TeamAction;
import org.eclipse.team.internal.ui.dialogs.IPromptCondition;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.*;
+import org.eclipse.ui.actions.RetargetAction;
+import org.eclipse.ui.commands.*;
+import org.eclipse.ui.commands.ExecutionException;
+import org.eclipse.ui.commands.IHandlerListener;
import org.eclipse.ui.ide.IDE;
/**
@@ -57,17 +45,75 @@ import org.eclipse.ui.ide.IDE;
* facilities for enablement handling, standard error handling, selection
* retrieval and prompting.
*/
-abstract public class CVSAction extends TeamAction implements IEditorActionDelegate {
+abstract public class CVSAction extends TeamAction implements IEditorActionDelegate, IHandler {
private List accumulatedStatus = new ArrayList();
+ private RetargetAction retargetAction;
+ private IAction action;
+
+ public CVSAction() {
+ super();
+ }
/**
+ * Initializes a retarget action that will listen to part changes and allow parts to
+ * override this action's behavior. The retarget action is used if this
+ * action is shown in a top-level menu or toolbar.
+ * @param window the workbench window showing this action
+ * @since 3.1
+ */
+ private void initializeRetargetAction(IWorkbenchWindow window) {
+ // Don't need to specify a the title because it will use this actions
+ // title instead.
+ retargetAction = new RetargetAction(getId(), ""); //$NON-NLS-1$
+ retargetAction.addPropertyChangeListener(new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if (event.getProperty().equals(IAction.ENABLED)) {
+ Object val = event.getNewValue();
+ if (val instanceof Boolean && action != null) {
+ action.setEnabled(((Boolean) val).booleanValue());
+ }
+ } else if (event.getProperty().equals(IAction.CHECKED)) {
+ Object val = event.getNewValue();
+ if (val instanceof Boolean && action != null) {
+ action.setChecked(((Boolean) val).booleanValue());
+ }
+ } else if (event.getProperty().equals(IAction.TEXT)) {
+ Object val = event.getNewValue();
+ if (val instanceof String && action != null) {
+ action.setText((String) val);
+ }
+ } else if (event.getProperty().equals(IAction.TOOL_TIP_TEXT)) {
+ Object val = event.getNewValue();
+ if (val instanceof String && action != null) {
+ action.setToolTipText((String) val);
+ }
+ } else if (event.getProperty().equals(SubActionBars.P_ACTION_HANDLERS)) {
+ if(action != null) {
+ action.setEnabled(retargetAction.isEnabled());
+ }
+ }
+ }
+ });
+ window.getPartService().addPartListener(retargetAction);
+ IWorkbenchPart activePart = window.getPartService().getActivePart();
+ if (activePart != null)
+ retargetAction.partActivated(activePart);
+ }
+
+ /**
* Common run method for all CVS actions.
*/
final public void run(IAction action) {
try {
- if (!beginExecution(action)) return;
- execute(action);
+ if (!beginExecution(action)) return;
+ // If the action has been replaced by another handler, then
+ // call that one instead.
+ if(retargetAction != null && retargetAction.getActionHandler() != null) {
+ retargetAction.run();
+ } else {
+ execute(action);
+ }
endExecution();
} catch (InvocationTargetException e) {
// Handle the exception and any accumulated errors
@@ -80,6 +126,54 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg
handle(e);
}
}
+
+ /**
+ * Return the command and retarget action id for this action. This is used to
+ *match retargetable actions and allow keybindings.
+ *
+ * @return the id for this action
+ * @since 3.1
+ */
+ public String getId() {
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * Called when this action is added to a top-level menu or toolbar (e.g. IWorkbenchWindowDelegate)
+ * @since 3.1
+ */
+ public void init(IWorkbenchWindow window) {
+ super.init(window);
+ initializeRetargetAction(window);
+ }
+
+ protected boolean isEnabled() throws TeamException {
+ if(retargetAction != null && retargetAction.getActionHandler() != null) {
+ return retargetAction.isEnabled();
+ }
+ // don't know so let subclasses decide
+ return false;
+ }
+
+ public void dispose() {
+ super.dispose();
+ getWindow().getPartService().removePartListener(retargetAction);
+ retargetAction.dispose();
+ retargetAction = null;
+ }
+
+ public void selectionChanged(final IAction action, ISelection selection) {
+ super.selectionChanged(action, selection);
+ this.action = action;
+ }
+
+ protected void setActionEnablement(IAction action) {
+ if(retargetAction != null && retargetAction.getActionHandler() != null) {
+ action.setEnabled(retargetAction.isEnabled());
+ } else {
+ super.setActionEnablement(action);
+ }
+ }
/**
* This method gets invoked before the <code>CVSAction#execute(IAction)</code>
@@ -478,6 +572,72 @@ abstract public class CVSAction extends TeamAction implements IEditorActionDeleg
return Utils.getResources(selection.toArray());
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
+ */
public void setActiveEditor(IAction action, IEditorPart targetEditor) {
}
+
+ /**
+ * This method is called by the platform UI framework when a command is run for
+ * which this action is the handler. The handler doesn't have an explicit context, for
+ * example unlike a view, editor, or workenchwindow actions, they are not initialized
+ * with a part. As a result when the action is run it will use the selection service
+ * to determine to elements on which to perform the action.
+ * <p>
+ * CVS actions should ensure that they can run without a proxy action. Meaning that
+ * <code>selectionChanged</code> and <code>run</code> should support passing
+ * <code>null</code> as the IAction parameter.
+ * </p>
+ * @param parameterValuesByName
+ * @return
+ * @throws ExecutionException
+ */
+ public Object execute(Map parameterValuesByName) throws ExecutionException {
+ try {
+ IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if(activeWorkbenchWindow!= null) {
+ IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
+ if(activePage!= null) {
+ // Prime the action with the selection
+ selectionChanged((IAction)null, activePage.getSelection());
+ // Safe guard to ensure that the action is only run when enabled.
+ if(isEnabled()) {
+ execute((IAction)null);
+ } else {
+ MessageDialog.openInformation(activeWorkbenchWindow.getShell(),
+ Policy.bind("CVSAction.handlerNotEnabledTitle"), //$NON-NLS-1$
+ Policy.bind("CVSAction.handlerNotEnabledMessage")); //$NON-NLS-1$
+ }
+ }
+ }
+ } catch (InvocationTargetException e) {
+ throw new ExecutionException(Policy.bind("CVSAction.errorTitle"), e); //$NON-NLS-1$
+ } catch (InterruptedException e) {
+ throw new ExecutionException(Policy.bind("CVSAction.errorTitle"), e); //$NON-NLS-1$
+ } catch (TeamException e) {
+ throw new ExecutionException(Policy.bind("CVSAction.errorTitle"), e); //$NON-NLS-1$
+ }
+ return Boolean.TRUE;
+ }
+
+ /**
+ * No-op. These handlers don't have any interesting properties.
+ * @return an empty attribute map
+ * @since 3.1
+ */
+ public Map getAttributeValuesByName() {
+ return new HashMap();
+ }
+
+ /**
+ * No-op. These handlers won't have any interesting property changes. There is
+ * no need to notify listeners.
+ * @param handlerListener
+ * @since 3.1
+ */
+ public void removeHandlerListener(IHandlerListener handlerListener) {
+ }
+ public void addHandlerListener(IHandlerListener handlerListener) {
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutWizardAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutWizardAction.java
index 036b22c2a..a25213289 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutWizardAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CheckoutWizardAction.java
@@ -10,45 +10,54 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.actions;
+import java.lang.reflect.InvocationTargetException;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.ui.wizards.CheckoutWizard;
import org.eclipse.ui.*;
/**
* Action that launches the checkout wizard
*/
-public class CheckoutWizardAction implements IWorkbenchWindowActionDelegate {
+public class CheckoutWizardAction extends CVSAction implements IWorkbenchWindowActionDelegate {
Shell shell;
- /**
- * @see IWorkbenchWindowActionDelegate#dispose()
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate2#dispose()
*/
public void dispose() {
}
- /**
- * @see IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
public void init(IWorkbenchWindow window) {
this.shell = window.getShell();
}
-
- /**
- * @see IActionDelegate#run(IAction)
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#execute(org.eclipse.jface.action.IAction)
*/
- public void run(IAction action) {
+ protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
CheckoutWizard wizard = new CheckoutWizard();
WizardDialog dialog = new WizardDialog(shell, wizard);
dialog.open();
}
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
}
-}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ui.actions.TeamAction#isEnabled()
+ */
+ protected boolean isEnabled() throws TeamException {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CommitAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CommitAction.java
index 91681fef9..d8bf04e80 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CommitAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CommitAction.java
@@ -2,7 +2,7 @@
* 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
+ * which accocmpanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
@@ -12,12 +12,12 @@ package org.eclipse.team.internal.ccvs.ui.actions;
import java.lang.reflect.InvocationTargetException;
-import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.operations.CommitOperation;
+import org.eclipse.team.internal.ccvs.ui.wizards.CommitWizard;
/**
* Action for checking in files to a CVS provider.
@@ -29,19 +29,14 @@ public class CommitAction extends WorkspaceTraversalAction {
* @see CVSAction#execute(IAction)
*/
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
- final CommitOperation operation = new CommitOperation(getTargetPart(), getCVSResourceMappings(), null);
- final boolean[] retVal = {true};
- run(new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- retVal[0] = operation.performPrompting(monitor);
- } catch (CVSException e) {
- new InvocationTargetException(e);
- }
- }
- }, false, PROGRESS_BUSYCURSOR);
- if(retVal[0])
- operation.run();
+
+ try {
+ final IResource [] resources= getSelectedResources();
+ CommitWizard.run(shell, resources);
+
+ } catch (CVSException e) {
+ throw new InvocationTargetException(e);
+ }
}
/**
@@ -64,4 +59,11 @@ public class CommitAction extends WorkspaceTraversalAction {
protected boolean isEnabledForNonExistantResources() {
return true;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getId()
+ */
+ public String getId() {
+ return ICVSUIConstants.CMD_COMMIT;
+}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java
index 21197ffe1..1ee17e8bb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/GenerateDiffFileAction.java
@@ -13,6 +13,7 @@ package org.eclipse.team.internal.ccvs.ui.actions;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.wizards.GenerateDiffFileWizard;
@@ -54,5 +55,11 @@ public class GenerateDiffFileAction extends WorkspaceAction {
protected boolean isEnabledForUnmanagedResources() {
return true;
}
-
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getId()
+ */
+ public String getId() {
+ return ICVSUIConstants.CMD_CREATEPATCH;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java
index a082354ad..885a3dad2 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java
@@ -21,6 +21,7 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.IgnoreResourcesDialog;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation;
@@ -133,4 +134,10 @@ public class IgnoreAction extends WorkspaceTraversalAction {
return false;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getId()
+ */
+ public String getId() {
+ return ICVSUIConstants.CMD_IGNORE;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/MergeAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/MergeAction.java
index 795c1c833..32cd41fd3 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/MergeAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/MergeAction.java
@@ -13,6 +13,7 @@ package org.eclipse.team.internal.ccvs.ui.actions;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.wizards.MergeWizard;
public class MergeAction extends WorkspaceAction {
@@ -30,5 +31,11 @@ public class MergeAction extends WorkspaceAction {
}
});
}
-
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getId()
+ */
+ public String getId() {
+ return ICVSUIConstants.CMD_MERGE;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SetKeywordSubstitutionAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SetKeywordSubstitutionAction.java
index dffb82f44..d33865e74 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SetKeywordSubstitutionAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SetKeywordSubstitutionAction.java
@@ -14,6 +14,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.ResizableWizardDialog;
import org.eclipse.team.internal.ccvs.ui.wizards.KSubstWizard;
@@ -36,4 +37,7 @@ public class SetKeywordSubstitutionAction extends WorkspaceAction {
previousOption = wizard.getKSubstOption();
}
+ public String getId() {
+ return ICVSUIConstants.CMD_SETFILETYPE;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
index e7e190b74..f7ae57c3c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java
@@ -20,6 +20,7 @@ import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.listeners.LogEntry;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.operations.ShowAnnotationOperation;
@@ -127,4 +128,8 @@ public class ShowAnnotationAction extends WorkspaceAction {
}
return info.getRevision();
}
+
+ public String getId() {
+ return ICVSUIConstants.CMD_ANNOTATE;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java
index dbd91c537..81a74c429 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java
@@ -18,6 +18,7 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
+import org.eclipse.team.internal.ccvs.ui.*;
import org.eclipse.team.internal.ccvs.ui.HistoryView;
import org.eclipse.team.internal.ccvs.ui.Policy;
@@ -73,4 +74,10 @@ public class ShowResourceInHistoryAction extends WorkspaceAction {
return (!cvsResource.isFolder() && super.isEnabledForCVSResource(cvsResource));
}
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getId()
+ */
+ public String getId() {
+ return ICVSUIConstants.CMD_HISTORY;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
index 14acbc3b1..481798ff0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/SyncAction.java
@@ -23,6 +23,7 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceSynchronizeParticipant;
import org.eclipse.team.internal.ui.Utils;
@@ -107,4 +108,8 @@ public class SyncAction extends WorkspaceAction {
protected boolean isEnabledForCVSResource(ICVSResource cvsResource) throws CVSException {
return (super.isEnabledForCVSResource(cvsResource) || (cvsResource.getParent().isCVSFolder() && !cvsResource.isIgnored()));
}
+
+ public String getId() {
+ return ICVSUIConstants.CMD_SYNCHRONIZE;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagLocalAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagLocalAction.java
index 6ae21b515..a32054162 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagLocalAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/TagLocalAction.java
@@ -14,6 +14,7 @@ import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.operations.ITagOperation;
import org.eclipse.team.internal.ccvs.ui.operations.TagOperation;
@@ -44,4 +45,11 @@ public class TagLocalAction extends TagAction {
mappings = getCVSResourceMappings();
return new TagOperation(getTargetPart(), mappings);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.actions.CVSAction#getId()
+ */
+ public String getId() {
+ return ICVSUIConstants.CMD_TAGASVERSION;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateAction.java
index aeaa0cb99..a5e671211 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateAction.java
@@ -14,6 +14,7 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.wizards.UpdateWizard;
/**
@@ -33,4 +34,7 @@ public class UpdateAction extends UpdateSilentAction {
dialog.open();
}
+ public String getId() {
+ return ICVSUIConstants.CMD_UPDATESWITCH;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateSilentAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateSilentAction.java
index 0d54e98d2..39cdc0573 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateSilentAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/UpdateSilentAction.java
@@ -13,6 +13,7 @@ package org.eclipse.team.internal.ccvs.ui.actions;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.jface.action.IAction;
import org.eclipse.team.internal.ccvs.core.client.Command;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.operations.UpdateOperation;
/**
@@ -39,4 +40,8 @@ public class UpdateSilentAction extends WorkspaceTraversalAction {
public void execute(IAction action) throws InterruptedException, InvocationTargetException {
new UpdateOperation(getTargetPart(), getCVSResourceMappings(), Command.NO_LOCAL_OPTIONS, null /* no tag */).run();
}
+
+ public String getId() {
+ return ICVSUIConstants.CMD_UPDATE;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
index 35c6a715e..c5e017fb0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/WorkspaceAction.java
@@ -280,6 +280,10 @@ public abstract class WorkspaceAction extends CVSAction {
*/
protected boolean isEnabled() throws TeamException {
+ // allow the super to decide enablement. if the super doesn't know it will return false.
+ boolean enabled = super.isEnabled();
+ if(enabled) return true;
+
// invoke the inherited method so that overlaps are maintained
IResource[] resources = getSelectedResourcesWithOverlap();
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index 15eeb5723..51a83afd1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -79,6 +79,8 @@ CVSAction.warningTitle=Warnings occurred
CVSAction.multipleProblemsMessage=Multiple problems occurred:
CVSAction.mixingTagsTitle=Confirm Mixing Tags
CVSAction.mixingTags=You are mixing tags within a project. Beware that synchronization uses the tag information associated with each resource to determine the remote resource with which the local resource is compared. \n\nThis means that the part(s) of your project that you are replacing with another tag will be synchronized with the tag ''{0}'' while other resources in the project will be synchronized with another tag. \n\nDo you wish to continue?
+CVSAction.handlerNotEnabledTitle=Warning
+CVSAction.handlerNotEnabledMessage=The action doesn't apply to the current selection.
CVSAnnotateView.showFileAnnotation=CVS Annotate - {0}
CVSAnnotateView.viewInstructions=This view shows annotations for a file in CVS. Select a file and then choose \"Team->Show Annotation\" from the context menu.
@@ -222,6 +224,7 @@ CVSPreferencePage.level7=7
CVSPreferencePage.level8=8
CVSPreferencePage.level9=9 (highest compression)
CVSPreferencePage.lineend=Con&vert text files to use platform line ending
+CVSPreferencePage.autoRefreshTags=R&efresh tags when comparing or replacing tags from another branch or version
CVSPreferencePage.Save_dirty_editors_before_CVS_operations_1=Save dirty editors before CVS operations
CVSPreferencePage.&Never_2=&Never
CVSPreferencePage.&Prompt_3=P&rompt
@@ -278,6 +281,13 @@ CVSAction.refreshQuestion={0} Would you like to refresh project ''{1}''?
CVSAction.refreshMultipleQuestion={0} Would you like to refresh the projects of the selected resources?
CommitAction.commitFailed=Problems encountered performing commit
+CommitWizardCommitPage.0=Commit
+CommitWizardCommitPage.2=Enter a comment for the commit operation.
+CommitWizardCommitPage.3=Please enter a commit comment\!
+CommitWizardCommitPage.4=Conflicting changes cannot be commited. Either exclude them from the commit or use the synchronize view to resolve the conflicts.
+CommitWizardFileTypePage.0=Add Resources
+CommitWizardFileTypePage.2=Unknown new files detected.
+CommitWizardFileTypePage.3=New files with the following unknown names or extensions have been detected in the workspace. Please specify whether these files should be stored as text or binary and whether this decision should be remembered.
CommitSyncAction.questionRelease=You have changes that conflict with the server. Release those changes?
CommitSyncAction.titleRelease=Confirm Overwrite
@@ -684,6 +694,7 @@ KeyboardInteractiveDialog.labelRepository=Enter values for the following reposit
VersionsElement.versions=Versions
WorkbenchUserAuthenticator.cancelled=Operation cancelled because login cancelled
+WorkbenchUserAuthenticator.0=An attempt to prompt for user authentication information has failed.
WorkbenchUserAuthenticator.errorFlushing=Error occurred while flushing password for {0}
WorkbenchUserAuthenticator.errorSaving=Error occurred while saving password for {0}
@@ -728,6 +739,14 @@ TagSelectionDialog.Select_a_Tag_1=&Select a branch or version
TagSelectionDialog.recurseOption=Recurse into sub-&folders
TagSelectionDialog.0=&Add Date...
TagSelectionDialog.1=&Remove
+TagSelectionDialog.2=No Tags Found
+TagSelectionDialog.3=Perform Deep Search
+TagSelectionDialog.4=Configure Manually
+TagSelectionDialog.5=Cancel
+TagSelectionDialog.6=Tags were not found for {0} using the auto-refresh files and a shallow cvs log operation. You can choose to search using a deep cvs log operation, to manually configure the tags or to cancel.
+TagSelectionDialog.7=Refreshing tags
+TagSelectionDialog.8=Error refreshing tags
+
TagSelectionArea.0=&Matching tags:
TagSelectionArea.1={0}:
TagSelectionArea.2={0} (? = any character, * = any String):
@@ -1100,6 +1119,8 @@ UpdateAction.jobName=CVS Update
MergeUpdateAction.jobName=CVS Merge
MergeUpdateAction.invalidSubscriber=Invalid subscriber: {0}
CommitAction.jobName=CVS Commit
+CommitCommentArea.0=<Click here to enter a commit comment>
+CommitCommentArea.1=<Choose a previously entered comment>
OverrideAndUpdateAction.jobName=Performing CVS Override and Update on {0} resources
WorkInProgressPreferencePage.0=CVS Work In Progress
WorkInProgressPreferencePage.1=Preferences for enabling features that are not complete:
@@ -1304,6 +1325,14 @@ CommitOperation.0=Committing {0}
CommitSetDialog.0=&Name:
CommitSetDialog.2=Use the &title as the commit comment
CommitSetDialog.3=Enter a commit &comment
+CommitWizard.0=Comitting resources
+CommitWizard.1=Comitting resources
+CommitWizard.2=Commit files
+CommitWizard.3=Empty commit comment
+CommitWizard.4=The commit comment is empty. Are you sure you would like to continue with an empty comment?
+CommitWizard.5=Remember decision?
+CommitWizard.6=Nothing to Commit
+CommitWizard.7=The selected resouces do not contain any changes.
UpdateOperation.0=Updating {0}
ReplaceOperation.0=Replacing {0}
TagOperation.0=Tagging {0}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java
index 6ce15fce0..52b8957b5 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/AddOperation.java
@@ -15,6 +15,7 @@ import java.util.*;
import org.eclipse.core.resources.*;
import org.eclipse.core.resources.mapping.ResourceMapping;
import org.eclipse.core.runtime.*;
+import org.eclipse.team.core.Team;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.Command;
@@ -30,15 +31,29 @@ import org.eclipse.ui.IWorkbenchPart;
* Performs a "cvs add"
*/
public class AddOperation extends RepositoryProviderOperation {
+
+ private Map fModesForExtensions;
+ private Map fModesForFiles;
public AddOperation(IWorkbenchPart part, ResourceMapping[] mappers) {
super(part, mappers);
+ fModesForExtensions= Collections.EMPTY_MAP;
+ fModesForFiles= Collections.EMPTY_MAP;
}
+ public void addModesForExtensions(Map modes) {
+ fModesForExtensions= modes;
+ }
+
+ public void addModesForNames(Map modes) {
+ fModesForFiles= modes;
+ }
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#execute(org.eclipse.team.internal.ccvs.core.CVSTeamProvider, org.eclipse.core.resources.IResource[], org.eclipse.core.runtime.IProgressMonitor)
*/
protected void execute(CVSTeamProvider provider, IResource[] resources, boolean recurse, IProgressMonitor monitor) throws CVSException, InterruptedException {
+ if (resources.length == 0)
+ return;
add(provider, resources, recurse ? IResource.DEPTH_INFINITE : IResource.DEPTH_ONE, monitor);
}
@@ -113,7 +128,7 @@ public class AddOperation extends RepositoryProviderOperation {
// added explicitly (is equal currentResource) or is not ignored
if (! isManaged(mResource) && (currentResource.equals(resource) || ! mResource.isIgnored())) {
if (resource.getType() == IResource.FILE) {
- KSubstOption ksubst = KSubstOption.fromFile((IFile) resource);
+ KSubstOption ksubst= getKSubstOption((IFile)resource);
Set set = (Set) files.get(ksubst);
if (set == null) {
set = new HashSet();
@@ -131,7 +146,8 @@ public class AddOperation extends RepositoryProviderOperation {
return false;
}
}
- }, depth, false);
+
+ }, depth, false);
if (exception[0] != null) {
throw exception[0];
}
@@ -200,7 +216,7 @@ public class AddOperation extends RepositoryProviderOperation {
/*
* Consider a folder managed only if it's also a CVS folder
*/
- private boolean isManaged(ICVSResource cvsResource) throws CVSException {
+ protected boolean isManaged(ICVSResource cvsResource) throws CVSException {
return cvsResource.isManaged() && (!cvsResource.isFolder() || ((ICVSFolder)cvsResource).isCVSFolder());
}
@@ -210,4 +226,20 @@ public class AddOperation extends RepositoryProviderOperation {
protected String getErrorMessage(IStatus[] failures, int totalOperations) {
return Policy.bind("AddAction.addFailed"); //$NON-NLS-1$
}
+
+ protected KSubstOption getKSubstOption(IFile file) {
+ final String extension= file.getFileExtension();
+ final Integer mode;
+ if (extension == null) {
+ mode= (Integer)fModesForFiles.get(file.getName());
+ } else {
+ mode= (Integer)fModesForExtensions.get(extension);
+ }
+ if (mode != null) {
+ return mode.intValue() == Team.BINARY ? Command.KSUBST_BINARY : KSubstOption.getDefaultTextMode();
+ } else {
+ return KSubstOption.fromFile(file);
+ }
+ }
+
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CommitOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CommitOperation.java
index a8151e0ec..65d8c2db8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CommitOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/CommitOperation.java
@@ -10,21 +10,16 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.operations;
-import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.mapping.ResourceMapping;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.*;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
-import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
import org.eclipse.ui.IWorkbenchPart;
/**
@@ -32,50 +27,9 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class CommitOperation extends SingleCommandOperation {
- public CommitOperation(IWorkbenchPart part, ResourceMapping[] mappers, LocalOption[] options) {
+ public CommitOperation(IWorkbenchPart part, ResourceMapping[] mappers, LocalOption[] options, String comment) {
super(part, mappers, options);
- }
-
- /**
- * Perform prompting for unadded resources and comment
- * @param monitor a progess monitor
- * @return <code>true</code> if execution should continue
- */
- public boolean performPrompting(IProgressMonitor monitor) throws CVSException, InvocationTargetException, InterruptedException {
- try {
- monitor.beginTask(null, 20);
- IResource[] resourcesToBeAdded = promptForResourcesToBeAdded(Policy.subMonitorFor(monitor, 10));
- if (resourcesToBeAdded == null) return false;
- String comment = promptForComment(getTraversalRoots());
- if (comment == null) return false;
- addLocalOption(Commit.makeArgumentOption(Command.MESSAGE_OPTION, comment));
- if (resourcesToBeAdded.length > 0) {
- new AddOperation(getPart(), RepositoryProviderOperation.asResourceMappers(resourcesToBeAdded))
- .run(Policy.subMonitorFor(monitor, 10));
- }
- //setResources(getSharedResources(getTraversalRoots()));
- monitor.done();
- return true;
- } catch (CoreException e) {
- throw CVSException.wrapException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
- */
- public void execute(IProgressMonitor monitor) throws CVSException, InterruptedException {
- try {
- // Ensure that a comment has been provided
- if (!Command.MESSAGE_OPTION.isElementOf(getLocalOptions(true))) {
- String comment = promptForComment(getTraversalRoots());
- if (comment == null) return;
- addLocalOption(Commit.makeArgumentOption(Command.MESSAGE_OPTION, comment));
- }
- super.execute(monitor);
- } catch (CoreException e) {
- throw CVSException.wrapException(e);
- }
+ addLocalOption(Commit.makeArgumentOption(Command.MESSAGE_OPTION, comment));
}
/* (non-Javadoc)
@@ -91,6 +45,22 @@ public class CommitOperation extends SingleCommandOperation {
}
/* (non-Javadoc)
+ * @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#handleErrors(org.eclipse.core.runtime.IStatus[])
+ */
+ protected void handleErrors(IStatus[] errors) throws CVSException {
+ // We are only concerned with server errors
+ List serverErrors = new ArrayList();
+ for (int i = 0; i < errors.length; i++) {
+ IStatus status = errors[i];
+ if (status.getCode() == CVSStatus.SERVER_ERROR) {
+ serverErrors.add(status);
+ }
+ }
+ if (serverErrors.isEmpty()) return;
+ super.handleErrors((IStatus[]) serverErrors.toArray(new IStatus[serverErrors.size()]));
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.CVSOperation#getTaskName()
*/
protected String getTaskName() {
@@ -111,78 +81,6 @@ public class CommitOperation extends SingleCommandOperation {
return Policy.bind("CommitAction.commitFailed"); //$NON-NLS-1$
}
- private IResource[] getUnaddedResources(IResource[] resources, IProgressMonitor iProgressMonitor) throws CVSException {
- final List unadded = new ArrayList();
- final CVSException[] exception = new CVSException[] { null };
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- // visit each resource deeply
- try {
- resource.accept(new IResourceVisitor() {
- public boolean visit(IResource resource) throws CoreException {
- ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
- // skip ignored resources and their children
- try {
- if (cvsResource.isIgnored())
- return false;
- // visit the children of shared resources
- if (cvsResource.isManaged())
- return true;
- if (cvsResource.isFolder() && ((ICVSFolder)cvsResource).isCVSFolder())
- return true;
- } catch (CVSException e) {
- exception[0] = e;
- }
- // don't add folders to avoid comitting empty folders
- if (resource.getType() == IResource.FOLDER)
- return true;
- // file is unshared so record it
- unadded.add(resource);
- // no need to go into children because add is deep
- return false;
- }
- });
- } catch (CoreException e) {
- throw CVSException.wrapException(e);
- }
- if (exception[0] != null) throw exception[0];
- }
- return (IResource[]) unadded.toArray(new IResource[unadded.size()]);
- }
-
- protected IResource[] promptForResourcesToBeAdded(IProgressMonitor monitor) throws CVSException {
- try {
- IResource[] unadded = getUnaddedResources(getTraversalRoots(), monitor);
- RepositoryManager manager = CVSUIPlugin.getPlugin().getRepositoryManager();
- return manager.promptForResourcesToBeAdded(getShell(), unadded);
- } catch (CoreException e) {
- throw CVSException.wrapException(e);
- }
- }
-
- protected String promptForComment(IResource[] resourcesToCommit) {
- RepositoryManager manager = CVSUIPlugin.getPlugin().getRepositoryManager();
- return manager.promptForComment(getShell(), resourcesToCommit, null);
- }
-
- /*
- * Return all resources in the provided collection that are shared with a repo
- * @param resources
- * @return IResource[]
- */
- private IResource[] getSharedResources(IResource[] resources) throws CVSException {
- List shared = new ArrayList();
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource);
- if (cvsResource.isManaged()
- || (cvsResource.isFolder() && ((ICVSFolder)cvsResource).isCVSFolder())) {
- shared.add(resource);
- }
- }
- return (IResource[]) shared.toArray(new IResource[shared.size()]);
- }
-
/* (non-Javadoc)
* @see org.eclipse.team.internal.ccvs.ui.operations.SingleCommandOperation#isServerModificationOperation()
*/
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSActionDelegateWrapper.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSActionDelegateWrapper.java
index 1cff07326..23787d092 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSActionDelegateWrapper.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSActionDelegateWrapper.java
@@ -11,10 +11,10 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.actions.CVSAction;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.synchronize.ActionDelegateWrapper;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
-import org.eclipse.ui.IActionDelegate;
/**
* Superclass of CVS participant action delegates that uses the classname as the key
@@ -22,8 +22,8 @@ import org.eclipse.ui.IActionDelegate;
*/
public class CVSActionDelegateWrapper extends ActionDelegateWrapper {
- public CVSActionDelegateWrapper(IActionDelegate delegate, ISynchronizePageConfiguration configuration) {
- super(delegate, configuration);
+ public CVSActionDelegateWrapper(CVSAction delegate, ISynchronizePageConfiguration configuration) {
+ super(delegate, configuration, delegate.getId());
Utils.initAction(this, getBundleKeyPrefix(), Policy.getBundle());
}
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 2b749f7e4..3b17f0423 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
@@ -13,28 +13,20 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-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.jface.viewers.*;
import org.eclipse.swt.graphics.Image;
import org.eclipse.team.core.synchronize.SyncInfo;
-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.*;
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.CVSDecoration;
-import org.eclipse.team.internal.ccvs.ui.CVSLightweightDecorator;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.*;
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 {
+public class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyChangeListener, ILabelDecorator {
private ISynchronizePageConfiguration configuration;
public CVSParticipantLabelDecorator(ISynchronizePageConfiguration configuration) {
@@ -51,7 +43,7 @@ class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyCha
IResource resource = ((ISynchronizeModelElement) element).getResource();
if (resource != null && resource.getType() != IResource.ROOT) {
// Prepare the decoration but substitute revision and hide dirty indicator
- CVSDecoration decoration = CVSLightweightDecorator.decorate(resource);
+ CVSDecoration decoration = getDecoration(resource);
decoration.setRevision(getRevisionNumber((ISynchronizeModelElement) element));
decoration.setDirty(false);
decoration.compute();
@@ -72,18 +64,29 @@ class CVSParticipantLabelDecorator extends LabelProvider implements IPropertyCha
return input;
}
}
- public Image decorateImage(Image base, Object element) {
+ /**
+ * @return
+ */
+ protected CVSDecoration getDecoration(IResource resource) throws CVSException {
+ return CVSLightweightDecorator.decorate(resource);
+ }
+
+ public Image decorateImage(Image base, Object element) {
return base;
}
public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if(property.equals(CVSUIPlugin.P_DECORATORS_CHANGED) || property.equals(TeamUI.GLOBAL_FILE_TYPES_CHANGED)) {
+ if (needsRefresh(event)) {
Viewer viewer = configuration.getPage().getViewer();
if(viewer instanceof StructuredViewer && !viewer.getControl().isDisposed()) {
((StructuredViewer)viewer).refresh(true);
}
}
}
+
+ protected boolean needsRefresh(PropertyChangeEvent event) {
+ final String property= event.getProperty();
+ return property.equals(CVSUIPlugin.P_DECORATORS_CHANGED) || property.equals(TeamUI.GLOBAL_FILE_TYPES_CHANGED);
+ }
public void dispose() {
CVSUIPlugin.removePropertyChangeListener(this);
TeamUI.removePropertyChangeListener(this);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java
index 089250d53..fa539ff2f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CommitSetDialog.java
@@ -17,6 +17,7 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
@@ -30,6 +31,8 @@ import org.eclipse.ui.help.WorkbenchHelp;
*/
public class CommitSetDialog extends Dialog {
+ private static final int DEFAULT_WIDTH_IN_CHARS= 80;
+
private final ActiveChangeSet set;
private CommitCommentArea commitCommentArea;
private Text nameText;
@@ -102,6 +105,17 @@ public class CommitSetDialog extends Dialog {
Dialog.applyDialogFont(parent);
return composite;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.window.Window#getInitialSize()
+ */
+ protected Point getInitialSize() {
+ final Point size= super.getInitialSize();
+ size.x= convertWidthInCharsToPixels(DEFAULT_WIDTH_IN_CHARS);
+ size.y += convertHeightInCharsToPixels(8);
+ return size;
+ }
+
private void createNameArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
@@ -193,7 +207,7 @@ public class CommitSetDialog extends Dialog {
set.setTitle(nameText.getText());
if (isUseCustomComment()) {
// Call getComment so the comment gets saved
- set.setComment(commitCommentArea.getComment());
+ set.setComment(commitCommentArea.getComment(true));
} else {
set.setComment(null);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
index fa088f061..b83a9e4fa 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
@@ -48,10 +48,11 @@ public class CompareParticipant extends CVSParticipant implements IPropertyChang
new CompareRevertAction(configuration));
if (!configuration.getSite().isModal()) {
+ ShowAnnotationAction showAnnotationAction = new ShowAnnotationAction();
appendToGroup(
ISynchronizePageConfiguration.P_CONTEXT_MENU,
NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP,
- new CVSActionDelegateWrapper(new ShowAnnotationAction(), configuration));
+ new CVSActionDelegateWrapper(showAnnotationAction, configuration));
appendToGroup(
ISynchronizePageConfiguration.P_CONTEXT_MENU,
NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP,
@@ -169,6 +170,7 @@ public class CompareParticipant extends CVSParticipant implements IPropertyChang
public void dispose() {
super.dispose();
CVSUIPlugin.getPlugin().getPluginPreferences().removePropertyChangeListener(this);
+ getCVSCompareSubscriber().dispose();
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitAction.java
index eea6dc9e7..e34935a00 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitAction.java
@@ -12,16 +12,24 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
-import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.core.synchronize.*;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
+import org.eclipse.team.internal.ccvs.ui.wizards.CommitWizard;
+import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
+import org.eclipse.ui.PlatformUI;
public class WorkspaceCommitAction extends CVSParticipantAction {
public WorkspaceCommitAction(ISynchronizePageConfiguration configuration) {
super(configuration);
+ setId(ICVSUIConstants.CMD_COMMIT);
+ setActionDefinitionId(ICVSUIConstants.CMD_COMMIT);
}
public WorkspaceCommitAction(ISynchronizePageConfiguration configuration, ISelectionProvider provider, String bundleKey) {
@@ -32,7 +40,7 @@ public class WorkspaceCommitAction extends CVSParticipantAction {
* @see org.eclipse.team.ui.sync.SubscriberAction#getSyncInfoFilter()
*/
protected FastSyncInfoFilter getSyncInfoFilter() {
- return new SyncInfoDirectionFilter(new int[] {SyncInfo.OUTGOING});
+ return new SyncInfoDirectionFilter(new int[] { SyncInfo.OUTGOING });
}
/* (non-Javadoc)
@@ -41,4 +49,31 @@ public class WorkspaceCommitAction extends CVSParticipantAction {
protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
return new WorkspaceCommitOperation(configuration, elements, false /* override */);
}
+
+ public void runOperation() {
+ final SyncInfoSet set = getSyncInfoSet();
+ final Shell shell= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ try {
+ CommitWizard.run(shell, set);
+ } catch (CVSException e) {
+ CVSUIPlugin.log(e);
+ }
+ }
+
+ /*
+ * Return the selected SyncInfo for which this action is enabled.
+ *
+ * @return the selected SyncInfo for which this action is enabled.
+ */
+ private SyncInfoSet getSyncInfoSet() {
+ IDiffElement [] elements= getFilteredDiffElements();
+ SyncInfoSet filtered = new SyncInfoSet();
+ for (int i = 0; i < elements.length; i++) {
+ IDiffElement e = elements[i];
+ if (e instanceof SyncInfoModelElement) {
+ filtered.add(((SyncInfoModelElement)e).getSyncInfo());
+ }
+ }
+ return filtered;
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
index 4e7fb1247..e28b69d11 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
@@ -11,8 +11,7 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
@@ -27,7 +26,6 @@ import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.ccvs.core.*;
import org.eclipse.team.internal.ccvs.core.client.Command;
-import org.eclipse.team.internal.ccvs.core.client.Commit;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
@@ -213,7 +211,7 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
private void commit(IResource[] commits, IProgressMonitor monitor) throws TeamException {
try {
new CommitOperation(getPart(), RepositoryProviderOperation.asResourceMappers(commits),
- new Command.LocalOption[] { Commit.makeArgumentOption(Command.MESSAGE_OPTION, comment) })
+ new Command.LocalOption[0], comment)
.run(monitor);
} catch (InvocationTargetException e) {
throw TeamException.asTeamException(e);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
index b40f36d70..118a6874b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
@@ -190,7 +190,7 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
*/
protected void initializeConfiguration(ISynchronizePageConfiguration configuration) {
super.initializeConfiguration(configuration);
- ILabelDecorator labelDecorator = new CVSParticipantLabelDecorator(configuration);
+ ILabelDecorator labelDecorator = getLabelDecorator(configuration);
configuration.addLabelDecorator(labelDecorator);
configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, TOOLBAR_CONTRIBUTION_GROUP);
configuration.addActionContribution(new WorkspaceActionContribution());
@@ -213,6 +213,10 @@ public class WorkspaceSynchronizeParticipant extends ScopableSubscriberParticipa
CONTEXT_MENU_CONTRIBUTION_GROUP_4);
}
+ protected ILabelDecorator getLabelDecorator(ISynchronizePageConfiguration configuration) {
+ return new CVSParticipantLabelDecorator(configuration);
+ }
+
protected ISynchronizeParticipantDescriptor getDescriptor() {
return TeamUI.getSynchronizeManager().getParticipantDescriptor(ID);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
index 6682d6ffe..06737dfc8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
@@ -15,6 +15,7 @@ import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
@@ -24,6 +25,8 @@ public class WorkspaceUpdateAction extends CVSParticipantAction {
public WorkspaceUpdateAction(ISynchronizePageConfiguration configuration) {
super(configuration);
+ setId(ICVSUIConstants.CMD_UPDATE);
+ setActionDefinitionId(ICVSUIConstants.CMD_UPDATE);
}
public WorkspaceUpdateAction(ISynchronizePageConfiguration configuration, ISelectionProvider provider, String bundleKey) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/BranchPromptDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/BranchPromptDialog.java
index 4a052014a..a261b204e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/BranchPromptDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/BranchPromptDialog.java
@@ -13,7 +13,6 @@ package org.eclipse.team.internal.ccvs.ui.tags;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -23,6 +22,7 @@ import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.wizards.CVSWizardPage;
+import org.eclipse.team.internal.ui.SWTUtils;
import org.eclipse.team.internal.ui.dialogs.DetailsDialog;
import org.eclipse.ui.help.WorkbenchHelp;
@@ -57,23 +57,15 @@ public class BranchPromptDialog extends DetailsDialog {
* @see DetailsDialog#createMainDialogArea(Composite)
*/
protected void createMainDialogArea(Composite composite) {
- // create message
- Label label = new Label(composite, SWT.WRAP);
- String message;
- if(allStickyResources) {
- message = Policy.bind("BranchWizardPage.pageDescriptionVersion"); //$NON-NLS-1$
- } else {
- message = Policy.bind("BranchWizardPage.pageDescription"); //$NON-NLS-1$
- }
- label.setText(message);
- GridData data = new GridData(
- GridData.GRAB_HORIZONTAL |
- GridData.HORIZONTAL_ALIGN_FILL |
- GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
- label.setLayoutData(data);
-
- CVSWizardPage.createLabel(composite, Policy.bind("BranchWizardPage.branchName")); //$NON-NLS-1$
+
+ final int areaWidth= convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
+
+ final Label description= SWTUtils.createLabel(composite, allStickyResources ? Policy.bind("BranchWizardPage.pageDescriptionVersion") : Policy.bind("BranchWizardPage.pageDescription")); //$NON-NLS-1$//$NON-NLS-2$
+ description.setLayoutData(SWTUtils.createGridData(areaWidth, SWT.DEFAULT, true, false));
+
+ final Label name= SWTUtils.createLabel(composite, Policy.bind("BranchWizardPage.branchName")); //$NON-NLS-1$
+ name.setLayoutData(SWTUtils.createGridData(areaWidth, SWT.DEFAULT, true, false));
+
branchText = CVSWizardPage.createTextField(composite);
branchText.addListener(SWT.Modify, new Listener() {
public void handleEvent(Event event) {
@@ -84,11 +76,7 @@ public class BranchPromptDialog extends DetailsDialog {
});
addBranchContentAssist();
- final Button check = new Button(composite, SWT.CHECK);
- data = new GridData();
- data.horizontalSpan = 2;
- check.setLayoutData(data);
- check.setText(Policy.bind("BranchWizardPage.startWorking")); //$NON-NLS-1$
+ final Button check = SWTUtils.createCheckBox(composite, Policy.bind("BranchWizardPage.startWorking")); //$NON-NLS-1$
check.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
update = check.getSelection();
@@ -97,17 +85,12 @@ public class BranchPromptDialog extends DetailsDialog {
check.setSelection(true);
update = true;
- label = new Label(composite, SWT.WRAP);
- label.setText(Policy.bind("BranchWizardPage.specifyVersion")); //$NON-NLS-1$
- data = new GridData(
- GridData.GRAB_HORIZONTAL |
- GridData.HORIZONTAL_ALIGN_FILL |
- GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
- data.horizontalSpan = 2;
- label.setLayoutData(data);
-
- CVSWizardPage.createLabel(composite, Policy.bind("BranchWizardPage.versionName")); //$NON-NLS-1$
+ final Label versionLabel1= SWTUtils.createLabel(composite, Policy.bind("BranchWizardPage.specifyVersion")); //$NON-NLS-1$
+ versionLabel1.setLayoutData(SWTUtils.createGridData(areaWidth, SWT.DEFAULT, true, false));
+
+ final Label versionLabel2= SWTUtils.createLabel(composite, Policy.bind("BranchWizardPage.versionName")); //$NON-NLS-1$
+ versionLabel2.setLayoutData(SWTUtils.createGridData(areaWidth, SWT.DEFAULT, true, false));
+
versionText = CVSWizardPage.createTextField(composite);
versionText.addListener(SWT.Modify, new Listener() {
public void handleEvent(Event event) {
@@ -123,7 +106,7 @@ public class BranchPromptDialog extends DetailsDialog {
// F1 Help
WorkbenchHelp.setHelp(composite, IHelpContextIds.BRANCH_DIALOG);
- Dialog.applyDialogFont(composite);
+ applyDialogFont(composite);
branchText.setFocus();
}
@@ -154,8 +137,8 @@ public class BranchPromptDialog extends DetailsDialog {
// create a composite with standard margins and spacing
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
composite.setLayout(layout);
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagAsVersionDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagAsVersionDialog.java
index 3a59a7026..888ec8df1 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagAsVersionDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagAsVersionDialog.java
@@ -100,16 +100,16 @@ public class TagAsVersionDialog extends DetailsDialog {
*/
protected Composite createDropDownDialogArea(Composite parent) {
// create a composite with standard margins and spacing
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- composite.setLayout(layout);
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.heightHint = TAG_AREA_HEIGHT_HINT;
- composite.setLayoutData(gridData);
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
+ layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ composite.setLayout(layout);
+ final GridData gridData = new GridData(GridData.FILL_BOTH);
+ gridData.heightHint = TAG_AREA_HEIGHT_HINT;
+ composite.setLayoutData(gridData);
tagArea = new TagSelectionArea(getShell(), tagSource, TagSelectionArea.INCLUDE_VERSIONS, null);
tagArea.setTagAreaLabel(Policy.bind("TagAction.existingVersions")); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagRefreshButtonArea.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagRefreshButtonArea.java
index a4506ed9f..3a09ed215 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagRefreshButtonArea.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagRefreshButtonArea.java
@@ -11,7 +11,6 @@
package org.eclipse.team.internal.ccvs.ui.tags;
import java.lang.reflect.InvocationTargetException;
-
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -84,38 +83,54 @@ public class TagRefreshButtonArea extends DialogArea {
WorkbenchHelp.setHelp(addButton, IHelpContextIds.TAG_CONFIGURATION_OVERVIEW);
Dialog.applyDialogFont(buttonComp);
}
+
+ public void refresh() {
+ try {
+ getRunnableContext().run(true, true, new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ setBusy(true);
+ monitor.beginTask(Policy.bind("TagRefreshButtonArea.5"), 100); //$NON-NLS-1$
+ CVSTag[] tags = tagSource.refresh(false, Policy.subMonitorFor(monitor, 70));
+ if (tags.length == 0 && promptForBestEffort()) {
+ tagSource.refresh(true, Policy.subMonitorFor(monitor, 30));
+ }
+ } catch (TeamException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ setBusy(false);
+ monitor.done();
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ // operation cancelled
+ } catch (InvocationTargetException e) {
+ CVSUIPlugin.openError(shell, Policy.bind("TagConfigurationDialog.14"), null, e); //$NON-NLS-1$
+ }
+ }
+
+ private void setBusy(final boolean busy) {
+ if (shell != null && !shell.isDisposed())
+ shell.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ refreshButton.setEnabled(!busy);
+ }
+ });
+ }
/*
- * Returns a button that implements the standard refresh tags operation. The runnable is run immediatly after
- * the tags are fetched from the server. A client should refresh their widgets that show tags because they
- * may of changed.
+ * Returns a button that implements the standard refresh tags operation. The
+ * runnable is run immediatly after the tags are fetched from the server. A
+ * client should refresh their widgets that show tags because they may of
+ * changed.
*/
private Button createTagRefreshButton(Composite composite, String title) {
Button refreshButton = new Button(composite, SWT.PUSH);
refreshButton.setText (title);
refreshButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
- try {
- getRunnableContext().run(true, true, new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- monitor.beginTask(Policy.bind("TagRefreshButtonArea.5"), 100); //$NON-NLS-1$
- CVSTag[] tags = tagSource.refresh(false, Policy.subMonitorFor(monitor, 70));
- if (tags.length == 0 && promptForBestEffort()) {
- tagSource.refresh(true, Policy.subMonitorFor(monitor, 30));
- }
- } catch (TeamException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
- });
- } catch (InterruptedException e) {
- // operation cancelled
- } catch (InvocationTargetException e) {
- CVSUIPlugin.openError(shell, Policy.bind("TagConfigurationDialog.14"), null, e); //$NON-NLS-1$
- }
+ refresh();
}
});
return refreshButton;
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionArea.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionArea.java
index 3f165b816..dddfcd585 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionArea.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionArea.java
@@ -15,6 +15,7 @@ import java.util.List;
import org.eclipse.jface.action.*;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
@@ -29,6 +30,7 @@ import org.eclipse.team.internal.ccvs.ui.actions.CVSAction;
import org.eclipse.team.internal.ccvs.ui.repo.NewDateTagAction;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
import org.eclipse.team.internal.ccvs.ui.tags.TagSourceWorkbenchAdapter.ProjectElementSorter;
+import org.eclipse.team.internal.ui.SWTUtils;
import org.eclipse.team.internal.ui.dialogs.DialogArea;
import org.eclipse.ui.help.WorkbenchHelp;
import org.eclipse.ui.model.WorkbenchContentProvider;
@@ -69,6 +71,7 @@ public class TagSelectionArea extends DialogArea {
private String helpContext;
private Text filterText;
private TagSource tagSource;
+ private Label tagAreaTextLabel;
private final Shell shell;
private TagRefreshButtonArea tagRefreshArea;
private final TagSource.ITagSourceChangeListener listener = new TagSource.ITagSourceChangeListener() {
@@ -76,8 +79,8 @@ public class TagSelectionArea extends DialogArea {
Shell shell = getShell();
if (!shell.isDisposed()) {
shell.getDisplay().syncExec(new Runnable() {
- public void run() {
- refresh();
+ public void run() {
+ refresh();
}
});
}
@@ -111,8 +114,12 @@ public class TagSelectionArea extends DialogArea {
* @see org.eclipse.team.internal.ui.dialogs.DialogArea#createArea(org.eclipse.swt.widgets.Composite)
*/
public void createArea(Composite parent) {
+ initializeDialogUnits(parent);
// Create a composite for the entire area
- Composite outer = createComposite(parent, 1, true);
+ Composite outer= new Composite(parent, SWT.NONE);
+ outer.setLayoutData(SWTUtils.createHVFillGridData());
+ outer.setLayout(SWTUtils.createGridLayout(1, convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN), convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN)));
+
initializeDialogUnits(outer);
// Add F1 help
if (helpContext != null) {
@@ -132,9 +139,9 @@ public class TagSelectionArea extends DialogArea {
Composite inner = createGrabbingComposite(parent, 1);
if (isIncludeFilterInputArea()) {
createFilterInput(inner);
- createWrappingLabel(inner, Policy.bind("TagSelectionArea.0"), 1); //$NON-NLS-1$
+ tagAreaTextLabel = createWrappingLabel(inner, Policy.bind("TagSelectionArea.0"), 1); //$NON-NLS-1$
} else {
- createWrappingLabel(inner, Policy.bind("TagSelectionArea.1", getTagAreaLabel()), 1); //$NON-NLS-1$
+ tagAreaTextLabel = createWrappingLabel(inner, Policy.bind("TagSelectionArea.1", getTagAreaLabel()), 1); //$NON-NLS-1$
}
switcher = new PageBook(inner, SWT.NONE);
GridData gridData = new GridData(GridData.FILL_BOTH);
@@ -531,6 +538,10 @@ public class TagSelectionArea extends DialogArea {
}
}
}
+
+ public void refreshTagList() {
+ tagRefreshArea.refresh();
+ }
/**
* Set the enablement state of the area
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionDialog.java
index 30050625d..a64b0724f 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/tags/TagSelectionDialog.java
@@ -10,18 +10,25 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.tags;
-
+import java.lang.reflect.InvocationTargetException;
+import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.*;
+import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
-import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.*;
/**
* Dialog to prompt the user to choose a tag for a selected resource
@@ -29,6 +36,7 @@ import org.eclipse.team.internal.ccvs.ui.Policy;
public class TagSelectionDialog extends Dialog implements IPropertyChangeListener {
private TagSelectionArea tagSelectionArea;
+ private Cursor appBusyCursor;
public static final int INCLUDE_HEAD_TAG = TagSourceWorkbenchAdapter.INCLUDE_HEAD_TAG;
public static final int INCLUDE_BASE_TAG = TagSourceWorkbenchAdapter.INCLUDE_BASE_TAG;
@@ -147,7 +155,7 @@ public class TagSelectionDialog extends Dialog implements IPropertyChangeListene
* Subclasses should override.
* </p>
*
- * @param the parent composite to contain the dialog area
+ * @param parent the parent composite to contain the dialog area
* @return the dialog area control
*/
protected Control createDialogArea(Composite parent) {
@@ -172,6 +180,7 @@ public class TagSelectionDialog extends Dialog implements IPropertyChangeListene
tagSelectionArea.setTagAreaLabel(message);
tagSelectionArea.addPropertyChangeListener(this);
tagSelectionArea.createArea(top);
+ tagSelectionArea.setRunnableContext(getRunnableContext());
// Create a separator between the tag area and the button area
Label seperator = new Label(top, SWT.SEPARATOR | SWT.HORIZONTAL);
@@ -220,6 +229,8 @@ public class TagSelectionDialog extends Dialog implements IPropertyChangeListene
*/
protected void initialize() {
okButton.setEnabled(false);
+ if (CVSUIPlugin.getPlugin().getPreferenceStore().getBoolean(ICVSUIConstants.PREF_AUTO_REFRESH_TAGS_IN_TAG_SELECTION_DIALOG))
+ tagSelectionArea.refreshTagList();
}
@@ -244,4 +255,67 @@ public class TagSelectionDialog extends Dialog implements IPropertyChangeListene
okPressed();
}
}
+
+ /**
+ * Creates a runnable context that allows refreshing the tags in the background.
+ *
+ * @since 3.1
+ */
+ private IRunnableContext getRunnableContext() {
+ return new IRunnableContext() {
+ public void run(boolean fork, boolean cancelable, final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
+ final Job refreshJob = new Job(Policy.bind("TagSelectionDialog.7")) { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ if (monitor.isCanceled())
+ return Status.CANCEL_STATUS;
+ try {
+ setBusy(true);
+ runnable.run(monitor);
+ } catch (InvocationTargetException e) {
+ return new CVSStatus(IStatus.ERROR, Policy.bind("TagSelectionDialog.8"), e); //$NON-NLS-1$
+ } catch (InterruptedException e) {
+ return new CVSStatus(IStatus.ERROR, Policy.bind("TagSelectionDialog.8"), e); //$NON-NLS-1$
+ } finally {
+ setBusy(false);
+ }
+ if (monitor.isCanceled())
+ return Status.CANCEL_STATUS;
+ else
+ return Status.OK_STATUS;
+ }
+ };
+ refreshJob.setUser(false);
+ refreshJob.setPriority(Job.DECORATE);
+ getShell().addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ refreshJob.cancel();
+ }
+ });
+ refreshJob.schedule();
+ }
+ };
+ }
+
+ private void setBusy(final boolean busy) {
+ final Shell shell = getShell();
+ if (shell != null && !shell.isDisposed()) {
+ shell.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ Cursor cursor = null;
+ if (busy) {
+ if (appBusyCursor == null)
+ appBusyCursor = new Cursor(shell.getDisplay(), SWT.CURSOR_APPSTARTING);
+ cursor = appBusyCursor;
+ }
+ shell.setCursor(cursor);
+ }
+ });
+ }
+ }
+
+ public boolean close() {
+ if(appBusyCursor != null)
+ appBusyCursor.dispose();
+ return super.close();
+ }
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java
index 3adf28015..508a6a142 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CVSWizardPage.java
@@ -124,7 +124,7 @@ public abstract class CVSWizardPage extends WizardPage {
protected Composite createComposite(Composite parent, int numColumns, boolean grabExcess) {
final Composite composite = new Composite(parent, SWT.NULL);
composite.setLayout(new GridLayout(numColumns, false));
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, grabExcess, grabExcess));
return composite;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizard.java
index eeb8698a8..61fd9d8e8 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/CommitWizard.java
@@ -112,11 +112,11 @@ public class CommitWizard extends Wizard {
protected void execute(IProgressMonitor monitor) throws CVSException, InterruptedException {
try {
- final AddOperation op= new AddOperation(getPart(), fNewResources);
+ final AddOperation op= new AddOperation(getPart(), RepositoryProviderOperation.asResourceMappers(fNewResources));
op.addModesForExtensions(fModesForExtensionsForOneTime);
op.addModesForNames(fModesForNamesForOneTime);
op.run(monitor);
- new CommitOperation(getPart(), fAllResources, new Command.LocalOption[0], fComment).run(monitor);
+ new CommitOperation(getPart(), RepositoryProviderOperation.asResourceMappers(fAllResources), new Command.LocalOption[0], fComment).run(monitor);
} catch (InvocationTargetException e) {
throw CVSException.wrapException(e);
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardCommitCommentPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardCommitCommentPage.java
index d9bbe10e8..e8bfb96ac 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardCommitCommentPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/KSubstWizardCommitCommentPage.java
@@ -59,7 +59,7 @@ public class KSubstWizardCommitCommentPage extends CVSWizardPage {
* @return String
*/
public String getComment() {
- return commitCommentArea.getComment();
+ return commitCommentArea.getComment(true);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/MergeWizardPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/MergeWizardPage.java
index c10125b69..4ddc9149b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/MergeWizardPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/MergeWizardPage.java
@@ -11,6 +11,7 @@
package org.eclipse.team.internal.ccvs.ui.wizards;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.*;
@@ -20,6 +21,7 @@ import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.ui.IHelpContextIds;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.tags.*;
+import org.eclipse.team.internal.ui.SWTUtils;
public class MergeWizardPage extends CVSWizardPage {
@@ -44,7 +46,8 @@ public class MergeWizardPage extends CVSWizardPage {
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
public void createControl(Composite parent) {
- Composite composite = createComposite(parent, 1, true);
+ initializeDialogUnits(parent);
+ Composite composite = SWTUtils.createGridComposite(parent, 1);
Composite mainArea = createComposite(composite, 2, true);
createEndTagArea(mainArea);
@@ -81,6 +84,7 @@ public class MergeWizardPage extends CVSWizardPage {
private void createEndTagArea(Composite parent) {
createWrappingLabel(parent, Policy.bind("MergeWizardPage.2"), 0, 2); //$NON-NLS-1$
endTagField = createTextField(parent);
+ endTagField.setLayoutData(SWTUtils.createHFillGridData());
endTagField.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updateEndTag(endTagField.getText());
@@ -89,6 +93,8 @@ public class MergeWizardPage extends CVSWizardPage {
final int endTagIncludeFlags = TagSelectionArea.INCLUDE_VERSIONS | TagSelectionArea.INCLUDE_BRANCHES | TagSelectionArea.INCLUDE_HEAD_TAG;
TagContentAssistProcessor.createContentAssistant(endTagField, tagSource, endTagIncludeFlags);
endTagBrowseButton = createPushButton(parent, Policy.bind("MergeWizardPage.3")); //$NON-NLS-1$
+ endTagBrowseButton.setLayoutData(getButtonData());
+
endTagBrowseButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
TagSelectionDialog dialog = new TagSelectionDialog(getShell(), getTagSource(),
@@ -103,10 +109,17 @@ public class MergeWizardPage extends CVSWizardPage {
}
});
}
+
+ private GridData getButtonData() {
+ final GridData gd= new GridData(SWT.FILL, SWT.FILL, false, false);
+ gd.widthHint= convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
+ return gd;
+ }
private void createStartTagArea(Composite parent) {
createWrappingLabel(parent, Policy.bind("MergeWizardPage.6"), 0, 2); //$NON-NLS-1$
startTagField = createTextField(parent);
+ startTagField.setLayoutData(SWTUtils.createHFillGridData());
startTagField.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updateStartTag(startTagField.getText());
@@ -114,6 +127,7 @@ public class MergeWizardPage extends CVSWizardPage {
});
TagContentAssistProcessor.createContentAssistant(startTagField, tagSource, TagSelectionArea.INCLUDE_VERSIONS);
startTagBrowseButton = createPushButton(parent, Policy.bind("MergeWizardPage.7")); //$NON-NLS-1$
+ startTagBrowseButton.setLayoutData(getButtonData());
startTagBrowseButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
TagSelectionDialog dialog = new TagSelectionDialog(getShell(), getTagSource(),
@@ -251,4 +265,9 @@ public class MergeWizardPage extends CVSWizardPage {
public boolean isPreview() {
return preview;
}
+
+ public void setVisible(boolean visible) {
+ endTagField.setFocus();
+ super.setVisible(visible);
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
index 1adcdb3ed..832f997bb 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Utils.java
@@ -290,23 +290,12 @@ public class Utils {
}
public static Shell findShell() {
- // First find the active shell of the display and use it.
- // We need to do this since the active shell may be model
- // in which case we nned to parent off that or risk deadlock
- Display display= Display.getCurrent();
- if (display == null) {
- display= Display.getDefault();
- }
- if (display != null) {
- return display.getActiveShell();
- }
- // Try to use the active window (although I suspect this will fail if the bove failed)
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- if(window != null) {
- return window.getShell();
- }
+ Display display = TeamUIPlugin.getStandardDisplay();
+ Shell activeShell = display.getActiveShell();
+ if (activeShell != null)
+ return activeShell;
// worst case, just create our own.
- return new Shell(TeamUIPlugin.getStandardDisplay());
+ return new Shell(display);
}
public static IWorkbenchPartSite findSite(Control c) {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
index e229a00c0..d5cfb41de 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java
@@ -42,7 +42,7 @@ import org.eclipse.ui.actions.ActionDelegate;
* Team providers may also instantiate or subclass any of the
* subclasses of TeamAction provided in this package.
*/
-public abstract class TeamAction extends ActionDelegate implements IObjectActionDelegate, IViewActionDelegate {
+public abstract class TeamAction extends ActionDelegate implements IObjectActionDelegate, IViewActionDelegate, IWorkbenchWindowActionDelegate {
// The current selection
protected IStructuredSelection selection;
@@ -55,6 +55,14 @@ public abstract class TeamAction extends ActionDelegate implements IObjectAction
public final static int PROGRESS_BUSYCURSOR = 2;
private IWorkbenchPart targetPart;
+ private IWorkbenchWindow window;
+
+ private ISelectionListener selectionListener = new ISelectionListener() {
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if(selection instanceof IStructuredSelection)
+ TeamAction.this.selection = (IStructuredSelection)selection;
+ }
+ };
/**
* Creates an array of the given class type containing all the
@@ -384,6 +392,10 @@ public abstract class TeamAction extends ActionDelegate implements IObjectAction
* @return IWorkbenchPart
*/
protected IWorkbenchPart getTargetPart() {
+ if(targetPart == null) {
+ IWorkbenchPage page = TeamUIPlugin.getActivePage();
+ targetPart = page.getActivePart();
+ }
return targetPart;
}
@@ -417,4 +429,20 @@ public abstract class TeamAction extends ActionDelegate implements IObjectAction
public void init(IViewPart view) {
targetPart = view;
}
+
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ window.getSelectionService().addPostSelectionListener(selectionListener);
+ }
+
+ public IWorkbenchWindow getWindow() {
+ return window;
+ }
+
+ public void dispose() {
+ super.dispose();
+ if(window != null) {
+ window.getSelectionService().removePostSelectionListener(selectionListener);
+ }
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DetailsDialog.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DetailsDialog.java
index 2025a74d3..51ca09f5b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DetailsDialog.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/dialogs/DetailsDialog.java
@@ -136,7 +136,7 @@ abstract public class DetailsDialog extends Dialog {
// create composite
Composite composite = (Composite)super.createDialogArea(parent);
if (!isMainGrabVertical()) {
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
}
// create image
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
index 955200821..5e6dead6c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
@@ -99,7 +99,8 @@ TeamAction.internal=Internal error occurred.
TeamFile.saveChanges=Unable to save changes to file: {0}
TeamFile.modified={0}*
-TextPreferencePage.add=&Add...
+TextPreferencePage.add=&Add Extension...
+TextPreferencePage.0=Add Name...
TextPreferencePage.binary=Binary
TextPreferencePage.change=&Change
TextPreferencePage.contents=Contents
@@ -398,6 +399,7 @@ SynchronizeManager.31=&Remember my decision
SynchronizeManager.30=The Synchronize View is associated with the {0} perspective. Do you want to switch to that perspective now?
RefreshCompleteDialog.9=Changes
Participant.comparing=Comparing
+ParticipantPagePane.0=Error creating Synchronize Page
Participant.merging=Merging
Participant.synchronizing=Synchronizing
Participant.comparingDetail=Comparing {0}
@@ -491,3 +493,10 @@ ChangeLogModelProvider.6=Ed&it Change Set...
ChangeLogModelProvider.9=Make De&fault
ChangeLogModelManager.0=Show Change Sets
CommitSetDiffNode.0={0} (default)
+FileTypeTable.0=Binary
+FileTypeTable.1=ASCII Text
+FileTypeTable.2=Yes
+FileTypeTable.3=No
+FileTypeTable.4=Name/Extension
+FileTypeTable.5=Content
+FileTypeTable.6=Remember decision?
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
index 0cd7d275b..de4e6b016 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/preferences/TextPreferencePage.java
@@ -20,16 +20,11 @@ import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.TableEditor;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.*;
-import org.eclipse.team.core.IFileTypeInfo;
+import org.eclipse.team.core.IStringMapping;
import org.eclipse.team.core.Team;
import org.eclipse.team.internal.ui.*;
-import org.eclipse.team.internal.ui.IHelpContextIds;
-import org.eclipse.team.internal.ui.Policy;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
@@ -39,230 +34,136 @@ import org.eclipse.ui.help.WorkbenchHelp;
* is to be treated as a text file or not. The page allows the user to add or
* remove entries from this table, and change their values from Text to Binary.
*/
-public class TextPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
- // Some string constants for display purposes
- private static final String TEXT = Policy.bind("TextPreferencePage.text"); //$NON-NLS-1$
- private static final String BINARY = Policy.bind("TextPreferencePage.binary"); //$NON-NLS-1$
-
+public class TextPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, FileTypeTable.PixelConverter {
+
// The input for the table viewer
- private List input;
+ private final List fItems;
// Widgets
- private TableViewer viewer;
- private Button removeButton;
- private Button changeButton;
+ private Button fRemoveButton;
+ private Button fChangeButton;
+
+ protected FileTypeTable fTable;
+
+ public TextPreferencePage() {
+ fItems= new ArrayList();
+ initializeItems();
+ }
+
+ private void initializeItems() {
+
+ fItems.clear();
+
+ final IStringMapping [] extensionInfoArray= Team.getFileContentManager().getExtensionMappings();
+ final IStringMapping [] nameInfoArray= Team.getFileContentManager().getNameMappings();
+
+ for (int i = 0; i < extensionInfoArray.length; i++) {
+ final IStringMapping info= extensionInfoArray[i];
+ final FileTypeTable.Extension extension= new FileTypeTable.Extension(info.getString());
+ extension.mode= info.getType();
+ fItems.add(extension);
+ }
+
+ for (int i = 0; i < nameInfoArray.length; i++) {
+ final IStringMapping info= nameInfoArray[i];
+ final FileTypeTable.Name name= new FileTypeTable.Name(info.getString());
+ name.mode= info.getType();
+ fItems.add(name);
+ }
+
+ }
- /**
- * TableEntry is a pair of strings representing an entry in the table
- */
- class TableEntry {
- String ext;
- String value;
- public TableEntry(String ext, String value) {
- this.ext = ext;
- this.value = value;
- }
- public String getExtension() {
- return ext;
- }
- public String getValue() {
- return value;
- }
- public void setValue(String value) {
- this.value = value;
- }
- }
- /**
- * TableLabelProvider provides labels for TableEntrys.
- */
- class TableLabelProvider extends LabelProvider implements ITableLabelProvider {
- public String getColumnText(Object element, int columnIndex) {
- TableEntry entry = (TableEntry)element;
- switch (columnIndex) {
- case 0:
- return entry.getExtension();
- case 1:
- return entry.getValue();
- default:
- return null;
- }
- }
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
- };
-
- /*
- * Method declared on IWorkbenchPreferencePage
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
public void init(IWorkbench workbench) {
}
- /*
- * @see PreferencePage#createControl
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
- protected Control createContents(Composite ancestor) {
+ protected Control createContents(Composite parent) {
- Composite parent = new Composite(ancestor, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.numColumns = 2;
- parent.setLayout(layout);
-
// set F1 help
WorkbenchHelp.setHelp(parent, IHelpContextIds.FILE_TYPE_PREFERENCE_PAGE);
-
- Label l1 = new Label(parent, SWT.NULL);
- l1.setText(Policy.bind("TextPreferencePage.description")); //$NON-NLS-1$
- GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
- data.horizontalSpan = 2;
- l1.setLayoutData(data);
+ initializeDialogUnits(parent);
+
+ final Composite composite= new Composite(parent, SWT.NONE);
+ composite.setLayout(SWTUtils.createGridLayout(2, 0, 0));
+
+ fTable= new FileTypeTable(composite, this, fItems, false);
- viewer = new TableViewer(parent, SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- Table table = viewer.getTable();
- new TableEditor(table);
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.widthHint = convertWidthInCharsToPixels(30);
- /*
- * The hardcoded hint does not look elegant, but in reality
- * it does not make anything bound to this 100-pixel value,
- * because in any case the tree on the left is taller and
- * that's what really determines the height.
- */
- gd.heightHint = 100;
- table.setLayoutData(gd);
- table.addListener(SWT.Selection, new Listener() {
+
+ fTable.getViewer().getControl().addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
handleSelection();
}
});
- // Create the table columns
- new TableColumn(table, SWT.NULL);
- new TableColumn(table, SWT.NULL);
- TableColumn[] columns = table.getColumns();
- columns[0].setText(Policy.bind("TextPreferencePage.extension")); //$NON-NLS-1$
- columns[1].setText(Policy.bind("TextPreferencePage.contents")); //$NON-NLS-1$
-
- CellEditor editor = new ComboBoxCellEditor(table, new String[] {TEXT, BINARY});
- viewer.setCellEditors(new CellEditor[] {null, editor});
- viewer.setColumnProperties(new String[] {"extension", "contents"}); //$NON-NLS-1$ //$NON-NLS-2$
- viewer.setCellModifier(new ICellModifier() {
- public Object getValue(Object element, String property) {
- String value = ((TableEntry)element).getValue();
- if (value.equals(TEXT)) {
- return new Integer(0);
- } else {
- return new Integer(1);
- }
- }
- public boolean canModify(Object element, String property) {
- return true;
- }
- public void modify(Object element, String property, Object value) {
- IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
- TableEntry entry = (TableEntry)selection.getFirstElement();
- if (((Integer)value).intValue() == 0) {
- entry.setValue(TEXT);
- } else {
- entry.setValue(BINARY);
- }
- viewer.refresh(entry);
- }
- });
- viewer.setLabelProvider(new TableLabelProvider());
- viewer.setContentProvider(new IStructuredContentProvider() {
- public void dispose() {
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- }
- public Object[] getElements(Object inputElement) {
- if (inputElement == null) return null;
- return ((List)inputElement).toArray();
- }
- });
- viewer.addDoubleClickListener(new IDoubleClickListener() {
+
+ fTable.getViewer().addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
- ISelection selection = event.getSelection();
+ final ISelection selection = event.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
return;
}
- viewer.editElement(((IStructuredSelection)selection).getFirstElement(), 1);
+ fTable.getViewer().editElement(((IStructuredSelection)selection).getFirstElement(), 1);
}
});
- viewer.setSorter(new ViewerSorter() {
- public int compare(Viewer viewer, Object e1, Object e2) {
- TableEntry entry1 = (TableEntry)e1;
- TableEntry entry2 = (TableEntry)e2;
- return super.compare(viewer, entry1.getExtension(), entry2.getExtension());
+
+ final Composite buttonsComposite = new Composite(composite, SWT.NONE);
+ buttonsComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+ buttonsComposite.setLayout(SWTUtils.createGridLayout(1, 0, 0));
+
+ final int buttonWidth= (3 *convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH)) / 2;
+
+ final Button addExtensionButton = new Button(buttonsComposite, SWT.PUSH);
+ addExtensionButton.setText(Policy.bind("TextPreferencePage.add")); //$NON-NLS-1$
+ addExtensionButton.setLayoutData(SWTUtils.createGridData(buttonWidth, SWT.DEFAULT, SWT.FILL, SWT.FILL, false, false));
+ addExtensionButton.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event e) {
+ addExtension();
}
});
- TableLayout tl = new TableLayout();
- tl.addColumnData(new ColumnWeightData(50));
- tl.addColumnData(new ColumnWeightData(50));
- table.setLayout(tl);
- Composite buttons = new Composite(parent, SWT.NULL);
- buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- buttons.setLayout(layout);
-
- Button addButton = new Button(buttons, SWT.PUSH);
- addButton.setText(Policy.bind("TextPreferencePage.add")); //$NON-NLS-1$
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
- int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- data.widthHint = Math.max(widthHint, addButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- addButton.setLayoutData(data);
- addButton.addListener(SWT.Selection, new Listener() {
+ final Button addNameButton = new Button(buttonsComposite, SWT.PUSH);
+ addNameButton.setText(Policy.bind("TextPreferencePage.0")); //$NON-NLS-1$
+ addNameButton.setLayoutData(SWTUtils.createGridData(buttonWidth, SWT.DEFAULT, SWT.FILL, SWT.FILL, false, false));
+ addNameButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
- addPattern();
+ addName();
}
});
+
- changeButton = new Button(buttons, SWT.PUSH);
- changeButton.setText(Policy.bind("TextPreferencePage.change")); //$NON-NLS-1$
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
- widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- data.widthHint = Math.max(widthHint, changeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- changeButton.setLayoutData(data);
- changeButton.setEnabled(false);
- changeButton.addListener(SWT.Selection, new Listener() {
+ fChangeButton = new Button(buttonsComposite, SWT.PUSH);
+ fChangeButton.setText(Policy.bind("TextPreferencePage.change")); //$NON-NLS-1$
+ fChangeButton.setLayoutData(SWTUtils.createGridData(buttonWidth, SWT.DEFAULT, SWT.FILL, SWT.FILL, false, false));
+ fChangeButton.setEnabled(false);
+ fChangeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
changePattern();
}
});
- removeButton= new Button(buttons, SWT.PUSH);
- removeButton.setText(Policy.bind("TextPreferencePage.remove")); //$NON-NLS-1$
- data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.heightHint = convertVerticalDLUsToPixels(IDialogConstants.BUTTON_HEIGHT);
- widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- data.widthHint = Math.max(widthHint, removeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
- removeButton.setLayoutData(data);
- removeButton.setEnabled(false);
- removeButton.addListener(SWT.Selection, new Listener() {
+ fRemoveButton= new Button(buttonsComposite, SWT.PUSH);
+ fRemoveButton.setText(Policy.bind("TextPreferencePage.remove")); //$NON-NLS-1$
+ fRemoveButton.setLayoutData(SWTUtils.createGridData(buttonWidth, SWT.DEFAULT, SWT.FILL, SWT.FILL, false, false));
+ fRemoveButton.setEnabled(false);
+ fRemoveButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
removePattern();
}
});
- fillTable(Team.getAllTypes());
Dialog.applyDialogFont(parent);
- return parent;
+ return composite;
}
protected void performDefaults() {
super.performDefaults();
- IFileTypeInfo[] infos = Team.getDefaultTypes();
- fillTable(infos);
+ initializeItems();
+ if (fTable != null)
+ fTable.getViewer().refresh();
}
/**
@@ -271,110 +172,140 @@ public class TextPreferencePage extends PreferencePage implements IWorkbenchPref
* @return whether it is okay to close the preference page
*/
public boolean performOk() {
- int size = input.size();
- String[] extensions = new String[size];
- int[] types = new int[size];
- int i = 0;
-
- Iterator it = input.iterator();
- while (it.hasNext()) {
- TableEntry entry = (TableEntry)it.next();
- String value = entry.getValue();
- if (value.equals(TEXT)) {
- types[i] = Team.TEXT;
- } else {
- types[i] = Team.BINARY;
- }
- extensions[i] = entry.getExtension();
- i++;
- }
- Team.setAllTypes(extensions, types);
+ final ArrayList extensionsList= new ArrayList();
+ final ArrayList extensionsModesList= new ArrayList();
+
+ final ArrayList namesList= new ArrayList();
+ final ArrayList namesModesList= new ArrayList();
+
+ for (final Iterator iter = fItems.iterator(); iter.hasNext();) {
+ final FileTypeTable.Item item= (FileTypeTable.Item) iter.next();
+
+ if (item instanceof FileTypeTable.Extension) {
+ extensionsList.add(item.name);
+ extensionsModesList.add(new Integer(item.mode));
+ } else if (item instanceof FileTypeTable.Name) {
+ namesList.add(item.name);
+ namesModesList.add(new Integer(item.mode));
+ }
+ }
+
+ final String [] extensions= (String [])extensionsList.toArray(new String [extensionsList.size()]);
+ final String [] names= (String [])namesList.toArray(new String [namesList.size()]);
+
+ final int [] extensionsModes= integerListToIntArray(extensionsModesList);
+ final int [] namesModes= integerListToIntArray(namesModesList);
+
+ Team.getFileContentManager().setExtensionMappings(extensions, extensionsModes);
+ Team.getFileContentManager().setNameMappings(names, namesModes);
+
TeamUIPlugin.broadcastPropertyChange(new PropertyChangeEvent(this, TeamUI.GLOBAL_FILE_TYPES_CHANGED, null, null));
+
return true;
}
+
+ private static int [] integerListToIntArray(List integers) {
+ final int [] array= new int [integers.size()];
+ int index= 0;
+ for (Iterator iter = integers.iterator(); iter.hasNext();)
+ array[index++]= ((Integer)iter.next()).intValue();
+ return array;
+ }
+
/**
- * Fill the table with the values from the file type registry
+ * Add a new item to the table with the default type of Text.
*/
- private void fillTable(IFileTypeInfo[] infos) {
- this.input = new ArrayList();
- for (int i = 0; i < infos.length; i++) {
- IFileTypeInfo info = infos[i];
- int type = info.getType();
- switch (type) {
- case Team.TEXT:
- input.add(new TableEntry(info.getExtension(), TEXT));
- break;
- case Team.BINARY:
- input.add(new TableEntry(info.getExtension(), BINARY));
- break;
+ void addExtension() {
+ final InputDialog dialog = new InputDialog(getShell(), Policy.bind("TextPreferencePage.enterExtensionShort"), Policy.bind("TextPreferencePage.enterExtensionLong"), null, null); //$NON-NLS-1$ //$NON-NLS-2$
+ dialog.open();
+ if (dialog.getReturnCode() != InputDialog.OK) return;
+
+ final String extension = dialog.getValue().trim().replaceAll("\\*\\.", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ if (extension.equals("")) //$NON-NLS-1$
+ return;
+
+ // Check if the item already exists
+ final Iterator it = fItems.iterator();
+ while (it.hasNext()) {
+ final FileTypeTable.Item item= (FileTypeTable.Item)it.next();
+ if (item instanceof FileTypeTable.Extension && item.name.equals(extension)) {
+ MessageDialog.openWarning(getShell(), Policy.bind("TextPreferencePage.extensionExistsShort"), Policy.bind("TextPreferencePage.extensionExistsLong")); //$NON-NLS-1$ //$NON-NLS-2$
+ return;
}
}
- viewer.setInput(input);
+ final FileTypeTable.Item item= new FileTypeTable.Extension(extension);
+ fItems.add(item);
+ fTable.getViewer().refresh();
}
+
/**
* Add a new item to the table with the default type of Text.
*/
- private void addPattern() {
- InputDialog dialog = new InputDialog(getShell(), Policy.bind("TextPreferencePage.enterExtensionShort"), Policy.bind("TextPreferencePage.enterExtensionLong"), null, null); //$NON-NLS-1$ //$NON-NLS-2$
+ void addName() {
+ final InputDialog dialog = new InputDialog(getShell(), "New File Type", "Enter a file name:", null, null); //$NON-NLS-1$ //$NON-NLS-2$
dialog.open();
if (dialog.getReturnCode() != InputDialog.OK) return;
- String pattern = dialog.getValue();
- if (pattern.equals("")) return; //$NON-NLS-1$
+
+ final String name = dialog.getValue();
+ if (name.length() == 0 || name.indexOf(" ") >= 0) //$NON-NLS-1$
+ return; //$NON-NLS-1$
+
// Check if the item already exists
- Iterator it = input.iterator();
+ final Iterator it = fItems.iterator();
while (it.hasNext()) {
- TableEntry entry = (TableEntry)it.next();
- if (entry.getExtension().equals(pattern)) {
+ final FileTypeTable.Item item= (FileTypeTable.Item)it.next();
+ if (item instanceof FileTypeTable.Name && item.name.equals(name)) {
MessageDialog.openWarning(getShell(), Policy.bind("TextPreferencePage.extensionExistsShort"), Policy.bind("TextPreferencePage.extensionExistsLong")); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
}
- input.add(new TableEntry(pattern, TEXT));
- viewer.refresh();
+ final FileTypeTable.Item item= new FileTypeTable.Name(name);
+ fItems.add(item);
+ fTable.getViewer().refresh();
}
+
/**
* Remove the selected items from the table
*/
- private void removePattern() {
- ISelection selection = viewer.getSelection();
- if (selection == null || !(selection instanceof IStructuredSelection)) {
+ void removePattern() {
+ final IStructuredSelection selection = fTable.getSelection();
+ if (selection == null)
return;
+
+ for (final Iterator it = selection.iterator(); it.hasNext(); ) {
+ final FileTypeTable.Item item= (FileTypeTable.Item)it.next();
+ fItems.remove(item);
}
- IStructuredSelection ss = (IStructuredSelection)selection;
- Iterator it = ss.iterator();
- while (it.hasNext()) {
- TableEntry entry = (TableEntry)it.next();
- input.remove(entry);
- }
- viewer.refresh();
+ fTable.getViewer().refresh();
}
/**
* Toggle the selected items' content types
*/
- private void changePattern() {
- ISelection selection = viewer.getSelection();
- if (selection == null || !(selection instanceof IStructuredSelection)) {
+ void changePattern() {
+ final IStructuredSelection selection = fTable.getSelection();
+ if (selection == null)
return;
- }
- IStructuredSelection ss = (IStructuredSelection)selection;
- Iterator it = ss.iterator();
- while (it.hasNext()) {
- TableEntry entry = (TableEntry)it.next();
- String string = entry.getValue();
- if (string.equals(TEXT)) {
- entry.setValue(BINARY);
- } else {
- entry.setValue(TEXT);
- }
- viewer.refresh(entry);
+
+ for (final Iterator it = selection.iterator(); it.hasNext(); ) {
+ final FileTypeTable.Item item= (FileTypeTable.Item)it.next();
+ item.mode= item.mode == Team.TEXT ? Team.BINARY : Team.TEXT;
+ fTable.getViewer().refresh(item);
}
}
+
/**
* The table viewer selection has changed. Update the remove and change button enablement.
*/
- private void handleSelection() {
- boolean empty = viewer.getSelection().isEmpty();
- removeButton.setEnabled(!empty);
- changeButton.setEnabled(!empty);
+ void handleSelection() {
+ final boolean empty = fTable.getSelection().isEmpty();
+ fRemoveButton.setEnabled(!empty);
+ fChangeButton.setEnabled(!empty);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.DialogPage#convertWidthInCharsToPixels(int)
+ */
+ public int convertWidthInCharsToPixels(int chars) {
+ return super.convertWidthInCharsToPixels(chars);
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/RegistryReader.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/RegistryReader.java
index 87c695f46..be81b7b55 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/RegistryReader.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/registry/RegistryReader.java
@@ -13,8 +13,8 @@ package org.eclipse.team.internal.ui.registry;
import java.util.Hashtable;
import org.eclipse.core.runtime.*;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils.Sorter;
-import org.eclipse.ui.internal.WorkbenchPlugin;
public abstract class RegistryReader {
protected static final String TAG_DESCRIPTION = "description"; //$NON-NLS-1$
@@ -45,7 +45,7 @@ public abstract class RegistryReader {
StringBuffer buf = new StringBuffer();
buf.append("Plugin " + extension.getNamespace() + ", extension " + extension.getExtensionPointUniqueIdentifier()); //$NON-NLS-2$//$NON-NLS-1$
buf.append("\n" + text); //$NON-NLS-1$
- WorkbenchPlugin.log(buf.toString());
+ TeamUIPlugin.log(IStatus.ERROR, buf.toString(), null);
}
/**
* Logs a very common registry error when a required attribute is missing.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActionDelegateWrapper.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActionDelegateWrapper.java
index d85b8878d..9633c84bd 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActionDelegateWrapper.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActionDelegateWrapper.java
@@ -16,13 +16,7 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.*;
/**
* An Action that wraps IActionDelegates so they can be used programatically
@@ -50,6 +44,12 @@ public class ActionDelegateWrapper extends Action implements ISelectionChangedLi
}
initialize(configuration);
}
+
+ public ActionDelegateWrapper(IActionDelegate delegate, ISynchronizePageConfiguration configuration, String id) {
+ this(delegate, configuration);
+ setId(id);
+ setActionDefinitionId(id);
+ }
/**
* Method invoked from the constructor when a configuration is provided.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
index a386c76a9..53e51f004 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ChangesSection.java
@@ -152,12 +152,12 @@ public class ChangesSection extends Composite {
this.changesViewer = viewer;
calculateDescription();
configuration.addActionContribution(changedListener);
- getWorkingSetSyncInfoSet().addSyncSetChangedListener(subscriberListener);
- getSyncInfoTree().addSyncSetChangedListener(outputSetListener);
+ getParticipantSyncInfoSet().addSyncSetChangedListener(subscriberListener);
+ getVisibleSyncInfoSet().addSyncSetChangedListener(outputSetListener);
}
private void calculateDescription() {
- SyncInfoTree syncInfoTree = getSyncInfoTree();
+ SyncInfoTree syncInfoTree = getVisibleSyncInfoSet();
if (syncInfoTree.getErrors().length > 0) {
if (!showingError) {
TeamUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
@@ -224,42 +224,91 @@ public class ChangesSection extends Composite {
return composite;
}
- SyncInfoSet workingSet = getWorkingSetSyncInfoSet();
- SyncInfoSet filteredSet = getSyncInfoTree();
+ SyncInfoSet participantSet = getParticipantSyncInfoSet();
- int changesInWorkingSet = workingSet.size();
- int changesInFilter = filteredSet.size();
+ int allChanges = participantSet.size();
+ int visibleChanges = getVisibleSyncInfoSet().size();
- long outgoingChanges = workingSet.countFor(SyncInfo.OUTGOING, SyncInfo.DIRECTION_MASK);
- long incomingChanges = workingSet.countFor(SyncInfo.INCOMING, SyncInfo.DIRECTION_MASK);
-
- if(changesInFilter == 0 && changesInWorkingSet != 0) {
- final int newMode = outgoingChanges != 0 ? ISynchronizePageConfiguration.OUTGOING_MODE : ISynchronizePageConfiguration.INCOMING_MODE;
- long numChanges = outgoingChanges != 0 ? outgoingChanges : incomingChanges;
- StringBuffer text = new StringBuffer();
- text.append(Policy.bind("ChangesSection.filterHides", Utils.modeToString(configuration.getMode()))); //$NON-NLS-1$
- if(numChanges > 1) {
- text.append(Policy.bind("ChangesSection.filterHidesPlural", Long.toString(numChanges), Utils.modeToString(newMode))); //$NON-NLS-1$
- } else {
- text.append(Policy.bind("ChangesSection.filterHidesSingular", Long.toString(numChanges), Utils.modeToString(newMode))); //$NON-NLS-1$
- }
-
- Label warning = new Label(composite, SWT.NONE);
- warning.setImage(TeamUIPlugin.getPlugin().getImage(ISharedImages.IMG_WARNING_OVR));
-
- Hyperlink link = forms.createHyperlink(composite, Policy.bind("ChangesSection.filterChange", Utils.modeToString(newMode)), SWT.WRAP); //$NON-NLS-1$
- link.addHyperlinkListener(new HyperlinkAdapter() {
- public void linkActivated(HyperlinkEvent e) {
- configuration.setMode(newMode);
+ if(visibleChanges == 0 && allChanges != 0) {
+ final int candidateMode = getCandidateMode(participantSet);
+ int currentMode = page.getConfiguration().getMode();
+ if (candidateMode != currentMode) {
+ long numChanges = getChangesInMode(participantSet, candidateMode);
+ if (numChanges > 0) {
+ StringBuffer text = new StringBuffer();
+ text.append(Policy.bind("ChangesSection.filterHides", Utils.modeToString(configuration.getMode()))); //$NON-NLS-1$
+ if(numChanges > 1) {
+ text.append(Policy.bind("ChangesSection.filterHidesPlural", Long.toString(numChanges), Utils.modeToString(candidateMode))); //$NON-NLS-1$
+ } else {
+ text.append(Policy.bind("ChangesSection.filterHidesSingular", Long.toString(numChanges), Utils.modeToString(candidateMode))); //$NON-NLS-1$
+ }
+
+ Label warning = new Label(composite, SWT.NONE);
+ warning.setImage(TeamUIPlugin.getPlugin().getImage(ISharedImages.IMG_WARNING_OVR));
+
+ Hyperlink link = forms.createHyperlink(composite, Policy.bind("ChangesSection.filterChange", Utils.modeToString(candidateMode)), SWT.WRAP); //$NON-NLS-1$
+ link.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ configuration.setMode(candidateMode);
+ }
+ });
+ forms.getHyperlinkGroup().add(link);
+ createDescriptionLabel(composite, text.toString());
+ return composite;
}
- });
- forms.getHyperlinkGroup().add(link);
- createDescriptionLabel(composite, text.toString());
- } else {
- createDescriptionLabel(composite,Policy.bind("ChangesSection.noChanges", participant.getName())); //$NON-NLS-1$
- }
+ }
+ }
+ // There is no other mode that can be shown so just indicate that there are no changes
+ createDescriptionLabel(composite,Policy.bind("ChangesSection.noChanges", participant.getName())); //$NON-NLS-1$
return composite;
}
+
+ private long getChangesInMode(SyncInfoSet participantSet, final int candidateMode) {
+ long numChanges;
+ switch (candidateMode) {
+ case ISynchronizePageConfiguration.OUTGOING_MODE:
+ numChanges = participantSet.countFor(SyncInfo.OUTGOING, SyncInfo.DIRECTION_MASK);
+ break;
+ case ISynchronizePageConfiguration.INCOMING_MODE:
+ numChanges = participantSet.countFor(SyncInfo.INCOMING, SyncInfo.DIRECTION_MASK);
+ break;
+ case ISynchronizePageConfiguration.BOTH_MODE:
+ numChanges = participantSet.countFor(SyncInfo.INCOMING, SyncInfo.DIRECTION_MASK)
+ + participantSet.countFor(SyncInfo.OUTGOING, SyncInfo.DIRECTION_MASK);
+ break;
+ default:
+ numChanges = 0;
+ break;
+ }
+ return numChanges;
+ }
+
+ /*
+ * Return the candidate mode based on the presence of unfiltered changes
+ * and the modes supported by the page.
+ */
+ private int getCandidateMode(SyncInfoSet participantSet) {
+ SynchronizePageConfiguration configuration = (SynchronizePageConfiguration)page.getConfiguration();
+ long outgoingChanges = participantSet.countFor(SyncInfo.OUTGOING, SyncInfo.DIRECTION_MASK);
+ if (outgoingChanges > 0) {
+ if (configuration.isModeSupported(ISynchronizePageConfiguration.OUTGOING_MODE)) {
+ return ISynchronizePageConfiguration.OUTGOING_MODE;
+ }
+ if (configuration.isModeSupported(ISynchronizePageConfiguration.BOTH_MODE)) {
+ return ISynchronizePageConfiguration.BOTH_MODE;
+ }
+ }
+ long incomingChanges = participantSet.countFor(SyncInfo.INCOMING, SyncInfo.DIRECTION_MASK);
+ if (incomingChanges > 0) {
+ if (configuration.isModeSupported(ISynchronizePageConfiguration.INCOMING_MODE)) {
+ return ISynchronizePageConfiguration.INCOMING_MODE;
+ }
+ if (configuration.isModeSupported(ISynchronizePageConfiguration.BOTH_MODE)) {
+ return ISynchronizePageConfiguration.BOTH_MODE;
+ }
+ }
+ return configuration.getMode();
+ }
private Label createDescriptionLabel(Composite parent, String text) {
Label description = new Label(parent, SWT.WRAP);
@@ -276,8 +325,8 @@ public class ChangesSection extends Composite {
super.dispose();
forms.dispose();
configuration.removeActionContribution(changedListener);
- getWorkingSetSyncInfoSet().removeSyncSetChangedListener(subscriberListener);
- getSyncInfoTree().removeSyncSetChangedListener(outputSetListener);
+ getParticipantSyncInfoSet().removeSyncSetChangedListener(subscriberListener);
+ getVisibleSyncInfoSet().removeSyncSetChangedListener(outputSetListener);
}
private Composite getErrorComposite(Composite parent) {
@@ -316,7 +365,7 @@ public class ChangesSection extends Composite {
}
/* private */ void showErrors() {
- ITeamStatus[] status = getSyncInfoTree().getErrors();
+ ITeamStatus[] status = getVisibleSyncInfoSet().getErrors();
String title = Policy.bind("ChangesSection.11"); //$NON-NLS-1$
if (status.length == 1) {
ErrorDialog.openError(getShell(), title, status[0].getMessage(), status[0]);
@@ -330,11 +379,18 @@ public class ChangesSection extends Composite {
return getShell().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND);
}
- private SyncInfoTree getSyncInfoTree() {
+ /*
+ * Return the sync info set that contains the visible resources
+ */
+ private SyncInfoTree getVisibleSyncInfoSet() {
return (SyncInfoTree)configuration.getProperty(ISynchronizePageConfiguration.P_SYNC_INFO_SET);
}
- private SyncInfoSet getWorkingSetSyncInfoSet() {
+ /*
+ * Return the sync info set for the participant that contains all the resources
+ * including those that may not be visible due to filters (e.g. mode)
+ */
+ private SyncInfoSet getParticipantSyncInfoSet() {
return (SyncInfoSet)configuration.getProperty(SynchronizePageConfiguration.P_WORKING_SET_SYNC_INFO_SET);
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java
index d05df4a2f..c9d7639ba 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java
@@ -14,7 +14,6 @@ import org.eclipse.compare.internal.INavigatable;
import org.eclipse.compare.structuremergeviewer.*;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.action.*;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -490,12 +489,8 @@ public abstract class StructuredViewerAdvisor implements IAdaptable {
IWorkbenchPartSite ws = null;
if (workbenchSite instanceof IWorkbenchPartSite)
ws = (IWorkbenchPartSite)workbenchSite;
-// if (ws == null)
-// ws = Utils.findSite();
if (ws != null) {
ws.registerContextMenu(targetID, menuMgr, viewer);
- } else {
- TeamUIPlugin.log(IStatus.ERROR, "Cannot add menu contributions because the site cannot be found: " + targetID, null); //$NON-NLS-1$
}
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java
index cc25ba381..ce8650303 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java
@@ -458,7 +458,12 @@ public class SynchronizePageConfiguration extends SynchronizePageActionGroup imp
* @see org.eclipse.team.ui.synchronize.subscribers.ISubscriberPageConfiguration#setMode(int)
*/
public void setMode(int mode) {
- setProperty(P_MODE, new Integer(mode));
+ if (isModeSupported(mode))
+ setProperty(P_MODE, new Integer(mode));
+ }
+
+ public boolean isModeSupported(int mode) {
+ return (getSupportedModes() & mode) > 0;
}
public int getSupportedModes() {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveFromViewAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveFromViewAction.java
index 6abdfc091..f84053121 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveFromViewAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RemoveFromViewAction.java
@@ -36,7 +36,7 @@ import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
*/
public class RemoveFromViewAction extends SynchronizeModelAction {
- protected RemoveFromViewAction(ISynchronizePageConfiguration configuration) {
+ public RemoveFromViewAction(ISynchronizePageConfiguration configuration) {
super(null, configuration);
Utils.initAction(this, "action.removeFromView.", Policy.getBundle()); //$NON-NLS-1$
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SubscriberActionContribution.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SubscriberActionContribution.java
index c4347a502..8003b92b9 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SubscriberActionContribution.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/SubscriberActionContribution.java
@@ -53,6 +53,8 @@ public final class SubscriberActionContribution extends SynchronizePageActionGro
}
};
Utils.initAction(refreshSelectionAction, "action.refreshWithRemote."); //$NON-NLS-1$
+ refreshSelectionAction.setActionDefinitionId("org.eclipse.team.ui.synchronizeLast"); //$NON-NLS-1$
+ refreshSelectionAction.setId("org.eclipse.team.ui.synchronizeLast"); //$NON-NLS-1$
configureSchedule = new Action() {
public void run() {
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java
index 47fec70cc..f2a40b695 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java
@@ -80,6 +80,7 @@ public class ParticipantPageSaveablePart extends SaveablePartAdapter implements
// when the dialog is closed.
private IActionBars actionBars;
private List actionHandlers = new ArrayList(2);
+ private IPageBookViewPage page;
/*
* Page site that allows hosting the participant page in a dialog.
@@ -170,6 +171,8 @@ public class ParticipantPageSaveablePart extends SaveablePartAdapter implements
if(titleImage != null) {
titleImage.dispose();
}
+ if (page != null)
+ page.dispose();
IWorkbenchCommandSupport cm = PlatformUI.getWorkbench().getCommandSupport();
for (Iterator it = actionHandlers.iterator(); it.hasNext();) {
HandlerSubmission handler = (HandlerSubmission) it.next();
@@ -270,7 +273,7 @@ public class ParticipantPageSaveablePart extends SaveablePartAdapter implements
});
fEditionPane.setText(Policy.bind("ParticipantPageSaveablePart.0")); //$NON-NLS-1$
- IPageBookViewPage page = participant.createPage(pageConfiguration);
+ page = participant.createPage(pageConfiguration);
((SynchronizePageConfiguration)pageConfiguration).setSite(new CompareViewerPaneSite());
ToolBarManager tbm = CompareViewerPane.getToolBarManager(fEditionPane);
createActionBars(tbm);
@@ -499,13 +502,13 @@ public class ParticipantPageSaveablePart extends SaveablePartAdapter implements
return toolbar;
}
public void setGlobalActionHandler(String actionId, IAction action) {
- IHandler handler = new ActionHandler(action);
- HandlerSubmission handlerSubmission = new HandlerSubmission(null,
- dialogShell, null, actionId, handler, Priority.MEDIUM);
- PlatformUI.getWorkbench().getCommandSupport().addHandlerSubmission(handlerSubmission);
- actionHandlers.add(handlerSubmission);
+ if (actionId != null && !"".equals(actionId)) {
+ IHandler handler = new ActionHandler(action);
+ HandlerSubmission handlerSubmission = new HandlerSubmission(null, dialogShell, null, actionId, handler, Priority.MEDIUM);
+ PlatformUI.getWorkbench().getCommandSupport().addHandlerSubmission(handlerSubmission);
+ actionHandlers.add(handlerSubmission);
+ }
}
-
public void updateActionBars() {
}
};
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java
index 2b316cb26..9ebe0630b 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java
@@ -93,7 +93,7 @@ public abstract class SynchronizeModelAction extends BaseSelectionListenerAction
}
}
try {
- getSubscriberOperation(configuration, getFilteredDiffElements()).run();
+ runOperation();
} catch (InvocationTargetException e) {
handle(e);
} catch (InterruptedException e) {
@@ -101,6 +101,19 @@ public abstract class SynchronizeModelAction extends BaseSelectionListenerAction
}
}
+ /**
+ * Create aand run the operation for this action. By default, the operation is created
+ * by calling <code>getSubscriberOperation</code> and then run. Subclasses may
+ * override.
+ *
+ * @throws InvocationTargetException
+ * @throws InterruptedException
+ * @since 3.1
+ */
+ protected void runOperation() throws InvocationTargetException, InterruptedException {
+ getSubscriberOperation(configuration, getFilteredDiffElements()).run();
+ }
+
/**
* Return whether dirty editor should be saved before this action is run.
* Default is <code>true</code>.
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
index ff19d48b4..5110fdffc 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
@@ -18,6 +18,7 @@ import org.eclipse.jface.util.SafeRunnable;
import org.eclipse.jface.viewers.*;
import org.eclipse.team.internal.ui.synchronize.SynchronizePageConfiguration;
import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IKeyBindingService;
import org.eclipse.ui.actions.ActionGroup;
/**
@@ -207,6 +208,7 @@ public abstract class SynchronizePageActionGroup extends ActionGroup {
IContributionItem group = findGroup(manager, groupId);
if (group != null) {
manager.appendToGroup(group.getId(), action);
+ registerActionWithWorkbench(action);
return true;
}
return false;
@@ -247,10 +249,25 @@ public abstract class SynchronizePageActionGroup extends ActionGroup {
* @param action the action to be added
*/
protected void appendToGroup(String menuId, String groupId, IAction action) {
+ registerActionWithWorkbench(action);
internalAppendToGroup(menuId, groupId, action);
}
/**
+ * Register this action with the workbench so that it can participate in keybindings and
+ * retargetable actions.
+ *
+ * @param action the action to register
+ */
+ private void registerActionWithWorkbench(IAction action) {
+ ISynchronizePageSite site = configuration.getSite();
+ site.getActionBars().setGlobalActionHandler(action.getId(), action);
+ IKeyBindingService keyBindingService = site.getKeyBindingService();
+ if(keyBindingService != null)
+ keyBindingService.registerAction(action);
+ }
+
+ /**
* Helper method that can be invoked during initialization to add an item to
* a particular menu (one of P_TOOLBAR_MENU, P_VIEW_MENU, P_CONTEXT_MENU
* from ISynchronizePageConfiguration). The item is added to the given group
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00012.html b/tests/org.eclipse.team.tests.cvs.core/html/00012.html
index 1b01caa93..b533b2f6a 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/00012.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00012.html
@@ -1,7 +1,7 @@
-<html><head><title>Merging</title>
+<html><head><title>Branch/Merge</title>
<LINK REL=STYLESHEET HREF=../book.css CHARSET=ISO-8859-1 TYPE=text/css>
<meta NAME="keywords" content="">
<meta NAME="since" content="">
-</head><body><h2>Merging</h2>
+</head><body><h2>Branch/Merge</h2>
</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/00022.html b/tests/org.eclipse.team.tests.cvs.core/html/00022.html
index c60fcf158..d2d8b41b7 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/00022.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/00022.html
@@ -3,8 +3,8 @@
<meta NAME="keywords" content="">
<meta NAME="since" content="">
</head><body><h2>Performing a Merge</h2>
-<p>Since: M8<br>
-Last Modified: $Date: 2004/06/01 15:23:56 $</p>
+<p>Since: 3.1 M4<br>
+Last Modified: $Date: 2004/12/14 19:09:41 $</p>
<h3>Scenario 1: One Time Merge</h3>
@@ -15,6 +15,13 @@ update the incoming changes, resolve any conflicts and ensure they worked, After
redo the same merge. A no-changes dialog should be
presented since the local contents match the end-point.
+<p>
+Things to try:
+<ul>
+<li>Use content assist to select an existing branch for the end tag. A root versions should ne automatically found if it exists.
+<li>Choose to perform the merge into the local workspace. Ensure it works with and without a start tag.
+</ul>
+
<h3>Scenario 2: Ongoing Merge</h3>
After performing a one-time merge, pin the entry in the synchronize view.
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/branch00001.html b/tests/org.eclipse.team.tests.cvs.core/html/branch00001.html
index 5bc67c668..1949f238e 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/branch00001.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/branch00001.html
@@ -4,7 +4,7 @@
<meta NAME="since" content="">
</head><body><h2>Branching</h2>
<p>Since: 3.1 M4<br>
-Last Modified: $Date: 2004/06/01 15:24:23 $</p>
+Last Modified: $Date: 2004/12/14 19:09:41 $</p>
<ol>
<li>Choose Team>Branch from the context menu of the Navigator.
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/commit00001.html b/tests/org.eclipse.team.tests.cvs.core/html/commit00001.html
index f19c51ec1..56c94f2b6 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/commit00001.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/commit00001.html
@@ -4,6 +4,6 @@
<meta NAME="since" content="">
</head><body><h2>Commit</h2>
<p>Since: 3.1 M4<br>
-Last Modified: $Date: 2004/06/01 15:24:23 $</p>
+Last Modified: $Date: 2004/12/14 19:09:41 $</p>
</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/commit00002.html b/tests/org.eclipse.team.tests.cvs.core/html/commit00002.html
index 802d470db..8965e527c 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/commit00002.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/commit00002.html
@@ -4,7 +4,7 @@
<meta NAME="since" content="">
</head><body><h2>Committing Changes</h2>
<p>Since: 3.1 M4<br>
-Last Modified: $Date: 2004/06/01 15:24:23 $</p>
+Last Modified: $Date: 2004/12/14 19:09:41 $</p>
<h3>Commiting changes to existing files</h3>
<ol>
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/tags00001.html b/tests/org.eclipse.team.tests.cvs.core/html/tags00001.html
index 33e70924d..da55cef4a 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/tags00001.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/tags00001.html
@@ -4,6 +4,6 @@
<meta NAME="since" content="">
</head><body><h2>Tags</h2>
<p>Since: 3.1 M4<br>
-Last Modified: $Date: 2004/06/01 15:24:23 $</p>
+Last Modified: $Date: 2004/12/14 19:09:41 $</p>
</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/tags00002.html b/tests/org.eclipse.team.tests.cvs.core/html/tags00002.html
index 1ac5f6378..01dca2b16 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/tags00002.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/tags00002.html
@@ -4,7 +4,7 @@
<meta NAME="since" content="">
</head><body><h2>Tag Selection in Dialogs</h2>
<p>Since: 3.1 M4<br>
-Last Modified: $Date: 2004/06/01 15:24:23 $</p>
+Last Modified: $Date: 2004/12/14 19:09:41 $</p>
Tag lists appear in many dialogs:
<ul>
diff --git a/tests/org.eclipse.team.tests.cvs.core/html/tags00003.html b/tests/org.eclipse.team.tests.cvs.core/html/tags00003.html
index 0148c3515..cfe8dae53 100644
--- a/tests/org.eclipse.team.tests.cvs.core/html/tags00003.html
+++ b/tests/org.eclipse.team.tests.cvs.core/html/tags00003.html
@@ -4,7 +4,7 @@
<meta NAME="since" content="">
</head><body><h2>Tag Caching</h2>
<p>Since: 3.1 M4<br>
-Last Modified: $Date: 2004/06/01 15:24:23 $</p>
+Last Modified: $Date: 2004/12/14 19:09:41 $</p>
Discovered tags are cached locally to improve performance. Caching is done in the following ways:
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
index 7612367f7..ffd812b8e 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
@@ -291,7 +291,7 @@ public class EclipseTest extends ResourceTest {
* Commit the resources contained by the mappers.
*/
protected void commit(ResourceMapping[] mappers, String message) throws CVSException {
- executeHeadless(new CommitOperation(null, mappers, new Command.LocalOption[] { Commit.makeArgumentOption(Command.MESSAGE_OPTION, message) }));
+ executeHeadless(new CommitOperation(null, mappers, new Command.LocalOption[0], message));
}
/**
@@ -327,8 +327,8 @@ public class EclipseTest extends ResourceTest {
public void tagRemoteResource(ICVSRemoteResource resource, CVSTag tag, boolean force) throws TeamException {
ITagOperation op = new TagInRepositoryOperation(null, new ICVSRemoteResource[] {resource});
runTag(op, tag, force);
-
}
+
private void runTag(ITagOperation op, CVSTag tag, boolean force) throws TeamException {
if (force) op.moveTag();
op.setTag(tag);
diff --git a/tests/org.eclipse.team.tests.cvs.core/toc.xml b/tests/org.eclipse.team.tests.cvs.core/toc.xml
index d7e096a8d..8904b16de 100644
--- a/tests/org.eclipse.team.tests.cvs.core/toc.xml
+++ b/tests/org.eclipse.team.tests.cvs.core/toc.xml
@@ -57,11 +57,13 @@
<topic label="Scenarios" href="html/sync00001.html">
</topic>
</topic>
- <topic label="Merging" href="html/00012.html">
+ <topic label="Branch/Merge" href="html/00012.html">
<topic label="Performing a Merge" href="html/00022.html">
</topic>
<topic label="Synchronize View" href="html/00013.html">
</topic>
+ <topic label="Branching" href="html/branch00001.html">
+ </topic>
</topic>
<topic label="Patching" href="html/00029.html">
<topic label="Importing a zip over a shared project" href="html/00030.html">
@@ -145,4 +147,14 @@
<topic label="Refactoring" href="html/validate_edit_refactoring00001.html">
</topic>
</topic>
+ <topic label="Commit" href="html/commit00001.html">
+ <topic label="Committing Changes" href="html/commit00002.html">
+ </topic>
+ </topic>
+ <topic label="Tags" href="html/tags00001.html">
+ <topic label="Tag Selection in Dialogs" href="html/tags00002.html">
+ </topic>
+ <topic label="Tag Caching" href="html/tags00003.html">
+ </topic>
+ </topic>
</toc>

Back to the top