Eclipse.org makes available all content in this plug-in "Content". Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 0.5 "CPL". For purposes of the CPL, "Program" will mean the Content.
-
-
Third Party Content
-
-
The Content includes items that have been sourced from third parties as follows:
-
-
Ant 1.4.1
-
The plug-in is based on software developed by The Apache Software Foundation as part of the Jakarta project.
-
-
The class PServerConnection "Ant Derivative Work" contained in teamcvs.jar and teamcvssrc.zip is based on Ant code.
-
-
The Ant Derivative Work is:
-
-
Copyright (c) 1999 The Apache Software Foundation. All rights reserved.
-
-
Your use of the Ant Derivative Work, is subject to the terms and conditions of the
-Apache Software License 1.1.
-More specifically:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of
- conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice, this list of
- conditions and the following disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- 3. The end-user documentation included with the redistribution, if any, must include the
- following acknowledgment:
-
- "This product includes software developed by the Apache Software Foundation
- (http://www.apache.org/)."
-
- Alternately, this acknowledgment may appear in the software itself, if and wherever such
- third-party acknowledgments normally appear.
-
- 4. The names "Ant" and "Apache Software Foundation" must not be used to endorse or
- promote products derived from this software without prior written permission. For written
- permission, please contact apache@apache.org.
-
- 5. Products derived from this software may not be called "Apache", nor may "Apache" appear
- in their name, without prior written permission of the Apache Software Foundation.
-
- THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
Contributions
-
-
If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.
-
-
If this Content is licensed to you under license terms and conditions other than the CPL "Other License", any modifications, enhancements and/or
-other code and/or documentation "Modifications" uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.
-
-
+
+
+About
+
+
+
+
+
+
About This Content
+
+
+
+
11th December, 2001
+
License
+
Eclipse.org makes available all content in this plug-in "Content". Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Common Public License Version 0.5 "CPL". For purposes of the CPL, "Program" will mean the Content.
+
+
Third Party Content
+
+
The Content includes items that have been sourced from third parties as follows:
+
+
Ant 1.4.1
+
The plug-in is based on software developed by The Apache Software Foundation as part of the Jakarta project.
+
+
The class PServerConnection "Ant Derivative Work" contained in teamcvs.jar and teamcvssrc.zip is based on Ant code.
+
+
The Ant Derivative Work is:
+
+
Copyright (c) 1999 The Apache Software Foundation. All rights reserved.
+
+
Your use of the Ant Derivative Work, is subject to the terms and conditions of the
+Apache Software License 1.1.
+More specifically:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of
+ conditions and the following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ 3. The end-user documentation included with the redistribution, if any, must include the
+ following acknowledgment:
+
+ "This product includes software developed by the Apache Software Foundation
+ (http://www.apache.org/)."
+
+ Alternately, this acknowledgment may appear in the software itself, if and wherever such
+ third-party acknowledgments normally appear.
+
+ 4. The names "Ant" and "Apache Software Foundation" must not be used to endorse or
+ promote products derived from this software without prior written permission. For written
+ permission, please contact apache@apache.org.
+
+ 5. Products derived from this software may not be called "Apache", nor may "Apache" appear
+ in their name, without prior written permission of the Apache Software Foundation.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
Contributions
+
+
If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
+made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
+Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.
+
+
If this Content is licensed to you under license terms and conditions other than the CPL "Other License", any modifications, enhancements and/or
+other code and/or documentation "Modifications" uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
+host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
+to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
+providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
+the CPL.
+
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/buildnotes_cvs.html b/bundles/org.eclipse.team.cvs.core/buildnotes_cvs.html
index 4212066a2..2c27755cd 100644
--- a/bundles/org.eclipse.team.cvs.core/buildnotes_cvs.html
+++ b/bundles/org.eclipse.team.cvs.core/buildnotes_cvs.html
@@ -13,122 +13,122 @@
Eclipse Platform Release Notes - VCM
-
-
diff --git a/bundles/org.eclipse.team.cvs.core/doc/hglegal.htm b/bundles/org.eclipse.team.cvs.core/doc/hglegal.htm
index b071dbdf4..c59811321 100644
--- a/bundles/org.eclipse.team.cvs.core/doc/hglegal.htm
+++ b/bundles/org.eclipse.team.cvs.core/doc/hglegal.htm
@@ -1,14 +1,14 @@
-
-
-
-
-
- Legal Notices
-
-
-
-
-Notices
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-
-
+
+
+
+
+
+ Legal Notices
+
+
+
+
-The extension points declared by this plug-in are for internal use only.
-
-
-
-
+
+
+
+
+
+ Eclipse CVS Core Extension Points
+
+
+
+
Eclipse CVS Core
+The extension points declared by this plug-in are for internal use only.
+
+
+
+
diff --git a/bundles/org.eclipse.team.cvs.core/plugin.properties b/bundles/org.eclipse.team.cvs.core/plugin.properties
index 5f8281e6f..aaa56cf85 100644
--- a/bundles/org.eclipse.team.cvs.core/plugin.properties
+++ b/bundles/org.eclipse.team.cvs.core/plugin.properties
@@ -1,2 +1,2 @@
-pluginName = CVS Team Provider
+pluginName = CVS Team Provider
cvsNature=CVS Team Nature
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/plugin.xml b/bundles/org.eclipse.team.cvs.core/plugin.xml
index 072b9dedf..462a77d2a 100644
--- a/bundles/org.eclipse.team.cvs.core/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.core/plugin.xml
@@ -1,61 +1,61 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java
index 610b4b87b..1ffc83cbc 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSTag.java
@@ -1,77 +1,77 @@
-package org.eclipse.team.ccvs.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.team.internal.ccvs.core.Policy;
-
-/**
- * A tag in CVS gives a label to a collection of revisions. The labels can represent a version, a branch,
- * or a date.
- */
-public class CVSTag {
-
- public final static int HEAD = 0;
- public final static int BRANCH = 1;
- public final static int VERSION = 2;
- public final static int DATE = 3;
-
- public static final CVSTag DEFAULT = new CVSTag();
-
- protected String name;
- protected int type;
-
- public CVSTag() {
- this("HEAD", HEAD); //$NON-NLS-1$
- }
-
- public CVSTag(String name, int type) {
- this.name = name;
- this.type = type;
- }
-
- public boolean equals(Object other) {
- if(other == this) return true;
- if (!(other instanceof CVSTag)) return false;
-
- CVSTag tag = ((CVSTag)other);
- if (getType() != tag.getType()) return false;
- if (!getName().equals(tag.getName())) return false;
- return true;
- }
-
- public String getName() {
- return name;
- }
-
- public int getType() {
- return type;
- }
-
- public int hashCode() {
- return name.hashCode();
- }
-
- public int compareTo(CVSTag other) {
- return getName().compareTo(other.getName());
- }
-
- public static IStatus validateTagName(String tagName) {
- if (tagName == null)
- return new CVSStatus(CVSStatus.ERROR, Policy.bind("CVSTag.nullName")); //$NON-NLS-1$
- if (tagName.equals("")) //$NON-NLS-1$
- return new CVSStatus(CVSStatus.ERROR, Policy.bind("CVSTag.emptyName")); //$NON-NLS-1$
- if (!Character. isLetter(tagName.charAt(0)))
- return new CVSStatus(CVSStatus.ERROR, Policy.bind("CVSTag.beginName")); //$NON-NLS-1$
-
- for (int i = 0; i < tagName.length(); i++) {
- char c = tagName.charAt(i);
- if ( Character.isSpaceChar(c) || c == '$' || c == ',' || c == '.' || c == ':' || c == ';' || c == '@' || c == '|')
- return new CVSStatus(CVSStatus.ERROR, Policy.bind("CVSTag.badCharName")); //$NON-NLS-1$
- }
- return new CVSStatus(CVSStatus.OK, Policy.bind("ok")); //$NON-NLS-1$
- }
+package org.eclipse.team.ccvs.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2002.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.internal.ccvs.core.Policy;
+
+/**
+ * A tag in CVS gives a label to a collection of revisions. The labels can represent a version, a branch,
+ * or a date.
+ */
+public class CVSTag {
+
+ public final static int HEAD = 0;
+ public final static int BRANCH = 1;
+ public final static int VERSION = 2;
+ public final static int DATE = 3;
+
+ public static final CVSTag DEFAULT = new CVSTag();
+
+ protected String name;
+ protected int type;
+
+ public CVSTag() {
+ this("HEAD", HEAD); //$NON-NLS-1$
+ }
+
+ public CVSTag(String name, int type) {
+ this.name = name;
+ this.type = type;
+ }
+
+ public boolean equals(Object other) {
+ if(other == this) return true;
+ if (!(other instanceof CVSTag)) return false;
+
+ CVSTag tag = ((CVSTag)other);
+ if (getType() != tag.getType()) return false;
+ if (!getName().equals(tag.getName())) return false;
+ return true;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public int hashCode() {
+ return name.hashCode();
+ }
+
+ public int compareTo(CVSTag other) {
+ return getName().compareTo(other.getName());
+ }
+
+ public static IStatus validateTagName(String tagName) {
+ if (tagName == null)
+ return new CVSStatus(CVSStatus.ERROR, Policy.bind("CVSTag.nullName")); //$NON-NLS-1$
+ if (tagName.equals("")) //$NON-NLS-1$
+ return new CVSStatus(CVSStatus.ERROR, Policy.bind("CVSTag.emptyName")); //$NON-NLS-1$
+ if (!Character. isLetter(tagName.charAt(0)))
+ return new CVSStatus(CVSStatus.ERROR, Policy.bind("CVSTag.beginName")); //$NON-NLS-1$
+
+ for (int i = 0; i < tagName.length(); i++) {
+ char c = tagName.charAt(i);
+ if ( Character.isSpaceChar(c) || c == '$' || c == ',' || c == '.' || c == ':' || c == ';' || c == '@' || c == '|')
+ return new CVSStatus(CVSStatus.ERROR, Policy.bind("CVSTag.badCharName")); //$NON-NLS-1$
+ }
+ return new CVSStatus(CVSStatus.OK, Policy.bind("ok")); //$NON-NLS-1$
+ }
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSRemoteFile.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSRemoteFile.java
index 3f815061e..a150af4e2 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSRemoteFile.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/ICVSRemoteFile.java
@@ -1,37 +1,37 @@
-package org.eclipse.team.ccvs.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.InputStream;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.team.core.TeamException;
-
- /**
- * This interface represents a file in a repository.
- * Instances of this interface can be used to fetch the contents
- * of the remote file.
- *
- * In the future, additional information should be available (tags, revisions, etc.)
- *
- * Clients are not expected to implement this interface.
- */
-public interface ICVSRemoteFile extends ICVSRemoteResource {
-
- /**
- * Get the log entries of the remote file
- */
- public ILogEntry[] getLogEntries(IProgressMonitor monitor) throws TeamException;
-
- /**
- * Get the revision of the remote file (e.g. 1.1)
- *
- * The revision depends on any tagging associated with the remote parent used
- * to access the file.
- */
- public String getRevision() throws TeamException;
-}
-
+package org.eclipse.team.ccvs.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.team.core.TeamException;
+
+ /**
+ * This interface represents a file in a repository.
+ * Instances of this interface can be used to fetch the contents
+ * of the remote file.
+ *
+ * In the future, additional information should be available (tags, revisions, etc.)
+ *
+ * Clients are not expected to implement this interface.
+ */
+public interface ICVSRemoteFile extends ICVSRemoteResource {
+
+ /**
+ * Get the log entries of the remote file
+ */
+ public ILogEntry[] getLogEntries(IProgressMonitor monitor) throws TeamException;
+
+ /**
+ * Get the revision of the remote file (e.g. 1.1)
+ *
+ * The revision depends on any tagging associated with the remote parent used
+ * to access the file.
+ */
+ public String getRevision() throws TeamException;
+}
+
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IConnectionMethod.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IConnectionMethod.java
index f2346ddf9..81d122db8 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IConnectionMethod.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IConnectionMethod.java
@@ -1,31 +1,31 @@
-package org.eclipse.team.ccvs.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * Implementators of this class can act as factories for creating connections to a CVS server
- * with the desired custom communication protocol. Providers of CVS connection methods must implement
- * this interface and register the implementation with the extension point:
- *
- * org.eclipse.team.cvs.core.connectionmethods
- *
- * The createConnection() method will be invoked by the CVS client when the user
- * is attempting to make a connection to the server using the connection name which matches
- * the String returned by getName() (e.g. "pserver", "ext", etc.).
- */
-public interface IConnectionMethod {
-
- /**
- * Returns the name of this connection method (e.g."local", "ext").
- */
- public String getName();
-
- /**
- * Creates a new server connection using the given repository root
- * (which includes the user name) and the given password.
- */
- public IServerConnection createConnection(ICVSRepositoryLocation location, String password);
-}
+package org.eclipse.team.ccvs.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ * Implementators of this class can act as factories for creating connections to a CVS server
+ * with the desired custom communication protocol. Providers of CVS connection methods must implement
+ * this interface and register the implementation with the extension point:
+ *
+ * org.eclipse.team.cvs.core.connectionmethods
+ *
+ * The createConnection() method will be invoked by the CVS client when the user
+ * is attempting to make a connection to the server using the connection name which matches
+ * the String returned by getName() (e.g. "pserver", "ext", etc.).
+ */
+public interface IConnectionMethod {
+
+ /**
+ * Returns the name of this connection method (e.g."local", "ext").
+ */
+ public String getName();
+
+ /**
+ * Creates a new server connection using the given repository root
+ * (which includes the user name) and the given password.
+ */
+ public IServerConnection createConnection(ICVSRepositoryLocation location, String password);
+}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IServerConnection.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IServerConnection.java
index 95b8fe472..62fc1ab9a 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IServerConnection.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IServerConnection.java
@@ -1 +1 @@
-package org.eclipse.team.ccvs.core;
/*
* (c) Copyright IBM Corp. 2000, 2002.
* All Rights Reserved.
*/
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.ccvs.core.connection.CVSAuthenticationException;
/**
* CVS supports different connection methods for communicating between a client and the server.
* Furthermore, custom connection methods can be added. Connection methods are added
* to the CVS client as an IConnectionMethod, which can be used to create connections of
* type IServerConnection.
*
* @see IConnectionMethod
*/
public interface IServerConnection {
/**
* Open a connection to the CVS server.
*
* Throw CVSAuthenticationException if the username or password is invalid.
* Throw IOExceptions for other failures.
*/
public void open(IProgressMonitor monitor) throws IOException, CVSAuthenticationException;
/**
* Close the connection
*
* Throw IOException on failures
*/
public void close() throws IOException;
/**
* Get the input stream to receive responses from the server
*/
public InputStream getInputStream();
/**
* Get the output stream to send requests to the server
*/
public OutputStream getOutputStream();
}
\ No newline at end of file
+package org.eclipse.team.ccvs.core;
/*
* (c) Copyright IBM Corp. 2000, 2002.
* All Rights Reserved.
*/
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.ccvs.core.connection.CVSAuthenticationException;
/**
* CVS supports different connection methods for communicating between a client and the server.
* Furthermore, custom connection methods can be added. Connection methods are added
* to the CVS client as an IConnectionMethod, which can be used to create connections of
* type IServerConnection.
*
* @see IConnectionMethod
*/
public interface IServerConnection {
/**
* Open a connection to the CVS server.
*
* Throw CVSAuthenticationException if the username or password is invalid.
* Throw IOExceptions for other failures.
*/
public void open(IProgressMonitor monitor) throws IOException, CVSAuthenticationException;
/**
* Close the connection
*
* Throw IOException on failures
*/
public void close() throws IOException;
/**
* Get the input stream to receive responses from the server
*/
public InputStream getInputStream();
/**
* Get the output stream to send requests to the server
*/
public OutputStream getOutputStream();
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IUserInfo.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IUserInfo.java
index 6725306a8..4f060706b 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IUserInfo.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/IUserInfo.java
@@ -1,34 +1,34 @@
-package org.eclipse.team.ccvs.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * Instances of this class represent a username password pair.
- * Both values can be set and the username can be retrieved.
- * However, it is possible that the username is not mutable.
- * Users must check before trying to set the username.
- *
- * Clients are not expected to implement this interface
- */
-public interface IUserInfo {
- /**
- * Get the username for this user.
- */
- public String getUsername();
- /**
- * Return true if the username is mutable. If not, setUsername should not be called.
- */
- public boolean isUsernameMutable();
- /**
- * Sets the password for this user.
- */
- public void setPassword(String password);
- /**
- * Sets the username for this user. This should not be called if
- * isUsernameMutable() returns false.
- */
- public void setUsername(String username);
+package org.eclipse.team.ccvs.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ * Instances of this class represent a username password pair.
+ * Both values can be set and the username can be retrieved.
+ * However, it is possible that the username is not mutable.
+ * Users must check before trying to set the username.
+ *
+ * Clients are not expected to implement this interface
+ */
+public interface IUserInfo {
+ /**
+ * Get the username for this user.
+ */
+ public String getUsername();
+ /**
+ * Return true if the username is mutable. If not, setUsername should not be called.
+ */
+ public boolean isUsernameMutable();
+ /**
+ * Sets the password for this user.
+ */
+ public void setPassword(String password);
+ /**
+ * Sets the username for this user. This should not be called if
+ * isUsernameMutable() returns false.
+ */
+ public void setUsername(String username);
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSEntryLineTag.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSEntryLineTag.java
index f097f1b00..54cd2595c 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSEntryLineTag.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSEntryLineTag.java
@@ -1,58 +1,58 @@
-package org.eclipse.team.internal.ccvs.core.resources;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.team.ccvs.core.CVSTag;
-
-public class CVSEntryLineTag extends CVSTag {
-
- /*
- * The parameter tag must not be null.
- */
- public CVSEntryLineTag(CVSTag tag) {
- super(tag.getName(), tag.getType());
- }
-
- public CVSEntryLineTag(String entryLineTag) {
- switch (entryLineTag.charAt(0)) {
- case 'T' : type = BRANCH; break;
- case 'N' : type = VERSION; break;
- case 'D' : type = DATE; break;
- default: type = HEAD;
- }
- name = entryLineTag.substring(1);
- }
- /*
- * Returns the tag name
- */
- public String getName() {
- return name;
- }
- /*
- * Returns the tag type
- */
- public int getType() {
- return type;
- }
-
- public String toEntryLineFormat(boolean useSamePrefixForBranchAndTag) {
- if (type == BRANCH || (type == VERSION && useSamePrefixForBranchAndTag))
- return "T" + name;//$NON-NLS-1$
- else if (type == VERSION)
- return "N" + name;//$NON-NLS-1$
- else if (type == DATE)
- return "D" + name;//$NON-NLS-1$
- return "";//$NON-NLS-1$
- }
-
- public boolean equals(Object obj) {
- // We assume, that the name and type can not be null
- if (obj == this) return true;
- if (!(obj instanceof CVSEntryLineTag)) return false;
- return (type == ((CVSEntryLineTag)obj).type) && name.equals(((CVSEntryLineTag)obj).name);
- }
-}
-
+package org.eclipse.team.internal.ccvs.core.resources;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.team.ccvs.core.CVSTag;
+
+public class CVSEntryLineTag extends CVSTag {
+
+ /*
+ * The parameter tag must not be null.
+ */
+ public CVSEntryLineTag(CVSTag tag) {
+ super(tag.getName(), tag.getType());
+ }
+
+ public CVSEntryLineTag(String entryLineTag) {
+ switch (entryLineTag.charAt(0)) {
+ case 'T' : type = BRANCH; break;
+ case 'N' : type = VERSION; break;
+ case 'D' : type = DATE; break;
+ default: type = HEAD;
+ }
+ name = entryLineTag.substring(1);
+ }
+ /*
+ * Returns the tag name
+ */
+ public String getName() {
+ return name;
+ }
+ /*
+ * Returns the tag type
+ */
+ public int getType() {
+ return type;
+ }
+
+ public String toEntryLineFormat(boolean useSamePrefixForBranchAndTag) {
+ if (type == BRANCH || (type == VERSION && useSamePrefixForBranchAndTag))
+ return "T" + name;//$NON-NLS-1$
+ else if (type == VERSION)
+ return "N" + name;//$NON-NLS-1$
+ else if (type == DATE)
+ return "D" + name;//$NON-NLS-1$
+ return "";//$NON-NLS-1$
+ }
+
+ public boolean equals(Object obj) {
+ // We assume, that the name and type can not be null
+ if (obj == this) return true;
+ if (!(obj instanceof CVSEntryLineTag)) return false;
+ return (type == ((CVSEntryLineTag)obj).type) && name.equals(((CVSEntryLineTag)obj).name);
+ }
+}
+
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSLocalSyncElement.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSLocalSyncElement.java
index f8af2d450..479fda922 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSLocalSyncElement.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSLocalSyncElement.java
@@ -1,134 +1,134 @@
-package org.eclipse.team.internal.ccvs.core.resources;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.team.ccvs.core.*;
-import org.eclipse.team.core.sync.ILocalSyncElement;
-import org.eclipse.team.core.sync.IRemoteResource;
-import org.eclipse.team.core.sync.LocalSyncElement;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
-
-public class CVSLocalSyncElement extends LocalSyncElement {
-
- protected IRemoteResource base;
- protected IResource local;
-
- public CVSLocalSyncElement(IResource local, IRemoteResource base) {
- this.local = local;
- this.base = base;
- }
-
- /*
- * @see RemoteSyncElement#create(IResource, IRemoteResource, IRemoteResource)
- */
- public ILocalSyncElement create(IResource local, IRemoteResource base, Object data) {
- return new CVSLocalSyncElement(local, base);
- }
-
- /*
- * @see ILocalSyncElement#getLocal()
- */
- public IResource getLocal() {
- return local;
- }
-
- /*
- * @see ILocalSyncElement#getBase()
- */
- public IRemoteResource getBase() {
- return base;
- }
-
- /*
- * @see ILocalSyncElement#isDirty()
- */
- public boolean isDirty() {
- ICVSResource cvsResource = getCVSResourceFor(getLocal());
- if(cvsResource == null) {
- return false;
- } else {
- // a folder is dirty if it is managed but is not a CVS folder. This can
- // easily happen if someone deletes a folder from the file system but
- // doesn't unmanage it.
- if(cvsResource.isFolder()) {
- return false;
- } else {
- try {
- ResourceSyncInfo info = cvsResource.getSyncInfo();
- if(info==null) {
- return false;
- }
- if(base!=null) {
- boolean sameRevisions = ((RemoteFile)base).getRevision().equals(info.getRevision());
- if(!sameRevisions) {
- return true;
- }
- }
- return ((ICVSFile)cvsResource).isDirty();
- } catch(CVSException e) {
- return true;
- }
- }
- }
- }
-
- /*
- * @see ILocalSyncElement#isCheckedOut()
- */
- public boolean isCheckedOut() {
- return getLocal() != null;
- }
-
- /*
- * @see ILocalSyncElement#hasRemote()
- */
- public boolean hasRemote() {
- return getLocal() != null;
- }
-
- /*
- * @see RemoteSyncElement#getData()
- */
- protected Object getData() {
- return null;
- }
-
- /*
- * Answers the CVS resource for this sync element
- */
- public ICVSResource getCVSResource() {
- return getCVSResourceFor(getLocal());
- }
-
- /*
- * @see LocalSyncElement#isIgnored(IResource)
- */
- protected boolean isIgnored(IResource child) {
- ICVSResource cvsResource = getCVSResourceFor(getLocal());
- if(cvsResource==null || !cvsResource.isFolder() ) {
- return false;
- } else {
- try {
- ICVSResource managedChild = ((ICVSFolder)cvsResource).getChild(child.getName());
- return managedChild.isIgnored();
- } catch(CVSException e) {
- return false;
- }
- }
- }
-
- private ICVSResource getCVSResourceFor(IResource resource) {
- if(resource.getType() != IResource.FILE) {
- return new EclipseFolder((IContainer)resource);
- } else {
- return new EclipseFile((IFile)resource);
- }
- }
+package org.eclipse.team.internal.ccvs.core.resources;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.team.ccvs.core.*;
+import org.eclipse.team.core.sync.ILocalSyncElement;
+import org.eclipse.team.core.sync.IRemoteResource;
+import org.eclipse.team.core.sync.LocalSyncElement;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
+
+public class CVSLocalSyncElement extends LocalSyncElement {
+
+ protected IRemoteResource base;
+ protected IResource local;
+
+ public CVSLocalSyncElement(IResource local, IRemoteResource base) {
+ this.local = local;
+ this.base = base;
+ }
+
+ /*
+ * @see RemoteSyncElement#create(IResource, IRemoteResource, IRemoteResource)
+ */
+ public ILocalSyncElement create(IResource local, IRemoteResource base, Object data) {
+ return new CVSLocalSyncElement(local, base);
+ }
+
+ /*
+ * @see ILocalSyncElement#getLocal()
+ */
+ public IResource getLocal() {
+ return local;
+ }
+
+ /*
+ * @see ILocalSyncElement#getBase()
+ */
+ public IRemoteResource getBase() {
+ return base;
+ }
+
+ /*
+ * @see ILocalSyncElement#isDirty()
+ */
+ public boolean isDirty() {
+ ICVSResource cvsResource = getCVSResourceFor(getLocal());
+ if(cvsResource == null) {
+ return false;
+ } else {
+ // a folder is dirty if it is managed but is not a CVS folder. This can
+ // easily happen if someone deletes a folder from the file system but
+ // doesn't unmanage it.
+ if(cvsResource.isFolder()) {
+ return false;
+ } else {
+ try {
+ ResourceSyncInfo info = cvsResource.getSyncInfo();
+ if(info==null) {
+ return false;
+ }
+ if(base!=null) {
+ boolean sameRevisions = ((RemoteFile)base).getRevision().equals(info.getRevision());
+ if(!sameRevisions) {
+ return true;
+ }
+ }
+ return ((ICVSFile)cvsResource).isDirty();
+ } catch(CVSException e) {
+ return true;
+ }
+ }
+ }
+ }
+
+ /*
+ * @see ILocalSyncElement#isCheckedOut()
+ */
+ public boolean isCheckedOut() {
+ return getLocal() != null;
+ }
+
+ /*
+ * @see ILocalSyncElement#hasRemote()
+ */
+ public boolean hasRemote() {
+ return getLocal() != null;
+ }
+
+ /*
+ * @see RemoteSyncElement#getData()
+ */
+ protected Object getData() {
+ return null;
+ }
+
+ /*
+ * Answers the CVS resource for this sync element
+ */
+ public ICVSResource getCVSResource() {
+ return getCVSResourceFor(getLocal());
+ }
+
+ /*
+ * @see LocalSyncElement#isIgnored(IResource)
+ */
+ protected boolean isIgnored(IResource child) {
+ ICVSResource cvsResource = getCVSResourceFor(getLocal());
+ if(cvsResource==null || !cvsResource.isFolder() ) {
+ return false;
+ } else {
+ try {
+ ICVSResource managedChild = ((ICVSFolder)cvsResource).getChild(child.getName());
+ return managedChild.isIgnored();
+ } catch(CVSException e) {
+ return false;
+ }
+ }
+ }
+
+ private ICVSResource getCVSResourceFor(IResource resource) {
+ if(resource.getType() != IResource.FILE) {
+ return new EclipseFolder((IContainer)resource);
+ } else {
+ return new EclipseFile((IFile)resource);
+ }
+ }
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
index 0d8bd1670..9b0d64cc1 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/CVSRemoteSyncElement.java
@@ -1,318 +1,318 @@
-package org.eclipse.team.internal.ccvs.core.resources;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.team.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.ccvs.core.ICVSFolder;
-import org.eclipse.team.ccvs.core.ICVSRemoteResource;
-import org.eclipse.team.ccvs.core.ICVSResource;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.sync.ILocalSyncElement;
-import org.eclipse.team.core.sync.IRemoteResource;
-import org.eclipse.team.core.sync.IRemoteSyncElement;
-import org.eclipse.team.core.sync.RemoteSyncElement;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.CVSProvider;
-import org.eclipse.team.internal.ccvs.core.Policy;
-import org.eclipse.team.internal.ccvs.core.client.Update;
-import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
-import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
-import org.eclipse.team.internal.ccvs.core.util.Assert;
-
-public class CVSRemoteSyncElement extends RemoteSyncElement {
-
- CVSLocalSyncElement localSync;
- IRemoteResource remote;
- boolean ignoreBaseTree = true;
-
- public CVSRemoteSyncElement(boolean ignoreBaseTree, IResource local, IRemoteResource base, IRemoteResource remote) {
- localSync = new CVSLocalSyncElement(local, base);
- this.remote = remote;
- this.ignoreBaseTree = ignoreBaseTree;
- }
-
- /*
- * @see RemoteSyncElement#create(IResource, IRemoteResource, IRemoteResource)
- */
- public IRemoteSyncElement create(boolean ignoreBaseTree, IResource local, IRemoteResource base, IRemoteResource remote, Object data) {
- return new CVSRemoteSyncElement(ignoreBaseTree, local, base, remote);
- }
-
- /*
- * @see IRemoteSyncElement#getRemote()
- */
- public IRemoteResource getRemote() {
- return remote;
- }
-
- /*
- * @see IRemoteSyncElement#isOutOfDate()
- */
- public boolean isOutOfDate() {
- IRemoteResource base = getBase();
- if(base!=null && remote!=null) {
- ICVSRemoteResource remoteCvs = (ICVSRemoteResource)remote;
- ICVSRemoteResource baseCvs = (ICVSRemoteResource)base;
- return ! remoteCvs.equals(baseCvs);
- } else if(base!=null && remote==null) {
- return true;
- } else {
- return false;
- }
- }
-
- /*
- * @see LocalSyncElement#getData()
- */
- protected Object getData() {
- return localSync.getData();
- }
-
- /*
- * @see ILocalSyncElement#getLocal()
- */
- public IResource getLocal() {
- return localSync.getLocal();
- }
-
- /*
- * @see ILocalSyncElement#getBase()
- */
- public IRemoteResource getBase() {
- return localSync.getBase();
- }
-
- /*
- * @see ILocalSyncElement#isDirty()
- */
- public boolean isDirty() {
- return localSync.isDirty();
- }
-
- /*
- * @see ILocalSyncElement#isCheckedOut()
- */
- public boolean isCheckedOut() {
- return localSync.isCheckedOut();
- }
-
- /*
- * Local helper to indicate if the corresponding local resource has a base
- *
- * XXX Should this be part of the interface?
- */
- public boolean hasBase() {
- return getBase() != null;
- }
-
- /*
- * @see ILocalSyncElement#hasRemote()
- */
- public boolean hasRemote() {
- return remote != null;
- }
-
- /*
- * @see LocalSyncElement#create(IResource, IRemoteResource, Object)
- */
- public ILocalSyncElement create(IResource local, IRemoteResource base, Object data) {
- return localSync.create(local, base, data);
- }
- /*
- * @see LocalSyncElement#isIgnored(IResource)
- */
- protected boolean isIgnored(IResource resource) {
- return localSync.isIgnored(resource);
- }
- /*
- * @see IRemoteSyncElement#ignoreBaseTree()
- */
- public boolean ignoreBaseTree() {
- return ignoreBaseTree;
- }
-
- /*
- * Update the sync info of the local resource in such a way that the local changes can be committed.
- */
- public void makeOutgoing(IProgressMonitor monitor) throws TeamException {
-
- int syncKind = getSyncKind(GRANULARITY_TIMESTAMP, monitor);
- boolean conflict = (syncKind & DIRECTION_MASK) == CONFLICTING;
- boolean incoming = (syncKind & DIRECTION_MASK) == INCOMING;
- boolean outgoing = (syncKind & DIRECTION_MASK) == OUTGOING;
-
- ICVSResource local = localSync.getCVSResource();
- RemoteResource remote = (RemoteResource)getRemote();
- ResourceSyncInfo info = local.getSyncInfo();
- String revision = null;
-
- if (outgoing) {
- // The sync info is alright, it's already outgoing!
- return;
- } else if (incoming) {
- // We have an incoming change, addition, or deletion that we want to ignore
- if (local.exists()) {
- // We could have an incoming change or deletion
- if (remote == null) {
- info = new ResourceSyncInfo(local.getName(), ResourceSyncInfo.ADDED_REVISION, ResourceSyncInfo.DUMMY_TIMESTAMP,
- CVSProvider.isText(local.getName()) ? ResourceSyncInfo.USE_SERVER_MODE:ResourceSyncInfo.BINARY_TAG, local.getParent().getFolderSyncInfo().getTag(), null);
- revision = info.getRevision();
- } else {
- info = remote.getSyncInfo();
- // Otherwise change the revision to the remote revision
- revision = info.getRevision();
- // Use the local sync info for the other info
- info = local.getSyncInfo();
- }
- } else {
- // We have an incoming add, turn it around as an outgoing delete
- info = remote.getSyncInfo();
- revision = ResourceSyncInfo.DELETED_PREFIX + info.getRevision();
- }
- } else if (local.exists()) {
- // We have a conflict and a local resource!
- if (hasRemote()) {
- if (hasBase()) {
- // We have a conflicting change, Update the local revision
- revision = remote.getSyncInfo().getRevision();
- } else {
- // We have conflictin additions.
- // We need to fetch the contents of the remote to get all the relevant information (timestamp, permissions)
- remote.getContents(Policy.monitorFor(monitor));
- info = remote.getSyncInfo();
- revision = info.getRevision();
- }
- } else if (hasBase()) {
- // We have a remote deletion. Make the local an addition
- revision = ResourceSyncInfo.ADDED_REVISION;
- } else {
- // There's a local, no base and no remote. We can't possible have a conflict!
- Assert.isTrue(false);
- }
- } else {
- // We have a conflict and there is no local!
- if (hasRemote()) {
- // We have a local deletion that conflicts with remote changes.
- revision = ResourceSyncInfo.DELETED_PREFIX + remote.getSyncInfo().getRevision();
- } else {
- // We have conflicting deletions. Clear the sync info
- local.setSyncInfo(null);
- return;
- }
- }
- info = new ResourceSyncInfo(info.getName(), revision, ResourceSyncInfo.DUMMY_TIMESTAMP, info.getKeywordMode(), local.getParent().getFolderSyncInfo().getTag(), info.getPermissions());
- local.setSyncInfo(info);
- }
-
- /*
- * Update the sync info of the local resource in such a way that the remote resource can be loaded
- * ignore any local changes.
- */
- public void makeIncoming(IProgressMonitor monitor) throws TeamException {
- // To make outgoing deletions incoming, the local will not exist but
- // it is still important to unmanage (e.g. delete all meta info) for the
- // deletion.
- CVSWorkspaceRoot.getCVSResourceFor(getLocal()).unmanage();
- }
-
- /*
- * Load the resource and folder sync info into the local from the remote
- *
- * This method can be used on incoming folder additions to set the folder sync info properly
- * without hitting the server again. It also applies to conflicts that involves unmanaged
- * local resources.
- */
- public void makeInSync(IProgressMonitor monitor) throws TeamException {
-
- // Only work on folders
- if (! isContainer()) return;
-
- int syncKind = getSyncKind(GRANULARITY_TIMESTAMP, monitor);
- boolean outgoing = (syncKind & DIRECTION_MASK) == OUTGOING;
- if (outgoing) return;
-
- ICVSFolder local = (ICVSFolder)localSync.getCVSResource();
- RemoteFolder remote = (RemoteFolder)getRemote();
-
- // The parent must be managed
- if (! local.getParent().isCVSFolder())
- return;
-
- if (! local.exists()) {
- local.mkdir();
- } else {
- // If the folder already has CVS info, check that the remote and local match
- if(local.isManaged() && local.isCVSFolder() && ! remote.getFolderSyncInfo().equals(local.getFolderSyncInfo())) {
- throw new CVSException(IStatus.ERROR, 0, Policy.bind("CVSRemoteSyncElement.alreadyManaged"));//$NON-NLS-1$
- }
- }
-
- // Since the parent is managed, this will also set the resource sync info. It is
- // impossible for an incoming folder addition to map to another location in the
- // repo, so we assume that using the parent's folder sync as a basis is safe.
- FolderSyncInfo remoteInfo = remote.getFolderSyncInfo();
- FolderSyncInfo localInfo = local.getParent().getFolderSyncInfo();
- local.setFolderSyncInfo(new FolderSyncInfo(remoteInfo.getRepository(), remoteInfo.getRoot(), localInfo.getTag(), localInfo.getIsStatic()));
- }
- /*
- * @see ILocalSyncElement#getSyncKind(int, IProgressMonitor)
- */
- public int getSyncKind(int granularity, IProgressMonitor progress) {
-
- // 1. Run the generic sync calculation algorithm, then handle CVS specific
- // sync cases.
- int kind = super.getSyncKind(granularity, progress);
-
- // 2. Set the CVS specific sync type based on the workspace sync state provided
- // by the CVS server.
- if(remote!=null && (kind & IRemoteSyncElement.PSEUDO_CONFLICT) == 0) {
- int type = ((RemoteResource)remote).getWorkspaceSyncState();
- switch(type) {
- // the server compared both text files and decided that it cannot merge
- // them without line conflicts.
- case Update.STATE_CONFLICT:
- return ILocalSyncElement.CONFLICTING |
- ILocalSyncElement.CHANGE |
- ILocalSyncElement.MANUAL_CONFLICT;
-
- // the server compared both text files and decided that it can safely merge
- // them without line conflicts.
- case Update.STATE_MERGEABLE_CONFLICT:
- return ILocalSyncElement.CONFLICTING |
- ILocalSyncElement.CHANGE |
- ILocalSyncElement.AUTOMERGE_CONFLICT;
- }
- }
-
- // 3. unmanage delete/delete conflicts and return that they are in sync
- kind = handleDeletionConflicts(kind);
-
- return kind;
- }
-
- /*
- * If the resource has a delete/delete conflict then ensure that the local is unmanaged so that the sync info
- * can be properly flushed.
- */
- private int handleDeletionConflicts(int kind) {
- if(kind == (IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.DELETION | IRemoteSyncElement.PSEUDO_CONFLICT)) {
- try {
- ICVSResource cvsResource = localSync.getCVSResource();
- if(!isContainer() && cvsResource.isManaged()) {
- cvsResource.unmanage();
- }
- return IRemoteSyncElement.IN_SYNC;
- } catch(CVSException e) {
- CVSProviderPlugin.log(e.getStatus());
- return IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.DELETION;
- }
- }
- return kind;
- }
+package org.eclipse.team.internal.ccvs.core.resources;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2002.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.team.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.ccvs.core.ICVSResource;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.sync.ILocalSyncElement;
+import org.eclipse.team.core.sync.IRemoteResource;
+import org.eclipse.team.core.sync.IRemoteSyncElement;
+import org.eclipse.team.core.sync.RemoteSyncElement;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.CVSProvider;
+import org.eclipse.team.internal.ccvs.core.Policy;
+import org.eclipse.team.internal.ccvs.core.client.Update;
+import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
+import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
+import org.eclipse.team.internal.ccvs.core.util.Assert;
+
+public class CVSRemoteSyncElement extends RemoteSyncElement {
+
+ CVSLocalSyncElement localSync;
+ IRemoteResource remote;
+ boolean ignoreBaseTree = true;
+
+ public CVSRemoteSyncElement(boolean ignoreBaseTree, IResource local, IRemoteResource base, IRemoteResource remote) {
+ localSync = new CVSLocalSyncElement(local, base);
+ this.remote = remote;
+ this.ignoreBaseTree = ignoreBaseTree;
+ }
+
+ /*
+ * @see RemoteSyncElement#create(IResource, IRemoteResource, IRemoteResource)
+ */
+ public IRemoteSyncElement create(boolean ignoreBaseTree, IResource local, IRemoteResource base, IRemoteResource remote, Object data) {
+ return new CVSRemoteSyncElement(ignoreBaseTree, local, base, remote);
+ }
+
+ /*
+ * @see IRemoteSyncElement#getRemote()
+ */
+ public IRemoteResource getRemote() {
+ return remote;
+ }
+
+ /*
+ * @see IRemoteSyncElement#isOutOfDate()
+ */
+ public boolean isOutOfDate() {
+ IRemoteResource base = getBase();
+ if(base!=null && remote!=null) {
+ ICVSRemoteResource remoteCvs = (ICVSRemoteResource)remote;
+ ICVSRemoteResource baseCvs = (ICVSRemoteResource)base;
+ return ! remoteCvs.equals(baseCvs);
+ } else if(base!=null && remote==null) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * @see LocalSyncElement#getData()
+ */
+ protected Object getData() {
+ return localSync.getData();
+ }
+
+ /*
+ * @see ILocalSyncElement#getLocal()
+ */
+ public IResource getLocal() {
+ return localSync.getLocal();
+ }
+
+ /*
+ * @see ILocalSyncElement#getBase()
+ */
+ public IRemoteResource getBase() {
+ return localSync.getBase();
+ }
+
+ /*
+ * @see ILocalSyncElement#isDirty()
+ */
+ public boolean isDirty() {
+ return localSync.isDirty();
+ }
+
+ /*
+ * @see ILocalSyncElement#isCheckedOut()
+ */
+ public boolean isCheckedOut() {
+ return localSync.isCheckedOut();
+ }
+
+ /*
+ * Local helper to indicate if the corresponding local resource has a base
+ *
+ * XXX Should this be part of the interface?
+ */
+ public boolean hasBase() {
+ return getBase() != null;
+ }
+
+ /*
+ * @see ILocalSyncElement#hasRemote()
+ */
+ public boolean hasRemote() {
+ return remote != null;
+ }
+
+ /*
+ * @see LocalSyncElement#create(IResource, IRemoteResource, Object)
+ */
+ public ILocalSyncElement create(IResource local, IRemoteResource base, Object data) {
+ return localSync.create(local, base, data);
+ }
+ /*
+ * @see LocalSyncElement#isIgnored(IResource)
+ */
+ protected boolean isIgnored(IResource resource) {
+ return localSync.isIgnored(resource);
+ }
+ /*
+ * @see IRemoteSyncElement#ignoreBaseTree()
+ */
+ public boolean ignoreBaseTree() {
+ return ignoreBaseTree;
+ }
+
+ /*
+ * Update the sync info of the local resource in such a way that the local changes can be committed.
+ */
+ public void makeOutgoing(IProgressMonitor monitor) throws TeamException {
+
+ int syncKind = getSyncKind(GRANULARITY_TIMESTAMP, monitor);
+ boolean conflict = (syncKind & DIRECTION_MASK) == CONFLICTING;
+ boolean incoming = (syncKind & DIRECTION_MASK) == INCOMING;
+ boolean outgoing = (syncKind & DIRECTION_MASK) == OUTGOING;
+
+ ICVSResource local = localSync.getCVSResource();
+ RemoteResource remote = (RemoteResource)getRemote();
+ ResourceSyncInfo info = local.getSyncInfo();
+ String revision = null;
+
+ if (outgoing) {
+ // The sync info is alright, it's already outgoing!
+ return;
+ } else if (incoming) {
+ // We have an incoming change, addition, or deletion that we want to ignore
+ if (local.exists()) {
+ // We could have an incoming change or deletion
+ if (remote == null) {
+ info = new ResourceSyncInfo(local.getName(), ResourceSyncInfo.ADDED_REVISION, ResourceSyncInfo.DUMMY_TIMESTAMP,
+ CVSProvider.isText(local.getName()) ? ResourceSyncInfo.USE_SERVER_MODE:ResourceSyncInfo.BINARY_TAG, local.getParent().getFolderSyncInfo().getTag(), null);
+ revision = info.getRevision();
+ } else {
+ info = remote.getSyncInfo();
+ // Otherwise change the revision to the remote revision
+ revision = info.getRevision();
+ // Use the local sync info for the other info
+ info = local.getSyncInfo();
+ }
+ } else {
+ // We have an incoming add, turn it around as an outgoing delete
+ info = remote.getSyncInfo();
+ revision = ResourceSyncInfo.DELETED_PREFIX + info.getRevision();
+ }
+ } else if (local.exists()) {
+ // We have a conflict and a local resource!
+ if (hasRemote()) {
+ if (hasBase()) {
+ // We have a conflicting change, Update the local revision
+ revision = remote.getSyncInfo().getRevision();
+ } else {
+ // We have conflictin additions.
+ // We need to fetch the contents of the remote to get all the relevant information (timestamp, permissions)
+ remote.getContents(Policy.monitorFor(monitor));
+ info = remote.getSyncInfo();
+ revision = info.getRevision();
+ }
+ } else if (hasBase()) {
+ // We have a remote deletion. Make the local an addition
+ revision = ResourceSyncInfo.ADDED_REVISION;
+ } else {
+ // There's a local, no base and no remote. We can't possible have a conflict!
+ Assert.isTrue(false);
+ }
+ } else {
+ // We have a conflict and there is no local!
+ if (hasRemote()) {
+ // We have a local deletion that conflicts with remote changes.
+ revision = ResourceSyncInfo.DELETED_PREFIX + remote.getSyncInfo().getRevision();
+ } else {
+ // We have conflicting deletions. Clear the sync info
+ local.setSyncInfo(null);
+ return;
+ }
+ }
+ info = new ResourceSyncInfo(info.getName(), revision, ResourceSyncInfo.DUMMY_TIMESTAMP, info.getKeywordMode(), local.getParent().getFolderSyncInfo().getTag(), info.getPermissions());
+ local.setSyncInfo(info);
+ }
+
+ /*
+ * Update the sync info of the local resource in such a way that the remote resource can be loaded
+ * ignore any local changes.
+ */
+ public void makeIncoming(IProgressMonitor monitor) throws TeamException {
+ // To make outgoing deletions incoming, the local will not exist but
+ // it is still important to unmanage (e.g. delete all meta info) for the
+ // deletion.
+ CVSWorkspaceRoot.getCVSResourceFor(getLocal()).unmanage();
+ }
+
+ /*
+ * Load the resource and folder sync info into the local from the remote
+ *
+ * This method can be used on incoming folder additions to set the folder sync info properly
+ * without hitting the server again. It also applies to conflicts that involves unmanaged
+ * local resources.
+ */
+ public void makeInSync(IProgressMonitor monitor) throws TeamException {
+
+ // Only work on folders
+ if (! isContainer()) return;
+
+ int syncKind = getSyncKind(GRANULARITY_TIMESTAMP, monitor);
+ boolean outgoing = (syncKind & DIRECTION_MASK) == OUTGOING;
+ if (outgoing) return;
+
+ ICVSFolder local = (ICVSFolder)localSync.getCVSResource();
+ RemoteFolder remote = (RemoteFolder)getRemote();
+
+ // The parent must be managed
+ if (! local.getParent().isCVSFolder())
+ return;
+
+ if (! local.exists()) {
+ local.mkdir();
+ } else {
+ // If the folder already has CVS info, check that the remote and local match
+ if(local.isManaged() && local.isCVSFolder() && ! remote.getFolderSyncInfo().equals(local.getFolderSyncInfo())) {
+ throw new CVSException(IStatus.ERROR, 0, Policy.bind("CVSRemoteSyncElement.alreadyManaged"));//$NON-NLS-1$
+ }
+ }
+
+ // Since the parent is managed, this will also set the resource sync info. It is
+ // impossible for an incoming folder addition to map to another location in the
+ // repo, so we assume that using the parent's folder sync as a basis is safe.
+ FolderSyncInfo remoteInfo = remote.getFolderSyncInfo();
+ FolderSyncInfo localInfo = local.getParent().getFolderSyncInfo();
+ local.setFolderSyncInfo(new FolderSyncInfo(remoteInfo.getRepository(), remoteInfo.getRoot(), localInfo.getTag(), localInfo.getIsStatic()));
+ }
+ /*
+ * @see ILocalSyncElement#getSyncKind(int, IProgressMonitor)
+ */
+ public int getSyncKind(int granularity, IProgressMonitor progress) {
+
+ // 1. Run the generic sync calculation algorithm, then handle CVS specific
+ // sync cases.
+ int kind = super.getSyncKind(granularity, progress);
+
+ // 2. Set the CVS specific sync type based on the workspace sync state provided
+ // by the CVS server.
+ if(remote!=null && (kind & IRemoteSyncElement.PSEUDO_CONFLICT) == 0) {
+ int type = ((RemoteResource)remote).getWorkspaceSyncState();
+ switch(type) {
+ // the server compared both text files and decided that it cannot merge
+ // them without line conflicts.
+ case Update.STATE_CONFLICT:
+ return ILocalSyncElement.CONFLICTING |
+ ILocalSyncElement.CHANGE |
+ ILocalSyncElement.MANUAL_CONFLICT;
+
+ // the server compared both text files and decided that it can safely merge
+ // them without line conflicts.
+ case Update.STATE_MERGEABLE_CONFLICT:
+ return ILocalSyncElement.CONFLICTING |
+ ILocalSyncElement.CHANGE |
+ ILocalSyncElement.AUTOMERGE_CONFLICT;
+ }
+ }
+
+ // 3. unmanage delete/delete conflicts and return that they are in sync
+ kind = handleDeletionConflicts(kind);
+
+ return kind;
+ }
+
+ /*
+ * If the resource has a delete/delete conflict then ensure that the local is unmanaged so that the sync info
+ * can be properly flushed.
+ */
+ private int handleDeletionConflicts(int kind) {
+ if(kind == (IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.DELETION | IRemoteSyncElement.PSEUDO_CONFLICT)) {
+ try {
+ ICVSResource cvsResource = localSync.getCVSResource();
+ if(!isContainer() && cvsResource.isManaged()) {
+ cvsResource.unmanage();
+ }
+ return IRemoteSyncElement.IN_SYNC;
+ } catch(CVSException e) {
+ CVSProviderPlugin.log(e.getStatus());
+ return IRemoteSyncElement.CONFLICTING | IRemoteSyncElement.DELETION;
+ }
+ }
+ return kind;
+ }
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AssertionFailedException.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AssertionFailedException.java
index 99a2892a5..df2926d74 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AssertionFailedException.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/AssertionFailedException.java
@@ -1,28 +1,28 @@
-package org.eclipse.team.internal.ccvs.core.util;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * AssertionFailedException is a runtime exception thrown
- * by some of the methods in Assert.
- *
- * This class is not declared public to prevent some misuses; programs that catch
- * or otherwise depend on assertion failures are susceptible to unexpected
- * breakage when assertions in the code are added or removed.
- *
- */
-/* package */
-class AssertionFailedException extends RuntimeException {
-/** Constructs a new exception.
- */
-public AssertionFailedException() {
-}
-/** Constructs a new exception with the given message.
- */
-public AssertionFailedException(String detail) {
- super(detail);
-}
-}
+package org.eclipse.team.internal.ccvs.core.util;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+/**
+ * AssertionFailedException is a runtime exception thrown
+ * by some of the methods in Assert.
+ *
+ * This class is not declared public to prevent some misuses; programs that catch
+ * or otherwise depend on assertion failures are susceptible to unexpected
+ * breakage when assertions in the code are added or removed.
+ *
+ */
+/* package */
+class AssertionFailedException extends RuntimeException {
+/** Constructs a new exception.
+ */
+public AssertionFailedException() {
+}
+/** Constructs a new exception with the given message.
+ */
+public AssertionFailedException(String detail) {
+ super(detail);
+}
+}
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/FileUtil.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/FileUtil.java
index 67e6771a4..6f4d5df07 100644
--- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/FileUtil.java
+++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/util/FileUtil.java
@@ -1,39 +1,39 @@
-package org.eclipse.team.internal.ccvs.core.util;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import org.eclipse.team.ccvs.core.ICVSFolder;
-import org.eclipse.team.ccvs.core.ICVSResource;
-
-public class FileUtil {
-
- public static void deepDelete(File resource) {
- if (resource.isDirectory()) {
- File[] fileList = resource.listFiles();
- for (int i = 0; i < fileList.length; i++) {
+package org.eclipse.team.internal.ccvs.core.util;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2002.
+ * All Rights Reserved.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.ccvs.core.ICVSResource;
+
+public class FileUtil {
+
+ public static void deepDelete(File resource) {
+ if (resource.isDirectory()) {
+ File[] fileList = resource.listFiles();
+ for (int i = 0; i < fileList.length; i++) {
deepDelete(fileList[i]);
- }
- }
- resource.delete();
- }
-
- public static void transfer(InputStream in, OutputStream out) throws IOException {
- final byte[] BUFFER = new byte[4096];
- int read = 0;
- long totalRead = 0;
- synchronized (BUFFER) {
- while ((read = in.read(BUFFER)) != -1) {
- out.write(BUFFER, 0, read);
- }
- }
- out.flush();
- }
+ }
+ }
+ resource.delete();
+ }
+
+ public static void transfer(InputStream in, OutputStream out) throws IOException {
+ final byte[] BUFFER = new byte[4096];
+ int read = 0;
+ long totalRead = 0;
+ synchronized (BUFFER) {
+ while ((read = in.read(BUFFER)) != -1) {
+ out.write(BUFFER, 0, read);
+ }
+ }
+ out.flush();
+ }
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ssh/about.html b/bundles/org.eclipse.team.cvs.ssh/about.html
index e3c15c80d..ab1dd4198 100644
--- a/bundles/org.eclipse.team.cvs.ssh/about.html
+++ b/bundles/org.eclipse.team.cvs.ssh/about.html
@@ -1,104 +1,104 @@
-
-
-About
-
-
-
-
-
-
About This Content
-
-
-
-
11th December, 2001
-
License
-
Eclipse.org makes available all content in this plug-in "Content". Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 0.5 "CPL". For purposes of the CPL, "Program" will mean the Content.
-
-
Third Party Content
-
-
The Content includes items that have been sourced from third parties as follows:
-
-
The Java (TM) Ssh Applet
-
The plug-in is based on software developed by Cedric Gourio.
-If the source code is included, it is located in teamcvssshsrc.zip. The binary code is located in teamcvsssh.jar. The Java Ssh Applet includes the following copyright notice which
-must be included in any redistribution:
This program is FREE FOR COMMERCIAL AND NON-COMMERCIAL USE.
- You can freely modify the code.
-
-
You should however include this copyright notice in any redistribution
- and please keep in touch with the author for any feedback.
-
-
-
The Blowfish Encryption Algorithm
-
The plug-in is based on an algorithm developed by Bruce Schneier. The algorithm was originally published in
-a paper that is located at http://www.counterpane.com/bfsverlag.html.
-Your use of the Blowfish Encryption Algorithm in both source and binary code form contained in the plug-in is not subject to any
-additional terms and conditions. If the source code, Blowfish.java is included, it is located in teamcvssshsrc.zip. The binary code, Blowfish.class is located in
-teamcvsssh.jar.
-
-
Contributions
-
-
If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.
-
-
If this Content is licensed to you under license terms and conditions other than the CPL "Other License", any modifications, enhancements and/or
-other code and/or documentation "Modifications" uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.
-
-
Cryptography
-
-
Export Control
-
The plug-in contains encryption software. The country in which you are currently may have restrictions on the import, possession,
-and use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check the country's
-laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this
-is permitted.
-
-
Encryption Items
-
-
Details of the encryption software in this plug-in are provided to assist in obtaining relevant export control classification and approval.
-Cryptography in this plug-in has been classified as Export Commodity Control Number (ECCN) 5D002.c.1 by the U.S. Government Department of Commerce,
-Bureau of Export Administration and deemed eligible for export under License Exception ENC Technology Software Unrestricted (TSU) for object code
-and (cryptographic) source code, and License Exception ENC Retail for object code and no (cryptographic) source code.
-
-
The plug-in contains an implementation of the Secure Shell (SSH) protocol that encrypts the network traffic (program code files
-in file versioning systems) between a Concurrent Versions System (CVS) server and a CVS client. Data is encrypted using the Blowfish algorithm
-which is a 64-bit symmetric cipher that uses a key varying in length from 32 bits to 448 bits. The RSA PKCS #1 v1.5 key exchange algorithm is
-used to authenticate and exchange keys with a minimum modulus size of 96 bits and a maximum modulus size theoretically unlimited since the
-implementation uses the java.math.BigInteger class which has a maximum positive integer range limited only by the available memory in the computer.
-In practice, the key length is defined by the CVS server with which communication is initiated.
-
-
The following Java classes contain encryption items (the plug-in may contain both binary and source code):
-
-
-
org.eclipse.team.internal.ccvs.ssh.Blowfish
-
org.eclipse.team.internal.ccvs.ssh.Cipher
-
org.eclipse.team.internal.ccvs.ssh.Client
-
org.eclipse.team.internal.ccvs.ssh.ClientPacket
-
org.eclipse.team.internal.ccvs.ssh.Misc
-
-
-Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
-
-
+
+
+About
+
+
+
+
+
+
About This Content
+
+
+
+
11th December, 2001
+
License
+
Eclipse.org makes available all content in this plug-in "Content". Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Common Public License Version 0.5 "CPL". For purposes of the CPL, "Program" will mean the Content.
+
+
Third Party Content
+
+
The Content includes items that have been sourced from third parties as follows:
+
+
The Java (TM) Ssh Applet
+
The plug-in is based on software developed by Cedric Gourio.
+If the source code is included, it is located in teamcvssshsrc.zip. The binary code is located in teamcvsssh.jar. The Java Ssh Applet includes the following copyright notice which
+must be included in any redistribution:
This program is FREE FOR COMMERCIAL AND NON-COMMERCIAL USE.
+ You can freely modify the code.
+
+
You should however include this copyright notice in any redistribution
+ and please keep in touch with the author for any feedback.
+
+
+
The Blowfish Encryption Algorithm
+
The plug-in is based on an algorithm developed by Bruce Schneier. The algorithm was originally published in
+a paper that is located at http://www.counterpane.com/bfsverlag.html.
+Your use of the Blowfish Encryption Algorithm in both source and binary code form contained in the plug-in is not subject to any
+additional terms and conditions. If the source code, Blowfish.java is included, it is located in teamcvssshsrc.zip. The binary code, Blowfish.class is located in
+teamcvsssh.jar.
+
+
Contributions
+
+
If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
+made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
+Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.
+
+
If this Content is licensed to you under license terms and conditions other than the CPL "Other License", any modifications, enhancements and/or
+other code and/or documentation "Modifications" uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
+host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
+to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
+providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
+the CPL.
+
+
Cryptography
+
+
Export Control
+
The plug-in contains encryption software. The country in which you are currently may have restrictions on the import, possession,
+and use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check the country's
+laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this
+is permitted.
+
+
Encryption Items
+
+
Details of the encryption software in this plug-in are provided to assist in obtaining relevant export control classification and approval.
+Cryptography in this plug-in has been classified as Export Commodity Control Number (ECCN) 5D002.c.1 by the U.S. Government Department of Commerce,
+Bureau of Export Administration and deemed eligible for export under License Exception ENC Technology Software Unrestricted (TSU) for object code
+and (cryptographic) source code, and License Exception ENC Retail for object code and no (cryptographic) source code.
+
+
The plug-in contains an implementation of the Secure Shell (SSH) protocol that encrypts the network traffic (program code files
+in file versioning systems) between a Concurrent Versions System (CVS) server and a CVS client. Data is encrypted using the Blowfish algorithm
+which is a 64-bit symmetric cipher that uses a key varying in length from 32 bits to 448 bits. The RSA PKCS #1 v1.5 key exchange algorithm is
+used to authenticate and exchange keys with a minimum modulus size of 96 bits and a maximum modulus size theoretically unlimited since the
+implementation uses the java.math.BigInteger class which has a maximum positive integer range limited only by the available memory in the computer.
+In practice, the key length is defined by the CVS server with which communication is initiated.
+
+
The following Java classes contain encryption items (the plug-in may contain both binary and source code):
+
+
+
org.eclipse.team.internal.ccvs.ssh.Blowfish
+
org.eclipse.team.internal.ccvs.ssh.Cipher
+
org.eclipse.team.internal.ccvs.ssh.Client
+
org.eclipse.team.internal.ccvs.ssh.ClientPacket
+
org.eclipse.team.internal.ccvs.ssh.Misc
+
+
+Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.
+
Eclipse.org makes available all content in this plug-in "Content". Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 0.5 "CPL". For purposes of the CPL, "Program" will mean the Content.
-
-
Contributions
-
-
If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.
-
-
If this Content is licensed to you under license terms and conditions other than the CPL "Other License", any modifications, enhancements and/or
-other code and/or documentation "Modifications" uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.
-
-
+
+
+About
+
+
+
+
+
+
About This Content
+
+
+
+
11th December, 2001
+
License
+
Eclipse.org makes available all content in this plug-in "Content". Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Common Public License Version 0.5 "CPL". For purposes of the CPL, "Program" will mean the Content.
+
+
Contributions
+
+
If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
+made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
+Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.
+
+
If this Content is licensed to you under license terms and conditions other than the CPL "Other License", any modifications, enhancements and/or
+other code and/or documentation "Modifications" uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
+host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
+to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
+providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
+the CPL.
+
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index f593e1659..0162b01b2 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -1,379 +1,379 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java
index a13bfab1d..a999bca20 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSCompareEditorInput.java
@@ -1,358 +1,358 @@
-package org.eclipse.team.internal.ccvs.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.CompareEditorInput;
-import org.eclipse.compare.ITypedElement;
-import org.eclipse.compare.ResourceNode;
-import org.eclipse.compare.structuremergeviewer.Differencer;
-import org.eclipse.compare.structuremergeviewer.IStructureComparator;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.team.ccvs.core.CVSTag;
-import org.eclipse.team.ccvs.core.CVSTeamProvider;
-import org.eclipse.team.ccvs.core.ICVSFile;
-import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
-import org.eclipse.team.ccvs.core.ICVSRemoteResource;
-import org.eclipse.team.ccvs.core.ICVSResource;
-import org.eclipse.team.core.ITeamProvider;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.TeamPlugin;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+package org.eclipse.team.internal.ccvs.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2002.
+ * All Rights Reserved.
+ */
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.compare.CompareEditorInput;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.compare.ResourceNode;
+import org.eclipse.compare.structuremergeviewer.Differencer;
+import org.eclipse.compare.structuremergeviewer.IStructureComparator;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.team.ccvs.core.CVSTag;
+import org.eclipse.team.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSRemoteFolder;
+import org.eclipse.team.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.ccvs.core.ICVSResource;
+import org.eclipse.team.core.ITeamProvider;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.TeamPlugin;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;
-
-/**
- * A compare input for performing naive comparisons between
- * resources and resource editions.
- */
-public class CVSCompareEditorInput extends CompareEditorInput {
- private ITypedElement left;
- private ITypedElement right;
- private ITypedElement ancestor;
-
- // comparison constants
- private static final int NODE_EQUAL = 0;
- private static final int NODE_NOT_EQUAL = 1;
- private static final int NODE_UNKNOWN = 2;
-
- // provider for the project being compared
- CVSTeamProvider cvsProvider = null;
-
- /**
- * Creates a new CVSCompareEditorInput.
- */
- public CVSCompareEditorInput(ITypedElement left, ITypedElement right) {
- this(left, right, null);
- }
-
- /**
- * Creates a new CVSCompareEditorInput.
- */
- public CVSCompareEditorInput(ITypedElement left, ITypedElement right, ITypedElement ancestor) {
- super(new CompareConfiguration());
- this.left = left;
- this.right = right;
- this.ancestor = ancestor;
- }
-
- /**
- * Overridden to create the CVSDiffTreeViewer to have the proper popup actions
- */
- //public Viewer createDiffViewer(Composite parent) {
- // return new CVSDiffTreeViewer(parent, this);
- //}
-
- /**
- * Returns the label for the given input element.
- */
- private String getLabel(ITypedElement element) {
- if (element instanceof ResourceNode) {
- return Policy.bind("CVSCompareEditorInput.workspace", element.getName());
- }
- if (element instanceof ResourceEditionNode) {
- ICVSRemoteResource edition = ((ResourceEditionNode)element).getRemoteResource();
- ICVSResource resource = (ICVSResource)edition;
- try {
- if (edition.isContainer()) {
- CVSTag tag = ((ICVSRemoteFolder)edition).getTag();
- if (tag == null) {
- return Policy.bind("CVSCompareEditorInput.inHead", edition.getName());
- } else if (tag.getType() == CVSTag.BRANCH) {
- return Policy.bind("CVSCompareEditorInput.inBranch", new Object[] {edition.getName(), tag.getName()});
- } else {
- return Policy.bind("CVSCompareEditorInput.repository", new Object[] {edition.getName(), tag.getName()});
- }
- } else {
- return Policy.bind("CVSCompareEditorInput.repository", new Object[] {edition.getName(), resource.getSyncInfo().getRevision()});
- }
- } catch (TeamException e) {
- handle(e);
- // Fall through and get the default label
- }
- }
- return element.getName();
- }
-
- /**
- * Returns the label for the given input element.
- */
- private String getVersionLabel(ITypedElement element) {
- if (element instanceof ResourceNode) {
- return Policy.bind("CVSCompareEditorInput.workspaceLabel");
- }
- if (element instanceof ResourceEditionNode) {
- ICVSRemoteResource edition = ((ResourceEditionNode)element).getRemoteResource();
- ICVSResource resource = (ICVSResource)edition;
- try {
- if (edition.isContainer()) {
- CVSTag tag = ((ICVSRemoteFolder)resource).getTag();
- if (tag == null) {
- return Policy.bind("CVSCompareEditorInput.headLabel");
- } else if (tag.getType() == CVSTag.BRANCH) {
- return Policy.bind("CVSCompareEditorInput.branchLabel", tag.getName());
- } else {
- return tag.getName();
- }
- } else {
- return resource.getSyncInfo().getRevision();
- }
- } catch (TeamException e) {
- handle(e);
- // Fall through and get the default label
- }
- }
- return element.getName();
- }
-
- /*
- * Returns a guess of the resource name being compared, for display
- * in the title.
- */
- private String guessResourceName() {
- if (left != null) {
- return left.getName();
- }
- if (right != null) {
- return right.getName();
- }
- if (ancestor != null) {
- return ancestor.getName();
- }
- return "";
- }
-
- /**
- * Handles a random exception and sanitizes it into a reasonable
- * error message.
- */
- private void handle(Exception e) {
- // create a status
- Throwable t = e;
- // unwrap the invocation target exception
- if (t instanceof InvocationTargetException) {
- t = ((InvocationTargetException)t).getTargetException();
- }
- IStatus error;
- if (t instanceof CoreException) {
- error = ((CoreException)t).getStatus();
- } else if (t instanceof TeamException) {
- error = ((TeamException)t).getStatus();
- } else {
- error = new Status(IStatus.ERROR, CVSUIPlugin.ID, 1, Policy.bind("internal"), t);
- }
- setMessage(error.getMessage());
- if (!(t instanceof TeamException)) {
- CVSUIPlugin.log(error);
- }
- }
-
- /**
- * Sets up the title and pane labels for the comparison view.
- */
- private void initLabels() {
- CompareConfiguration cc = (CompareConfiguration) getCompareConfiguration();
-
- String leftLabel = getLabel(left);
- cc.setLeftLabel(leftLabel);
- cc.setLeftImage(left.getImage());
-
- String rightLabel = getLabel(right);
- cc.setRightLabel(rightLabel);
- cc.setRightImage(right.getImage());
-
- String title;
- if (ancestor != null) {
- cc.setAncestorLabel(getLabel(ancestor));
- cc.setAncestorImage(ancestor.getImage());
- title = Policy.bind("CVSCompareEditorInput.titleAncestor", new Object[] {guessResourceName(), getVersionLabel(ancestor), getVersionLabel(left), getVersionLabel(right)} );
- } else {
- String leftName = null;
- if (left != null) leftName = left.getName();
- String rightName = null;
- if (right != null) rightName = right.getName();
- boolean differentNames = false;
- if (leftName != null && !leftName.equals(rightName)) {
- title = Policy.bind("CVSCompareEditorInput.titleNoAncestorDifferent", new Object[] {leftName, getVersionLabel(left), rightName, getVersionLabel(right)} );
- } else {
- title = Policy.bind("CVSCompareEditorInput.titleNoAncestor", new Object[] {guessResourceName(), getVersionLabel(left), getVersionLabel(right)} );
- }
- }
- setTitle(title);
- }
-
- /* (Non-javadoc)
- * Method declared on CompareEditorInput
- */
- public boolean isSaveNeeded() {
- return false;
- }
-
- /* (non-Javadoc)
- * Method declared on CompareEditorInput
- */
- protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- boolean threeWay = ancestor != null;
- if (right == null || left == null) {
- setMessage(Policy.bind("CVSCompareEditorInput.different"));
- return null;
- }
-
- initLabels();
-
- Differencer d = new Differencer() {
- protected boolean contentsEqual(Object input1, Object input2) {
- int compare = teamEqual(input1, input2);
- if (compare == NODE_EQUAL) {
- return true;
- }
- if (compare == NODE_NOT_EQUAL) {
- return false;
- }
- //revert to slow content comparison
- return super.contentsEqual(input1, input2);
- }
- protected void updateProgress(IProgressMonitor progressMonitor, Object node) {
- super.updateProgress(progressMonitor, node);
- progressMonitor.worked(1);
- }
- protected Object[] getChildren(Object input) {
- if (input instanceof IStructureComparator) {
- Object[] children= ((IStructureComparator)input).getChildren();
- if (children != null)
- return children;
- }
- return null;
- }
- };
-
- try {
- monitor.beginTask(Policy.bind("CVSCompareEditorInput.comparing"), 30);
-
- // get the CVS provider if one exists
- if (left instanceof ResourceNode) {
- IResource resource = ((ResourceNode)left).getResource();
- ITeamProvider p = TeamPlugin.getManager().getProvider(resource);
- if(p != null && p instanceof CVSTeamProvider) {
- cvsProvider = (CVSTeamProvider)p;
- }
- }
-
- // do the diff
- IProgressMonitor sub = new SubProgressMonitor(monitor, 10);
- try {
- sub.beginTask(Policy.bind("CVSCompareEditorInput.comparing"), 100);
- return d.findDifferences(threeWay, sub, null, ancestor, left, right);
- } finally {
- sub.done();
- }
- } catch (OperationCanceledException e) {
- throw new InterruptedException(e.getMessage());
- } catch (RuntimeException e) {
- handle(e);
- return null;
- } finally {
- monitor.done();
- }
- }
-
- /**
- * Compares two nodes to determine if they are equal. Returns NODE_EQUAL
- * of they are the same, NODE_NOT_EQUAL if they are different, and
- * NODE_UNKNOWN if comparison was not possible.
- */
- protected int teamEqual(Object left, Object right) {
-
- // calculate the type for the left contribution
- ICVSRemoteResource leftEdition = null;
- if (left instanceof ResourceEditionNode) {
- leftEdition = ((ResourceEditionNode)left).getRemoteResource();
- } else if (left instanceof ResourceNode) {
- IResource resource = ((ResourceNode)left).getResource();
- try {
- ICVSResource element = CVSWorkspaceRoot.getCVSResourceFor(resource);
- if (resource.getType() == IResource.FILE) {
- if (((ICVSFile) element).isDirty()) return NODE_NOT_EQUAL;
- }
- if(cvsProvider==null) {
- return NODE_UNKNOWN;
- }
- leftEdition = CVSWorkspaceRoot.getRemoteResourceFor(resource);
- } catch(CVSException e) {
- return NODE_UNKNOWN;
- }
- }
-
- // calculate the type for the right contribution
- ICVSRemoteResource rightEdition = null;
- if (right instanceof ResourceEditionNode)
- rightEdition = ((ResourceEditionNode)right).getRemoteResource();
-
-
- // compare them
-
- if (leftEdition == null || rightEdition == null) {
- return NODE_UNKNOWN;
- }
- // if they're both non-files, they're the same
- if (leftEdition.isContainer() && rightEdition.isContainer()) {
- return NODE_EQUAL;
- }
- // if they have different types, they're different
- if (leftEdition.isContainer() != rightEdition.isContainer()) {
- return NODE_NOT_EQUAL;
- }
-
- if (!leftEdition.getRepository().getLocation().equals(rightEdition.getRepository().getLocation())) {
- return NODE_UNKNOWN;
- }
- try {
- ResourceSyncInfo leftInfo = ((ICVSResource)leftEdition).getSyncInfo();
- ResourceSyncInfo rightInfo = ((ICVSResource)rightEdition).getSyncInfo();
-
- if (leftEdition.getRepositoryRelativePath().equals(rightEdition.getRepositoryRelativePath()) &&
- leftInfo.getRevision().equals(rightInfo.getRevision())) {
- return NODE_EQUAL;
- } else {
- // Optimized for most common case. There are actually cases where a file is merged from
- // one branch to another where the revision numbers are different but the file is the same.
- // We do not handle this case properly.
- return NODE_NOT_EQUAL;
- }
- } catch (TeamException e) {
- handle(e);
- return NODE_UNKNOWN;
- }
- }
+
+/**
+ * A compare input for performing naive comparisons between
+ * resources and resource editions.
+ */
+public class CVSCompareEditorInput extends CompareEditorInput {
+ private ITypedElement left;
+ private ITypedElement right;
+ private ITypedElement ancestor;
+
+ // comparison constants
+ private static final int NODE_EQUAL = 0;
+ private static final int NODE_NOT_EQUAL = 1;
+ private static final int NODE_UNKNOWN = 2;
+
+ // provider for the project being compared
+ CVSTeamProvider cvsProvider = null;
+
+ /**
+ * Creates a new CVSCompareEditorInput.
+ */
+ public CVSCompareEditorInput(ITypedElement left, ITypedElement right) {
+ this(left, right, null);
+ }
+
+ /**
+ * Creates a new CVSCompareEditorInput.
+ */
+ public CVSCompareEditorInput(ITypedElement left, ITypedElement right, ITypedElement ancestor) {
+ super(new CompareConfiguration());
+ this.left = left;
+ this.right = right;
+ this.ancestor = ancestor;
+ }
+
+ /**
+ * Overridden to create the CVSDiffTreeViewer to have the proper popup actions
+ */
+ //public Viewer createDiffViewer(Composite parent) {
+ // return new CVSDiffTreeViewer(parent, this);
+ //}
+
+ /**
+ * Returns the label for the given input element.
+ */
+ private String getLabel(ITypedElement element) {
+ if (element instanceof ResourceNode) {
+ return Policy.bind("CVSCompareEditorInput.workspace", element.getName());
+ }
+ if (element instanceof ResourceEditionNode) {
+ ICVSRemoteResource edition = ((ResourceEditionNode)element).getRemoteResource();
+ ICVSResource resource = (ICVSResource)edition;
+ try {
+ if (edition.isContainer()) {
+ CVSTag tag = ((ICVSRemoteFolder)edition).getTag();
+ if (tag == null) {
+ return Policy.bind("CVSCompareEditorInput.inHead", edition.getName());
+ } else if (tag.getType() == CVSTag.BRANCH) {
+ return Policy.bind("CVSCompareEditorInput.inBranch", new Object[] {edition.getName(), tag.getName()});
+ } else {
+ return Policy.bind("CVSCompareEditorInput.repository", new Object[] {edition.getName(), tag.getName()});
+ }
+ } else {
+ return Policy.bind("CVSCompareEditorInput.repository", new Object[] {edition.getName(), resource.getSyncInfo().getRevision()});
+ }
+ } catch (TeamException e) {
+ handle(e);
+ // Fall through and get the default label
+ }
+ }
+ return element.getName();
+ }
+
+ /**
+ * Returns the label for the given input element.
+ */
+ private String getVersionLabel(ITypedElement element) {
+ if (element instanceof ResourceNode) {
+ return Policy.bind("CVSCompareEditorInput.workspaceLabel");
+ }
+ if (element instanceof ResourceEditionNode) {
+ ICVSRemoteResource edition = ((ResourceEditionNode)element).getRemoteResource();
+ ICVSResource resource = (ICVSResource)edition;
+ try {
+ if (edition.isContainer()) {
+ CVSTag tag = ((ICVSRemoteFolder)resource).getTag();
+ if (tag == null) {
+ return Policy.bind("CVSCompareEditorInput.headLabel");
+ } else if (tag.getType() == CVSTag.BRANCH) {
+ return Policy.bind("CVSCompareEditorInput.branchLabel", tag.getName());
+ } else {
+ return tag.getName();
+ }
+ } else {
+ return resource.getSyncInfo().getRevision();
+ }
+ } catch (TeamException e) {
+ handle(e);
+ // Fall through and get the default label
+ }
+ }
+ return element.getName();
+ }
+
+ /*
+ * Returns a guess of the resource name being compared, for display
+ * in the title.
+ */
+ private String guessResourceName() {
+ if (left != null) {
+ return left.getName();
+ }
+ if (right != null) {
+ return right.getName();
+ }
+ if (ancestor != null) {
+ return ancestor.getName();
+ }
+ return "";
+ }
+
+ /**
+ * Handles a random exception and sanitizes it into a reasonable
+ * error message.
+ */
+ private void handle(Exception e) {
+ // create a status
+ Throwable t = e;
+ // unwrap the invocation target exception
+ if (t instanceof InvocationTargetException) {
+ t = ((InvocationTargetException)t).getTargetException();
+ }
+ IStatus error;
+ if (t instanceof CoreException) {
+ error = ((CoreException)t).getStatus();
+ } else if (t instanceof TeamException) {
+ error = ((TeamException)t).getStatus();
+ } else {
+ error = new Status(IStatus.ERROR, CVSUIPlugin.ID, 1, Policy.bind("internal"), t);
+ }
+ setMessage(error.getMessage());
+ if (!(t instanceof TeamException)) {
+ CVSUIPlugin.log(error);
+ }
+ }
+
+ /**
+ * Sets up the title and pane labels for the comparison view.
+ */
+ private void initLabels() {
+ CompareConfiguration cc = (CompareConfiguration) getCompareConfiguration();
+
+ String leftLabel = getLabel(left);
+ cc.setLeftLabel(leftLabel);
+ cc.setLeftImage(left.getImage());
+
+ String rightLabel = getLabel(right);
+ cc.setRightLabel(rightLabel);
+ cc.setRightImage(right.getImage());
+
+ String title;
+ if (ancestor != null) {
+ cc.setAncestorLabel(getLabel(ancestor));
+ cc.setAncestorImage(ancestor.getImage());
+ title = Policy.bind("CVSCompareEditorInput.titleAncestor", new Object[] {guessResourceName(), getVersionLabel(ancestor), getVersionLabel(left), getVersionLabel(right)} );
+ } else {
+ String leftName = null;
+ if (left != null) leftName = left.getName();
+ String rightName = null;
+ if (right != null) rightName = right.getName();
+ boolean differentNames = false;
+ if (leftName != null && !leftName.equals(rightName)) {
+ title = Policy.bind("CVSCompareEditorInput.titleNoAncestorDifferent", new Object[] {leftName, getVersionLabel(left), rightName, getVersionLabel(right)} );
+ } else {
+ title = Policy.bind("CVSCompareEditorInput.titleNoAncestor", new Object[] {guessResourceName(), getVersionLabel(left), getVersionLabel(right)} );
+ }
+ }
+ setTitle(title);
+ }
+
+ /* (Non-javadoc)
+ * Method declared on CompareEditorInput
+ */
+ public boolean isSaveNeeded() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * Method declared on CompareEditorInput
+ */
+ protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ boolean threeWay = ancestor != null;
+ if (right == null || left == null) {
+ setMessage(Policy.bind("CVSCompareEditorInput.different"));
+ return null;
+ }
+
+ initLabels();
+
+ Differencer d = new Differencer() {
+ protected boolean contentsEqual(Object input1, Object input2) {
+ int compare = teamEqual(input1, input2);
+ if (compare == NODE_EQUAL) {
+ return true;
+ }
+ if (compare == NODE_NOT_EQUAL) {
+ return false;
+ }
+ //revert to slow content comparison
+ return super.contentsEqual(input1, input2);
+ }
+ protected void updateProgress(IProgressMonitor progressMonitor, Object node) {
+ super.updateProgress(progressMonitor, node);
+ progressMonitor.worked(1);
+ }
+ protected Object[] getChildren(Object input) {
+ if (input instanceof IStructureComparator) {
+ Object[] children= ((IStructureComparator)input).getChildren();
+ if (children != null)
+ return children;
+ }
+ return null;
+ }
+ };
+
+ try {
+ monitor.beginTask(Policy.bind("CVSCompareEditorInput.comparing"), 30);
+
+ // get the CVS provider if one exists
+ if (left instanceof ResourceNode) {
+ IResource resource = ((ResourceNode)left).getResource();
+ ITeamProvider p = TeamPlugin.getManager().getProvider(resource);
+ if(p != null && p instanceof CVSTeamProvider) {
+ cvsProvider = (CVSTeamProvider)p;
+ }
+ }
+
+ // do the diff
+ IProgressMonitor sub = new SubProgressMonitor(monitor, 10);
+ try {
+ sub.beginTask(Policy.bind("CVSCompareEditorInput.comparing"), 100);
+ return d.findDifferences(threeWay, sub, null, ancestor, left, right);
+ } finally {
+ sub.done();
+ }
+ } catch (OperationCanceledException e) {
+ throw new InterruptedException(e.getMessage());
+ } catch (RuntimeException e) {
+ handle(e);
+ return null;
+ } finally {
+ monitor.done();
+ }
+ }
+
+ /**
+ * Compares two nodes to determine if they are equal. Returns NODE_EQUAL
+ * of they are the same, NODE_NOT_EQUAL if they are different, and
+ * NODE_UNKNOWN if comparison was not possible.
+ */
+ protected int teamEqual(Object left, Object right) {
+
+ // calculate the type for the left contribution
+ ICVSRemoteResource leftEdition = null;
+ if (left instanceof ResourceEditionNode) {
+ leftEdition = ((ResourceEditionNode)left).getRemoteResource();
+ } else if (left instanceof ResourceNode) {
+ IResource resource = ((ResourceNode)left).getResource();
+ try {
+ ICVSResource element = CVSWorkspaceRoot.getCVSResourceFor(resource);
+ if (resource.getType() == IResource.FILE) {
+ if (((ICVSFile) element).isDirty()) return NODE_NOT_EQUAL;
+ }
+ if(cvsProvider==null) {
+ return NODE_UNKNOWN;
+ }
+ leftEdition = CVSWorkspaceRoot.getRemoteResourceFor(resource);
+ } catch(CVSException e) {
+ return NODE_UNKNOWN;
+ }
+ }
+
+ // calculate the type for the right contribution
+ ICVSRemoteResource rightEdition = null;
+ if (right instanceof ResourceEditionNode)
+ rightEdition = ((ResourceEditionNode)right).getRemoteResource();
+
+
+ // compare them
+
+ if (leftEdition == null || rightEdition == null) {
+ return NODE_UNKNOWN;
+ }
+ // if they're both non-files, they're the same
+ if (leftEdition.isContainer() && rightEdition.isContainer()) {
+ return NODE_EQUAL;
+ }
+ // if they have different types, they're different
+ if (leftEdition.isContainer() != rightEdition.isContainer()) {
+ return NODE_NOT_EQUAL;
+ }
+
+ if (!leftEdition.getRepository().getLocation().equals(rightEdition.getRepository().getLocation())) {
+ return NODE_UNKNOWN;
+ }
+ try {
+ ResourceSyncInfo leftInfo = ((ICVSResource)leftEdition).getSyncInfo();
+ ResourceSyncInfo rightInfo = ((ICVSResource)rightEdition).getSyncInfo();
+
+ if (leftEdition.getRepositoryRelativePath().equals(rightEdition.getRepositoryRelativePath()) &&
+ leftInfo.getRevision().equals(rightInfo.getRevision())) {
+ return NODE_EQUAL;
+ } else {
+ // Optimized for most common case. There are actually cases where a file is merged from
+ // one branch to another where the revision numbers are different but the file is the same.
+ // We do not handle this case properly.
+ return NODE_NOT_EQUAL;
+ }
+ } catch (TeamException e) {
+ handle(e);
+ return NODE_UNKNOWN;
+ }
+ }
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSResourceNode.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSResourceNode.java
index 9d5cd8640..18e56ec23 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSResourceNode.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSResourceNode.java
@@ -1,91 +1,91 @@
-package org.eclipse.team.internal.ccvs.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-
-import org.eclipse.compare.ResourceNode;
-import org.eclipse.compare.structuremergeviewer.IStructureComparator;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.team.ccvs.core.ICVSFile;
-import org.eclipse.team.ccvs.core.ICVSFolder;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
-
-/**
- * This class is a wrapper for a CVSResource. We use it instead of the standard
- * ResourceNode because it can more accurately get its local children taking
- * into account ignored resources, CVS/ directories, etc.
- */
-public class CVSResourceNode extends ResourceNode {
- ArrayList fChildren;
-
- public CVSResourceNode(IResource resource) {
- super(resource);
- }
-
- public Object[] getChildren() {
- if (fChildren == null) {
- fChildren= new ArrayList();
- IResource resource = getResource();
- if (resource instanceof IContainer) {
- try {
- ICVSFolder cvsFolder = CVSWorkspaceRoot.getCVSFolderFor((IContainer) resource);
- ICVSFile[] files = cvsFolder.getFiles();
- for (int i= 0; i < files.length; i++) {
- IResource child = getFile((IContainer)resource, files[i].getName());
- if (child.exists()) {
- IStructureComparator childNode = createChild(child);
- if (childNode != null) {
- fChildren.add(childNode);
- }
- }
- }
- ICVSFolder[] folders = cvsFolder.getFolders();
- for (int i= 0; i < folders.length; i++) {
- IResource child = getFolder((IContainer)resource, folders[i].getName());
- if (child.exists()) {
- IStructureComparator childNode = createChild(child);
- if (childNode != null) {
- fChildren.add(childNode);
- }
- }
- }
- } catch (TeamException e) {
- CVSUIPlugin.log(e.getStatus());
- }
- }
- }
- return fChildren.toArray();
- }
-
- private IResource getFile(IContainer container, String name) {
- if (container instanceof IProject) {
- return ((IProject)container).getFile(name);
- }
- if (container instanceof IFolder) {
- return ((IFolder)container).getFile(name);
- }
- return null;
- }
-
- private IResource getFolder(IContainer container, String name) {
- if (container instanceof IProject) {
- return ((IProject)container).getFolder(name);
- }
- if (container instanceof IFolder) {
- return ((IFolder)container).getFolder(name);
- }
- return null;
- }
-
- protected IStructureComparator createChild(IResource child) {
- return new CVSResourceNode(child);
- }
-}
+package org.eclipse.team.internal.ccvs.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.util.ArrayList;
+
+import org.eclipse.compare.ResourceNode;
+import org.eclipse.compare.structuremergeviewer.IStructureComparator;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSFolder;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
+
+/**
+ * This class is a wrapper for a CVSResource. We use it instead of the standard
+ * ResourceNode because it can more accurately get its local children taking
+ * into account ignored resources, CVS/ directories, etc.
+ */
+public class CVSResourceNode extends ResourceNode {
+ ArrayList fChildren;
+
+ public CVSResourceNode(IResource resource) {
+ super(resource);
+ }
+
+ public Object[] getChildren() {
+ if (fChildren == null) {
+ fChildren= new ArrayList();
+ IResource resource = getResource();
+ if (resource instanceof IContainer) {
+ try {
+ ICVSFolder cvsFolder = CVSWorkspaceRoot.getCVSFolderFor((IContainer) resource);
+ ICVSFile[] files = cvsFolder.getFiles();
+ for (int i= 0; i < files.length; i++) {
+ IResource child = getFile((IContainer)resource, files[i].getName());
+ if (child.exists()) {
+ IStructureComparator childNode = createChild(child);
+ if (childNode != null) {
+ fChildren.add(childNode);
+ }
+ }
+ }
+ ICVSFolder[] folders = cvsFolder.getFolders();
+ for (int i= 0; i < folders.length; i++) {
+ IResource child = getFolder((IContainer)resource, folders[i].getName());
+ if (child.exists()) {
+ IStructureComparator childNode = createChild(child);
+ if (childNode != null) {
+ fChildren.add(childNode);
+ }
+ }
+ }
+ } catch (TeamException e) {
+ CVSUIPlugin.log(e.getStatus());
+ }
+ }
+ }
+ return fChildren.toArray();
+ }
+
+ private IResource getFile(IContainer container, String name) {
+ if (container instanceof IProject) {
+ return ((IProject)container).getFile(name);
+ }
+ if (container instanceof IFolder) {
+ return ((IFolder)container).getFile(name);
+ }
+ return null;
+ }
+
+ private IResource getFolder(IContainer container, String name) {
+ if (container instanceof IProject) {
+ return ((IProject)container).getFolder(name);
+ }
+ if (container instanceof IFolder) {
+ return ((IFolder)container).getFolder(name);
+ }
+ return null;
+ }
+
+ protected IStructureComparator createChild(IResource child) {
+ return new CVSResourceNode(child);
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ResourceEditionNode.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ResourceEditionNode.java
index c5fcac58f..9fa3f2fcb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ResourceEditionNode.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ResourceEditionNode.java
@@ -1,159 +1,159 @@
-package org.eclipse.team.internal.ccvs.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.InputStream;
-
-import org.eclipse.compare.BufferedContent;
-import org.eclipse.compare.CompareUI;
-import org.eclipse.compare.ITypedElement;
-import org.eclipse.compare.structuremergeviewer.IStructureComparator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.team.ccvs.core.ICVSRemoteResource;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.sync.IRemoteResource;
-
-/**
- * A class for comparing ICVSRemoteResource objects
- */
-public class ResourceEditionNode extends BufferedContent implements IStructureComparator, ITypedElement {
- private ICVSRemoteResource resource;
- private ResourceEditionNode[] children;
-
- /**
- * Creates a new ResourceEditionNode on the given resource edition.
- */
- public ResourceEditionNode(ICVSRemoteResource resourceEdition) {
- this.resource = resourceEdition;
- }
-
- /**
- * @see BufferedContent#createStream
- */
- public InputStream createStream() throws CoreException {
- if (resource == null) {
- return null;
- }
- try {
- return resource.getContents(new NullProgressMonitor());
- } catch (TeamException e) {
- throw new CoreException(e.getStatus());
- }
- }
-
- /**
- * Returns true if both resources names are identical.
- * The content is not considered.
- * @see IComparator#equals
- */
- public boolean equals(Object other) {
- if (other instanceof ITypedElement) {
- String otherName = ((ITypedElement)other).getName();
- return getName().equals(otherName);
- }
- return super.equals(other);
- }
-
- /**
- * Enumerate children of this node (if any).
- */
- public Object[] getChildren() {
- if (children == null) {
- if (resource == null) {
- children = new ResourceEditionNode[0];
- } else {
- try {
- IRemoteResource[] members = resource.members(new NullProgressMonitor());
- children = new ResourceEditionNode[members.length];
- for (int i = 0; i < members.length; i++) {
- children[i] = new ResourceEditionNode((ICVSRemoteResource)members[i]);
- }
- } catch (TeamException e) {
- CVSUIPlugin.log(e.getStatus());
- }
- }
- }
- return children;
- }
-
- /**
- * @see IStreamContentAccessor#getContents()
- */
- public InputStream getContents() throws CoreException {
- if (resource == null) {
- return null;
- }
- //show busy cursor if this is happening in the UI thread
- Display display = Display.getCurrent();
- if (display != null) {
- final InputStream[] stream = new InputStream[1];
- final TeamException[] exception = new TeamException[1];
- BusyIndicator.showWhile(display, new Runnable() {
- public void run() {
- try {
- stream[0] = resource.getContents(new NullProgressMonitor());
- } catch (TeamException e) {
- exception[0] = e;
- }
- }
- });
- if (exception[0] != null) {
- throw new CoreException(exception[0].getStatus());
- }
- return stream[0];
- } else {
- //we're not in the UI thread, just get the contents.
- try {
- return resource.getContents(new NullProgressMonitor());
- } catch (TeamException e) {
- throw new CoreException(e.getStatus());
- }
- }
- }
-
- public Image getImage() {
- return CompareUI.getImage(resource);
- }
-
- /**
- * Returns the name of this node.
- */
- public String getName() {
- return resource == null ? "" : resource.getName();
- }
-
- public ICVSRemoteResource getRemoteResource() {
- return resource;
- }
-
- /**
- * Returns the comparison type for this node.
- */
- public String getType() {
- if (resource == null) {
- return UNKNOWN_TYPE;
- }
- if (resource.isContainer()) {
- return FOLDER_TYPE;
- }
- String name = resource.getName();
- name = name.substring(name.lastIndexOf('.') + 1);
- return name.length() == 0 ? UNKNOWN_TYPE : name;
- }
-
- /**
- * @see IComparator#equals
- */
- public int hashCode() {
- return getName().hashCode();
- }
-}
+package org.eclipse.team.internal.ccvs.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.io.InputStream;
+
+import org.eclipse.compare.BufferedContent;
+import org.eclipse.compare.CompareUI;
+import org.eclipse.compare.ITypedElement;
+import org.eclipse.compare.structuremergeviewer.IStructureComparator;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.team.ccvs.core.ICVSRemoteResource;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.sync.IRemoteResource;
+
+/**
+ * A class for comparing ICVSRemoteResource objects
+ */
+public class ResourceEditionNode extends BufferedContent implements IStructureComparator, ITypedElement {
+ private ICVSRemoteResource resource;
+ private ResourceEditionNode[] children;
+
+ /**
+ * Creates a new ResourceEditionNode on the given resource edition.
+ */
+ public ResourceEditionNode(ICVSRemoteResource resourceEdition) {
+ this.resource = resourceEdition;
+ }
+
+ /**
+ * @see BufferedContent#createStream
+ */
+ public InputStream createStream() throws CoreException {
+ if (resource == null) {
+ return null;
+ }
+ try {
+ return resource.getContents(new NullProgressMonitor());
+ } catch (TeamException e) {
+ throw new CoreException(e.getStatus());
+ }
+ }
+
+ /**
+ * Returns true if both resources names are identical.
+ * The content is not considered.
+ * @see IComparator#equals
+ */
+ public boolean equals(Object other) {
+ if (other instanceof ITypedElement) {
+ String otherName = ((ITypedElement)other).getName();
+ return getName().equals(otherName);
+ }
+ return super.equals(other);
+ }
+
+ /**
+ * Enumerate children of this node (if any).
+ */
+ public Object[] getChildren() {
+ if (children == null) {
+ if (resource == null) {
+ children = new ResourceEditionNode[0];
+ } else {
+ try {
+ IRemoteResource[] members = resource.members(new NullProgressMonitor());
+ children = new ResourceEditionNode[members.length];
+ for (int i = 0; i < members.length; i++) {
+ children[i] = new ResourceEditionNode((ICVSRemoteResource)members[i]);
+ }
+ } catch (TeamException e) {
+ CVSUIPlugin.log(e.getStatus());
+ }
+ }
+ }
+ return children;
+ }
+
+ /**
+ * @see IStreamContentAccessor#getContents()
+ */
+ public InputStream getContents() throws CoreException {
+ if (resource == null) {
+ return null;
+ }
+ //show busy cursor if this is happening in the UI thread
+ Display display = Display.getCurrent();
+ if (display != null) {
+ final InputStream[] stream = new InputStream[1];
+ final TeamException[] exception = new TeamException[1];
+ BusyIndicator.showWhile(display, new Runnable() {
+ public void run() {
+ try {
+ stream[0] = resource.getContents(new NullProgressMonitor());
+ } catch (TeamException e) {
+ exception[0] = e;
+ }
+ }
+ });
+ if (exception[0] != null) {
+ throw new CoreException(exception[0].getStatus());
+ }
+ return stream[0];
+ } else {
+ //we're not in the UI thread, just get the contents.
+ try {
+ return resource.getContents(new NullProgressMonitor());
+ } catch (TeamException e) {
+ throw new CoreException(e.getStatus());
+ }
+ }
+ }
+
+ public Image getImage() {
+ return CompareUI.getImage(resource);
+ }
+
+ /**
+ * Returns the name of this node.
+ */
+ public String getName() {
+ return resource == null ? "" : resource.getName();
+ }
+
+ public ICVSRemoteResource getRemoteResource() {
+ return resource;
+ }
+
+ /**
+ * Returns the comparison type for this node.
+ */
+ public String getType() {
+ if (resource == null) {
+ return UNKNOWN_TYPE;
+ }
+ if (resource.isContainer()) {
+ return FOLDER_TYPE;
+ }
+ String name = resource.getName();
+ name = name.substring(name.lastIndexOf('.') + 1);
+ return name.length() == 0 ? UNKNOWN_TYPE : name;
+ }
+
+ /**
+ * @see IComparator#equals
+ */
+ public int hashCode() {
+ return getName().hashCode();
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/BranchCategory.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/BranchCategory.java
index 19d501be7..adaebcd0e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/BranchCategory.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/model/BranchCategory.java
@@ -10,7 +10,7 @@ import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.widgets.Display;
import org.eclipse.team.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
-import org.eclipse.ui.model.IWorkbenchAdapter;
+import org.eclipse.ui.model.IWorkbenchAdapter;
/**
* BranchCategory is the model element for the branches category
* for a particular repsitory in the repositories view. Its children
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
index 84f98ec5b..852de443c 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSCatchupReleaseViewer.java
@@ -1,271 +1,271 @@
-package org.eclipse.team.internal.ccvs.ui.sync;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.resource.CompositeImageDescriptor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.ccvs.core.ICVSFile;
-import org.eclipse.team.ccvs.core.ICVSRemoteFile;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.sync.IRemoteResource;
-import org.eclipse.team.core.sync.IRemoteSyncElement;
-import org.eclipse.team.internal.ccvs.core.CVSException;
-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.CVSDecorator;
-import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
-import org.eclipse.team.internal.ccvs.ui.HistoryView;
-import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
-import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ccvs.ui.merge.UpdateMergeAction;
-import org.eclipse.team.ui.sync.CatchupReleaseViewer;
-import org.eclipse.team.ui.sync.ITeamNode;
-import org.eclipse.team.ui.sync.MergeResource;
-import org.eclipse.team.ui.sync.SyncView;
-import org.eclipse.team.ui.sync.TeamFile;
-
-public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
- // Actions
- private UpdateSyncAction updateAction;
- private CommitSyncAction commitAction;
- private UpdateMergeAction updateMergeAction;
- private IgnoreAction ignoreAction;
- private HistoryAction showInHistory;
-
- class DiffImage extends CompositeImageDescriptor {
- private static final int HEIGHT= 16;
- private static final int WIDTH= 22;
-
- Image baseImage;
- ImageDescriptor overlay;
-
- public DiffImage(Image baseImage, ImageDescriptor overlay) {
- this.baseImage = baseImage;
- this.overlay = overlay;
- }
-
- /*
- * @see CompositeImageDescriptor#drawCompositeImage(int, int)
- */
- protected void drawCompositeImage(int width, int height) {
- drawImage(baseImage.getImageData(), 0, 0);
- ImageData overlayData = overlay.getImageData();
- drawImage(overlayData, WIDTH - overlayData.width, (HEIGHT - overlayData.height) / 2);
- }
-
- /*
- * @see CompositeImageDescriptor#getSize()
- */
- protected Point getSize() {
- return new Point(WIDTH, HEIGHT);
- }
- }
- class HistoryAction extends Action implements ISelectionChangedListener {
- IStructuredSelection selection;
- public HistoryAction(String label) {
- super(label);
- }
- public void run() {
- if (selection.isEmpty()) return;
- HistoryView view = HistoryView.openInActivePerspective();
- if (view == null) return;
- ITeamNode node = (ITeamNode)selection.getFirstElement();
- IRemoteSyncElement remoteSyncElement = ((TeamFile)node).getMergeResource().getSyncElement();
- IResource resource = remoteSyncElement.getLocal();
- if (resource.exists()) {
- view.showHistory(resource);
- } else {
- ICVSRemoteFile remoteFile = (ICVSRemoteFile)remoteSyncElement.getRemote();
- view.showHistory(remoteFile);
- }
- }
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (!(selection instanceof IStructuredSelection)) {
- setEnabled(false);
- return;
- }
- IStructuredSelection ss = (IStructuredSelection)selection;
- if (ss.size() != 1) {
- setEnabled(false);
- return;
- }
- ITeamNode first = (ITeamNode)ss.getFirstElement();
- if (first instanceof TeamFile) {
- this.selection = ss;
- setEnabled(true);
- } else {
- this.selection = null;
- setEnabled(false);
- }
- }
- }
-
- public CVSCatchupReleaseViewer(Composite parent, CVSSyncCompareInput model) {
- super(parent, model);
- initializeActions(model);
- initializeLabelProvider();
- }
-
- private void initializeLabelProvider() {
- final ImageDescriptor conflictDescriptor = CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_MERGEABLE_CONFLICT);
- final ImageDescriptor questionableDescriptor = CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_QUESTIONABLE);
- final LabelProvider oldProvider = (LabelProvider)getLabelProvider();
- setLabelProvider(new LabelProvider() {
- public Image getImage(Object element) {
- Image image = oldProvider.getImage(element);
- if (element instanceof ITeamNode) {
- ITeamNode node = (ITeamNode)element;
- int kind = node.getKind();
- if ((kind & IRemoteSyncElement.AUTOMERGE_CONFLICT) != 0) {
- DiffImage diffImage = new DiffImage(image, conflictDescriptor);
- return diffImage.createImage();
- }
- if (kind == (IRemoteSyncElement.OUTGOING | IRemoteSyncElement.ADDITION)) {
- IResource resource = node.getResource();
- if (resource.getType() == IResource.FILE) {
- try {
- ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile) resource);
- if (cvsFile.getSyncInfo() == null) {
- DiffImage diffImage = new DiffImage(image, questionableDescriptor);
- return diffImage.createImage();
- }
- } catch (TeamException e) {
- ErrorDialog.openError(getControl().getShell(), null, null, e.getStatus());
- // Fall through and return the default image
- }
- }
- }
- }
- return image;
- }
- public String getText(Object element) {
- StringBuffer postfix = new StringBuffer();
- if (element instanceof ITeamNode) {
- ITeamNode node = (ITeamNode)element;
- IResource resource = node.getResource();
- if (resource.exists() && resource.getType() == IResource.FILE) {
- try {
- ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile) resource);
- ResourceSyncInfo info = cvsFile.getSyncInfo();
- String kw;
- if (info!=null) {
- kw = CVSDecorator.getFileTypeString(resource.getName(), info.getKeywordMode());
- } else {
- kw = CVSDecorator.getFileTypeString(resource.getName(), null);
- }
- postfix.append("(" + kw + ")");
- } catch(CVSException e) {
- ErrorDialog.openError(getControl().getShell(), null, null, e.getStatus());
- }
- }
- }
- return oldProvider.getText(element) + " " + postfix.toString() ;
- }
- });
- }
-
- protected void fillContextMenu(IMenuManager manager) {
- super.fillContextMenu(manager);
- if (showInHistory != null) {
- manager.add(showInHistory);
- }
- manager.add(new Separator());
- switch (getSyncMode()) {
- case SyncView.SYNC_INCOMING:
- updateAction.update(SyncView.SYNC_INCOMING);
- manager.add(updateAction);
- break;
- case SyncView.SYNC_OUTGOING:
- commitAction.update(SyncView.SYNC_OUTGOING);
- manager.add(commitAction);
- ignoreAction.update();
- manager.add(ignoreAction);
- manager.add(new Separator());
- updateAction.update(SyncView.SYNC_OUTGOING);
- manager.add(updateAction);
- break;
- case SyncView.SYNC_BOTH:
- commitAction.update(SyncView.SYNC_BOTH);
- manager.add(commitAction);
- manager.add(new Separator());
- updateAction.update(SyncView.SYNC_BOTH);
- manager.add(updateAction);
- break;
- case SyncView.SYNC_MERGE:
- updateMergeAction.update(SyncView.SYNC_INCOMING);
- manager.add(updateMergeAction);
- break;
- }
- }
-
- /**
- * Creates the actions for this viewer.
- */
- private void initializeActions(final CVSSyncCompareInput diffModel) {
- Shell shell = getControl().getShell();
- commitAction = new CommitSyncAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.commit"), shell);
- updateAction = new UpdateSyncAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.update"), shell);
- updateMergeAction = new UpdateMergeAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.update"), shell);
- ignoreAction = new IgnoreAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.ignore"), shell);
- // Show in history view
- showInHistory = new HistoryAction(Policy.bind("CVSCatchupReleaseViewer.showInHistory"));
- addSelectionChangedListener(showInHistory);
- }
-
- /**
- * Provide CVS-specific labels for the editors.
- */
- protected void updateLabels(MergeResource resource) {
- CompareConfiguration config = getCompareConfiguration();
- String name = resource.getName();
- config.setLeftLabel(Policy.bind("CVSCatchupReleaseViewer.workspaceFile", name));
-
- IRemoteSyncElement syncTree = resource.getSyncElement();
- IRemoteResource remote = syncTree.getRemote();
- if (remote != null) {
- try {
- String revision = ((ICVSRemoteFile)remote).getRevision();
- config.setRightLabel(Policy.bind("CVSCatchupReleaseViewer.repositoryFileRevision", new Object[] {name, revision}));
- } catch (TeamException e) {
- ErrorDialog.openError(getControl().getShell(), null, null, e.getStatus());
- config.setRightLabel(Policy.bind("CVSCatchupReleaseViewer.repositoryFile", name));
- }
- } else {
- config.setRightLabel(Policy.bind("CVSCatchupReleaseViewer.noRepositoryFile"));
- }
-
- IRemoteResource base = syncTree.getBase();
- if (base != null) {
- try {
- String revision = ((ICVSRemoteFile)base).getRevision();
- config.setAncestorLabel(Policy.bind("CVSCatchupReleaseViewer.commonFileRevision", new Object[] {name, revision} ));
- } catch (TeamException e) {
- ErrorDialog.openError(getControl().getShell(), null, null, e.getStatus());
- config.setRightLabel(Policy.bind("CVSCatchupReleaseViewer.commonFile", name));
- }
- } else {
- config.setAncestorLabel(Policy.bind("CVSCatchupReleaseViewer.noCommonFile"));
- }
- }
-}
+package org.eclipse.team.internal.ccvs.ui.sync;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2002.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.compare.CompareConfiguration;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.resource.CompositeImageDescriptor;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.team.ccvs.core.ICVSFile;
+import org.eclipse.team.ccvs.core.ICVSRemoteFile;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.sync.IRemoteResource;
+import org.eclipse.team.core.sync.IRemoteSyncElement;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+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.CVSDecorator;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.HistoryView;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
+import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ccvs.ui.merge.UpdateMergeAction;
+import org.eclipse.team.ui.sync.CatchupReleaseViewer;
+import org.eclipse.team.ui.sync.ITeamNode;
+import org.eclipse.team.ui.sync.MergeResource;
+import org.eclipse.team.ui.sync.SyncView;
+import org.eclipse.team.ui.sync.TeamFile;
+
+public class CVSCatchupReleaseViewer extends CatchupReleaseViewer {
+ // Actions
+ private UpdateSyncAction updateAction;
+ private CommitSyncAction commitAction;
+ private UpdateMergeAction updateMergeAction;
+ private IgnoreAction ignoreAction;
+ private HistoryAction showInHistory;
+
+ class DiffImage extends CompositeImageDescriptor {
+ private static final int HEIGHT= 16;
+ private static final int WIDTH= 22;
+
+ Image baseImage;
+ ImageDescriptor overlay;
+
+ public DiffImage(Image baseImage, ImageDescriptor overlay) {
+ this.baseImage = baseImage;
+ this.overlay = overlay;
+ }
+
+ /*
+ * @see CompositeImageDescriptor#drawCompositeImage(int, int)
+ */
+ protected void drawCompositeImage(int width, int height) {
+ drawImage(baseImage.getImageData(), 0, 0);
+ ImageData overlayData = overlay.getImageData();
+ drawImage(overlayData, WIDTH - overlayData.width, (HEIGHT - overlayData.height) / 2);
+ }
+
+ /*
+ * @see CompositeImageDescriptor#getSize()
+ */
+ protected Point getSize() {
+ return new Point(WIDTH, HEIGHT);
+ }
+ }
+ class HistoryAction extends Action implements ISelectionChangedListener {
+ IStructuredSelection selection;
+ public HistoryAction(String label) {
+ super(label);
+ }
+ public void run() {
+ if (selection.isEmpty()) return;
+ HistoryView view = HistoryView.openInActivePerspective();
+ if (view == null) return;
+ ITeamNode node = (ITeamNode)selection.getFirstElement();
+ IRemoteSyncElement remoteSyncElement = ((TeamFile)node).getMergeResource().getSyncElement();
+ IResource resource = remoteSyncElement.getLocal();
+ if (resource.exists()) {
+ view.showHistory(resource);
+ } else {
+ ICVSRemoteFile remoteFile = (ICVSRemoteFile)remoteSyncElement.getRemote();
+ view.showHistory(remoteFile);
+ }
+ }
+ public void selectionChanged(SelectionChangedEvent event) {
+ ISelection selection = event.getSelection();
+ if (!(selection instanceof IStructuredSelection)) {
+ setEnabled(false);
+ return;
+ }
+ IStructuredSelection ss = (IStructuredSelection)selection;
+ if (ss.size() != 1) {
+ setEnabled(false);
+ return;
+ }
+ ITeamNode first = (ITeamNode)ss.getFirstElement();
+ if (first instanceof TeamFile) {
+ this.selection = ss;
+ setEnabled(true);
+ } else {
+ this.selection = null;
+ setEnabled(false);
+ }
+ }
+ }
+
+ public CVSCatchupReleaseViewer(Composite parent, CVSSyncCompareInput model) {
+ super(parent, model);
+ initializeActions(model);
+ initializeLabelProvider();
+ }
+
+ private void initializeLabelProvider() {
+ final ImageDescriptor conflictDescriptor = CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_MERGEABLE_CONFLICT);
+ final ImageDescriptor questionableDescriptor = CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_QUESTIONABLE);
+ final LabelProvider oldProvider = (LabelProvider)getLabelProvider();
+ setLabelProvider(new LabelProvider() {
+ public Image getImage(Object element) {
+ Image image = oldProvider.getImage(element);
+ if (element instanceof ITeamNode) {
+ ITeamNode node = (ITeamNode)element;
+ int kind = node.getKind();
+ if ((kind & IRemoteSyncElement.AUTOMERGE_CONFLICT) != 0) {
+ DiffImage diffImage = new DiffImage(image, conflictDescriptor);
+ return diffImage.createImage();
+ }
+ if (kind == (IRemoteSyncElement.OUTGOING | IRemoteSyncElement.ADDITION)) {
+ IResource resource = node.getResource();
+ if (resource.getType() == IResource.FILE) {
+ try {
+ ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile) resource);
+ if (cvsFile.getSyncInfo() == null) {
+ DiffImage diffImage = new DiffImage(image, questionableDescriptor);
+ return diffImage.createImage();
+ }
+ } catch (TeamException e) {
+ ErrorDialog.openError(getControl().getShell(), null, null, e.getStatus());
+ // Fall through and return the default image
+ }
+ }
+ }
+ }
+ return image;
+ }
+ public String getText(Object element) {
+ StringBuffer postfix = new StringBuffer();
+ if (element instanceof ITeamNode) {
+ ITeamNode node = (ITeamNode)element;
+ IResource resource = node.getResource();
+ if (resource.exists() && resource.getType() == IResource.FILE) {
+ try {
+ ICVSFile cvsFile = CVSWorkspaceRoot.getCVSFileFor((IFile) resource);
+ ResourceSyncInfo info = cvsFile.getSyncInfo();
+ String kw;
+ if (info!=null) {
+ kw = CVSDecorator.getFileTypeString(resource.getName(), info.getKeywordMode());
+ } else {
+ kw = CVSDecorator.getFileTypeString(resource.getName(), null);
+ }
+ postfix.append("(" + kw + ")");
+ } catch(CVSException e) {
+ ErrorDialog.openError(getControl().getShell(), null, null, e.getStatus());
+ }
+ }
+ }
+ return oldProvider.getText(element) + " " + postfix.toString() ;
+ }
+ });
+ }
+
+ protected void fillContextMenu(IMenuManager manager) {
+ super.fillContextMenu(manager);
+ if (showInHistory != null) {
+ manager.add(showInHistory);
+ }
+ manager.add(new Separator());
+ switch (getSyncMode()) {
+ case SyncView.SYNC_INCOMING:
+ updateAction.update(SyncView.SYNC_INCOMING);
+ manager.add(updateAction);
+ break;
+ case SyncView.SYNC_OUTGOING:
+ commitAction.update(SyncView.SYNC_OUTGOING);
+ manager.add(commitAction);
+ ignoreAction.update();
+ manager.add(ignoreAction);
+ manager.add(new Separator());
+ updateAction.update(SyncView.SYNC_OUTGOING);
+ manager.add(updateAction);
+ break;
+ case SyncView.SYNC_BOTH:
+ commitAction.update(SyncView.SYNC_BOTH);
+ manager.add(commitAction);
+ manager.add(new Separator());
+ updateAction.update(SyncView.SYNC_BOTH);
+ manager.add(updateAction);
+ break;
+ case SyncView.SYNC_MERGE:
+ updateMergeAction.update(SyncView.SYNC_INCOMING);
+ manager.add(updateMergeAction);
+ break;
+ }
+ }
+
+ /**
+ * Creates the actions for this viewer.
+ */
+ private void initializeActions(final CVSSyncCompareInput diffModel) {
+ Shell shell = getControl().getShell();
+ commitAction = new CommitSyncAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.commit"), shell);
+ updateAction = new UpdateSyncAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.update"), shell);
+ updateMergeAction = new UpdateMergeAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.update"), shell);
+ ignoreAction = new IgnoreAction(diffModel, this, Policy.bind("CVSCatchupReleaseViewer.ignore"), shell);
+ // Show in history view
+ showInHistory = new HistoryAction(Policy.bind("CVSCatchupReleaseViewer.showInHistory"));
+ addSelectionChangedListener(showInHistory);
+ }
+
+ /**
+ * Provide CVS-specific labels for the editors.
+ */
+ protected void updateLabels(MergeResource resource) {
+ CompareConfiguration config = getCompareConfiguration();
+ String name = resource.getName();
+ config.setLeftLabel(Policy.bind("CVSCatchupReleaseViewer.workspaceFile", name));
+
+ IRemoteSyncElement syncTree = resource.getSyncElement();
+ IRemoteResource remote = syncTree.getRemote();
+ if (remote != null) {
+ try {
+ String revision = ((ICVSRemoteFile)remote).getRevision();
+ config.setRightLabel(Policy.bind("CVSCatchupReleaseViewer.repositoryFileRevision", new Object[] {name, revision}));
+ } catch (TeamException e) {
+ ErrorDialog.openError(getControl().getShell(), null, null, e.getStatus());
+ config.setRightLabel(Policy.bind("CVSCatchupReleaseViewer.repositoryFile", name));
+ }
+ } else {
+ config.setRightLabel(Policy.bind("CVSCatchupReleaseViewer.noRepositoryFile"));
+ }
+
+ IRemoteResource base = syncTree.getBase();
+ if (base != null) {
+ try {
+ String revision = ((ICVSRemoteFile)base).getRevision();
+ config.setAncestorLabel(Policy.bind("CVSCatchupReleaseViewer.commonFileRevision", new Object[] {name, revision} ));
+ } catch (TeamException e) {
+ ErrorDialog.openError(getControl().getShell(), null, null, e.getStatus());
+ config.setRightLabel(Policy.bind("CVSCatchupReleaseViewer.commonFile", name));
+ }
+ } else {
+ config.setAncestorLabel(Policy.bind("CVSCatchupReleaseViewer.noCommonFile"));
+ }
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
index 57623a908..540916f38 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/CVSSyncCompareInput.java
@@ -1,110 +1,110 @@
-package org.eclipse.team.internal.ccvs.ui.sync;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.compare.structuremergeviewer.ICompareInput;
-import org.eclipse.compare.structuremergeviewer.IDiffContainer;
-import org.eclipse.compare.structuremergeviewer.IDiffElement;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.team.ccvs.core.CVSTeamProvider;
-import org.eclipse.team.core.ITeamProvider;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.TeamPlugin;
-import org.eclipse.team.core.sync.IRemoteSyncElement;
-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.ui.sync.CatchupReleaseViewer;
-import org.eclipse.team.ui.sync.ChangedTeamContainer;
-import org.eclipse.team.ui.sync.ITeamNode;
-import org.eclipse.team.ui.sync.SyncCompareInput;
-import org.eclipse.team.ui.sync.SyncSet;
-import org.eclipse.team.ui.sync.TeamFile;
-import org.eclipse.team.ui.sync.UnchangedTeamContainer;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-public class CVSSyncCompareInput extends SyncCompareInput {
- IResource[] resources;
- /**
- * Creates a new catchup or release operation.
- */
- public CVSSyncCompareInput(IResource[] resources) {
- super();
- this.resources = resources;
- }
- /**
- * Overridden to create a custom DiffTreeViewer in the top left pane of the CompareProvider.
- *
- * Subclasses must create and return a new CatchupReleaseViewer, and set the viewer
- * using setViewer().
- */
- public Viewer createDiffViewer(Composite parent) {
- CatchupReleaseViewer catchupReleaseViewer = new CVSCatchupReleaseViewer(parent, this);
- setViewer(catchupReleaseViewer);
- return catchupReleaseViewer;
- }
-
- protected IRemoteSyncElement[] createSyncElements(IProgressMonitor monitor) throws TeamException {
- IRemoteSyncElement[] trees = new IRemoteSyncElement[resources.length];
- int work = 1000 * resources.length;
- monitor.beginTask(null, work);
- try {
- for (int i = 0; i < trees.length; i++) {
- trees[i] = CVSWorkspaceRoot.getRemoteSyncTree(resources[i], null, Policy.subMonitorFor(monitor, 1000));
- }
- } finally {
- monitor.done();
- }
- return trees;
- }
-
- protected void updateView() {
- // Update the view
- if (getDiffRoot().hasChildren()) {
- getViewer().refresh();
- } else {
- getViewer().setInput(null);
- }
-
- // Update the status line
- updateStatusLine();
- }
-
- /**
- * Overridden to mark the source as merged.
- */
- protected void compareInputChanged(ICompareInput source) {
- super.compareInputChanged(source);
- contentsChanged(source);
- }
- protected void contentsChanged(ICompareInput source) {
- // Mark the source as merged.
- if (source instanceof TeamFile) {
- IRemoteSyncElement element = ((TeamFile)source).getMergeResource().getSyncElement();
- try {
- CVSUIPlugin.getPlugin().getRepositoryManager().merged(new IRemoteSyncElement[] {element});
- } catch (TeamException e) {
- ErrorDialog.openError(getShell(), null, null, e.getStatus());
- }
- }
- }
- /*
- * @see SyncCompareInput#getSyncGranularity()
- */
- protected int getSyncGranularity() {
- // assuming that sync is always performed relative to the current branch. In
- // these cases the server will perform the content comparison for us.
- return IRemoteSyncElement.GRANULARITY_TIMESTAMP;
- }
-}
+package org.eclipse.team.internal.ccvs.ui.sync;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.compare.structuremergeviewer.ICompareInput;
+import org.eclipse.compare.structuremergeviewer.IDiffContainer;
+import org.eclipse.compare.structuremergeviewer.IDiffElement;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.team.ccvs.core.CVSTeamProvider;
+import org.eclipse.team.core.ITeamProvider;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.core.TeamPlugin;
+import org.eclipse.team.core.sync.IRemoteSyncElement;
+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.ui.sync.CatchupReleaseViewer;
+import org.eclipse.team.ui.sync.ChangedTeamContainer;
+import org.eclipse.team.ui.sync.ITeamNode;
+import org.eclipse.team.ui.sync.SyncCompareInput;
+import org.eclipse.team.ui.sync.SyncSet;
+import org.eclipse.team.ui.sync.TeamFile;
+import org.eclipse.team.ui.sync.UnchangedTeamContainer;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+public class CVSSyncCompareInput extends SyncCompareInput {
+ IResource[] resources;
+ /**
+ * Creates a new catchup or release operation.
+ */
+ public CVSSyncCompareInput(IResource[] resources) {
+ super();
+ this.resources = resources;
+ }
+ /**
+ * Overridden to create a custom DiffTreeViewer in the top left pane of the CompareProvider.
+ *
+ * Subclasses must create and return a new CatchupReleaseViewer, and set the viewer
+ * using setViewer().
+ */
+ public Viewer createDiffViewer(Composite parent) {
+ CatchupReleaseViewer catchupReleaseViewer = new CVSCatchupReleaseViewer(parent, this);
+ setViewer(catchupReleaseViewer);
+ return catchupReleaseViewer;
+ }
+
+ protected IRemoteSyncElement[] createSyncElements(IProgressMonitor monitor) throws TeamException {
+ IRemoteSyncElement[] trees = new IRemoteSyncElement[resources.length];
+ int work = 1000 * resources.length;
+ monitor.beginTask(null, work);
+ try {
+ for (int i = 0; i < trees.length; i++) {
+ trees[i] = CVSWorkspaceRoot.getRemoteSyncTree(resources[i], null, Policy.subMonitorFor(monitor, 1000));
+ }
+ } finally {
+ monitor.done();
+ }
+ return trees;
+ }
+
+ protected void updateView() {
+ // Update the view
+ if (getDiffRoot().hasChildren()) {
+ getViewer().refresh();
+ } else {
+ getViewer().setInput(null);
+ }
+
+ // Update the status line
+ updateStatusLine();
+ }
+
+ /**
+ * Overridden to mark the source as merged.
+ */
+ protected void compareInputChanged(ICompareInput source) {
+ super.compareInputChanged(source);
+ contentsChanged(source);
+ }
+ protected void contentsChanged(ICompareInput source) {
+ // Mark the source as merged.
+ if (source instanceof TeamFile) {
+ IRemoteSyncElement element = ((TeamFile)source).getMergeResource().getSyncElement();
+ try {
+ CVSUIPlugin.getPlugin().getRepositoryManager().merged(new IRemoteSyncElement[] {element});
+ } catch (TeamException e) {
+ ErrorDialog.openError(getShell(), null, null, e.getStatus());
+ }
+ }
+ }
+ /*
+ * @see SyncCompareInput#getSyncGranularity()
+ */
+ protected int getSyncGranularity() {
+ // assuming that sync is always performed relative to the current branch. In
+ // these cases the server will perform the content comparison for us.
+ return IRemoteSyncElement.GRANULARITY_TIMESTAMP;
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ToolTipMessageDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ToolTipMessageDialog.java
index aa8df4e4a..3dd338bcc 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ToolTipMessageDialog.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/sync/ToolTipMessageDialog.java
@@ -1,25 +1,25 @@
-package org.eclipse.team.internal.ccvs.ui.sync;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
-/**
- * A class that adds tool-tips to the buttons of a standard message dialog.
+package org.eclipse.team.internal.ccvs.ui.sync;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
+/**
+ * A class that adds tool-tips to the buttons of a standard message dialog.
*/
public class ToolTipMessageDialog extends MessageDialog {
- private String[] buttonToolTips;
- /**
- * Same as the MessageDialog constructor, with the addition of a button tooltip
- * argument. The number of button tool tips must match the number of button labels.
- */
- public ToolTipMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, int dialogImageType, String[] dialogButtonLabels, String[] buttonToolTips, int defaultIndex) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
- this.buttonToolTips = buttonToolTips;
- }
- /**
- * Method declared on MessageDialog.
- */
- protected void createButtonsForButtonBar(Composite parent) {
- super.createButtonsForButtonBar(parent);
- if (buttonToolTips != null) {
- for (int i = 0; i < buttonToolTips.length; i++) {
- getButton(i).setToolTipText(buttonToolTips[i]);
- }
- }
+ private String[] buttonToolTips;
+ /**
+ * Same as the MessageDialog constructor, with the addition of a button tooltip
+ * argument. The number of button tool tips must match the number of button labels.
+ */
+ public ToolTipMessageDialog(Shell parentShell, String dialogTitle, Image dialogTitleImage, String dialogMessage, int dialogImageType, String[] dialogButtonLabels, String[] buttonToolTips, int defaultIndex) {
+ super(parentShell, dialogTitle, dialogTitleImage, dialogMessage, dialogImageType, dialogButtonLabels, defaultIndex);
+ this.buttonToolTips = buttonToolTips;
+ }
+ /**
+ * Method declared on MessageDialog.
+ */
+ protected void createButtonsForButtonBar(Composite parent) {
+ super.createButtonsForButtonBar(parent);
+ if (buttonToolTips != null) {
+ for (int i = 0; i < buttonToolTips.length; i++) {
+ getButton(i).setToolTipText(buttonToolTips[i]);
+ }
+ }
}
}
diff --git a/bundles/org.eclipse.team.ui/README b/bundles/org.eclipse.team.ui/README
index e5bced73f..6a358f07a 100644
--- a/bundles/org.eclipse.team.ui/README
+++ b/bundles/org.eclipse.team.ui/README
@@ -1,13 +1,13 @@
-Note to users of this plug-in
-
-The classes and interfaces in this plug-in are part of an API that is
-still under development and expected to change significantly before
-reaching stability. It is being made available at this early stage to
-solicit feedback from pioneering adopters on the understanding
-that any code that uses this API will almost certainly be broken
-(repeatedly) as the API evolves.
-
-For up-to-date information on these APIs and other related news see
-our component page:
-
+Note to users of this plug-in
+
+The classes and interfaces in this plug-in are part of an API that is
+still under development and expected to change significantly before
+reaching stability. It is being made available at this early stage to
+solicit feedback from pioneering adopters on the understanding
+that any code that uses this API will almost certainly be broken
+(repeatedly) as the API evolves.
+
+For up-to-date information on these APIs and other related news see
+our component page:
+
http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/platform-vcm-home/main.html
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/about.html b/bundles/org.eclipse.team.ui/about.html
index 768324e89..441774f92 100644
--- a/bundles/org.eclipse.team.ui/about.html
+++ b/bundles/org.eclipse.team.ui/about.html
@@ -1,42 +1,42 @@
-
-
-About
-
-
-
-
-
-
About This Content
-
-
-
-
11th December, 2001
-
License
-
Eclipse.org makes available all content in this plug-in "Content". Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Common Public License Version 0.5 "CPL". For purposes of the CPL, "Program" will mean the Content.
-
-
Contributions
-
-
If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
-made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
-Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.
-
-
If this Content is licensed to you under license terms and conditions other than the CPL "Other License", any modifications, enhancements and/or
-other code and/or documentation "Modifications" uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
-host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
-to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
-providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
-the CPL.
-
-
+
+
+About
+
+
+
+
+
+
About This Content
+
+
+
+
11th December, 2001
+
License
+
Eclipse.org makes available all content in this plug-in "Content". Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
+Common Public License Version 0.5 "CPL". For purposes of the CPL, "Program" will mean the Content.
+
+
Contributions
+
+
If this Content is licensed to you under the terms and conditions of the CPL, any Contributions, as defined in the CPL, uploaded, submitted, or otherwise
+made available to Eclipse.org, members of Eclipse.org and/or the host of Eclipse.org web site, by you that relate to such
+Content are provided under the terms and conditions of the CPL and can be made available to others under the terms of the CPL.
+
+
If this Content is licensed to you under license terms and conditions other than the CPL "Other License", any modifications, enhancements and/or
+other code and/or documentation "Modifications" uploaded, submitted, or otherwise made available to Eclipse.org, members of Eclipse.org and/or the
+host of Eclipse.org, by you that relate to such Content are provided under terms and conditions of the Other License and can be made available
+to others under the terms of the Other License. In addition, with regard to Modifications for which you are the copyright holder, you are also
+providing the Modifications under the terms and conditions of the CPL and such Modifications can be made available to others under the terms of
+the CPL.
+
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/doc/hglegal.htm b/bundles/org.eclipse.team.ui/doc/hglegal.htm
index b071dbdf4..c59811321 100644
--- a/bundles/org.eclipse.team.ui/doc/hglegal.htm
+++ b/bundles/org.eclipse.team.ui/doc/hglegal.htm
@@ -1,14 +1,14 @@
-
-
-
-
-
- Legal Notices
-
-
-
-
-Notices
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-
-
+
+
+
+
+
+ Legal Notices
+
+
+
+
+Notices
+(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
+
+
diff --git a/bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui.html b/bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui.html
index 18113134f..21fdecd7d 100644
--- a/bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui.html
+++ b/bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui.html
@@ -1,30 +1,30 @@
-
-
-
-
- Team Core Extension Points
-
-
-
-
-
Team UI Plug-in
-This document lists all of the extension points that the Team UI plug-in makes available to provider developers.
-
-
-
-General Extension Points
-The following extension point can be used to register a configuration mechanism for associating a project
-with a team provider:
-
Description: This extension point is used to register
-a method for configuration of a project. Configuration involves the association
-of a project with a team provider, including all information necessary to
-initialize that team provider, including such things as username, password, and
-any relevant information necessary to locate the provider.
-
Providers may provide an extension for this extension point, and an
-implementation of org.eclipse.team.ui.IConfigurationWizard which
-gathers the necessary information and configures the project.
-
Configuration Markup:
-
<!ELEMENT wizard EMPTY>
- <!ATTLIST wizard
- name
-CDATA #REQUIRED
- icon
-CDATA #REQUIRED
- class
-CDATA #REQUIRED
- id
-CDATA #REQUIRED
- >
-
-
-
name - the name of the configuration type, as it should appear in the configuration wizard. Examples are "CVS", "WebDAV".
-
icon - the icon to present in the configuration wizard next to the name.
-
class - a fully qualified name of the Java class implementing org.eclipse.team.ui.IConfigurationWizard.
-
id - a unique identifier for this extension.
-
-
-Examples:
-
Following is an example of a configuration wizard extension:
-
API Information: The value of the class attribute
-must represent a class that implements org.eclipse.team.ui.IConfigurationWizard.
-This interface supports configuration of a wizard given a workbench and a project.
-
-
Supplied Implementation: The plug-in org.eclipse.team.provider.examples.ui contains
-sample implementations of IConfigurationWizard for the WebDAV and filesystem provider types.
-
-
Description: This extension point is used to register
+a method for configuration of a project. Configuration involves the association
+of a project with a team provider, including all information necessary to
+initialize that team provider, including such things as username, password, and
+any relevant information necessary to locate the provider.
+
Providers may provide an extension for this extension point, and an
+implementation of org.eclipse.team.ui.IConfigurationWizard which
+gathers the necessary information and configures the project.
+
Configuration Markup:
+
<!ELEMENT wizard EMPTY>
+ <!ATTLIST wizard
+ name
+CDATA #REQUIRED
+ icon
+CDATA #REQUIRED
+ class
+CDATA #REQUIRED
+ id
+CDATA #REQUIRED
+ >
+
+
+
name - the name of the configuration type, as it should appear in the configuration wizard. Examples are "CVS", "WebDAV".
+
icon - the icon to present in the configuration wizard next to the name.
+
class - a fully qualified name of the Java class implementing org.eclipse.team.ui.IConfigurationWizard.
+
id - a unique identifier for this extension.
+
+
+Examples:
+
Following is an example of a configuration wizard extension:
+
API Information: The value of the class attribute
+must represent a class that implements org.eclipse.team.ui.IConfigurationWizard.
+This interface supports configuration of a wizard given a workbench and a project.
+
+
Supplied Implementation: The plug-in org.eclipse.team.provider.examples.ui contains
+sample implementations of IConfigurationWizard for the WebDAV and filesystem provider types.
+
+
Description: This extension point is used to register
-object decorator extensions. These decorators may adorn objects with
-labels and icons depending on certain aspects of their team status. For
-example, elements which are locally modified may their label or icon
-modified to indicate this status.
-
Providers may provide an extension for this extension point, and an
-implementation of org.eclipse.team.ui.ITeamDecorator which
-decorates objects in a provider-specific fashion.
-
API Information: The value of the class attribute
-must represent a class that implements org.eclipse.team.ui.ITeamDecorator.
-This decorator may be called upon at any time to provide textual labels and
-icon adornments for a given resource.
-
-
Supplied Implementation: The plug-in org.eclipse.team.provider.examples.ui contains
-sample implementations of ITeamDecorator which decorate for the filesystem provider implementation
-and the WebDAV provider implementation.
-
-
Description: This extension point is used to register
+object decorator extensions. These decorators may adorn objects with
+labels and icons depending on certain aspects of their team status. For
+example, elements which are locally modified may their label or icon
+modified to indicate this status.
+
Providers may provide an extension for this extension point, and an
+implementation of org.eclipse.team.ui.ITeamDecorator which
+decorates objects in a provider-specific fashion.
+
API Information: The value of the class attribute
+must represent a class that implements org.eclipse.team.ui.ITeamDecorator.
+This decorator may be called upon at any time to provide textual labels and
+icon adornments for a given resource.
+
+
Supplied Implementation: The plug-in org.eclipse.team.provider.examples.ui contains
+sample implementations of ITeamDecorator which decorate for the filesystem provider implementation
+and the WebDAV provider implementation.
+
+
+
+
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
index d5c5cc867..4652d9f76 100644
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ b/bundles/org.eclipse.team.ui/plugin.xml
@@ -1,101 +1,101 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardElement.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardElement.java
index bb7c9e813..b40b54eb2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardElement.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardElement.java
@@ -1,137 +1,137 @@
-package org.eclipse.team.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.internal.model.WorkbenchAdapter;
-import org.eclipse.ui.model.IWorkbenchAdapter;
-import org.eclipse.team.ui.*;
-
-/**
- * ConfigurationWizardElement represents an item in the configuration wizard table,
- * declared by an extension to the configurationWizards extension point.
- */
-public class ConfigurationWizardElement extends WorkbenchAdapter implements IAdaptable {
- private String id;
- private String name;
- private ImageDescriptor imageDescriptor;
- private String description;
- private IConfigurationElement configurationElement;
-
- /**
- * Creates a new instance of this class
- *
- * @param name the name of the element
- */
- public ConfigurationWizardElement(String name) {
- this.name = name;
- }
- /**
- * Create an the instance of the object described by the configuration
- * element. That is, create the instance of the class the isv supplied in
- * the extension point.
- *
- * @throws CoreException if an error occurs creating the extension
- */
- public Object createExecutableExtension() throws CoreException {
- return TeamUIPlugin.createExtension(configurationElement, ConfigureProjectWizard.ATT_CLASS);
- }
- /*
- * Method declared on IAdaptable.
- */
- public Object getAdapter(Class adapter) {
- if (adapter == IWorkbenchAdapter.class) {
- return this;
- }
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
- /**
- * Returns the configuration element
- *
- * @return the configuration element
- */
- public IConfigurationElement getConfigurationElement() {
- return configurationElement;
- }
- /**
- * Returns the description parameter of this element
- *
- * @return the description of this elemnet
- */
- public String getDescription() {
- return description;
- }
- /**
- * Returns the image for the given element
- *
- * @param element the element to get the image for
- * @return the image for the given element
- */
- public ImageDescriptor getImageDescriptor(Object element) {
- return imageDescriptor;
- }
- /**
- * Returns the label for the given element
- *
- * @param element the element to get the label for
- * @return the label for the given element
- */
- public String getLabel(Object element) {
- return name;
- }
- /**
- * Returns the id as specified in the extension.
- *
- * @return java.lang.String
- */
- public String getID() {
- return id;
- }
- /**
- * Returns the image for this element.
- *
- * @return the image for this element
- */
- public ImageDescriptor getImageDescriptor() {
- return imageDescriptor;
- }
- /**
- * Set the configuration element
- *
- * @param newConfigurationElement the new configuration element
- */
- public void setConfigurationElement(IConfigurationElement newConfigurationElement) {
- configurationElement = newConfigurationElement;
- }
- /**
- * Set the description parameter of this element
- *
- * @param value the new desrciption
- */
- public void setDescription(String value) {
- description = value;
- }
- /**
- * Sets the id parameter of this element
- *
- * @param value the new ID
- */
- public void setID(String value) {
- id = value;
- }
- /**
- * Sets the image for this element.
- *
- * @param value the new image
- */
- public void setImageDescriptor(ImageDescriptor value) {
- imageDescriptor = value;
- }
-}
+package org.eclipse.team.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.internal.model.WorkbenchAdapter;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+import org.eclipse.team.ui.*;
+
+/**
+ * ConfigurationWizardElement represents an item in the configuration wizard table,
+ * declared by an extension to the configurationWizards extension point.
+ */
+public class ConfigurationWizardElement extends WorkbenchAdapter implements IAdaptable {
+ private String id;
+ private String name;
+ private ImageDescriptor imageDescriptor;
+ private String description;
+ private IConfigurationElement configurationElement;
+
+ /**
+ * Creates a new instance of this class
+ *
+ * @param name the name of the element
+ */
+ public ConfigurationWizardElement(String name) {
+ this.name = name;
+ }
+ /**
+ * Create an the instance of the object described by the configuration
+ * element. That is, create the instance of the class the isv supplied in
+ * the extension point.
+ *
+ * @throws CoreException if an error occurs creating the extension
+ */
+ public Object createExecutableExtension() throws CoreException {
+ return TeamUIPlugin.createExtension(configurationElement, ConfigureProjectWizard.ATT_CLASS);
+ }
+ /*
+ * Method declared on IAdaptable.
+ */
+ public Object getAdapter(Class adapter) {
+ if (adapter == IWorkbenchAdapter.class) {
+ return this;
+ }
+ return Platform.getAdapterManager().getAdapter(this, adapter);
+ }
+ /**
+ * Returns the configuration element
+ *
+ * @return the configuration element
+ */
+ public IConfigurationElement getConfigurationElement() {
+ return configurationElement;
+ }
+ /**
+ * Returns the description parameter of this element
+ *
+ * @return the description of this elemnet
+ */
+ public String getDescription() {
+ return description;
+ }
+ /**
+ * Returns the image for the given element
+ *
+ * @param element the element to get the image for
+ * @return the image for the given element
+ */
+ public ImageDescriptor getImageDescriptor(Object element) {
+ return imageDescriptor;
+ }
+ /**
+ * Returns the label for the given element
+ *
+ * @param element the element to get the label for
+ * @return the label for the given element
+ */
+ public String getLabel(Object element) {
+ return name;
+ }
+ /**
+ * Returns the id as specified in the extension.
+ *
+ * @return java.lang.String
+ */
+ public String getID() {
+ return id;
+ }
+ /**
+ * Returns the image for this element.
+ *
+ * @return the image for this element
+ */
+ public ImageDescriptor getImageDescriptor() {
+ return imageDescriptor;
+ }
+ /**
+ * Set the configuration element
+ *
+ * @param newConfigurationElement the new configuration element
+ */
+ public void setConfigurationElement(IConfigurationElement newConfigurationElement) {
+ configurationElement = newConfigurationElement;
+ }
+ /**
+ * Set the description parameter of this element
+ *
+ * @param value the new desrciption
+ */
+ public void setDescription(String value) {
+ description = value;
+ }
+ /**
+ * Sets the id parameter of this element
+ *
+ * @param value the new ID
+ */
+ public void setID(String value) {
+ id = value;
+ }
+ /**
+ * Sets the image for this element.
+ *
+ * @param value the new image
+ */
+ public void setImageDescriptor(ImageDescriptor value) {
+ imageDescriptor = value;
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardNode.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardNode.java
index 1079aa80c..f7f59d8c3 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardNode.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardNode.java
@@ -1,65 +1,65 @@
-package org.eclipse.team.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardNode;
-import org.eclipse.swt.graphics.Point;
-
-/**
- * ConfigurationWizardNode represents the objects in the
- * table in the Configuration wizard.
- */
-public class ConfigurationWizardNode implements IWizardNode {
- // The element this node represents
- ConfigurationWizardElement element;
- // The wizard this node is in
- IWizard wizard;
-
- /**
- * Create a new ConfigurationWizardNode
- *
- * @param element the configuration wizard element for this node
- */
- public ConfigurationWizardNode(ConfigurationWizardElement element) {
- this.element = element;
- }
- /*
- * Method declared on IWizardNode.
- */
- public void dispose() {
- if (wizard != null) {
- wizard.dispose();
- wizard = null;
- }
- }
- /*
- * Method declared on IWizardNode.
- */
- public Point getExtent() {
- return new Point(-1, -1);
- }
- /*
- * Method declared on IWizardNode.
- */
- public IWizard getWizard() {
- if (wizard == null) {
- try {
- wizard = (IWizard)element.createExecutableExtension();
- } catch (CoreException e) {
- System.out.println(Policy.bind("exceptionCreatingWizard"));
- }
- }
- return wizard;
- }
- /*
- * Method declared on IWizardNode.
- */
- public boolean isContentCreated() {
- return wizard != null;
- }
-}
+package org.eclipse.team.internal.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardNode;
+import org.eclipse.swt.graphics.Point;
+
+/**
+ * ConfigurationWizardNode represents the objects in the
+ * table in the Configuration wizard.
+ */
+public class ConfigurationWizardNode implements IWizardNode {
+ // The element this node represents
+ ConfigurationWizardElement element;
+ // The wizard this node is in
+ IWizard wizard;
+
+ /**
+ * Create a new ConfigurationWizardNode
+ *
+ * @param element the configuration wizard element for this node
+ */
+ public ConfigurationWizardNode(ConfigurationWizardElement element) {
+ this.element = element;
+ }
+ /*
+ * Method declared on IWizardNode.
+ */
+ public void dispose() {
+ if (wizard != null) {
+ wizard.dispose();
+ wizard = null;
+ }
+ }
+ /*
+ * Method declared on IWizardNode.
+ */
+ public Point getExtent() {
+ return new Point(-1, -1);
+ }
+ /*
+ * Method declared on IWizardNode.
+ */
+ public IWizard getWizard() {
+ if (wizard == null) {
+ try {
+ wizard = (IWizard)element.createExecutableExtension();
+ } catch (CoreException e) {
+ System.out.println(Policy.bind("exceptionCreatingWizard"));
+ }
+ }
+ return wizard;
+ }
+ /*
+ * Method declared on IWizardNode.
+ */
+ public boolean isContentCreated() {
+ return wizard != null;
+ }
+}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TextPreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TextPreferencePage.java
index bd7349b19..2d885d328 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TextPreferencePage.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TextPreferencePage.java
@@ -1 +1 @@
-package org.eclipse.team.internal.ui;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ComboBoxCellEditor;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
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.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.team.core.IFileTypeRegistry;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
/**
* This preference page displays all patterns which determine whether a resource
* 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");
private static final String BINARY = Policy.bind("TextPreferencePage.binary");
private static final String TRUE = "true";
private static final String FALSE = "false";
// The name of the parameter in the file registry
private static final String IS_TEXT = "isText";
// The input for the table viewer
private List input;
// Widgets
private TableViewer viewer;
private Button removeButton;
private Button changeButton;
// File type registry
private IFileTypeRegistry registry;
/**
* 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
*/
public void init(IWorkbench workbench) {
}
/*
* @see PreferencePage#createControl
*/
protected Control createContents(Composite ancestor) {
noDefaultAndApplyButton();
Composite parent = new Composite(ancestor, SWT.NULL);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
parent.setLayout(layout);
// set F1 help
//WorkbenchHelp.setHelp(parent, new DialogPageContextComputer (this, ITeamHelpContextIds.TEXT_PREFERENCE_PAGE));
Label l1 = new Label(parent, SWT.NULL);
l1.setText(Policy.bind("TextPreferencePage.description"));
GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
data.horizontalSpan = 2;
l1.setLayoutData(data);
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);
table.setLayoutData(gd);
table.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"));
columns[1].setText(Policy.bind("TextPreferencePage.contents"));
CellEditor editor = new ComboBoxCellEditor(table, new String[] {TEXT, BINARY});
viewer.setCellEditors(new CellEditor[] {null, editor});
viewer.setColumnProperties(new String[] {"extension", "contents"});
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() {
public void doubleClick(DoubleClickEvent event) {
ISelection selection = event.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
return;
}
viewer.editElement(((IStructuredSelection)selection).getFirstElement(), 1);
}
});
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));
buttons.setLayout(new GridLayout());
Button addButton = new Button(buttons, SWT.PUSH);
addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
addButton.setText(Policy.bind("TextPreferencePage.add"));
addButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
addPattern();
}
});
removeButton= new Button(buttons, SWT.PUSH);
removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
removeButton.setText(Policy.bind("TextPreferencePage.remove"));
removeButton.setEnabled(false);
removeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
removePattern();
}
});
changeButton = new Button(buttons, SWT.PUSH);
changeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
changeButton.setText(Policy.bind("TextPreferencePage.change"));
changeButton.setEnabled(false);
changeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
changePattern();
}
});
fillTable();
return parent;
}
/**
* Do anything necessary because the OK button has been pressed.
*
* @return whether it is okay to close the preference page
*/
public boolean performOk() {
Iterator it = input.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
String value = entry.getValue();
if (value.equals(TEXT)) {
value = TRUE;
} else {
value = FALSE;
}
registry.setValue(entry.getExtension(), IS_TEXT, value);
}
return true;
}
/**
* Fill the table with the values from the file type registry
*/
private void fillTable() {
this.input = new ArrayList();
this.registry = TeamPlugin.getFileTypeRegistry();
String[] extensions = registry.getExtensions(IS_TEXT);
for (int i = 0; i < extensions.length; i++) {
String value = registry.getValue(extensions[i], IS_TEXT);
if (value.equals(TRUE)) {
value = TEXT;
} else {
value = BINARY;
}
input.add(new TableEntry(extensions[i], value));
}
viewer.setInput(input);
}
/**
* 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);
dialog.open();
if (dialog.getReturnCode() != InputDialog.OK) return;
String pattern = dialog.getValue();
if (pattern.equals("")) return;
// Check if the item already exists
Iterator it = input.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
if (entry.getExtension().equals(pattern)) {
MessageDialog.openWarning(getShell(), Policy.bind("TextPreferencePage.extensionExistsShort"), Policy.bind("TextPreferencePage.extensionExistsLong"));
return;
}
}
input.add(new TableEntry(pattern, TEXT));
viewer.refresh();
}
/**
* Remove the selected items from the table
*/
private void removePattern() {
ISelection selection = viewer.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
return;
}
IStructuredSelection ss = (IStructuredSelection)selection;
Iterator it = ss.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
input.remove(entry);
}
viewer.refresh();
}
/**
* Toggle the selected items' content types
*/
private void changePattern() {
ISelection selection = viewer.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
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);
}
}
/**
* 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);
}
}
\ No newline at end of file
+package org.eclipse.team.internal.ui;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ComboBoxCellEditor;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
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.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.team.core.IFileTypeRegistry;
import org.eclipse.team.core.TeamPlugin;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
/**
* This preference page displays all patterns which determine whether a resource
* 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");
private static final String BINARY = Policy.bind("TextPreferencePage.binary");
private static final String TRUE = "true";
private static final String FALSE = "false";
// The name of the parameter in the file registry
private static final String IS_TEXT = "isText";
// The input for the table viewer
private List input;
// Widgets
private TableViewer viewer;
private Button removeButton;
private Button changeButton;
// File type registry
private IFileTypeRegistry registry;
/**
* 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
*/
public void init(IWorkbench workbench) {
}
/*
* @see PreferencePage#createControl
*/
protected Control createContents(Composite ancestor) {
noDefaultAndApplyButton();
Composite parent = new Composite(ancestor, SWT.NULL);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
parent.setLayout(layout);
// set F1 help
//WorkbenchHelp.setHelp(parent, new DialogPageContextComputer (this, ITeamHelpContextIds.TEXT_PREFERENCE_PAGE));
Label l1 = new Label(parent, SWT.NULL);
l1.setText(Policy.bind("TextPreferencePage.description"));
GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
data.horizontalSpan = 2;
l1.setLayoutData(data);
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);
table.setLayoutData(gd);
table.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"));
columns[1].setText(Policy.bind("TextPreferencePage.contents"));
CellEditor editor = new ComboBoxCellEditor(table, new String[] {TEXT, BINARY});
viewer.setCellEditors(new CellEditor[] {null, editor});
viewer.setColumnProperties(new String[] {"extension", "contents"});
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() {
public void doubleClick(DoubleClickEvent event) {
ISelection selection = event.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
return;
}
viewer.editElement(((IStructuredSelection)selection).getFirstElement(), 1);
}
});
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));
buttons.setLayout(new GridLayout());
Button addButton = new Button(buttons, SWT.PUSH);
addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
addButton.setText(Policy.bind("TextPreferencePage.add"));
addButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
addPattern();
}
});
removeButton= new Button(buttons, SWT.PUSH);
removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
removeButton.setText(Policy.bind("TextPreferencePage.remove"));
removeButton.setEnabled(false);
removeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
removePattern();
}
});
changeButton = new Button(buttons, SWT.PUSH);
changeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
changeButton.setText(Policy.bind("TextPreferencePage.change"));
changeButton.setEnabled(false);
changeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
changePattern();
}
});
fillTable();
return parent;
}
/**
* Do anything necessary because the OK button has been pressed.
*
* @return whether it is okay to close the preference page
*/
public boolean performOk() {
Iterator it = input.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
String value = entry.getValue();
if (value.equals(TEXT)) {
value = TRUE;
} else {
value = FALSE;
}
registry.setValue(entry.getExtension(), IS_TEXT, value);
}
return true;
}
/**
* Fill the table with the values from the file type registry
*/
private void fillTable() {
this.input = new ArrayList();
this.registry = TeamPlugin.getFileTypeRegistry();
String[] extensions = registry.getExtensions(IS_TEXT);
for (int i = 0; i < extensions.length; i++) {
String value = registry.getValue(extensions[i], IS_TEXT);
if (value.equals(TRUE)) {
value = TEXT;
} else {
value = BINARY;
}
input.add(new TableEntry(extensions[i], value));
}
viewer.setInput(input);
}
/**
* 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);
dialog.open();
if (dialog.getReturnCode() != InputDialog.OK) return;
String pattern = dialog.getValue();
if (pattern.equals("")) return;
// Check if the item already exists
Iterator it = input.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
if (entry.getExtension().equals(pattern)) {
MessageDialog.openWarning(getShell(), Policy.bind("TextPreferencePage.extensionExistsShort"), Policy.bind("TextPreferencePage.extensionExistsLong"));
return;
}
}
input.add(new TableEntry(pattern, TEXT));
viewer.refresh();
}
/**
* Remove the selected items from the table
*/
private void removePattern() {
ISelection selection = viewer.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
return;
}
IStructuredSelection ss = (IStructuredSelection)selection;
Iterator it = ss.iterator();
while (it.hasNext()) {
TableEntry entry = (TableEntry)it.next();
input.remove(entry);
}
viewer.refresh();
}
/**
* Toggle the selected items' content types
*/
private void changePattern() {
ISelection selection = viewer.getSelection();
if (selection == null || !(selection instanceof IStructuredSelection)) {
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);
}
}
/**
* 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);
}
}
\ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizard.java
index 168015f72..fcd51bfbc 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizard.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizard.java
@@ -1,30 +1,30 @@
-package org.eclipse.team.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * IConfigurationWizard defines the interface that users of the extension
- * point org.eclipse.team.ui.configurationWizards must implement.
- */
-public interface IConfigurationWizard extends IWizard {
- /**
- * Initializes this creation wizard using the passed workbench and
- * object selection.
- *
- * This method is called after the no argument constructor and
- * before other methods are called.
- *
- *
- * @param workbench the current workbench
- * @param project the selected project
- */
- void init(IWorkbench workbench, IProject project);
-}
-
+package org.eclipse.team.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * IConfigurationWizard defines the interface that users of the extension
+ * point org.eclipse.team.ui.configurationWizards must implement.
+ */
+public interface IConfigurationWizard extends IWizard {
+ /**
+ * Initializes this creation wizard using the passed workbench and
+ * object selection.
+ *
+ * This method is called after the no argument constructor and
+ * before other methods are called.
+ *
+ *
+ * @param workbench the current workbench
+ * @param project the selected project
+ */
+ void init(IWorkbench workbench, IProject project);
+}
+
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ISharedImages.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ISharedImages.java
index 1b324faa4..5ea2a4bf1 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ISharedImages.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ISharedImages.java
@@ -1,21 +1,21 @@
-package org.eclipse.team.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * Images that are available for providers to re-use. They include
- * common overlays and wizard images. A provider can use their own
- * custom images, these shared images are only available for
- * convenience.
- */
-public interface ISharedImages {
- public final String IMG_DIRTY_OVR = "ovr/dirty_ov.gif";
- public final String IMG_CHECKEDIN_OVR = "ovr/checkedin_ov.gif";
- public final String IMG_CHECKEDOUT_OVR = "ovr/checkedout_ov.gif";
-}
-
+package org.eclipse.team.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.jface.resource.ImageDescriptor;
+
+/**
+ * Images that are available for providers to re-use. They include
+ * common overlays and wizard images. A provider can use their own
+ * custom images, these shared images are only available for
+ * convenience.
+ */
+public interface ISharedImages {
+ public final String IMG_DIRTY_OVR = "ovr/dirty_ov.gif";
+ public final String IMG_CHECKEDIN_OVR = "ovr/checkedin_ov.gif";
+ public final String IMG_CHECKEDOUT_OVR = "ovr/checkedout_ov.gif";
+}
+
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncView.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncView.java
index 4f2585811..1ea10c5ed 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncView.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncView.java
@@ -156,8 +156,8 @@ public class SyncView extends ViewPart {
private boolean isEmpty(DiffNode node) {
if (node.getKind() != 0) return false;
IDiffElement[] children = node.getChildren();
- for (int i = 0; i < children.length; i++) {
- if (!isEmpty(children[i])) return false;
+ for (int i = 0; i < children.length; i++) {
+ if (!isEmpty(children[i])) return false;
}
return true;
}
diff --git a/tests/org.eclipse.team.tests.cvs.core/.vcm_meta b/tests/org.eclipse.team.tests.cvs.core/.vcm_meta
index 691cc5016..2bfe4af84 100644
--- a/tests/org.eclipse.team.tests.cvs.core/.vcm_meta
+++ b/tests/org.eclipse.team.tests.cvs.core/.vcm_meta
@@ -1,19 +1,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/org.eclipse.team.tests.cvs.core/resources/BenchmarkTest/benchmarkBig.zip b/tests/org.eclipse.team.tests.cvs.core/resources/BenchmarkTest/benchmarkBig.zip
index ec9b17bdd..21415fd0c 100644
Binary files a/tests/org.eclipse.team.tests.cvs.core/resources/BenchmarkTest/benchmarkBig.zip and b/tests/org.eclipse.team.tests.cvs.core/resources/BenchmarkTest/benchmarkBig.zip differ
diff --git a/tests/org.eclipse.team.tests.cvs.core/resources/BenchmarkTest/benchmarkSmall.zip b/tests/org.eclipse.team.tests.cvs.core/resources/BenchmarkTest/benchmarkSmall.zip
index c56846755..2777111ce 100644
Binary files a/tests/org.eclipse.team.tests.cvs.core/resources/BenchmarkTest/benchmarkSmall.zip and b/tests/org.eclipse.team.tests.cvs.core/resources/BenchmarkTest/benchmarkSmall.zip differ
diff --git a/tests/org.eclipse.team.tests.cvs.core/resources/CommandTest/CVSROOT/modules b/tests/org.eclipse.team.tests.cvs.core/resources/CommandTest/CVSROOT/modules
index 1daac9387..3ab59a67f 100644
--- a/tests/org.eclipse.team.tests.cvs.core/resources/CommandTest/CVSROOT/modules
+++ b/tests/org.eclipse.team.tests.cvs.core/resources/CommandTest/CVSROOT/modules
@@ -1,65 +1,65 @@
-# Three different line formats are valid:
-# key -a aliases...
-# key [options] directory
-# key [options] directory files...
-#
-# Where "options" are composed of:
-# -i prog Run "prog" on "cvs commit" from top-level of module.
-# -o prog Run "prog" on "cvs checkout" of module.
-# -e prog Run "prog" on "cvs export" of module.
-# -t prog Run "prog" on "cvs rtag" of module.
-# -u prog Run "prog" on "cvs update" of module.
-# -d dir Place module in directory "dir" instead of module name.
-# -l Top-level directory only -- do not recurse.
-#
-# NOTE: If you change any of the "Run" options above, you'll have to
-# release and re-checkout any working directories of these modules.
-#
-# And "directory" is a path to a directory relative to $CVSROOT.
-#
-# The "-a" option specifies an alias. An alias is interpreted as if
-# everything on the right of the "-a" had been typed on the command line.
-#
-# You can encode a module within a module by using the special '&'
-# character to interpose another module into the current module. This
-# can be useful for creating a module that consists of many directories
-# spread out over the entire source repository.
-
-# Block access to CVS hogs
-#world -a denied___checkout_of_world_takes_too_long
-#. -a denied___checkout_of_world_takes_too_long
-
-# self referencing modules
-project1 project1
-
-# checkout docs in flattened structure
-docs -d docs common/docs
-macros common/macros
-
-# include docs with project
-project2 project2 &docs
-# only project2
-project2-only project2
-
-# a use of alias
-project3-src project3/src
-project3-src_file -a project3-src/file.c project3-src/file.h
-project3-sub project3/sub &project3-src_file
-
-# embeddings
-project4 project4 ¯os
-project5-project4 -d extensions/project4 project4
-project5 project5 &project5-project4 ¯os
-
-# using -d to build a project from other projects
-project6-dirA -d dirA project6/A
-project6-dirB -d dirB project6/B
-project6 &project6-dirA &project6-dirB
-
-# using aliases to provide packaging
-project7-common -a project7/common
-project7-pc -a project7-common project7/pc
-project7-linux -a project7-common project7/linux
-
-# simple use of module alias
+# Three different line formats are valid:
+# key -a aliases...
+# key [options] directory
+# key [options] directory files...
+#
+# Where "options" are composed of:
+# -i prog Run "prog" on "cvs commit" from top-level of module.
+# -o prog Run "prog" on "cvs checkout" of module.
+# -e prog Run "prog" on "cvs export" of module.
+# -t prog Run "prog" on "cvs rtag" of module.
+# -u prog Run "prog" on "cvs update" of module.
+# -d dir Place module in directory "dir" instead of module name.
+# -l Top-level directory only -- do not recurse.
+#
+# NOTE: If you change any of the "Run" options above, you'll have to
+# release and re-checkout any working directories of these modules.
+#
+# And "directory" is a path to a directory relative to $CVSROOT.
+#
+# The "-a" option specifies an alias. An alias is interpreted as if
+# everything on the right of the "-a" had been typed on the command line.
+#
+# You can encode a module within a module by using the special '&'
+# character to interpose another module into the current module. This
+# can be useful for creating a module that consists of many directories
+# spread out over the entire source repository.
+
+# Block access to CVS hogs
+#world -a denied___checkout_of_world_takes_too_long
+#. -a denied___checkout_of_world_takes_too_long
+
+# self referencing modules
+project1 project1
+
+# checkout docs in flattened structure
+docs -d docs common/docs
+macros common/macros
+
+# include docs with project
+project2 project2 &docs
+# only project2
+project2-only project2
+
+# a use of alias
+project3-src project3/src
+project3-src_file -a project3-src/file.c project3-src/file.h
+project3-sub project3/sub &project3-src_file
+
+# embeddings
+project4 project4 ¯os
+project5-project4 -d extensions/project4 project4
+project5 project5 &project5-project4 ¯os
+
+# using -d to build a project from other projects
+project6-dirA -d dirA project6/A
+project6-dirB -d dirB project6/B
+project6 &project6-dirA &project6-dirB
+
+# using aliases to provide packaging
+project7-common -a project7/common
+project7-pc -a project7-common project7/pc
+project7-linux -a project7-common project7/linux
+
+# simple use of module alias
project8-alias -a project8 common
\ No newline at end of file
diff --git a/tests/org.eclipse.team.tests.cvs.core/resources/CommandTest/common/docs/readme.html b/tests/org.eclipse.team.tests.cvs.core/resources/CommandTest/common/docs/readme.html
index 5b1b16d1f..8c7fe2111 100644
--- a/tests/org.eclipse.team.tests.cvs.core/resources/CommandTest/common/docs/readme.html
+++ b/tests/org.eclipse.team.tests.cvs.core/resources/CommandTest/common/docs/readme.html
@@ -1,2 +1,2 @@
-
+
\ No newline at end of file
--
cgit v1.2.3