restore "Fix package dependencies" action
diff --git a/tcl/plugins/org.eclipse.dltk.tcl.ui/plugin.xml b/tcl/plugins/org.eclipse.dltk.tcl.ui/plugin.xml
index 85e5395..6d93b4f 100644
--- a/tcl/plugins/org.eclipse.dltk.tcl.ui/plugin.xml
+++ b/tcl/plugins/org.eclipse.dltk.tcl.ui/plugin.xml
@@ -556,6 +556,26 @@
          </action>
       </editorContribution>
 </extension>
+<extension
+      point="org.eclipse.ui.popupMenus">
+   <objectContribution
+         adaptable="false"
+         id="org.eclipse.dltk.tcl.ui.fixdeps"
+         objectClass="org.eclipse.dltk.core.IModelElement">
+         <filter
+               name="org.eclipse.dltk.ui.nature"
+               value="org.eclipse.dltk.tcl.core.nature">
+         </filter>
+      <action
+            class="org.eclipse.dltk.tcl.internal.ui.packages.FixAllDependenciesActionDelegate"
+            icon="icons/etool16/newpack_wiz.gif"
+            id="org.eclipse.dltk.tcl.ui.fixDependencies"
+            label="Fix package dependencies"
+            menubarPath="org.eclipse.dltk.ui.refactoring.menu"
+            style="push">
+      </action>
+   </objectContribution>
+</extension>
 
 <!-- =========================================================================== -->
 <!-- Tcl Compare                                                                -->
diff --git a/tcl/plugins/org.eclipse.dltk.tcl.ui/src/org/eclipse/dltk/tcl/internal/ui/packages/FixAllDependenciesActionDelegate.java b/tcl/plugins/org.eclipse.dltk.tcl.ui/src/org/eclipse/dltk/tcl/internal/ui/packages/FixAllDependenciesActionDelegate.java
new file mode 100644
index 0000000..f585aac
--- /dev/null
+++ b/tcl/plugins/org.eclipse.dltk.tcl.ui/src/org/eclipse/dltk/tcl/internal/ui/packages/FixAllDependenciesActionDelegate.java
@@ -0,0 +1,121 @@
+package org.eclipse.dltk.tcl.internal.ui.packages;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.dltk.core.DLTKCore;
+import org.eclipse.dltk.core.IModelElement;
+import org.eclipse.dltk.core.IScriptProject;
+import org.eclipse.dltk.launching.IInterpreterInstall;
+import org.eclipse.dltk.launching.ScriptRuntime;
+import org.eclipse.dltk.tcl.core.TclPackagesManager;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.util.SafeRunnable;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+
+public class FixAllDependenciesActionDelegate implements
+		IWorkbenchWindowActionDelegate {
+	private ISelection selection;
+
+	public void dispose() {
+	}
+
+	public void init(IWorkbenchWindow window) {
+	}
+
+	public void run(IAction action) {
+		if (this.selection == null) {
+			return;
+		}
+		processSelectionToElements(selection);
+	}
+
+	public static void processResourcesToElements(Object o,
+			Set<IProject> projects) {
+		if (o instanceof IResource) {
+			projects.add(((IResource) o).getProject());
+		} else if (o instanceof IModelElement) {
+			projects.add(((IModelElement) o).getScriptProject().getProject());
+		}
+	}
+
+	protected void processSelectionToElements(ISelection selection) {
+		final Set<IProject> projects = new HashSet<IProject>();
+		if (this.selection != null
+				&& this.selection instanceof IStructuredSelection) {
+			final IStructuredSelection sel = (IStructuredSelection) this.selection;
+			for (Iterator<?> iterator = sel.iterator(); iterator.hasNext();) {
+				Object o = iterator.next();
+				processResourcesToElements(o, projects);
+			}
+		}
+		if (!projects.isEmpty()) {
+			final ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(
+					PlatformUI.getWorkbench().getActiveWorkbenchWindow()
+							.getShell()) {
+				protected void configureShell(Shell shell) {
+					super.configureShell(shell);
+					shell.setText("Fix package dependencies...");
+				}
+			};
+			SafeRunner.run(new SafeRunnable() {
+				public void run() throws Exception {
+					progressDialog.run(true, true, new IRunnableWithProgress() {
+						public void run(IProgressMonitor monitor)
+								throws InvocationTargetException,
+								InterruptedException {
+							SubMonitor topMonitor = SubMonitor.convert(monitor,
+									"Fixing dependencies", projects.size());
+							final Set<IInterpreterInstall> installs = new HashSet<IInterpreterInstall>();
+							for (IProject project : projects) {
+								IScriptProject scriptProject = DLTKCore
+										.create(project);
+								try {
+									IInterpreterInstall install = ScriptRuntime
+											.getInterpreterInstall(scriptProject);
+									if (install != null
+											&& installs.add(install)) {
+										TclPackagesManager
+												.removeInterpreterInfo(install);
+									}
+									project
+											.build(
+													IncrementalProjectBuilder.FULL_BUILD,
+													SubMonitor
+															.convert(
+																	topMonitor,
+																	"Building "
+																			+ project
+																					.getName(),
+																	1));
+								} catch (CoreException e) {
+									throw new InvocationTargetException(e);
+								}
+							}
+						}
+					});
+				}
+			});
+		}
+	}
+
+	public void selectionChanged(IAction action, ISelection selection) {
+		this.selection = selection;
+	}
+}