Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.team.ui')
-rw-r--r--bundles/org.eclipse.team.ui/.classpath12
-rw-r--r--bundles/org.eclipse.team.ui/.cvsignore1
-rw-r--r--bundles/org.eclipse.team.ui/.project24
-rw-r--r--bundles/org.eclipse.team.ui/README13
-rw-r--r--bundles/org.eclipse.team.ui/about.html42
-rw-r--r--bundles/org.eclipse.team.ui/build.properties3
-rw-r--r--bundles/org.eclipse.team.ui/doc/hglegal.htm14
-rw-r--r--bundles/org.eclipse.team.ui/doc/ngibmcpy.gifbin814 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui.html30
-rw-r--r--bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui_configurationWizards.html61
-rw-r--r--bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui_decorators.html55
-rw-r--r--bundles/org.eclipse.team.ui/icons/basic/clcl16/catchup_rls.gifbin137 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/basic/clcl16/catchuprelease_rls.gifbin169 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/basic/clcl16/conflict_synch.gifbin90 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/basic/clcl16/ignorews_edit.gifbin119 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/basic/clcl16/incom_synch.gifbin96 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/basic/clcl16/outgo_synch.gifbin119 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/basic/clcl16/refresh.gifbin182 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/basic/clcl16/release_rls.gifbin146 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/basic/cview16/synch_synch.gifbin133 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/basic/wizban/newconnect_wizban.gifbin603 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/clcl16/catchup_rls.gifbin145 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/clcl16/catchuprelease_rls.gifbin184 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/clcl16/conflict_synch.gifbin117 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/clcl16/ignorews_edit.gifbin119 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/clcl16/incom_synch.gifbin117 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/clcl16/outgo_synch.gifbin120 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/clcl16/refresh.gifbin182 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/clcl16/release_rls.gifbin145 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/cview16/synch_synch.gifbin163 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/ovr/checkedin_ov.gifbin876 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/ovr/checkedout_ov.gifbin106 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/ovr/dirty_ov.gifbin124 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/icons/full/wizban/newconnect_wizban.gifbin2615 -> 0 bytes
-rw-r--r--bundles/org.eclipse.team.ui/plugin.properties11
-rw-r--r--bundles/org.eclipse.team.ui/plugin.xml90
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardElement.java137
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardNode.java65
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizard.java198
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizardMainPage.java154
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IgnorePreferencePage.java4
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java125
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TextPreferencePage.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/UIConstants.java38
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties119
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizard.java30
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ISharedImages.java21
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUIPlugin.java225
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckInAction.java70
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckOutAction.java70
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/ConfigureProjectAction.java53
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeconfigureProjectAction.java46
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeleteAction.java86
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/GetAction.java70
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/TeamAction.java292
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/UndoCheckOutAction.java71
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/CatchupReleaseViewer.java444
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ChangedTeamContainer.java59
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ITeamNode.java38
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/MergeResource.java162
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncCompareInput.java383
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncSet.java270
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncView.java354
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamFile.java254
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TypedBufferedContent.java65
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/UnchangedTeamContainer.java67
66 files changed, 0 insertions, 4327 deletions
diff --git a/bundles/org.eclipse.team.ui/.classpath b/bundles/org.eclipse.team.ui/.classpath
deleted file mode 100644
index eec652d16..000000000
--- a/bundles/org.eclipse.team.ui/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="var" path="JRE_LIB" rootpath="JRE_SRCROOT" sourcepath="JRE_SRC"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="/org.eclipse.team.core"/>
- <classpathentry kind="src" path="/org.eclipse.core.resources"/>
- <classpathentry kind="src" path="/org.eclipse.ui"/>
- <classpathentry kind="src" path="/org.eclipse.core.runtime"/>
- <classpathentry kind="src" path="/org.eclipse.swt"/>
- <classpathentry kind="src" path="/org.eclipse.compare"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/bundles/org.eclipse.team.ui/.cvsignore b/bundles/org.eclipse.team.ui/.cvsignore
deleted file mode 100644
index ba077a403..000000000
--- a/bundles/org.eclipse.team.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/bundles/org.eclipse.team.ui/.project b/bundles/org.eclipse.team.ui/.project
deleted file mode 100644
index 2388e90e6..000000000
--- a/bundles/org.eclipse.team.ui/.project
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.team.ui</name>
- <comment></comment>
- <projects>
- <project>org.eclipse.compare</project>
- <project>org.eclipse.ui</project>
- <project>org.eclipse.core.runtime</project>
- <project>org.eclipse.core.resources</project>
- <project>org.eclipse.swt</project>
- <project>org.eclipse.team.core</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.team.cvs.core.cvsnature</nature>
- </natures>
-</projectDescription>
diff --git a/bundles/org.eclipse.team.ui/README b/bundles/org.eclipse.team.ui/README
deleted file mode 100644
index 6a358f07a..000000000
--- a/bundles/org.eclipse.team.ui/README
+++ /dev/null
@@ -1,13 +0,0 @@
-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
deleted file mode 100644
index 441774f92..000000000
--- a/bundles/org.eclipse.team.ui/about.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<html>
-<head>
-<title>About</title>
-<style type="text/css">
-p, table, td, th { font-family: arial, helvetica, geneva; font-size: 10pt}
-pre { font-family: "Courier New", Courier, mono; font-size: 10pt}
-h2 { font-family: arial, helvetica, geneva; font-size: 18pt; font-weight: bold ; line-height: 14px}
-code { font-family: "Courier New", Courier, mono; font-size: 10pt}
-sup { font-family: arial,helvetica,geneva; font-size: 10px}
-h3 { font-family: arial, helvetica, geneva; font-size: 14pt; font-weight: bold}
-li { font-family: arial, helvetica, geneva; font-size: 10pt}
-h1 { font-family: arial, helvetica, geneva; font-size: 28px; font-weight: bold}
-body { font-family: arial, helvetica, geneva; font-size: 10pt; clip: rect( ); margin-top: 5mm; margin-left: 3mm}
-</style>
-</head>
-<body lang="EN-US" link="blue" vlink="purple">
-<table border="0" cellspacing="5" cellpadding="2" width="100%" >
- <tr>
- <td align="LEFT" valign="TOP" colspan="2" bgcolor="#0080C0"><b><font color="#FFFFFF">About This Content</font></b></td>
- </tr>
- <tr>
- <td>
-<p>11th December, 2001</p>
-<h3>License</h3>
-<p>Eclipse.org makes available all content in this plug-in &quot;Content&quot;. Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-<a href="http://www.eclipse.org/legal/cpl-v05.html">Common Public License Version 0.5</a> &quot;CPL&quot;. For purposes of the CPL, &quot;Program&quot; will mean the Content.</p>
-
-<h3>Contributions</h3>
-
-<p>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.</p>
-
-<p>If this Content is licensed to you under license terms and conditions other than the CPL &quot;Other License&quot;, any modifications, enhancements and/or
-other code and/or documentation &quot;Modifications&quot; 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.</p>
-</td></tr></table>
-</body>
-</html> \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/build.properties b/bundles/org.eclipse.team.ui/build.properties
deleted file mode 100644
index 2dc225a6f..000000000
--- a/bundles/org.eclipse.team.ui/build.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-# Eclipse build contribution
-bin.includes=about.html,icons/,plugin.xml,plugin.properties,*.jar
-source.teamui.jar=src/
diff --git a/bundles/org.eclipse.team.ui/doc/hglegal.htm b/bundles/org.eclipse.team.ui/doc/hglegal.htm
deleted file mode 100644
index c59811321..000000000
--- a/bundles/org.eclipse.team.ui/doc/hglegal.htm
+++ /dev/null
@@ -1,14 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Win98; U) [Netscape]">
- <title>Legal Notices</title>
-</head>
-<body>
-
-<h3>
-<a NAME="Notices"></a>Notices</h3>
-(c) Copyright IBM Corp. 2000, 2001. All Rights Reserved.
-</body>
-</html>
diff --git a/bundles/org.eclipse.team.ui/doc/ngibmcpy.gif b/bundles/org.eclipse.team.ui/doc/ngibmcpy.gif
deleted file mode 100644
index 360f8e998..000000000
--- a/bundles/org.eclipse.team.ui/doc/ngibmcpy.gif
+++ /dev/null
Binary files differ
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
deleted file mode 100644
index 21fdecd7d..000000000
--- a/bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <title>Team Core Extension Points</title>
-</head>
-<body link="#0000FF" vlink="#800080">
-
-<center>
-<h1>Team UI Plug-in</h1></center>
-This document lists all of the extension points that the Team UI plug-in makes available to provider developers.
-<p>
-<hr WIDTH="100%">
-<h1>
-General Extension Points</h1>
-The following extension point can be used to register a configuration mechanism for associating a project
-with a team provider:
-<ul>
-<li>
-<a href="org_eclipse_team_ui_configurationWizards.html">org.eclipse.team.ui.configurationWizards</a></li>
-</ul>
-The following extension point can be used to register a decorator to add team-related adornments to elements
-in the UI:
-<ul>
-<li>
-<a href="org_eclipse_team_ui_decorators.html">org.eclipse.team.ui.decorators</a></li>
-</ul>
-<a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
-</body>
-</html>
diff --git a/bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui_configurationWizards.html b/bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui_configurationWizards.html
deleted file mode 100644
index 69eed425a..000000000
--- a/bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui_configurationWizards.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Eclipse Team UI Extension Point: Configuration Wizards</title>
-</head>
-<body link="#0000FF" vlink="#800080">
-
-<center>
-<h1>
-Configuration Wizards</h1></center>
-<b><i>Identifier: </i></b>org.eclipse.team.ui.configurationWizards
-<p><b><i>Description: </i></b>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.
-<p>Providers may provide an extension for this extension point, and an
-implementation of <code>org.eclipse.team.ui.IConfigurationWizard</code> which
-gathers the necessary information and configures the project.
-<p><b><i>Configuration Markup:</i></b>
-<p><tt>&nbsp;&nbsp; &lt;!ELEMENT wizard EMPTY></tt>
-<br><tt>&nbsp;&nbsp; &lt;!ATTLIST wizard</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp; ></tt>
-
-<ul>
-<li><b>name -</b> the name of the configuration type, as it should appear in the configuration wizard. Examples are "CVS", "WebDAV".</li>
-<li><b>icon -</b> the icon to present in the configuration wizard next to the name.</li>
-<li><b>class -</b> a fully qualified name of the Java class implementing <tt>org.eclipse.team.ui.IConfigurationWizard</tt>.</li>
-<li><b>id - </b> a unique identifier for this extension.</li>
-</ul>
-
-<b><i>Examples:</i></b>
-<p>Following is an example of a configuration wizard extension:
-<p><tt>&nbsp;&nbsp; &lt;extension point="org.eclipse.team.ui.configurationWizard"></tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;wizard</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name="WebDAV"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon="webdav.gif"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class="com.xyz.DAVDecorator"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id="com.xyz.dav"></tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/wizard></tt>
-<br><tt>&nbsp;&nbsp; &lt;/extension></tt>
-
-<p><b><i>API Information</i>: </b>The value of the <tt>class</tt> attribute
-must represent a class that implements <tt>org.eclipse.team.ui.IConfigurationWizard</tt>.
-This interface supports configuration of a wizard given a workbench and a project.
-
-<p><b><i>Supplied Implementation: </i></b>The plug-in org.eclipse.team.provider.examples.ui contains
-sample implementations of IConfigurationWizard for the WebDAV and filesystem provider types.
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
-</body>
-</html>
diff --git a/bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui_decorators.html b/bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui_decorators.html
deleted file mode 100644
index ee5e9f5a9..000000000
--- a/bundles/org.eclipse.team.ui/doc/org_eclipse_team_ui_decorators.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0//en">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <title>Eclipse Team UI Extension Point: Decorators</title>
-</head>
-<body link="#0000FF" vlink="#800080">
-
-<center>
-<h1>
-Decorators</h1></center>
-<b><i>Identifier: </i></b>org.eclipse.team.ui.decorators
-<p><b><i>Description: </i></b>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.
-<p>Providers may provide an extension for this extension point, and an
-implementation of <code>org.eclipse.team.ui.ITeamDecorator</code> which
-decorates objects in a provider-specific fashion.
-<p><b><i>Configuration Markup:</i></b>
-<p><tt>&nbsp;&nbsp; &lt;!ELEMENT decorator EMPTY></tt>
-<br><tt>&nbsp;&nbsp; &lt;!ATTLIST decorator</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; natureId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-CDATA #REQUIRED</tt>
-<br><tt>&nbsp;&nbsp; ></tt>
-
-<ul>
-<li><b>class -</b> a fully qualified name of the Java class implementing <tt>org.eclipse.team.ui.ITeamDecorator>.</li>
-<li><b>natureId</b> - a name of the nature, projects having which will be decorated by this decorator.</li>
-</ul>
-
-<b><i>Examples:</i></b>
-<p>Following is an example of decorator configuration:
-<p><tt>&nbsp;&nbsp; &lt;extension point="org.eclipse.team.ui.decorators"></tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;decorator</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class="com.xyz.XYZDecorator"</tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; natureId="com.xyz.XYZNature"></tt>
-<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/decorator></tt>
-<br><tt>&nbsp;&nbsp; &lt;/extension></tt>
-
-<p><b><i>API Information</i>: </b>The value of the <tt>class</tt> attribute
-must represent a class that implements <tt>org.eclipse.team.ui.ITeamDecorator</tt>.
-This decorator may be called upon at any time to provide textual labels and
-icon adornments for a given resource.
-
-<p><b><i>Supplied Implementation: </i></b>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.
-
-<p><a href="hglegal.htm"><img SRC="ngibmcpy.gif" ALT="Copyright IBM Corp. 2000, 2001. All Rights Reserved." BORDER=0 height=12 width=195></a>
-</body>
-</html>
diff --git a/bundles/org.eclipse.team.ui/icons/basic/clcl16/catchup_rls.gif b/bundles/org.eclipse.team.ui/icons/basic/clcl16/catchup_rls.gif
deleted file mode 100644
index a588368e2..000000000
--- a/bundles/org.eclipse.team.ui/icons/basic/clcl16/catchup_rls.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/basic/clcl16/catchuprelease_rls.gif b/bundles/org.eclipse.team.ui/icons/basic/clcl16/catchuprelease_rls.gif
deleted file mode 100644
index 46936352f..000000000
--- a/bundles/org.eclipse.team.ui/icons/basic/clcl16/catchuprelease_rls.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/basic/clcl16/conflict_synch.gif b/bundles/org.eclipse.team.ui/icons/basic/clcl16/conflict_synch.gif
deleted file mode 100644
index 124d42d6a..000000000
--- a/bundles/org.eclipse.team.ui/icons/basic/clcl16/conflict_synch.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/basic/clcl16/ignorews_edit.gif b/bundles/org.eclipse.team.ui/icons/basic/clcl16/ignorews_edit.gif
deleted file mode 100644
index 097ecdda5..000000000
--- a/bundles/org.eclipse.team.ui/icons/basic/clcl16/ignorews_edit.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/basic/clcl16/incom_synch.gif b/bundles/org.eclipse.team.ui/icons/basic/clcl16/incom_synch.gif
deleted file mode 100644
index c80beab02..000000000
--- a/bundles/org.eclipse.team.ui/icons/basic/clcl16/incom_synch.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/basic/clcl16/outgo_synch.gif b/bundles/org.eclipse.team.ui/icons/basic/clcl16/outgo_synch.gif
deleted file mode 100644
index 083abb578..000000000
--- a/bundles/org.eclipse.team.ui/icons/basic/clcl16/outgo_synch.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/basic/clcl16/refresh.gif b/bundles/org.eclipse.team.ui/icons/basic/clcl16/refresh.gif
deleted file mode 100644
index a063c230a..000000000
--- a/bundles/org.eclipse.team.ui/icons/basic/clcl16/refresh.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/basic/clcl16/release_rls.gif b/bundles/org.eclipse.team.ui/icons/basic/clcl16/release_rls.gif
deleted file mode 100644
index 24105b7bc..000000000
--- a/bundles/org.eclipse.team.ui/icons/basic/clcl16/release_rls.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/basic/cview16/synch_synch.gif b/bundles/org.eclipse.team.ui/icons/basic/cview16/synch_synch.gif
deleted file mode 100644
index 4d1895bb7..000000000
--- a/bundles/org.eclipse.team.ui/icons/basic/cview16/synch_synch.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/basic/wizban/newconnect_wizban.gif b/bundles/org.eclipse.team.ui/icons/basic/wizban/newconnect_wizban.gif
deleted file mode 100644
index 6a40323ff..000000000
--- a/bundles/org.eclipse.team.ui/icons/basic/wizban/newconnect_wizban.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/clcl16/catchup_rls.gif b/bundles/org.eclipse.team.ui/icons/full/clcl16/catchup_rls.gif
deleted file mode 100644
index ba8ee00a3..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/clcl16/catchup_rls.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/clcl16/catchuprelease_rls.gif b/bundles/org.eclipse.team.ui/icons/full/clcl16/catchuprelease_rls.gif
deleted file mode 100644
index 25d4c998b..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/clcl16/catchuprelease_rls.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/clcl16/conflict_synch.gif b/bundles/org.eclipse.team.ui/icons/full/clcl16/conflict_synch.gif
deleted file mode 100644
index ecde52ea8..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/clcl16/conflict_synch.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/clcl16/ignorews_edit.gif b/bundles/org.eclipse.team.ui/icons/full/clcl16/ignorews_edit.gif
deleted file mode 100644
index 097ecdda5..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/clcl16/ignorews_edit.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/clcl16/incom_synch.gif b/bundles/org.eclipse.team.ui/icons/full/clcl16/incom_synch.gif
deleted file mode 100644
index dc9bfc62d..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/clcl16/incom_synch.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/clcl16/outgo_synch.gif b/bundles/org.eclipse.team.ui/icons/full/clcl16/outgo_synch.gif
deleted file mode 100644
index afe6b1736..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/clcl16/outgo_synch.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/clcl16/refresh.gif b/bundles/org.eclipse.team.ui/icons/full/clcl16/refresh.gif
deleted file mode 100644
index a063c230a..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/clcl16/refresh.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/clcl16/release_rls.gif b/bundles/org.eclipse.team.ui/icons/full/clcl16/release_rls.gif
deleted file mode 100644
index 36e60e3d3..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/clcl16/release_rls.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/cview16/synch_synch.gif b/bundles/org.eclipse.team.ui/icons/full/cview16/synch_synch.gif
deleted file mode 100644
index 790b59620..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/cview16/synch_synch.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/ovr/checkedin_ov.gif b/bundles/org.eclipse.team.ui/icons/full/ovr/checkedin_ov.gif
deleted file mode 100644
index 871a2a5db..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/ovr/checkedin_ov.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/ovr/checkedout_ov.gif b/bundles/org.eclipse.team.ui/icons/full/ovr/checkedout_ov.gif
deleted file mode 100644
index afe61fc6c..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/ovr/checkedout_ov.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/ovr/dirty_ov.gif b/bundles/org.eclipse.team.ui/icons/full/ovr/dirty_ov.gif
deleted file mode 100644
index 28d5b40cd..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/ovr/dirty_ov.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/icons/full/wizban/newconnect_wizban.gif b/bundles/org.eclipse.team.ui/icons/full/wizban/newconnect_wizban.gif
deleted file mode 100644
index 3038a23c0..000000000
--- a/bundles/org.eclipse.team.ui/icons/full/wizban/newconnect_wizban.gif
+++ /dev/null
Binary files differ
diff --git a/bundles/org.eclipse.team.ui/plugin.properties b/bundles/org.eclipse.team.ui/plugin.properties
deleted file mode 100644
index c3c9300cf..000000000
--- a/bundles/org.eclipse.team.ui/plugin.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-pluginName=Team Support UI
-
-# This will change shortly to "Text Resources" once a real Team page exists.
-TextPreferencePage.name=Team
-
-IgnorePreferencePage.name=Ignored Resources
-
-ConfigureProject.label=&Share Project...
-ConfigureProject.tooltip=Share the project with others using a version and configuration management provider.
-
-TeamGroupMenu.label=T&eam \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/plugin.xml b/bundles/org.eclipse.team.ui/plugin.xml
deleted file mode 100644
index c9f74cb1e..000000000
--- a/bundles/org.eclipse.team.ui/plugin.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- File written by PDE 1.0 -->
-<plugin
- id="org.eclipse.team.ui"
- name="%pluginName"
- version="2.0.0"
- provider-name="Object Technology International, Inc."
- class="org.eclipse.team.ui.TeamUIPlugin">
-<requires>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.team.core"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.compare"/>
-</requires>
-
-<runtime>
- <library name="teamui.jar">
- <export name="*"/>
- </library>
-</runtime>
-
-<extension-point id="configurationWizards" name="Configuration Wizards"/>
-
-<!-- **************** PREFERENCES ******************* -->
- <extension
- point = "org.eclipse.ui.preferencePages">
- <page id="org.eclipse.team.ui.TextPreferences"
- class="org.eclipse.team.internal.ui.TextPreferencePage"
- name="%TextPreferencePage.name">
- </page>
- <page id="org.eclipse.team.ui.IgnorePreferences"
- class="org.eclipse.team.internal.ui.IgnorePreferencePage"
- name="%IgnorePreferencePage.name"
- category="org.eclipse.team.ui.TextPreferences">
- </page>
- </extension>
-
-<!-- ****************** POPUP ACTIONS *************** -->
-
-<extension
- point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.team.ui.ResourceContributions"
- objectClass="org.eclipse.core.resources.IResource" adaptable="true">
- <menu
- id="team.main"
- path="additions"
- label="%TeamGroupMenu.label">
- <separator name="group1"/>
- <separator name="group2"/>
- <separator name="group3"/>
- <separator name="group4"/>
- <separator name="group5"/>
- <separator name="group6"/>
- <separator name="group7"/>
- <separator name="group8"/>
- <separator name="group9"/>
- <separator name="group10"/>
- <separator name="projectGroup"/>
- </menu>
- </objectContribution>
- <objectContribution
- id="org.eclipse.team.ui.ProjectContributions"
- objectClass="org.eclipse.core.resources.IProject" adaptable="true">
- <action
- id="org.eclipse.team.ui.ConfigureProject"
- label="%ConfigureProject.label"
- tooltip="%ConfigureProject.tooltip"
- menubarPath="team.main/projectGroup"
- enablesFor="1"
- class="org.eclipse.team.ui.actions.ConfigureProjectAction">
- </action>
- </objectContribution>
-</extension>
-
-<!-- ************** Views ********************** -->
-<extension point="org.eclipse.ui.views">
- <category
- id="org.eclipse.team.ui"
- name="Team">
- </category>
- <view
- id="org.eclipse.team.ui.sync.SyncView"
- icon="icons/full/cview16/synch_synch.gif"
- name="Synchronize"
- category="org.eclipse.team.ui"
- class="org.eclipse.team.ui.sync.SyncView">
- </view>
-</extension>
-</plugin> \ 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
deleted file mode 100644
index b40b54eb2..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardElement.java
+++ /dev/null
@@ -1,137 +0,0 @@
-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
deleted file mode 100644
index f7f59d8c3..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigurationWizardNode.java
+++ /dev/null
@@ -1,65 +0,0 @@
-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/ConfigureProjectWizard.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizard.java
deleted file mode 100644
index c84c64321..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizard.java
+++ /dev/null
@@ -1,198 +0,0 @@
-package org.eclipse.team.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.team.ui.IConfigurationWizard;
-import org.eclipse.team.ui.TeamUIPlugin;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.internal.model.AdaptableList;
-
-/**
- * The wizard for associating projects with team providers
- */
-public class ConfigureProjectWizard extends Wizard implements IConfigurationWizard {
- private IWorkbench workbench;
- private IProject project;
- private IConfigurationWizard wizard;
-
- private ConfigureProjectWizardMainPage mainPage;
- private String pluginId = UIConstants.PLUGIN_ID;
- private String extensionPoint = UIConstants.PT_CONFIGURATION;
-
- protected final static String TAG_WIZARD = "wizard";
- protected final static String TAG_DESCRIPTION = "description";
- protected final static String ATT_NAME = "name";
- protected final static String ATT_CLASS = "class";
- protected final static String ATT_ICON = "icon";
- protected final static String ATT_ID = "id";
-
- public ConfigureProjectWizard() {
- setNeedsProgressMonitor(true);
- setWindowTitle(Policy.bind("ConfigureProjectWizard.title"));
- }
-
- /*
- * @see Wizard#addPages
- */
- public void addPages() {
- AdaptableList wizards = getAvailableWizards();
- if (wizards.size() == 1) {
- // If there is only one wizard, skip the first page.
- // Only skip the first page if the one wizard has at least one page.
- ConfigurationWizardElement element = (ConfigurationWizardElement)wizards.getChildren()[0];
- try {
- this.wizard = (IConfigurationWizard)element.createExecutableExtension();
- wizard.init(workbench, project);
- wizard.addPages();
- if (wizard.getPageCount() > 0) {
- wizard.setContainer(getContainer());
- IWizardPage[] pages = wizard.getPages();
- for (int i = 0; i < pages.length; i++) {
- addPage(pages[i]);
- }
- return;
- }
- } catch (CoreException e) {
- TeamUIPlugin.log(e.getStatus());
- return;
- }
- }
- mainPage = new ConfigureProjectWizardMainPage("configurePage1", Policy.bind("ConfigureProjectWizard.configureProject"), TeamUIPlugin.getPlugin().getImageDescriptor(UIConstants.IMG_WIZBAN_SHARE), wizards);
- mainPage.setDescription(Policy.bind("ConfigureProjectWizard.description"));
- mainPage.setProject(project);
- mainPage.setWorkbench(workbench);
- addPage(mainPage);
- }
- public IWizardPage getNextPage(IWizardPage page) {
- if (wizard != null) {
- return wizard.getNextPage(page);
- }
- return super.getNextPage(page);
- }
- public boolean canFinish() {
- // If we are on the first page, never allow finish unless the selected wizard has no pages.
- if (getContainer().getCurrentPage() == mainPage) {
- if (mainPage.getSelectedWizard() != null && mainPage.getNextPage() == null) {
- return true;
- }
- return false;
- }
- if (wizard != null) {
- return wizard.canFinish();
- }
- return super.canFinish();
- }
- /*
- * @see Wizard#performFinish
- */
- public boolean performFinish() {
- if (wizard != null) {
- return wizard.performFinish();
- }
- return true;
- }
- /**
- * Returns the configuration wizards that are available for invocation.
- *
- * @return the available wizards
- */
- AdaptableList getAvailableWizards() {
- AdaptableList result = new AdaptableList();
- IPluginRegistry registry = Platform.getPluginRegistry();
- IExtensionPoint point = registry.getExtensionPoint(pluginId, extensionPoint);
- if (point != null) {
- IExtension[] extensions = point.getExtensions();
- for (int i = 0; i < extensions.length; i++) {
- IConfigurationElement[] elements = extensions[i].getConfigurationElements();
- for (int j = 0; j < elements.length; j++) {
- IConfigurationElement element = elements[j];
- if (element.getName().equals(TAG_WIZARD)) {
- ConfigurationWizardElement wizard = createWizardElement(element);
- if (wizard != null) {
- result.add(wizard);
- }
- }
- }
- }
- }
-
- return result;
- }
- /**
- * Returns a new ConfigurationWizardElement configured according to the parameters
- * contained in the passed Registry.
- *
- * May answer null if there was not enough information in the Extension to create
- * an adequate wizard
- *
- * @param element the element for which to create a wizard element
- * @return the wizard element for the given element
- */
- protected ConfigurationWizardElement createWizardElement(IConfigurationElement element) {
- // WizardElements must have a name attribute
- String nameString = element.getAttribute(ATT_NAME);
- if (nameString == null) {
- // Missing attribute
- return null;
- }
- ConfigurationWizardElement result = new ConfigurationWizardElement(nameString);
- if (initializeWizard(result, element)) {
- // initialization was successful
- return result;
- }
- return null;
- }
- /**
- * Initialize the passed element's properties based on the contents of
- * the passed registry. Answer a boolean indicating whether the element
- * was able to be adequately initialized.
- *
- * @param element the element to initialize the properties for
- * @param extension the registry to get properties from
- * @return whether initialization was successful
- */
- protected boolean initializeWizard(ConfigurationWizardElement element, IConfigurationElement config) {
- element.setID(config.getAttribute(ATT_ID));
- String description = "";
- IConfigurationElement [] children = config.getChildren(TAG_DESCRIPTION);
- if (children.length >= 1) {
- description = children[0].getValue();
- }
-
- element.setDescription(description);
-
- // apply CLASS and ICON properties
- element.setConfigurationElement(config);
- String iconName = config.getAttribute(ATT_ICON);
- if (iconName != null) {
- IExtension extension = config.getDeclaringExtension();
- element.setImageDescriptor(TeamUIPlugin.getImageDescriptorFromExtension(extension, iconName));
- }
- // ensure that a class was specified
- if (element.getConfigurationElement() == null) {
- // Missing attribute
- return false;
- }
- setForcePreviousAndNextButtons(true);
- return true;
- }
- /*
- * Method declared on IConfigurationWizard
- */
- public void init(IWorkbench workbench, IProject project) {
- this.workbench = workbench;
- this.project = project;
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizardMainPage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizardMainPage.java
deleted file mode 100644
index c9d8f18e3..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/ConfigureProjectWizardMainPage.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package org.eclipse.team.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.team.ui.IConfigurationWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.internal.model.AdaptableList;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-/**
- * The main page of the configure project wizard. It contains a table
- * which lists possible team providers with which to configure the project.
- * The user may select one and press "Next", which will display a provider-
- * specific wizard page.
- */
-public class ConfigureProjectWizardMainPage extends WizardPage {
- private Table table;
- private TableViewer viewer;
- private AdaptableList wizards;
- private IWorkbench workbench;
- private IProject project;
-
- private IConfigurationWizard selectedWizard;
-
- /**
- * Create a new ConfigureProjectWizardMainPage
- *
- * @param pageName the name of the page
- * @param title the title of the page
- * @param titleImage the image for the page title
- * @param wizard the wizards to populate the table with
- */
- public ConfigureProjectWizardMainPage(String pageName, String title, ImageDescriptor titleImage, AdaptableList wizards) {
- super(pageName, title, titleImage);
- this.wizards = wizards;
- }
- public IConfigurationWizard getSelectedWizard() {
- return selectedWizard;
- }
- /*
- * @see WizardPage#canFlipToNextPage
- */
- public boolean canFlipToNextPage() {
- return selectedWizard != null && selectedWizard.getPageCount() > 0;
- }
- /*
- * @see WizardPage#createControl
- */
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- setControl(composite);
-
- Label label = new Label(composite, SWT.LEFT);
- label.setText(Policy.bind("ConfigureProjectWizardMainPage.selectRepository"));
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- label.setLayoutData(data);
-
- table = new Table(composite, SWT.SINGLE | SWT.BORDER);
- data = new GridData(GridData.FILL_BOTH);
- data.heightHint = table.getItemHeight() * 7;
- table.setLayoutData(data);
- viewer = new TableViewer(table);
- viewer.setContentProvider(new WorkbenchContentProvider());
- viewer.setLabelProvider(new WorkbenchLabelProvider());
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- // Initialize the wizard so we can tell whether to enable the Next button
- ISelection selection = event.getSelection();
- if (selection == null || !(selection instanceof IStructuredSelection)) {
- selectedWizard = null;
- setPageComplete(false);
- return;
- }
- IStructuredSelection ss = (IStructuredSelection)selection;
- if (ss.size() != 1) {
- selectedWizard = null;
- setPageComplete(false);
- return;
- }
- ConfigurationWizardElement selectedElement = (ConfigurationWizardElement)ss.getFirstElement();
- try {
- selectedWizard = (IConfigurationWizard)selectedElement.createExecutableExtension();
- selectedWizard.init(workbench, project);
- } catch (CoreException e) {
- System.out.println(Policy.bind("exceptionCreatingWizard"));
- return;
- }
- selectedWizard.addPages();
-
- // Ask the container to update button enablement
- setPageComplete(true);
- }
- });
- viewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- getWizard().getContainer().showPage(getNextPage());
- }
- });
- viewer.setInput(wizards);
- }
- /**
- * The <code>WizardSelectionPage</code> implementation of
- * this <code>IWizardPage</code> method returns the first page
- * of the currently selected wizard if there is one.
- *
- * @see WizardPage#getNextPage
- */
- public IWizardPage getNextPage() {
- if (selectedWizard == null) return null;
- return selectedWizard.getStartingPage();
- }
- /**
- * Set the workbench to the argument
- *
- * @param workbench the workbench to set
- */
- public void setWorkbench(IWorkbench workbench) {
- this.workbench = workbench;
- }
- /**
- * Set the project to the argument
- *
- * @param project the project to set
- */
- public void setProject(IProject project) {
- this.project = project;
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IgnorePreferencePage.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IgnorePreferencePage.java
deleted file mode 100644
index dc44fe607..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/IgnorePreferencePage.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package org.eclipse.team.internal.ui; /* * (c) Copyright IBM Corp. 2000, 2002. * All Rights Reserved. */ import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.preference.PreferencePage; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.swt.SWT; 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.TableItem; import org.eclipse.team.core.IIgnoreInfo; import org.eclipse.team.core.TeamPlugin; import org.eclipse.team.ui.TeamUIPlugin; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage;
-public class IgnorePreferencePage extends PreferencePage implements IWorkbenchPreferencePage { private Table ignoreTable; private Button addButton; private Button removeButton;
- public void init(IWorkbench workbench) { setDescription(Policy.bind("IgnorePreferencePage.description")); } /** * Creates preference page controls on demand. * * @param parent the parent for the preference page */ 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, IVCMHelpContextIds.IGNORE_PREFERENCE_PAGE)); Label l1 = new Label(parent, SWT.NULL); l1.setText(Policy.bind("IgnorePreferencePage.ignorePatterns")); GridData data = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); data.horizontalSpan = 2; l1.setLayoutData(data); ignoreTable = new Table(parent, SWT.CHECK | SWT.BORDER); GridData gd = new GridData(GridData.FILL_BOTH); gd.widthHint= convertWidthInCharsToPixels(30); ignoreTable.setLayoutData(gd); ignoreTable.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { handleSelection(); } }); Composite buttons = new Composite(parent, SWT.NULL); buttons.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); buttons.setLayout(new GridLayout()); addButton = new Button(buttons, SWT.PUSH); addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); addButton.setText(Policy.bind("IgnorePreferencePage.add")); addButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { addIgnore(); } }); removeButton = new Button(buttons, SWT.PUSH); removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); removeButton.setText(Policy.bind("IgnorePreferencePage.remove")); removeButton.setEnabled(false); removeButton.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { removeIgnore(); } }); 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() { int count = ignoreTable.getItemCount(); String[] patterns = new String[count]; boolean[] enabled = new boolean[count]; TableItem[] items = ignoreTable.getItems(); for (int i = 0; i < count; i++) { patterns[i] = items[i].getText(); enabled[i] = items[i].getChecked(); } TeamPlugin.getPlugin().setGlobalIgnore(patterns, enabled); TeamUIPlugin.getPlugin().broadcastPropertyChange(new PropertyChangeEvent(TeamUIPlugin.getPlugin(), TeamUIPlugin.GLOBAL_IGNORES_CHANGED, null, null)); return true; } private void fillTable() { IIgnoreInfo[] ignore = TeamPlugin.getPlugin().getGlobalIgnore(); for (int i = 0; i < ignore.length; i++) { IIgnoreInfo info = ignore[i]; TableItem item = new TableItem(ignoreTable, SWT.NONE); item.setText(info.getPattern()); item.setChecked(info.getEnabled()); } } private void addIgnore() { InputDialog dialog = new InputDialog(getShell(), Policy.bind("IgnorePreferencePage.enterPatternShort"), Policy.bind("IgnorePreferencePage.enterPatternLong"), null, null); dialog.open(); if (dialog.getReturnCode() != InputDialog.OK) return; String pattern = dialog.getValue(); if (pattern.equals("")) return; // Check if the item already exists TableItem[] items = ignoreTable.getItems(); for (int i = 0; i < items.length; i++) { if (items[i].getText().equals(pattern)) { MessageDialog.openWarning(getShell(), Policy.bind("IgnorePreferencePage.patternExistsShort"), Policy.bind("IgnorePreferencePage.patternExistsLong")); return; } } TableItem item = new TableItem(ignoreTable, SWT.NONE); item.setText(pattern); item.setChecked(true); } private void removeIgnore() { int[] selection = ignoreTable.getSelectionIndices(); ignoreTable.remove(selection); } private void handleSelection() { if (ignoreTable.getSelectionCount() > 0) { removeButton.setEnabled(true); } else { removeButton.setEnabled(false); } }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java
deleted file mode 100644
index 68c81e76f..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/Policy.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.eclipse.team.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.text.MessageFormat;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubProgressMonitor;
-
-/**
- * Policy implements NLS convenience methods for the plugin and
- * makes progress monitor policy decisions
- */
-public class Policy {
- // The resource bundle to get strings from
- protected static ResourceBundle bundle = null;
-
- /**
- * Creates a NLS catalog for the given locale.
- *
- * @param bundleName the name of the bundle
- */
- public static void localize(String bundleName) {
- bundle = ResourceBundle.getBundle(bundleName);
- }
-
- /**
- * Lookup the message with the given ID in this catalog and bind its
- * substitution locations with the given string.
- *
- * @param id the id to look up
- * @param binding the string to bind to the result
- * @return the bound string
- */
- public static String bind(String id, String binding) {
- return bind(id, new String[] { binding });
- }
-
- /**
- * Lookup the message with the given ID in this catalog and bind its
- * substitution locations with the given strings.
- *
- * @param id the id to look up
- * @param binding1 the first string to bind to the result
- * @param binding2 the second string to bind to the result
- * @return the bound string
- */
- public static String bind(String id, String binding1, String binding2) {
- return bind(id, new String[] { binding1, binding2 });
- }
-
- /**
- * Gets a string from the resource bundle. We don't want to crash because of a missing String.
- * Returns the key if not found.
- *
- * @param key the id to look up
- * @return the string with the given key
- */
- public static String bind(String key) {
- try {
- return bundle.getString(key);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Gets a string from the resource bundle and binds it with the given arguments. If the key is
- * not found, return the key.
- *
- * @param key the id to look up
- * @param args the strings to bind to the result
- * @return the bound string
- */
- public static String bind(String key, Object[] args) {
- try {
- return MessageFormat.format(bind(key), args);
- } catch (MissingResourceException e) {
- return key;
- } catch (NullPointerException e) {
- return "!" + key + "!";
- }
- }
-
- /**
- * Checks if the progress monitor is canceled.
- *
- * @param monitor the onitor to check for cancellation
- * @throws OperationCanceledException if the monitor is canceled
- */
- public static void checkCanceled(IProgressMonitor monitor) {
- if (monitor.isCanceled()) {
- throw new OperationCanceledException();
- }
- }
- /**
- * Returns a monitor for the given monitor
- *
- * @param monitor the monitor to return a monitor for
- * @return a monitor for the given monitor
- */
- public static IProgressMonitor monitorFor(IProgressMonitor monitor) {
- if (monitor == null) {
- return new NullProgressMonitor();
- }
- return monitor;
- }
- public static IProgressMonitor subMonitorFor(IProgressMonitor monitor, int ticks) {
- if (monitor == null)
- return new NullProgressMonitor();
- if (monitor instanceof NullProgressMonitor)
- return monitor;
- return new SubProgressMonitor(monitor, ticks);
- }
-} \ No newline at end of file
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
deleted file mode 100644
index a6f109227..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TextPreferencePage.java
+++ /dev/null
@@ -1 +0,0 @@
-package org.eclipse.team.internal.ui; /* * (c) Copyright IBM Corp. 2000, 2002. * 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"); // The name of the parameter in the file registry private static final String TYPE = "type"; // 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(); int type; if (value.equals(TEXT)) { type = IFileTypeRegistry.TEXT; } else { type = IFileTypeRegistry.BINARY; } registry.setValue(entry.getExtension(), type); } 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(); for (int i = 0; i < extensions.length; i++) { int type = registry.getType(extensions[i]); switch (type) { case IFileTypeRegistry.TEXT: input.add(new TableEntry(extensions[i], TEXT)); break; case IFileTypeRegistry.BINARY: input.add(new TableEntry(extensions[i], BINARY)); break; } } 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/internal/ui/UIConstants.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/UIConstants.java
deleted file mode 100644
index c7e905dde..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/UIConstants.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.team.internal.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * Central location for constants used by the Team user interface.
- */
-public interface UIConstants {
- // plugin id
- public final String PLUGIN_ID = "org.eclipse.team.ui";
-
- // extension points
- public final String PT_CONFIGURATION ="configurationWizards";
- public final String PT_DECORATORS = "decorators";
-
- // image paths
- public final String ICON_PATH_FULL = "icons/full/";
- public final String ICON_PATH_BASIC = "icons/basic/";
-
- //Local toolbars (colour)
- public final String IMG_DLG_SYNC_INCOMING = "clcl16/incom_synch.gif";
- public final String IMG_DLG_SYNC_OUTGOING = "clcl16/outgo_synch.gif";
- public final String IMG_DLG_SYNC_CONFLICTING = "clcl16/conflict_synch.gif";
- public final String IMG_REFRESH = "clcl16/refresh.gif";
- public final String IMG_IGNORE_WHITESPACE = "clcl16/ignorews_edit.gif";
-
- //sync view modes
- public final String IMG_SYNC_MODE_CATCHUP = "clcl16/catchup_rls.gif";
- public final String IMG_SYNC_MODE_RELEASE = "clcl16/release_rls.gif";
- public final String IMG_SYNC_MODE_FREE = "clcl16/catchuprelease_rls.gif";
-
- // Wizard banners
- public final String IMG_WIZBAN_SHARE = "wizban/newconnect_wizban.gif";
-
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
deleted file mode 100644
index ee68665d5..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ /dev/null
@@ -1,119 +0,0 @@
-# String resources for org.eclipse.team.ui
-####################
-
-simpleInternal=Internal error
-exceptionCreatingWizard=Exception creating wizard.
-nothingToSynchronize=Nothing to Synchronize
-
-# ui
-
-CheckInAction.checkin=Check In
-CheckInAction.checkingIn=Checking In...
-
-CheckOutAction.checkout=Check Out
-CheckOutAction.checkingOut=Checking Out...
-
-ConfigureProjectAction.configureProject=Configure Project
-
-DeconfigureProjectAction.deconfigureProject=Deconfigure Project
-
-DeleteAction.delete=Delete
-DeleteAction.deleting=Deleting...
-
-ManageAction.manage=Manage
-ManageAction.managing=Managing...
-
-MoveAction.move=Move
-
-UnManageAction.unmanage=Unmanage
-UnManageAction.unmanaging=Unmanaging...
-
-UndoCheckOutAction.undoCheckout=Undo Check Out
-UndoCheckOutAction.undoing=Undoing Check Out...
-
-UpdateAction.updating=Getting...
-UpdateAction.title=Get
-
-# internal.ui
-
-ConfigureProjectWizard.configureProject=Share Project
-ConfigureProjectWizard.title=Share Project
-ConfigureProjectWizard.description=Select the repository plug-in that will be used to share the selected project.
-ConfigureProjectWizardMainPage.selectRepository=Select a repository type:
-
-IgnorePreferencePage.description=You may wish to exclude certain resources from version control.\n\
- Use this page to specify a list of resource name patterns to ignore.\n\
- Resources whose names match any enabled pattern will not be released.\n\
- The wildcard characters '*' and '?' are permitted.\n\
- These settings will not affect resources already under version control.
-IgnorePreferencePage.ignorePatterns=&Ignore Patterns:
-IgnorePreferencePage.add=&Add...
-IgnorePreferencePage.remove=&Remove
-IgnorePreferencePage.enterPatternShort=Enter Ignore Pattern
-IgnorePreferencePage.enterPatternLong=Please enter a pattern:
-IgnorePreferencePage.patternExistsShort=Pattern Already Exists
-IgnorePreferencePage.patternExistsLong=The entered pattern already exists.
-
-TextPreferencePage.text=Text
-TextPreferencePage.binary=Binary
-TextPreferencePage.description=&File extensions with known content:
-TextPreferencePage.add=&Add...
-TextPreferencePage.remove=&Remove
-TextPreferencePage.enterExtensionShort=Enter File Extension
-TextPreferencePage.enterExtensionLong=Please enter a file extension:
-TextPreferencePage.extensionExistsShort=Extension Already Exists
-TextPreferencePage.extensionExistsLong=The entered extension already exists.
-TextPreferencePage.change=&Change
-TextPreferencePage.extension=Extension
-TextPreferencePage.contents=Contents
-
-TeamResourceDecorator.badClassType=Error creating Team decorator: bad class type
-TeamResourceDecorator.coreException=Error creating Team decorator: core exception
-
-DeleteAction.promptMessage=Are you sure you want to delete the resource(s) from the repository and from the local workspace?
-DeleteAction.promptTitle=Confirm Repository Delete
-
-# internal.ui.sync
-
-CatchupReleaseViewer.expand=&Expand All
-CatchupReleaseViewer.ignoreWhiteSpace=&Ignore White Space
-CatchupReleaseViewer.refreshAction=&Refresh From Repository
-CatchupReleaseViewer.showInNavigator=&Show in Navigator
-CatchupReleaseViewer.showIncomingAction=Show Incoming
-CatchupReleaseViewer.showOutgoingAction=Show Outgoing
-CatchupReleaseViewer.showOnlyConflictsAction=Show Only Conflicts
-
-MergeResource.workspaceFile=Workspace file: {0}
-MergeResource.repositoryFile=Repository file: {0}
-MergeResource.noRepositoryFile=No repository file
-MergeResource.noCommonFile=No common file
-MergeResource.commonFile=Common file: {0}
-
-SyncCompareInput.nothingText=Workspace resources are the same as those released in the stream.
-SyncCompareInput.refresh=Error During Refresh with Repository
-SyncCompareInput.synchronize=Synchronize
-SyncCompareInput.taskTitle=Synchronizing with Repository...
-
-SyncSet.conflicts={0} conflicts,
-SyncSet.incomings={0} incoming change(s),
-SyncSet.noConflicts=No conflicts,
-SyncSet.noIncomings=no incoming changes,
-SyncSet.noOutgoings=no outgoing changes.
-SyncSet.outgoings={0} outgoing change(s).
-
-SyncView.incomingModeTitle=Synchronize - Incoming Mode
-SyncView.incomingModeAction=Incoming Mode
-SyncView.incomingModeToolTip=Incoming Mode
-SyncView.outgoingModeTitle=Synchronize - Outgoing Mode
-SyncView.outgoingModeAction=Outgoing Mode
-SyncView.outgoingModeToolTip=Outgoing Mode
-SyncView.freeModeTitle=Synchronize - Incoming/Outgoing Mode
-SyncView.freeModeAction=Incoming/Outgoing Mode
-SyncView.freeModeToolTip=Incoming/Outgoing Mode
-SyncView.same=Workspace resources are the same as those released in the repository.
-SyncView.text=Synchronize resources with their team provider to display them here.
-SyncView.unableSynchronize=Unable to Synchronize
-
-TeamFile.saveChanges=Unable to save changes to file: {0}
-
-TeamAction.internal=Internal error occured.
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
deleted file mode 100644
index fcd51bfbc..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/IConfigurationWizard.java
+++ /dev/null
@@ -1,30 +0,0 @@
-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.
- * <p>
- * This method is called after the no argument constructor and
- * before other methods are called.
- * </p>
- *
- * @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
deleted file mode 100644
index 5ea2a4bf1..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/ISharedImages.java
+++ /dev/null
@@ -1,21 +0,0 @@
-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/TeamUIPlugin.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUIPlugin.java
deleted file mode 100644
index 180ac6182..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamUIPlugin.java
+++ /dev/null
@@ -1,225 +0,0 @@
-package org.eclipse.team.ui;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.UIConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * TeamUIPlugin is the plugin for generic, non-provider specific,
- * team UI functionality in the workbench.
- */
-public class TeamUIPlugin extends AbstractUIPlugin implements ISharedImages {
-
- private static TeamUIPlugin instance;
- public static final String ID = "org.eclipse.team.ui";
-
- // property change types
- public static String GLOBAL_IGNORES_CHANGED = "global_ignores_changed";
-
- private Hashtable imageDescriptors = new Hashtable(20);
-
- private List propertyChangeListeners = new ArrayList(5);
-
- public final static String ICON_PATH;
-
- static {
- if (Display.getCurrent().getIconDepth() > 4) {
- ICON_PATH = UIConstants.ICON_PATH_FULL;
- } else {
- ICON_PATH = UIConstants.ICON_PATH_BASIC;
- }
- }
-
- /**
- * Creates a new TeamUIPlugin.
- *
- * @param descriptor the plugin descriptor
- */
- public TeamUIPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- instance = this;
- }
- /**
- * Creates an extension. If the extension plugin has not
- * been loaded a busy cursor will be activated during the duration of
- * the load.
- *
- * @param element the config element defining the extension
- * @param classAttribute the name of the attribute carrying the class
- * @return the extension object
- */
- public static Object createExtension(final IConfigurationElement element, final String classAttribute) throws CoreException {
- // If plugin has been loaded create extension.
- // Otherwise, show busy cursor then create extension.
- IPluginDescriptor plugin = element.getDeclaringExtension().getDeclaringPluginDescriptor();
- if (plugin.isPluginActivated()) {
- return element.createExecutableExtension(classAttribute);
- } else {
- final Object [] ret = new Object[1];
- final CoreException [] exc = new CoreException[1];
- BusyIndicator.showWhile(null, new Runnable() {
- public void run() {
- try {
- ret[0] = element.createExecutableExtension(classAttribute);
- } catch (CoreException e) {
- exc[0] = e;
- }
- }
- });
- if (exc[0] != null)
- throw exc[0];
- else
- return ret[0];
- }
- }
- /**
- * Creates an image and places it in the image registry.
- *
- * @param id the identifier for the image
- * @param baseURL the base URL for the image
- */
- protected void createImageDescriptor(String id, URL baseURL) {
- URL url = null;
- try {
- url = new URL(baseURL, UIConstants.ICON_PATH_FULL + id);
- } catch (MalformedURLException e) {
- }
- ImageDescriptor desc = ImageDescriptor.createFromURL(url);
- imageDescriptors.put(id, desc);
- }
- /**
- * Convenience method to get the currently active workbench page
- *
- * @return the active workbench page
- */
- public static IWorkbenchPage getActivePage() {
- return getPlugin().getWorkbench().getActiveWorkbenchWindow().getActivePage();
- }
- /**
- * Return the default instance of the receiver. This represents the runtime plugin.
- *
- * @return the singleton plugin instance
- */
- public static TeamUIPlugin getPlugin() {
- return instance;
- }
- /**
- * Returns the image descriptor for the given image ID.
- * Returns null if there is no such image.
- *
- * @param id the identifier for the image to retrieve
- * @return the image associated with the given ID
- */
- public ImageDescriptor getImageDescriptor(String id) {
- return (ImageDescriptor) imageDescriptors.get(id);
- }
- /**
- * Convenience method to get an image descriptor for an extension
- *
- * @param extension the extension declaring the image
- * @param subdirectoryAndFilename the path to the image
- * @return the image
- */
- public static ImageDescriptor getImageDescriptorFromExtension(IExtension extension, String subdirectoryAndFilename) {
- IPluginDescriptor pluginDescriptor = extension.getDeclaringPluginDescriptor();
- URL path = pluginDescriptor.getInstallURL();
- URL fullPathString = null;
- try {
- fullPathString = new URL(path,subdirectoryAndFilename);
- return ImageDescriptor.createFromURL(fullPathString);
- } catch (MalformedURLException e) {
- }
- return null;
- }
- /**
- * Initializes the table of images used in this plugin.
- */
- protected void initializeImages() {
- URL baseURL = getDescriptor().getInstallURL();
-
- // View decoration overlays
- createImageDescriptor(ISharedImages.IMG_DIRTY_OVR, baseURL);
- createImageDescriptor(ISharedImages.IMG_CHECKEDIN_OVR, baseURL);
- createImageDescriptor(ISharedImages.IMG_CHECKEDOUT_OVR, baseURL);
-
- createImageDescriptor(UIConstants.IMG_DLG_SYNC_INCOMING, baseURL);
- createImageDescriptor(UIConstants.IMG_DLG_SYNC_OUTGOING, baseURL);
- createImageDescriptor(UIConstants.IMG_DLG_SYNC_CONFLICTING, baseURL);
- createImageDescriptor(UIConstants.IMG_REFRESH, baseURL);
- createImageDescriptor(UIConstants.IMG_IGNORE_WHITESPACE, baseURL);
- createImageDescriptor(UIConstants.IMG_SYNC_MODE_CATCHUP, baseURL);
- createImageDescriptor(UIConstants.IMG_SYNC_MODE_RELEASE, baseURL);
- createImageDescriptor(UIConstants.IMG_SYNC_MODE_FREE, baseURL);
- createImageDescriptor(UIConstants.IMG_WIZBAN_SHARE, baseURL);
- }
- /**
- * Initializes the preferences for this plugin if necessary.
- */
- protected void initializePreferences() {
- //IPreferenceStore store = getPreferenceStore();
- }
-
- /**
- * Convenience method for logging statuses to the plugin log
- *
- * @param status the status to log
- */
- public static void log(IStatus status) {
- getPlugin().getLog().log(status);
- }
-
- /**
- * Register for changes made to Team UI properties.
- */
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
- propertyChangeListeners.add(listener);
- }
-
- /**
- * Deregister as a Team UI property changes.
- */
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
- propertyChangeListeners.remove(listener);
- }
-
- /**
- * Broadcast a Team UI property change.
- */
- public void broadcastPropertyChange(PropertyChangeEvent event) {
- for (Iterator it = propertyChangeListeners.iterator(); it.hasNext();) {
- IPropertyChangeListener listener = (IPropertyChangeListener) it.next();
- listener.propertyChange(event);
- }
- }
-
- /**
- * @see Plugin#startup()
- */
- public void startup() throws CoreException {
- Policy.localize("org.eclipse.team.internal.ui.messages");
- initializeImages();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckInAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckInAction.java
deleted file mode 100644
index ec894f824..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckInAction.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.eclipse.team.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.internal.simpleAccess.SimpleAccessOperations;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * Action for checking in the selected resources
- */
-public class CheckInAction extends TeamAction {
- /*
- * Method declared on IActionDelegate.
- */
- public void run(IAction action) {
- run(new WorkspaceModifyOperation() {
- public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
- try {
- Hashtable table = getProviderMapping();
- Set keySet = table.keySet();
- monitor.beginTask("", keySet.size() * 1000);
- monitor.setTaskName(Policy.bind("CheckInAction.checkingIn"));
- Iterator iterator = keySet.iterator();
- while (iterator.hasNext()) {
- IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1000);
- RepositoryProvider provider = (RepositoryProvider)iterator.next();
- List list = (List)table.get(provider);
- IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
- provider.getSimpleAccess().checkin(providerResources, IResource.DEPTH_INFINITE, subMonitor);
- }
- } catch (TeamException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
- }, Policy.bind("CheckInAction.checkin"), this.PROGRESS_DIALOG);
- }
- /**
- * @see TeamAction#isEnabled()
- */
- protected boolean isEnabled() {
- IResource[] resources = getSelectedResources();
- if (resources.length == 0) return false;
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject());
- SimpleAccessOperations ops = provider.getSimpleAccess();
- if (provider == null || ops == null) return false;
- if (!ops.isCheckedOut(resource)) return false;
- }
- return true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckOutAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckOutAction.java
deleted file mode 100644
index bb29787d3..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/CheckOutAction.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.eclipse.team.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.internal.simpleAccess.SimpleAccessOperations;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * CheckOutAction checks the selected resources out from the provider.
- */
-public class CheckOutAction extends TeamAction {
- /*
- * Method declared on IActionDelegate.
- */
- public void run(IAction action) {
- run(new WorkspaceModifyOperation() {
- public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
- try {
- Hashtable table = getProviderMapping();
- Set keySet = table.keySet();
- monitor.beginTask("", keySet.size() * 1000);
- monitor.setTaskName(Policy.bind("CheckOutAction.checkingOut"));
- Iterator iterator = keySet.iterator();
- while (iterator.hasNext()) {
- IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1000);
- RepositoryProvider provider = (RepositoryProvider)iterator.next();
- List list = (List)table.get(provider);
- IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
- provider.getSimpleAccess().checkout(providerResources, IResource.DEPTH_ZERO, subMonitor);
- }
- } catch (TeamException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
- }, Policy.bind("CheckOutAction.checkout"), this.PROGRESS_BUSYCURSOR);
- }
- /**
- * @see TeamAction#isEnabled()
- */
- protected boolean isEnabled() throws TeamException {
- IResource[] resources = getSelectedResources();
- if (resources.length == 0) return false;
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject());
- SimpleAccessOperations ops = provider.getSimpleAccess();
- if (provider == null || ops == null) return false;
- if (ops.isCheckedOut(resource)) return false;
- }
- return true;
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/ConfigureProjectAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/ConfigureProjectAction.java
deleted file mode 100644
index 6564bbbd7..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/ConfigureProjectAction.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.eclipse.team.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.internal.ui.ConfigureProjectWizard;
-import org.eclipse.team.internal.ui.Policy;
-
-/**
- * Action for configuring a project. Configuring involves associating
- * the project with a Team provider and performing any provider-specific
- * configuration that is necessary.
- */
-public class ConfigureProjectAction extends TeamAction {
- /*
- * Method declared on IActionDelegate.
- */
- public void run(IAction action) {
- run(new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- IProject project = getSelectedProjects()[0];
- ConfigureProjectWizard wizard = new ConfigureProjectWizard();
- wizard.init(null, project);
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- dialog.open();
- } catch (Exception e) {
- throw new InvocationTargetException(e);
- }
- }
- }, Policy.bind("ConfigureProjectAction.configureProject"), PROGRESS_BUSYCURSOR);
- }
- /**
- * @see TeamAction#isEnabled()
- */
- protected boolean isEnabled() {
- IProject[] selectedProjects = getSelectedProjects();
- if (selectedProjects.length != 1) return false;
- if (!selectedProjects[0].isAccessible()) return false;
- if (RepositoryProvider.getProvider(selectedProjects[0]) == null) return true;
- return false;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeconfigureProjectAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeconfigureProjectAction.java
deleted file mode 100644
index 76cc1a7e0..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeconfigureProjectAction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.eclipse.team.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * Action for deconfiguring a project. Deconfiguring involves removing
- * associated provider for the project.
- */
-public class DeconfigureProjectAction extends TeamAction {
- /*
- * Method declared on IActionDelegate.
- */
- public void run(IAction action) {
- run(new WorkspaceModifyOperation() {
- public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
- try {
- // should we use the id for the provider type and remove from the nature. Or would
- // this operation be provider specific?
- } catch (Exception e) {
- throw new InvocationTargetException(e);
- }
- }
- }, Policy.bind("DeconfigureProjectAction.deconfigureProject"), PROGRESS_BUSYCURSOR);
- }
- /**
- * @see TeamAction#isEnabled()
- */
- protected boolean isEnabled() {
- IProject[] selectedProjects = getSelectedProjects();
- if (selectedProjects.length != 1) return false;
- if (RepositoryProvider.getProvider(selectedProjects[0]) != null) return false;
- return true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeleteAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeleteAction.java
deleted file mode 100644
index d2270dcc6..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/DeleteAction.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.team.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.internal.simpleAccess.SimpleAccessOperations;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * Action for deleting the selected resources on the provider
- */
-public class DeleteAction extends TeamAction {
- /*
- * Method declared on IActionDelegate.
- */
- public void run(IAction action) {
- run(new WorkspaceModifyOperation() {
- public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
- try {
- final boolean[] okToContinue = {false};
- getShell().getDisplay().syncExec(new Runnable() {
- public void run() {
- okToContinue[0] = MessageDialog.openConfirm(getShell(), Policy.bind("DeleteAction.promptTitle"), Policy.bind("DeleteAction.promptMessage"));
- }
- });
-
- if (okToContinue[0]) {
- Hashtable table = getProviderMapping();
- Set keySet = table.keySet();
- monitor.beginTask("", keySet.size() * 1000);
- monitor.setTaskName(Policy.bind("DeleteAction.deleting"));
- Iterator iterator = keySet.iterator();
- while (iterator.hasNext()) {
- IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1000);
- RepositoryProvider provider = (RepositoryProvider)iterator.next();
- List list = (List)table.get(provider);
- IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
- provider.getSimpleAccess().delete(providerResources, subMonitor);
- for (int i = 0; i < providerResources.length; i++) {
- providerResources[i].delete(true, monitor);
- }
- }
- }
- } catch (TeamException e) {
- throw new InvocationTargetException(e);
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
- }, Policy.bind("DeleteAction.delete"), this.PROGRESS_BUSYCURSOR);
- }
- /**
- * @see TeamAction#isEnabled()
- */
- protected boolean isEnabled() throws TeamException {
- IResource[] resources = getSelectedResources();
- if (resources.length == 0) return false;
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject());
- SimpleAccessOperations ops = provider.getSimpleAccess();
- if (provider == null || ops == null) return false;
- if (!ops.hasRemote(resource)) return false;
- }
- return true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/GetAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/GetAction.java
deleted file mode 100644
index 0a3895bee..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/GetAction.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.eclipse.team.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.internal.simpleAccess.SimpleAccessOperations;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * Action for getting the contents of the selected resources
- */
-public class GetAction extends TeamAction {
- /*
- * Method declared on IActionDelegate.
- */
- public void run(IAction action) {
- run(new WorkspaceModifyOperation() {
- public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
- try {
- Hashtable table = getProviderMapping();
- Set keySet = table.keySet();
- monitor.beginTask("", keySet.size() * 1000);
- monitor.setTaskName(Policy.bind("UpdateAction.updating"));
- Iterator iterator = keySet.iterator();
- while (iterator.hasNext()) {
- IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1000);
- RepositoryProvider provider = (RepositoryProvider)iterator.next();
- List list = (List)table.get(provider);
- IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
- provider.getSimpleAccess().get(providerResources, IResource.DEPTH_INFINITE, subMonitor);
- }
- } catch (TeamException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
- }, Policy.bind("UpdateAction.title"), PROGRESS_DIALOG);
- }
- /**
- * @see TeamAction#isEnabled()
- */
- protected boolean isEnabled() throws TeamException {
- IResource[] resources = getSelectedResources();
- if (resources.length == 0) return false;
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject());
- SimpleAccessOperations ops = provider.getSimpleAccess();
- if (provider == null || ops == null) return false;
- if (!ops.hasRemote(resource)) return false;
- }
- return true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/TeamAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/TeamAction.java
deleted file mode 100644
index f640d824b..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/TeamAction.java
+++ /dev/null
@@ -1,292 +0,0 @@
-package org.eclipse.team.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.ui.TeamUIPlugin;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-/**
- * The abstract superclass of all Team actions. This class contains some convenience
- * methods for getting selected objects and mapping selected objects to their
- * providers.
- *
- * Team providers may subclass this class when creating their actions.
- * Team providers may also instantiate or subclass any of the
- * subclasses of TeamAction provided in this package.
- */
-public abstract class TeamAction extends ActionDelegate implements IObjectActionDelegate {
- // The current selection
- protected IStructuredSelection selection;
-
- // The shell, required for the progress dialog
- protected Shell shell;
-
- // Constants for determining the type of progress. Subclasses may
- // pass one of these values to the run method.
- public final static int PROGRESS_DIALOG = 1;
- public final static int PROGRESS_BUSYCURSOR = 2;
-
- /**
- * Returns the selected projects.
- *
- * @return the selected projects
- */
- protected IProject[] getSelectedProjects() {
- ArrayList projects = null;
- if (!selection.isEmpty()) {
- projects = new ArrayList();
- Iterator elements = ((IStructuredSelection) selection).iterator();
- while (elements.hasNext()) {
- Object next = elements.next();
- if (next instanceof IProject) {
- projects.add(next);
- continue;
- }
- if (next instanceof IAdaptable) {
- IAdaptable a = (IAdaptable) next;
- Object adapter = a.getAdapter(IResource.class);
- if (adapter instanceof IProject) {
- projects.add(adapter);
- continue;
- }
- }
- }
- }
- if (projects != null && !projects.isEmpty()) {
- IProject[] result = new IProject[projects.size()];
- projects.toArray(result);
- return result;
- }
- return new IProject[0];
- }
- /**
- * Returns the selected resources.
- *
- * @return the selected resources
- */
- protected IResource[] getSelectedResources() {
- ArrayList resources = null;
- if (!selection.isEmpty()) {
- resources = new ArrayList();
- Iterator elements = ((IStructuredSelection) selection).iterator();
- while (elements.hasNext()) {
- Object next = elements.next();
- if (next instanceof IResource) {
- resources.add(next);
- continue;
- }
- if (next instanceof IAdaptable) {
- IAdaptable a = (IAdaptable) next;
- Object adapter = a.getAdapter(IResource.class);
- if (adapter instanceof IResource) {
- resources.add(adapter);
- continue;
- }
- }
- }
- }
- if (resources != null && !resources.isEmpty()) {
- IResource[] result = new IResource[resources.size()];
- resources.toArray(result);
- return result;
- }
- return new IResource[0];
- }
-
- /**
- * Convenience method for getting the current shell.
- *
- * @return the shell
- */
- protected Shell getShell() {
- if (shell != null) {
- return shell;
- } else {
- return TeamUIPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow().getShell();
- }
- }
- /**
- * Convenience method for running an operation with progress and
- * error feedback.
- *
- * @param runnable the runnable which executes the operation
- * @param problemMessage the message to display in the case of errors
- * @param progressKind one of PROGRESS_BUSYCURSOR or PROGRESS_DIALOG
- */
- final protected void run(final IRunnableWithProgress runnable, final String problemMessage, int progressKind) {
- final Exception[] exceptions = new Exception[] {null};
- switch (progressKind) {
- case PROGRESS_BUSYCURSOR :
- BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
- public void run() {
- try {
- runnable.run(new NullProgressMonitor());
- } catch (InvocationTargetException e) {
- exceptions[0] = e;
- } catch (InterruptedException e) {
- exceptions[0] = null;
- }
- }
- });
- break;
- default :
- case PROGRESS_DIALOG :
- try {
- new ProgressMonitorDialog(getShell()).run(true, true, runnable);
- } catch (InvocationTargetException e) {
- exceptions[0] = e;
- } catch (InterruptedException e) {
- exceptions[0] = null;
- }
- break;
- }
- if (exceptions[0] != null) {
- handle(exceptions[0], null, problemMessage);
- }
- }
- /*
- * Method declared on IActionDelegate.
- */
- public void selectionChanged(IAction action, ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- this.selection = (IStructuredSelection) selection;
- if (action != null) {
- try {
- action.setEnabled(isEnabled());
- } catch (TeamException e) {
- action.setEnabled(false);
- handle(e, null, null);
- }
- }
- }
- }
- /*
- * Method declared on IObjectActionDelegate.
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.shell = targetPart.getSite().getShell();
- }
- /**
- * Shows the given errors to the user.
- *
- * @param status the status containing the error
- * @param title the title of the error dialog
- * @param message the message for the error dialog
- * @param shell the shell to open the error dialog in
- */
- protected void handle(Exception exception, String title, String message) {
- IStatus status = null;
- boolean log = false;
- boolean dialog = false;
- if (exception instanceof TeamException) {
- status = ((TeamException)exception).getStatus();
- log = false;
- dialog = true;
- } else if (exception instanceof InvocationTargetException) {
- Throwable t = ((InvocationTargetException)exception).getTargetException();
- if (t instanceof TeamException) {
- status = ((TeamException)t).getStatus();
- log = false;
- dialog = true;
- } else if (t instanceof CoreException) {
- status = ((CoreException)t).getStatus();
- log = true;
- dialog = true;
- } else if (t instanceof InterruptedException) {
- return;
- } else {
- status = new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, Policy.bind("TeamAction.internal"), t);
- log = true;
- dialog = true;
- }
- }
- if (status == null) return;
- if (!status.isOK()) {
- IStatus toShow = status;
- if (status.isMultiStatus()) {
- IStatus[] children = status.getChildren();
- if (children.length == 1) {
- toShow = children[0];
- }
- }
- if (title == null) {
- title = status.getMessage();
- }
- if (dialog) {
- ErrorDialog.openError(getShell(), title, message, toShow);
- }
- if (log) {
- TeamUIPlugin.log(toShow);
- }
- }
- }
- /**
- * Concrete action enablement code.
- * Subclasses must implement.
- *
- * @return whether the action is enabled
- * @throws TeamException if an error occurs during enablement detection
- */
- abstract protected boolean isEnabled() throws TeamException;
-
- /**
- * Convenience method that maps the selected resources to their providers.
- * The returned Hashtable has keys which are ITeamProviders, and values
- * which are Lists of IResources that are shared with that provider.
- *
- * @return a hashtable mapping providers to their selected resources
- */
- protected Hashtable getProviderMapping() {
- return getProviderMapping(getSelectedResources());
- }
- /**
- * Convenience method that maps the given resources to their providers.
- * The returned Hashtable has keys which are ITeamProviders, and values
- * which are Lists of IResources that are shared with that provider.
- *
- * @return a hashtable mapping providers to their resources
- */
- protected Hashtable getProviderMapping(IResource[] resources) {
- Hashtable result = new Hashtable();
- for (int i = 0; i < resources.length; i++) {
- RepositoryProvider provider = RepositoryProvider.getProvider(resources[i].getProject());
- List list = (List)result.get(provider);
- if (list == null) {
- list = new ArrayList();
- result.put(provider, list);
- }
- list.add(resources[i]);
- }
- return result;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/UndoCheckOutAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/UndoCheckOutAction.java
deleted file mode 100644
index fa782fe31..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/actions/UndoCheckOutAction.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.eclipse.team.ui.actions;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.team.core.RepositoryProvider;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.internal.simpleAccess.SimpleAccessOperations;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * Action for undoing a previous checkout operation.
- */
-public class UndoCheckOutAction extends TeamAction {
- /*
- * Method declared on IActionDelegate.
- */
- public void run(IAction action) {
- run(new WorkspaceModifyOperation() {
- public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
- try {
- Hashtable table = getProviderMapping();
- Set keySet = table.keySet();
- monitor.beginTask("", keySet.size() * 1000);
- monitor.setTaskName(Policy.bind("UndoCheckOutAction.undoing"));
- Iterator iterator = keySet.iterator();
- while (iterator.hasNext()) {
- IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1000);
- RepositoryProvider provider = (RepositoryProvider)iterator.next();
- List list = (List)table.get(provider);
- IResource[] providerResources = (IResource[])list.toArray(new IResource[list.size()]);
- provider.getSimpleAccess().uncheckout(providerResources, IResource.DEPTH_ZERO, subMonitor);
- }
- } catch (TeamException e) {
- throw new InvocationTargetException(e);
- } finally {
- monitor.done();
- }
- }
- }, Policy.bind("UndoCheckOutAction.undoCheckout"), this.PROGRESS_BUSYCURSOR);
- }
- /**
- * @see TeamAction#isEnabled()
- */
- protected boolean isEnabled() throws TeamException {
- IResource[] resources = getSelectedResources();
- if (resources.length == 0) return false;
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject());
- SimpleAccessOperations ops = provider.getSimpleAccess();
- if (provider == null || ops == null) return false;
- if (!ops.hasRemote(resource)) return false;
- if (!ops.isCheckedOut(resource)) return false;
- }
- return true;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/CatchupReleaseViewer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/CatchupReleaseViewer.java
deleted file mode 100644
index adcaffb7e..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/CatchupReleaseViewer.java
+++ /dev/null
@@ -1,444 +0,0 @@
-package org.eclipse.team.ui.sync;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.util.Iterator;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.structuremergeviewer.DiffTreeViewer;
-import org.eclipse.compare.structuremergeviewer.Differencer;
-import org.eclipse.compare.structuremergeviewer.IDiffContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-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.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.team.core.sync.IRemoteSyncElement;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.UIConstants;
-import org.eclipse.team.ui.TeamUIPlugin;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.views.navigator.ResourceNavigator;
-import org.eclipse.ui.views.navigator.ShowInNavigatorAction;
-
-/**
- * This viewer adds a custom filter and some merge actions.
- * Note this is a layer breaker and needs to be refactored. Viewers should
- * not contain references to workbench actions. Actions should be contributed
- * by the view.
- */
-public abstract class CatchupReleaseViewer extends DiffTreeViewer implements ISelectionChangedListener {
-
- class ShowInNavigatorAction extends Action implements ISelectionChangedListener {
- IViewSite viewSite;
- public ShowInNavigatorAction(IViewSite viewSite, String title) {
- super(title, null);
- this.viewSite = viewSite;
- }
- public void run() {
- showSelectionInNavigator(viewSite);
- }
- public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = (IStructuredSelection)event.getSelection();
- if (selection.size() != 1) {
- setEnabled(false);
- return;
- }
- ITeamNode node = (ITeamNode)selection.getFirstElement();
- setEnabled(node.getResource().isAccessible());
- }
- };
-
- /**
- * This filter hides all empty categories tree nodes.
- */
- class CategoryFilter extends ViewerFilter {
- static final int SHOW_INCOMING = 1;
- static final int SHOW_OUTGOING = 2;
- static final int SHOW_CONFLICTS = 4;
-
- private int showMask = 0;
-
- CategoryFilter(int showMask) {
- // Mask for all categories to show
- this.showMask = showMask;
- }
- int getMask() {
- return showMask;
- }
- void setMask(int mask) {
- this.showMask = mask;
- }
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- // If this element has visible children, always show it.
- // This is not great -- O(n^2) filtering
- if (hasFilteredChildren(element)) {
- return true;
- }
- if (element instanceof ITeamNode) {
- int change = ((ITeamNode)element).getKind() & IRemoteSyncElement.CHANGE_MASK;
- int direction = ((ITeamNode)element).getChangeDirection();
- switch (direction) {
- case ITeamNode.INCOMING:
- return (showMask & SHOW_INCOMING) != 0;
- case ITeamNode.OUTGOING:
- return (showMask & SHOW_OUTGOING) != 0;
- case Differencer.CONFLICTING:
- return (showMask & SHOW_CONFLICTS) != 0;
- default:
- return change != 0;
- }
- }
- // No children are visible, and this folder has no changes, so don't show it.
- return false;
- }
- public boolean isFilterProperty(Object element, String property) {
- return property.equals(PROP_KIND);
- }
- }
- class FilterAction extends Action {
- /**
- * Must subclass constructor to make it accessible to container class
- */
- FilterAction(String title, ImageDescriptor image) {
- super(title, image);
- }
- public void run() {
- updateFilters();
- }
- }
-
- // The current sync mode
- private int syncMode = SyncView.SYNC_NONE;
-
- // Actions
- private FilterAction showIncoming;
- private FilterAction showOutgoing;
- private FilterAction showOnlyConflicts;
- private Action refresh;
- private Action expandAll;
- private ShowInNavigatorAction showInNavigator;
- private Action ignoreWhiteSpace;
-
- // Property constant for diff mode kind
- static final String PROP_KIND = "team.ui.PropKind";
-
-
- /**
- * Creates a new catchup/release viewer.
- */
- protected CatchupReleaseViewer(Composite parent, SyncCompareInput model) {
- super(parent, model.getCompareConfiguration());
- initializeActions(model);
- }
-
- /**
- * Contributes actions to the provided toolbar
- */
- void contributeToActionBars(IActionBars actionBars) {
- IToolBarManager toolBar = actionBars.getToolBarManager();
-
- toolBar.add(new Separator());
- toolBar.add(showOnlyConflicts);
-
- // Drop down menu
- IMenuManager menu = actionBars.getMenuManager();
- if (syncMode == SyncView.SYNC_BOTH) {
- menu.add(showIncoming);
- menu.add(showOutgoing);
- }
- menu.add(ignoreWhiteSpace);
- menu.add(refresh);
- }
-
- /**
- * Contributes actions to the popup menu.
- */
- protected void fillContextMenu(IMenuManager manager) {
- manager.add(expandAll);
- if (showInNavigator != null) {
- manager.add(showInNavigator);
- }
- }
-
- /**
- * Expands to infinity all items in the selection.
- */
- protected void expandSelection() {
- ISelection selection = getSelection();
- if (selection instanceof IStructuredSelection) {
- Iterator elements = ((IStructuredSelection)selection).iterator();
- while (elements.hasNext()) {
- Object next = elements.next();
- expandToLevel(next, ALL_LEVELS);
- }
- }
- }
-
- protected int getSyncMode() {
- return syncMode;
- }
-
- /**
- * Returns true if the given element has filtered children, and false otherwise.
- */
- protected boolean hasFilteredChildren(Object element) {
- return getFilteredChildren(element).length > 0;
- }
-
- /**
- * Creates the actions for this viewer.
- */
- private void initializeActions(final SyncCompareInput diffModel) {
- // Mask actions
- ImageDescriptor image = TeamUIPlugin.getPlugin().getImageDescriptor(UIConstants.IMG_DLG_SYNC_INCOMING);
- showIncoming = new FilterAction(Policy.bind("CatchupReleaseViewer.showIncomingAction"), image);
- showIncoming.setToolTipText(Policy.bind("CatchupReleaseViewer.showIncomingAction"));
-
- image = TeamUIPlugin.getPlugin().getImageDescriptor(UIConstants.IMG_DLG_SYNC_OUTGOING);
- showOutgoing = new FilterAction(Policy.bind("CatchupReleaseViewer.showOutgoingAction"), image);
- showOutgoing.setToolTipText(Policy.bind("CatchupReleaseViewer.showOutgoingAction"));
-
- image = TeamUIPlugin.getPlugin().getImageDescriptor(UIConstants.IMG_DLG_SYNC_CONFLICTING);
-
- //show only conflicts is not a HideAction because it doesnt flip bits, it sets an exact mask
- showOnlyConflicts = new FilterAction(Policy.bind("CatchupReleaseViewer.showOnlyConflictsAction"), image);
- showOnlyConflicts.setToolTipText(Policy.bind("CatchupReleaseViewer.showOnlyConflictsAction"));
-
- //refresh action
- image = TeamUIPlugin.getPlugin().getImageDescriptor(UIConstants.IMG_REFRESH);
- refresh = new Action(Policy.bind("CatchupReleaseViewer.refreshAction"), image) {
- public void run() {
- diffModel.refresh();
- }
- };
- refresh.setToolTipText(Policy.bind("CatchupReleaseViewer.refreshAction"));
-
- // Expand action
- expandAll = new Action(Policy.bind("CatchupReleaseViewer.expand"), null) {
- public void run() {
- expandSelection();
- }
- };
-
- // Show in navigator
- if (diffModel.getViewSite() != null) {
- showInNavigator = new ShowInNavigatorAction(diffModel.getViewSite(), Policy.bind("CatchupReleaseViewer.showInNavigator"));
- addSelectionChangedListener(showInNavigator);
- }
-
- // Ignore white space
- image = TeamUIPlugin.getPlugin().getImageDescriptor(UIConstants.IMG_IGNORE_WHITESPACE);
- ignoreWhiteSpace = new Action(Policy.bind("CatchupReleaseViewer.ignoreWhiteSpace"), image) {
- public void run() {
- Boolean value = isChecked() ? Boolean.TRUE : Boolean.FALSE;
- diffModel.getCompareConfiguration().setProperty(CompareConfiguration.IGNORE_WHITESPACE, value);
- }
- };
- ignoreWhiteSpace.setId("team.ignoreWhiteSpace");
- ignoreWhiteSpace.setChecked(false);
-
- // Add a selection listener to set the left label
- addSelectionChangedListener(this);
-
- // Add a double-click listener for expanding/contracting
- getTree().addListener(SWT.MouseDoubleClick, new Listener() {
- public void handleEvent(Event e) {
- mouseDoubleClicked(e);
- }
- });
-
- // Add an F5 listener for refresh
- getTree().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent e) {
- if (e.keyCode == SWT.F5) {
- diffModel.refresh();
- }
- }
- });
-
- // Set an initial filter -- show all changes
- showIncoming.setChecked(true);
- showOutgoing.setChecked(true);
- showOnlyConflicts.setChecked(false);
- setFilters(CategoryFilter.SHOW_INCOMING| CategoryFilter.SHOW_CONFLICTS | CategoryFilter.SHOW_OUTGOING);
- }
-
- /*
- * Method declared on ContentViewer.
- */
- protected void inputChanged(Object input, Object oldInput) {
- super.inputChanged(input, oldInput);
- // Update the refresh action
- if (refresh != null) {
- Tree tree = getTree();
- if (tree != null) {
- refresh.setEnabled(input != null);
- }
- }
- }
-
- /**
- * Shows the selected resource(s) in the resource navigator.
- */
- private void showSelectionInNavigator(IViewSite viewSite) {
- ISelection selection = getSelection();
- if (!(selection instanceof IStructuredSelection)) {
- return;
- }
- // Create a selection of IResource objects
- Object[] selected = ((IStructuredSelection)selection).toArray();
- IResource[] resources = new IResource[selected.length];
- for (int i = 0; i < selected.length; i++) {
- resources[i] = ((ITeamNode)selected[i]).getResource();
- }
- ISelection resourceSelection = new StructuredSelection(resources);
-
- // Show the resource selection in the navigator
- try {
- IViewPart part = viewSite.getPage().showView(IPageLayout.ID_RES_NAV);
- if (part instanceof ResourceNavigator) {
- ((ResourceNavigator)part).selectReveal(resourceSelection);
- }
- } catch (PartInitException e) {
- TeamUIPlugin.log(e.getStatus());
- }
- }
-
- /**
- * The mouse has been double-clicked in the tree, perform appropriate
- * behaviour.
- */
- private void mouseDoubleClicked(Event e) {
- // Only act on single selection
- ISelection selection = getSelection();
- if (selection instanceof IStructuredSelection) {
- IStructuredSelection structured = (IStructuredSelection)selection;
- if (structured.size() == 1) {
- Object first = structured.getFirstElement();
- if (first instanceof IDiffContainer) {
- // Try to expand/contract
- setExpandedState(first, !getExpandedState(first));
- }
- }
- }
- }
-
- /**
- * Notifies that the selection has changed.
- *
- * @param event event object describing the change
- */
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (!selection.isEmpty() && selection instanceof IStructuredSelection) {
- IStructuredSelection structured = (IStructuredSelection)selection;
- Object selected = structured.getFirstElement();
- if (selected instanceof TeamFile) {
- updateLabels(((TeamFile)selected).getMergeResource());
- }
- }
- }
-
- /**
- * Subclasses may override to provide different labels for the compare configuration.
- */
- protected void updateLabels(MergeResource resource) {
- resource.setLabels(getCompareConfiguration());
- }
-
- /**
- * Set the filter mask to be the exact mask specified.
- */
- private void setFilters(int maskToHide) {
- ViewerFilter[] filters = getFilters();
- if (filters != null) {
- for (int i = 0; i < filters.length; i++) {
- if (filters[i] instanceof CategoryFilter) {
- CategoryFilter filter = (CategoryFilter)filters[i];
- // Set the exact match to be applied on the filter
- filter.setMask(maskToHide);
- refresh();
- return;
- }
- }
- }
- // No category filter found -- add one
- addFilter(new CategoryFilter(maskToHide));
- }
-
- /**
- * The sync mode has changed. Update the filters.
- */
- public void syncModeChanged(int mode) {
- this.syncMode = mode;
- updateFilters();
- }
-
- /**
- * Sets the viewer filtering based on the current state
- * of the filter actions.
- */
- void updateFilters() {
- //do nothing if viewer is disposed
- Control control = getControl();
- if (control == null || control.isDisposed())
- return;
-
- //always show conflicts
- int filters = CategoryFilter.SHOW_CONFLICTS;
-
- //determine what other filters to apply based on current action states
- switch (syncMode) {
- case SyncView.SYNC_INCOMING:
- case SyncView.SYNC_MERGE:
- if (!showOnlyConflicts.isChecked()) {
- filters |= CategoryFilter.SHOW_INCOMING;
- }
- break;
- case SyncView.SYNC_OUTGOING:
- if (!showOnlyConflicts.isChecked()) {
- filters |= CategoryFilter.SHOW_OUTGOING;
- }
- break;
- case SyncView.SYNC_BOTH:
- boolean conflictsOnly = showOnlyConflicts.isChecked();
- //if showing only conflicts, don't allow these actions to happen
- showIncoming.setEnabled(!conflictsOnly);
- showOutgoing.setEnabled(!conflictsOnly);
- if (!conflictsOnly) {
- if (showIncoming.isChecked()) {
- filters |= CategoryFilter.SHOW_INCOMING;
- }
- if (showOutgoing.isChecked()) {
- filters |= CategoryFilter.SHOW_OUTGOING;
- }
- }
- break;
- }
- setFilters(filters);
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ChangedTeamContainer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ChangedTeamContainer.java
deleted file mode 100644
index e90ebbb74..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ChangedTeamContainer.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.eclipse.team.ui.sync;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.compare.structuremergeviewer.Differencer;
-import org.eclipse.compare.structuremergeviewer.IDiffContainer;
-import org.eclipse.compare.structuremergeviewer.IDiffElement;
-
-/**
- * A node in a sync tree that represents a changed folder
- * (incoming/outgoing creation or deletion).
- */
-public class ChangedTeamContainer extends UnchangedTeamContainer {
- private MergeResource mergeResource;
-
- /**
- * ChangedTeamContainer constructor
- */
- public ChangedTeamContainer(IDiffContainer parent, MergeResource resource, int description) {
- super(parent, resource.getResource(), description);
- this.mergeResource = resource;
- }
-
- /*
- * Method declared on ITeamNode.
- */
- public int getChangeDirection() {
- return getKind() & Differencer.DIRECTION_MASK;
- }
-
- public String getName() {
- return mergeResource.getName();
- }
-
- /**
- * Returns the team resource managed by this object.
- */
- public MergeResource getMergeResource() {
- return mergeResource;
- }
-
- /*
- * Method declared on IDiffContainer
- */
- public void removeToRoot(IDiffElement child) {
- // Don't want to remove empty changed containers
- remove(child);
- }
-
- /**
- * For debugging purposes only.
- */
- public String toString() {
- return "ChangedTeamContainer(" + getResource().getName() + ")";
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ITeamNode.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ITeamNode.java
deleted file mode 100644
index 70f6e5f02..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/ITeamNode.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.eclipse.team.ui.sync;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.compare.structuremergeviewer.Differencer;
-import org.eclipse.compare.structuremergeviewer.IDiffElement;
-import org.eclipse.core.resources.IResource;
-
-/**
- * Interface for a sync node that responds to team commands.
- */
-public interface ITeamNode extends IDiffElement {
- // Possible values for the change direction
- static final int INCOMING = Differencer.RIGHT;
- static final int OUTGOING = Differencer.LEFT;
- static final int CONFLICTING = Differencer.CONFLICTING;
- static final int NO_CHANGE = Differencer.NO_CHANGE;
-
- /**
- * Returns the change direction for this resource. One of:
- * INCOMING, OUTGOING, CONFLICTING, NO_CHANGE.
- */
- public int getChangeDirection();
-
- /**
- * Returns the type of change for this resource. One of:
- * CHANGE, DELETION, ADDITION
- */
- public int getChangeType();
-
- /**
- * Returns the core resource represented by this node.
- */
- public IResource getResource();
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/MergeResource.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/MergeResource.java
deleted file mode 100644
index c5249aa2f..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/MergeResource.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package org.eclipse.team.ui.sync;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.InputStream;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.ITypedElement;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-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.ui.Policy;
-
-/**
- * Encapsulates information about a resource that requires
- * contact with the Team API.
- */
-public class MergeResource {
- private IRemoteSyncElement syncTree;
-
- /**
- * Creates a new merge resource based on the given sync information.
- */
- public MergeResource(IRemoteSyncElement syncTree) {
- this.syncTree = syncTree;
- }
-
- /**
- * The user has manually merged contents from the server into
- * the local resource. Clear the incoming changes from the server.
- */
- public void confirmMerge() {
- // manager.confirmMerge(syncTree.getResource());
- }
-
- /**
- * Returns an InputStream for the base revision of this incoming resource.
- */
- public InputStream getBaseRevision() throws CoreException {
- IRemoteResource remote = syncTree.getBase();
- if (remote != null && !remote.isContainer()) {
- try {
- return remote.getContents(new NullProgressMonitor());
- } catch (TeamException exception) {
- // The remote resource has gone.
- return null;
- }
- }
- return null;
- }
-
- public String getExtension() {
- if (syncTree.isContainer()) {
- return ITypedElement.FOLDER_TYPE;
- }
- String name = getName();
- if (name != null) {
- int index = name.lastIndexOf('.');
- if (index == -1)
- return "";
- if (index == (name.length() - 1))
- return "";
- return name.substring(index + 1);
- }
- return ITypedElement.FOLDER_TYPE;
- }
-
- /**
- * Returns an InputStream for the latest repository version of this incoming resource.
- */
- public InputStream getLatestRevision() throws CoreException {
- IRemoteResource remote = syncTree.getRemote();
- try {
- return remote.getContents(new NullProgressMonitor());
- } catch (TeamException e) {
- throw new CoreException(e.getStatus());
- }
- }
-
- /**
- * Returns an InputStream for the local resource.
- */
- public InputStream getLocalStream() throws CoreException {
- IResource left = syncTree.getLocal();
- if (left == null) return null;
- if (left.exists() && left.getType() == IResource.FILE) {
- return ((IFile)left).getContents(true);
- }
- return null;
- }
-
- public String getName() {
- return syncTree.getName();
- }
-
- /*
- * @see IMergeResource#getResource.
- */
- public IResource getResource() {
- return syncTree.getLocal();
- }
-
- public IRemoteSyncElement getSyncElement() {
- return syncTree;
- }
-
- /**
- * Returns true if this merge resource has a base resource,
- * and false otherwise.
- */
- public boolean hasBaseRevision() {
- return syncTree.getBase() != null;
- }
-
- /**
- * Returns true if this merge resource has a latest revision,
- * and false otherwise.
- */
- public boolean hasLatestRevision() {
- return syncTree.getRemote() != null;
- }
-
- /**
- * Is this a leaf node, i.e. a file?
- */
- public boolean isLeaf() {
- return !syncTree.isContainer();
- }
-
- /**
- * Updates the given compare configuration with appropriate left, right
- * and ancestor labels for this resource.
- */
- public void setLabels(CompareConfiguration config) {
- String name = getName();
- config.setLeftLabel(Policy.bind("MergeResource.workspaceFile", name));
-
-
- IRemoteResource remote = syncTree.getRemote();
- if (remote != null) {
- config.setRightLabel(Policy.bind("MergeResource.repositoryFile", name));
- // config.setRightLabel(TeamUIPlugin.getResourceString("MergeResource.repositoryFile", new Object[] {name, remote.getVersionName()} ));
- } else {
- config.setRightLabel(Policy.bind("MergeResource.noRepositoryFile"));
- }
-
- IRemoteResource base = syncTree.getBase();
- if (base != null) {
- config.setAncestorLabel(Policy.bind("MergeResource.commonFile", name));
- // config.setAncestorLabel(TeamUIPlugin.getResourceString("MergeResource.commonFile", new Object[] {name, common.getVersionName()} ));
- } else {
- config.setAncestorLabel(Policy.bind("MergeResource.noCommonFile"));
- }
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncCompareInput.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncCompareInput.java
deleted file mode 100644
index af5011953..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncCompareInput.java
+++ /dev/null
@@ -1,383 +0,0 @@
-package org.eclipse.team.ui.sync;
-
-/*
- * (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.structuremergeviewer.DiffContainer;
-import org.eclipse.compare.structuremergeviewer.DiffNode;
-import org.eclipse.compare.structuremergeviewer.Differencer;
-import org.eclipse.compare.structuremergeviewer.ICompareInput;
-import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;
-import org.eclipse.compare.structuremergeviewer.IDiffContainer;
-import org.eclipse.compare.structuremergeviewer.IDiffElement;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.sync.ILocalSyncElement;
-import org.eclipse.team.core.sync.IRemoteSyncElement;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.ui.TeamUIPlugin;
-import org.eclipse.ui.IViewSite;
-
-/**
- * Performs a catchup or release operation on an array of resources.
- */
-public abstract class SyncCompareInput extends CompareEditorInput {
- private IRemoteSyncElement[] trees;
- private CatchupReleaseViewer catchupReleaseViewer;
- private DiffNode diffRoot;
- private Shell shell;
- private IViewSite viewSite;
-
- private ICompareInputChangeListener listener = new ICompareInputChangeListener() {
- public void compareInputChanged(ICompareInput source) {
- SyncCompareInput.this.compareInputChanged(source);
- }
- };
-
- /**
- * Subclasses may override but must call super.
- */
- protected void compareInputChanged(ICompareInput source) {
- catchupReleaseViewer.update(source, new String[] {CatchupReleaseViewer.PROP_KIND});
- updateStatusLine();
- }
-
- /**
- * Creates a new catchup or release operation.
- */
- public SyncCompareInput() {
- super(new CompareConfiguration());
- }
-
- protected abstract IRemoteSyncElement[] createSyncElements(IProgressMonitor monitor) throws TeamException;
-
- /*
- * @see CompareEditorInput#createContents
- */
- public Control createContents(Composite parent) {
- Control result = super.createContents(parent);
- initialSelectionAndExpansionState();
- return result;
- }
-
- /**
- * Subclasses must create and return a new CatchupReleaseViewer, and set the viewer
- * using setViewer().
- */
- public abstract Viewer createDiffViewer(Composite parent);
-
- /**
- * Returns the root node of the diff tree.
- */
- public DiffNode getDiffRoot() {
- return diffRoot;
- }
-
- /**
- * Returns the first diff element that is still unresolved in the
- * subtree rooted at the given root element.
- * Returns null if everything is resolved.
- */
- private IDiffElement getFirstChange(IDiffElement root) {
- if (root instanceof ITeamNode) {
- ITeamNode node = (ITeamNode)root;
- if (node instanceof TeamFile) {
- return node;
- }
- }
- if (root instanceof IDiffContainer) {
- IDiffElement[] children = ((IDiffContainer)root).getChildren();
- IDiffElement result = null;
- for (int i = 0; i < children.length; i++) {
- result = getFirstChange(children[i]);
- if (result != null) {
- return result;
- }
- }
- }
- return null;
- }
-
- protected Shell getShell() {
- return shell;
- }
-
- /**
- * Returns the name of this operation.
- * It is dipslayed in the CompareEditor's title bar.
- */
- public String getTitle() {
- return Policy.bind("SyncCompareInput.synchronize");
- }
-
- /**
- * Returns the compare viewer;
- */
- public CatchupReleaseViewer getViewer() {
- return catchupReleaseViewer;
- }
-
- /**
- * Returns the view site, or null if this is a merge.
- */
- public IViewSite getViewSite() {
- return viewSite;
- }
-
- /**
- * Returns true if the model has incoming or conflicting changes.
- */
- boolean hasIncomingChanges() {
- if (diffRoot == null) {
- return false;
- }
- SyncSet set = new SyncSet(new StructuredSelection(diffRoot.getChildren()));
- return set.hasIncomingChanges() || set.hasConflicts();
- }
-
- /**
- * Set an appropriate initial selection and expansion state.
- */
- private void initialSelectionAndExpansionState() {
- // Select the next change
- IDiffElement next = getFirstChange(diffRoot);
- if (next != null) {
- catchupReleaseViewer.setSelection(new StructuredSelection(next), true);
- } else {
- catchupReleaseViewer.collapseAll();
- catchupReleaseViewer.setSelection(new StructuredSelection());
- }
- }
-
- /**
- * Returns true if we have unsaved changes.
- */
- public boolean isSaveNeeded() {
- // All changes take effect immediately, so never need to save.
- return diffRoot.hasChildren();
- }
-
- /**
- * Performs a compare on the given selection.
- * This method is called before the CompareEditor has been opened.
- * If the result of the diff is empty (or an error has occured)
- * no CompareEditor is opened but an Alert is shown.
- */
- public Object prepareInput(final IProgressMonitor pm) throws InterruptedException, InvocationTargetException {
- if (pm.isCanceled()) {
- throw new InterruptedException();
- }
-
- try {
- pm.beginTask(Policy.bind("SyncCompareInput.taskTitle"), 100);
-
- // Estimate 70% of the time is creating the sync elements
- this.trees = createSyncElements(Policy.subMonitorFor(pm, 70));
- setMessage(null);
- if (trees.length == 0) {
- return null;
- }
- final InterruptedException[] exceptions = new InterruptedException[1];
-
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- // collect changes and build the diff tree
- diffRoot = new DiffNode(0);
- try {
- doServerDelta(monitor);
- } catch (InterruptedException e) {
- exceptions[0] = e;
- }
- }
- };
- if (pm.isCanceled()) {
- throw new InterruptedException();
- }
- // Estimate 30% of the time is doing the server delta
- ResourcesPlugin.getWorkspace().run(runnable, Policy.subMonitorFor(pm, 30));
- if (exceptions[0] != null) throw exceptions[0];
- if (pm.isCanceled()) {
- throw new InterruptedException();
- }
-
- if (!diffRoot.hasChildren()) {
- diffRoot = null;
- }
-
- updateStatusLine();
-
- return diffRoot;
- } catch (CoreException e) {
- throw new InvocationTargetException(e);
- } catch (TeamException e) {
- throw new InvocationTargetException(e);
- }
- }
-
- void doServerDelta(IProgressMonitor pm) throws InterruptedException {
- pm.beginTask("", trees.length * 1000);
- pm.setTaskName(Policy.bind("SyncCompareInput.taskTitle"));
- for (int i = 0; i < trees.length; i++) {
- IRemoteSyncElement tree = trees[i];
- IDiffElement localRoot = collectResourceChanges(null, tree, Policy.subMonitorFor(pm, 1000));
- makeParents(localRoot);
- }
- }
-
- IDiffElement collectResourceChanges(IDiffContainer parent, IRemoteSyncElement tree, IProgressMonitor pm) {
- int type = tree.getSyncKind(getSyncGranularity(), pm);
- MergeResource mergeResource = new MergeResource(tree);
-
- if (tree.isContainer()) {
- IDiffContainer element = new ChangedTeamContainer(parent, mergeResource, type);
- try {
- ILocalSyncElement[] children = tree.members(pm);
- for (int i = 0; i < children.length; i++) {
- collectResourceChanges(element, (IRemoteSyncElement)children[i], pm);
- }
- } catch (TeamException e) {
- TeamUIPlugin.log(e.getStatus());
- }
- return element;
- } else {
- TeamFile file = new TeamFile(parent, mergeResource, type);
- file.addCompareInputChangeListener(listener);
- return file;
- }
- }
-
- protected abstract int getSyncGranularity();
-
- /**
- * Builds a DiffFolder tree under the given root for the given resource.
- */
- private DiffContainer buildPath(DiffContainer root, IContainer resource) {
- DiffContainer parent = root;
- if (resource.getType() == IResource.ROOT) {
- return root;
- }
- if (resource.getType() != IResource.PROJECT) {
- parent = buildPath(root, resource.getParent());
- }
-
- DiffContainer c = (DiffContainer)parent.findChild(resource.getName());
- if (c == null) {
- c = new UnchangedTeamContainer(parent, resource);
- }
- return c;
- }
-
- void makeParents(IDiffElement element) {
- IContainer parent = ((ITeamNode)element).getResource().getParent();
- DiffContainer container = buildPath(diffRoot, parent);
- container.add(element);
- }
-
- /**
- * Performs a refresh, with progress and cancelation.
- */
- public void refresh() {
- final Object[] input = new Object[1];
- IRunnableWithProgress op = new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- input[0] = prepareInput(monitor);
- }
- };
- try {
- run(op, Policy.bind("SyncCompareInput.refresh"));
- } catch (InterruptedException e) {
- return;
- }
-
- catchupReleaseViewer.setInput(input[0]);
- if (input[0] == null) {
- MessageDialog.openInformation(shell, Policy.bind("nothingToSynchronize"), Policy.bind("SyncCompareInput.nothingText"));
- }
- }
-
- protected void run(IRunnableWithProgress op, String problemMessage) throws InterruptedException {
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
- try {
- dialog.run(true, true, op);
- } catch (InvocationTargetException e) {
- Throwable throwable = e.getTargetException();
- IStatus error = null;
- if (throwable instanceof CoreException) {
- error = ((CoreException)throwable).getStatus();
- } else {
- error = new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, Policy.bind("simpleInternal") , throwable);
- }
- ErrorDialog.openError(shell, problemMessage, error.getMessage(), error);
- TeamUIPlugin.log(error);
- }
- }
-
- public void setViewSite(IViewSite viewSite) {
- this.viewSite = viewSite;
- this.shell = viewSite.getShell();
- }
-
- public void setViewer(CatchupReleaseViewer viewer) {
- this.catchupReleaseViewer = viewer;
- }
-
- /**
- * Updates the status line.
- */
- protected void updateStatusLine() {
- if (viewSite != null && !shell.isDisposed()) {
- Runnable update = new Runnable() {
- public void run() {
- if (!shell.isDisposed()) {
- IStatusLineManager statusLine = viewSite.getActionBars().getStatusLineManager();
- if (diffRoot == null) {
- statusLine.setMessage(null);
- statusLine.setErrorMessage(null);
- return;
- }
- SyncSet set = new SyncSet(new StructuredSelection(diffRoot.getChildren()));
- if (set.hasConflicts()) {
- statusLine.setMessage(null);
- statusLine.setErrorMessage(set.getStatusLineMessage());
- } else {
- statusLine.setErrorMessage(null);
- statusLine.setMessage(set.getStatusLineMessage());
- }
- viewSite.getActionBars().updateActionBars();
- }
- }
- };
- // Post or run the update
- if (shell.getDisplay() != Display.getCurrent()) {
- shell.getDisplay().asyncExec(update);
- } else {
- update.run();
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncSet.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncSet.java
deleted file mode 100644
index c595c95c8..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncSet.java
+++ /dev/null
@@ -1,270 +0,0 @@
-package org.eclipse.team.ui.sync;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2002.
- * All Rights Reserved.
- */
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.compare.structuremergeviewer.Differencer;
-import org.eclipse.compare.structuremergeviewer.IDiffContainer;
-import org.eclipse.compare.structuremergeviewer.IDiffElement;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.team.core.sync.IRemoteSyncElement;
-import org.eclipse.team.internal.ui.Policy;
-
-/**
- * This class contains a set of resources that are slated to be
- * synchronized. It performs various operations on the
- * set in preparation for catchup/release.
- */
-public class SyncSet {
- private HashSet set;
-
- /**
- * Creates a new sync set on the nodes in the given selection.
- */
- public SyncSet(IStructuredSelection nodeSelection) {
- this.set = new HashSet(nodeSelection.size() + 1);
- collectNodes(nodeSelection);
- }
-
- /**
- * Collects all nodes to which this action will apply. This means
- * all nodes in the selection, plus all their children.
- */
- private void collectNodes(IStructuredSelection selection) {
- Object[] nodes = selection.toArray();
- for (int i = 0; i < nodes.length; i++) {
- recursivelyAdd((ITeamNode)nodes[i]);
- }
- }
-
- /**
- * Adds all parent creations for the given node to the sync set.
- */
- private void collectParentCreations(ITeamNode node) {
- IDiffElement parent = node.getParent();
- if (parent != null && parent instanceof ITeamNode) {
- if (parent.getKind() != IRemoteSyncElement.IN_SYNC) {
- set.add(parent);
- collectParentCreations((ITeamNode)parent);
- }
- }
- }
-
- /**
- * Returns all nodes in the set that have changes
- */
- public ITeamNode[] getChangedNodes() {
- ArrayList nodeList = new ArrayList(set.size());
- for (Iterator it = set.iterator(); it.hasNext();) {
- ITeamNode node = (ITeamNode)it.next();
- int dir = node.getChangeDirection();
- // We assume changed nodes of the wrong type have been culled
- // during set creation.
- if (dir != Differencer.NO_CHANGE) {
- nodeList.add(node);
- }
- }
- ITeamNode[] nodes = new ITeamNode[nodeList.size()];
- nodeList.toArray(nodes);
- return nodes;
- }
-
- /**
- * Returns the resources from all the nodes in this set.
- */
- public IResource[] getResources() {
- ITeamNode[] changed = getChangedNodes();
- IResource[] resources = new IResource[changed.length];
- for (int i = 0; i < changed.length; i++) {
- resources[i] = changed[i].getResource();
- }
- return resources;
- }
-
- /**
- * Returns a message for the status line describing this sync set.
- */
- public String getStatusLineMessage() {
- int incoming = 0;
- int outgoing = 0;
- int conflicts = 0;
- for (Iterator it = set.iterator(); it.hasNext();) {
- ITeamNode next = (ITeamNode)it.next();
- switch (next.getChangeDirection()) {
- case IRemoteSyncElement.INCOMING:
- incoming++;
- break;
- case IRemoteSyncElement.OUTGOING:
- outgoing++;
- break;
- case IRemoteSyncElement.CONFLICTING:
- conflicts++;
- break;
- }
- }
- StringBuffer result = new StringBuffer();
-
- if (conflicts == 0) {
- result.append(Policy.bind("SyncSet.noConflicts"));
- } else {
- result.append(Policy.bind("SyncSet.conflicts", new Object[] {Integer.toString(conflicts)} ));
- }
- if (incoming == 0) {
- result.append(Policy.bind("SyncSet.noIncomings"));
- } else {
- result.append(Policy.bind("SyncSet.incomings", new Object[] {Integer.toString(incoming)} ));
- }
- if (outgoing == 0) {
- result.append(Policy.bind("SyncSet.noOutgoings"));
- } else {
- result.append(Policy.bind("SyncSet.outgoings", new Object[] {Integer.toString(outgoing)} ));
- }
- return result.toString();
- }
-
- /**
- * Returns true if there are any conflicting nodes in the set, and
- * false otherwise.
- */
- public boolean hasConflicts() {
- for (Iterator it = set.iterator(); it.hasNext();) {
- if (((ITeamNode)it.next()).getChangeDirection() == IRemoteSyncElement.CONFLICTING) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns true if this sync set has incoming changes.
- * Note that conflicts are not considered to be incoming changes.
- */
- public boolean hasIncomingChanges() {
- for (Iterator it = set.iterator(); it.hasNext();) {
- if (((ITeamNode)it.next()).getChangeDirection() == IRemoteSyncElement.INCOMING) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns true if this sync set has outgoing changes.
- * Note that conflicts are not considered to be outgoing changes.
- */
- public boolean hasOutgoingChanges() {
- for (Iterator it = set.iterator(); it.hasNext();) {
- if (((ITeamNode)it.next()).getChangeDirection() == IRemoteSyncElement.OUTGOING) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns true if this sync set has auto-mergeable conflicts.
- */
- public boolean hasAutoMergeableConflicts() {
- for (Iterator it = set.iterator(); it.hasNext();) {
- ITeamNode node = (ITeamNode)it.next();
- if ((node.getKind() & IRemoteSyncElement.AUTOMERGE_CONFLICT) != 0) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Adds the given node, plus all its children, to the given set.
- */
- private void recursivelyAdd(ITeamNode node) {
- // Add the node and recurse
- if (set.add(node)) {
- if (node instanceof IDiffContainer) {
- IDiffElement[] children = ((IDiffContainer)node).getChildren();
- for (int i = 0; i < children.length; i++) {
- if (children[i] instanceof ITeamNode) {
- recursivelyAdd((ITeamNode)children[i]);
- }
- }
- }
- // Add any created parents (can't release or load a
- // resource creation without including new parents)
- collectParentCreations(node);
- }
- }
-
- /**
- * Removes all conflicting nodes from this set.
- */
- public void removeConflictingNodes() {
- for (Iterator it = set.iterator(); it.hasNext();) {
- ITeamNode node = (ITeamNode)it.next();
- if (node.getChangeDirection() == IRemoteSyncElement.CONFLICTING) {
- it.remove();
- }
- }
- }
- /**
- * Removes all outgoing nodes from this set.
- */
- public void removeOutgoingNodes() {
- for (Iterator it = set.iterator(); it.hasNext();) {
- ITeamNode node = (ITeamNode)it.next();
- if (node.getChangeDirection() == IRemoteSyncElement.OUTGOING) {
- it.remove();
- }
- }
- }
- /**
- * Removes all incoming nodes from this set.
- */
- public void removeIncomingNodes() {
- for (Iterator it = set.iterator(); it.hasNext();) {
- ITeamNode node = (ITeamNode)it.next();
- if (node.getChangeDirection() == IRemoteSyncElement.INCOMING) {
- it.remove();
- }
- }
- }
- /**
- * Removes all conflicting nodes from this set that are not auto-mergeable
- */
- public void removeNonMergeableNodes() {
- for (Iterator it = set.iterator(); it.hasNext();) {
- ITeamNode node = (ITeamNode)it.next();
- if ((node.getKind() & IRemoteSyncElement.MANUAL_CONFLICT) != 0) {
- it.remove();
- }
- }
- }
-
- /**
- * Removes all nodes that aren't applicable for the direction.
- */
- public void removeNonApplicableNodes(int direction) {
- for (Iterator it = set.iterator(); it.hasNext();) {
- ITeamNode node = (ITeamNode)it.next();
- int nodeDirection = node.getKind() & IRemoteSyncElement.DIRECTION_MASK;
- if (nodeDirection != IRemoteSyncElement.CONFLICTING) {
- if (nodeDirection != direction) {
- it.remove();
- }
- }
- }
- }
-
- /**
- * Remove the given node from the sync set
- */
- public void remove(ITeamNode node) {
- set.remove(node);
- }
-}
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
deleted file mode 100644
index 1ea10c5ed..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/SyncView.java
+++ /dev/null
@@ -1,354 +0,0 @@
-package org.eclipse.team.ui.sync;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.compare.structuremergeviewer.DiffNode;
-import org.eclipse.compare.structuremergeviewer.IDiffElement;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.team.core.TeamException;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.team.internal.ui.UIConstants;
-import org.eclipse.team.ui.TeamUIPlugin;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * This class provides a view for performing synchronizations
- * between the local workspace and a repository.
- */
-public class SyncView extends ViewPart {
- public static final String VIEW_ID = "org.eclipse.team.ui.sync.SyncView";
- private SyncCompareInput input;
- private TreeViewer viewer;
- private Composite top;
-
- // The possible sync modes
- public static final int SYNC_NONE = 0;
- public static final int SYNC_INCOMING = 1;
- public static final int SYNC_OUTGOING = 2;
- public static final int SYNC_BOTH = 3;
- public static final int SYNC_MERGE = 4;
-
- // Titles cached for efficiency
- private final String CATCHUP_TITLE = Policy.bind("SyncView.incomingModeTitle");
- private final String RELEASE_TITLE = Policy.bind("SyncView.outgoingModeTitle");
- private final String FREE_TITLE = Policy.bind("SyncView.freeModeTitle");
-
- private int currentSyncMode = SYNC_NONE;
-
- /**
- * Action for toggling the sync mode.
- */
- class SyncModeAction extends Action {
- // The sync mode that this action enables
- private int syncMode;
- public SyncModeAction(String title, ImageDescriptor image, int mode) {
- super(title, image);
- this.syncMode = mode;
- }
- public void run() {
- SyncView.this.setSyncMode(syncMode);
- }
- }
-
- private SyncModeAction incomingMode;
- private SyncModeAction outgoingMode;
- private SyncModeAction freeMode;
-
- /**
- * Creates a new view.
- */
- public SyncView() {
- super();
- }
-
- /*
- * @see IWorkbenchPart#createPartControl
- */
- public void createPartControl(Composite parent) {
- top = new Composite(parent, SWT.NONE);
-
- //XXX Set the control data to be this part, so the compare
- //frames that will eventually live in this widget hierarchy
- //have some way to access the action bars for hooking global
- //actions. See corresponding XXX comment in CompareEditor#findActionBars
- top.setData(this);
-
- GridLayout layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- top.setLayout(layout);
- top.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- showDefaultContents();
-
- initializeSyncModes();
- }
-
- /**
- * Makes the sync view visible in the active perspective. If there
- * isn't a sync view registered <code>null</code> is returned.
- * Otherwise the opened view part is returned.
- */
- public static SyncView findInActivePerspective() {
- try {
- IViewPart part = TeamUIPlugin.getActivePage().findView(VIEW_ID);
- if (part == null) {
- part = TeamUIPlugin.getActivePage().showView(VIEW_ID);
- }
- return (SyncView)part;
- } catch (PartInitException pe) {
- return null;
- }
- }
-
- /**
- * Sets up the sync modes and the actions for switching between them.
- */
- private void initializeSyncModes() {
- // Create the actions
- incomingMode = new SyncModeAction(
- Policy.bind("SyncView.incomingModeAction"),
- TeamUIPlugin.getPlugin().getImageDescriptor(UIConstants.IMG_SYNC_MODE_CATCHUP),
- SYNC_INCOMING);
- incomingMode.setToolTipText(Policy.bind("SyncView.incomingModeToolTip"));
- incomingMode.setChecked(false);
-
- outgoingMode = new SyncModeAction(
- Policy.bind("SyncView.outgoingModeAction"),
- TeamUIPlugin.getPlugin().getImageDescriptor(UIConstants.IMG_SYNC_MODE_RELEASE),
- SYNC_OUTGOING);
- outgoingMode.setToolTipText(Policy.bind("SyncView.outgoingModeToolTip"));
- outgoingMode.setChecked(false);
-
- freeMode = new SyncModeAction(
- Policy.bind("SyncView.freeModeAction"),
- TeamUIPlugin.getPlugin().getImageDescriptor(UIConstants.IMG_SYNC_MODE_FREE),
- SYNC_BOTH);
- freeMode.setToolTipText(Policy.bind("SyncView.freeModeToolTip"));
- freeMode.setChecked(false);
- }
-
- 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;
- }
- return true;
- }
- private boolean isEmpty(IDiffElement element) {
- if (element.getKind() != 0) return false;
- if (element instanceof DiffNode) {
- IDiffElement[] children = ((DiffNode)element).getChildren();
- for (int i = 0; i < children.length; i++) {
- if (!isEmpty(children[i])) return false;
- }
- }
- return true;
- }
-
- /**
- * Runs an operation and handles progress and exceptions. Returns true
- * if the operation was successful, and false if there were errors or
- * the user canceled.
- */
- private boolean run(IRunnableWithProgress op) {
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(getSite().getShell());
- try {
- dialog.run(true, true, op);
- return true;
- } catch (InvocationTargetException e) {
- Throwable throwable = e.getTargetException();
- IStatus error = null;
- if (throwable instanceof TeamException) {
- error = ((TeamException)throwable).getStatus();
- } else if (throwable instanceof CoreException) {
- error = ((CoreException)throwable).getStatus();
- } else {
- error = new Status(IStatus.ERROR, TeamUIPlugin.ID, 1, Policy.bind("simpleInternal"), throwable);
- }
- ErrorDialog.openError(getSite().getShell(), Policy.bind("SyncView.unableSynchronize"), null, error);
- TeamUIPlugin.log(error);
- } catch (InterruptedException e) {
- }
- return false;
- }
-
- /**
- * Asks the part to take focus within the workbench.
- */
- public void setFocus() {
- if (top != null && !top.isDisposed()) {
- top.setFocus();
- }
- }
-
- /**
- * Activates the given sync mode.
- */
- void setSyncMode(int mode) {
- // Implement radio button behaviour
- switch (mode) {
- case SYNC_INCOMING:
- incomingMode.setChecked(true);
- outgoingMode.setChecked(false);
- freeMode.setChecked(false);
- setTitle(CATCHUP_TITLE);
- break;
- case SYNC_OUTGOING:
- outgoingMode.setChecked(true);
- incomingMode.setChecked(false);
- freeMode.setChecked(false);
- setTitle(RELEASE_TITLE);
- break;
- case SYNC_BOTH:
- freeMode.setChecked(true);
- outgoingMode.setChecked(false);
- incomingMode.setChecked(false);
- setTitle(FREE_TITLE);
- break;
- }
- // Only update actions if there is valid input
- if (input != null && input.getDiffRoot() != null && mode != currentSyncMode) {
- currentSyncMode = mode;
- input.getViewer().syncModeChanged(mode);
- updateActions();
- }
- }
-
- /**
- * Shows default contents for the view if there is nothing to synchronize.
- */
- private void showDefaultContents() {
- Label label = new Label(top, SWT.WRAP);
- label.setLayoutData(new GridData(GridData.FILL_BOTH));
- label.setText(Policy.bind("SyncView.text"));
- }
-
- /**
- * Shows synchronization information for the given resources in the sync view.
- */
- public void showSync(SyncCompareInput input) {
- input.setViewSite(getViewSite());
- this.input = input;
- currentSyncMode = SYNC_NONE;
-
- // Remove old viewer
- Control[] oldChildren = top.getChildren();
- if (oldChildren != null) {
- for (int i = 0; i < oldChildren.length; i++) {
- oldChildren[i].dispose();
- }
- }
- // Remove actions from toolbar
- IActionBars bars = getViewSite().getActionBars();
- bars.getToolBarManager().removeAll();
- bars.getToolBarManager().update(false);
- bars.getMenuManager().removeAll();
- bars.getMenuManager().update();
- bars.updateActionBars();
-
- // Display the default contents while running the diff
- showDefaultContents();
- top.layout();
-
- // Run the diff and stop if cancel or error occurred.
- if (!run(input)) return;
-
- // Check for problem message
- if (input.getMessage() != null) {
- MessageDialog.openInformation(getSite().getShell(), Policy.bind("SyncView.unableSynchronize"), input.getMessage());
- return;
- }
-
- // Check for empty comparison
- if (isEmpty(input.getDiffRoot())) {
- MessageDialog.openInformation(getSite().getShell(), Policy.bind("nothingToSynchronize"), Policy.bind("SyncView.same"));
- return;
- }
-
- // Remove the default contents
- oldChildren = top.getChildren();
- if (oldChildren != null) {
- for (int i = 0; i < oldChildren.length; i++) {
- oldChildren[i].dispose();
- }
- }
-
- // Show the result
- Control control = input.createContents(top);
- control.setLayoutData(new GridData(GridData.FILL_BOTH));
- /*TreeViewer viewer = input.getViewer();
- if (viewer != null) {
- Control viewerControl = viewer.getControl();
- if (viewerControl != null && !viewerControl.isDisposed()) {
- WorkbenchHelp.setHelp(viewerControl, new ViewContextComputer(this, ITeamHelpContextIds.SYNC_VIEW));
- }
- }*/
-
- top.layout();
-
- // Set the sync mode depending on user preference
- // To do: add the user preference later, just say no for now.
- // if (TeamUIPlugin.getPlugin().getPreferenceStore().getBoolean(UIConstants.PREF_ALWAYS_IN_CATCHUP_RELEASE)) {
- // freeMode.run();
- // } else {
- if (input.hasIncomingChanges()) {
- incomingMode.run();
- } else {
- outgoingMode.run();
- }
- // }
- // Reveal if fast view
- try {
- TeamUIPlugin.getActivePage().showView(VIEW_ID);
- } catch (PartInitException e) {
- TeamUIPlugin.log(e.getStatus());
- }
- }
-
- /**
- * Updates the actions for this view's action bar.
- */
- private void updateActions() {
- IActionBars bars = getViewSite().getActionBars();
- IToolBarManager toolBar = bars.getToolBarManager();
- IMenuManager menu = bars.getMenuManager();
- toolBar.removeAll();
- menu.removeAll();
-
- toolBar.add(incomingMode);
- toolBar.add(outgoingMode);
- toolBar.add(freeMode);
- input.getViewer().contributeToActionBars(bars);
-
- toolBar.update(false);
- menu.update(false);
- bars.updateActionBars();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamFile.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamFile.java
deleted file mode 100644
index a32788b88..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TeamFile.java
+++ /dev/null
@@ -1,254 +0,0 @@
-package org.eclipse.team.ui.sync;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import java.io.InputStream;
-
-import org.eclipse.compare.CompareUI;
-import org.eclipse.compare.ITypedElement;
-import org.eclipse.compare.structuremergeviewer.DiffElement;
-import org.eclipse.compare.structuremergeviewer.Differencer;
-import org.eclipse.compare.structuremergeviewer.ICompareInput;
-import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;
-import org.eclipse.compare.structuremergeviewer.IDiffContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.util.Assert;
-import org.eclipse.jface.util.ListenerList;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.team.core.sync.IRemoteSyncElement;
-import org.eclipse.team.internal.ui.Policy;
-import org.eclipse.ui.internal.WorkbenchPlugin;
-
-/**
- * A sync node for a version-controlled file, where the left
- * side is the local file, the right side is the remote file,
- * and the ancestor is the common file.
- */
-public class TeamFile extends DiffElement implements ICompareInput, ITeamNode {
- private MergeResource mergeResource;
- private Shell shell;
- private ListenerList listeners;
- private TypedBufferedContent localByteContents;
- private TypedBufferedContent commonByteContents;
- private TypedBufferedContent remoteByteContents;
-
- /**
- * Creates a new file node.
- */
- public TeamFile(IDiffContainer parent, MergeResource res, int changeType) {
- super(parent, changeType);
- Assert.isNotNull(res);
- this.mergeResource = res;
-
- commonByteContents = new TypedBufferedContent(this, false) {
- public InputStream createStream() throws CoreException {
- return mergeResource.getBaseRevision();
- }
- };
- remoteByteContents = new TypedBufferedContent(this, false) {
- protected InputStream createStream() throws CoreException {
- return mergeResource.getLatestRevision();
- }
- };
- // don't allow editing of outgoing deletion content. To revert from the deletion the
- // user should use the appropriate sync view action.
- boolean outgoingDeletion = getChangeDirection() == IRemoteSyncElement.OUTGOING && getChangeType() == IRemoteSyncElement.DELETION;
- localByteContents = new TypedBufferedContent(this, !outgoingDeletion) {
- protected InputStream createStream() throws CoreException {
- return mergeResource.getLocalStream();
- }
- public void setContent(byte[] contents) {
- super.setContent(contents);
- merged();
- fireContentChanged();
- }
- public ITypedElement replace(ITypedElement child, ITypedElement other) {
- System.out.println("TeamFile.replace");
- return null;
- }
- };
- }
- public void addCompareInputChangeListener(ICompareInputChangeListener l) {
- if (listeners == null) {
- listeners = new ListenerList();
- }
- listeners.add(l);
- }
-
- public void copy(boolean leftToRight) {
- if (!leftToRight) {
- // Catchup to all on the server
- localByteContents.setContent(remoteByteContents.getContent());
- merged();
- }
- }
- public boolean equals(Object other) {
- if (other != null && other.getClass() == getClass()) {
- TeamFile file = (TeamFile) other;
- return mergeResource.equals(file.mergeResource);
- }
- return super.equals(other);
- }
- private void fireThreeWayInputChange() {
- if (listeners != null) {
- Object[] listenerArray = listeners.getListeners();
- // Iterate backwards so that the model gets updated last
- // it might want to remove the node completely, which might
- // upset other listeners.
- for (int i = listenerArray.length; --i >= 0;)
- ((ICompareInputChangeListener) listenerArray[i]).compareInputChanged(this);
- }
- }
-
- /*
- * @see ICompareInput#getAncestor
- */
- public ITypedElement getAncestor() {
- if (mergeResource.hasBaseRevision()) {
- return commonByteContents;
- }
- return null;
- }
-
- /*
- * Method declared on ITeamNode.
- */
- public int getChangeDirection() {
- return getKind() & Differencer.DIRECTION_MASK;
- }
-
- /*
- * @see ITeamNode#getChangeType()
- */
- public int getChangeType() {
- return getKind() & Differencer.CHANGE_TYPE_MASK;
- }
- /*
- * @see ITypedInput#getType
- */
- public Image getImage() {
- return CompareUI.getImage(getType());
- }
-
- /*
- * @see ICompareInput#getLeft
- */
- public ITypedElement getLeft() {
- return localByteContents;
- }
-
- /**
- * Returns the team resource managed by this object.
- * Guaranteed to be non-null.
- */
- public MergeResource getMergeResource() {
- return mergeResource;
- }
-
- /*
- * @see ITypedInput#getName
- */
- public String getName() {
- return mergeResource.getName();
- }
- /**
- * Returns the core resource managed by this object.
- * Guaranteed to be non-null.
- */
- public IResource getResource() {
- return mergeResource.getResource();
- }
-
- /*
- * @see ICompareInput#getRight
- */
- public ITypedElement getRight() {
- if (mergeResource.hasLatestRevision()) {
- return remoteByteContents;
- } else {
- return null;
- }
- }
- /*
- * @see ITypedInput#getType
- */
- public String getType() {
- return mergeResource.getExtension();
- }
-
- /*
- * @see Object
- */
- public int hashCode() {
- return mergeResource.hashCode();
- }
-
- /**
- * The local resource has beed modified (i.e. merged).
- */
- private void merged() {
- mergeResource.confirmMerge();
- try {
- // persist changes to disk (e.g. there is no buffering in the sync view).
- saveChanges();
-
- // calculate the new sync state based on the type of change that was merged. This
- // logic cannot be in the IRemoteSyncElement because there is no way to update the
- // base before calling getSyncKind() again.
- if(getChangeDirection()==INCOMING) {
- switch(getChangeType()) {
- case Differencer.ADDITION:
- case Differencer.CHANGE:
- setKind(OUTGOING | Differencer.CHANGE);
- break;
- case Differencer.DELETION:
- setKind(CONFLICTING | Differencer.CHANGE);
- }
- } else {
- setKind(OUTGOING | (getKind() & Differencer.CHANGE_TYPE_MASK));
- }
-
- // update the UI with the sync state change.
- fireThreeWayInputChange();
- } catch (CoreException e) {
- ErrorDialog.openError(WorkbenchPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(), Policy.bind("TeamFile.saveChanges", getName()), null, e.getStatus());
- }
- }
-
- public void removeCompareInputChangeListener(ICompareInputChangeListener listener) {
- if (listeners != null) {
- listeners.remove(listener);
- }
- }
-
- /**
- * Saves cached copy to disk and clears dirty flag.
- */
- private void saveChanges() throws CoreException {
- InputStream stream = localByteContents.getContents();
- IFile file = (IFile) getResource();
- if (stream != null) {
- if (!file.exists()) {
- file.create(stream, false, null);
- } else {
- file.setContents(stream, false, true, null);
- }
- } else {
- file.delete(false, true, null);
- }
- }
- /**
- * For debugging purposes only.
- */
- public String toString() {
- return "TeamFile(" + mergeResource.getName() + ")";
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TypedBufferedContent.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TypedBufferedContent.java
deleted file mode 100644
index eff61ab36..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/TypedBufferedContent.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package org.eclipse.team.ui.sync;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.compare.BufferedContent;
-import org.eclipse.compare.IEditableContent;
-import org.eclipse.compare.ITypedElement;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A content buffer for resources on a server.
- */
-abstract class TypedBufferedContent extends BufferedContent implements ITypedElement, IEditableContent {
- private ITeamNode node;
- private boolean editable;
-
- /**
- * Creates a new content buffer for the given team node.
- */
- TypedBufferedContent(ITeamNode node, boolean editable) {
- this.node = node;
- this.editable = editable;
- }
-
- public Image getImage() {
- return node.getImage();
- }
-
- public String getName() {
- return node.getName();
- }
-
- public String getType() {
- return node.getType();
- }
-
- /**
- * Returns true if this object can be modified.
- * If it returns <code>false</code> the other methods must not be called.
- *
- * @return <code>true</code> if this object can be modified.
- */
- public boolean isEditable() {
- return editable;
- }
-
- /**
- * This is not the definitive API!
- * This method is called on a parent to
- * - add a child,
- * - remove a child,
- * - copy the contents of a child
- *
- * What to do is encoded in the two arguments as follows:
- * add: child == null other != null
- * remove: child != null other == null
- * copy: child != null other != null
- */
- public ITypedElement replace(ITypedElement child, ITypedElement other) {
- return null;
- }
-}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/UnchangedTeamContainer.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/UnchangedTeamContainer.java
deleted file mode 100644
index 9ce37f190..000000000
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/sync/UnchangedTeamContainer.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.eclipse.team.ui.sync;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-import org.eclipse.compare.CompareUI;
-import org.eclipse.compare.ITypedElement;
-import org.eclipse.compare.ResourceNode;
-import org.eclipse.compare.structuremergeviewer.DiffNode;
-import org.eclipse.compare.structuremergeviewer.Differencer;
-import org.eclipse.compare.structuremergeviewer.IDiffContainer;
-import org.eclipse.compare.structuremergeviewer.IDiffElement;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A node in a diff tree that represents a folder with no changes
- * to itself, it is only a placeholder for changes in its children.
- */
-public class UnchangedTeamContainer extends DiffNode implements ITeamNode {
- private IResource resource;
-
- public UnchangedTeamContainer(IDiffContainer parent, IResource resource) {
- this(parent, resource, Differencer.NO_CHANGE);
- }
-
- public UnchangedTeamContainer(IDiffContainer parent, IResource resource, int description) {
- super(parent, description);
- setLeft(new ResourceNode(resource));
- this.resource = resource;
- }
-
- /*
- * Method declared on ITeamNode
- */
- public int getChangeDirection() {
- return ITeamNode.NO_CHANGE;
- }
-
- /*
- * @see ITeamNode#getChangeType()
- */
- public int getChangeType() {
- return ITeamNode.NO_CHANGE;
- }
-
- public Image getImage() {
- return CompareUI.getImage(getType());
- }
-
- public String getName() {
- return resource.getName();
- }
-
- /**
- * Returns the resource underlying this diff node.
- */
- public IResource getResource() {
- return resource;
- }
-
- public String getType() {
- return ITypedElement.FOLDER_TYPE;
- }
-}

Back to the top