/*******************************************************************************
 * Copyright (c) 2005-2010 VecTrace (Zingo Andersen) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * John Peberdy	implementation
 *******************************************************************************/
package com.vectrace.MercurialEclipse.menu;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;

import com.vectrace.MercurialEclipse.team.CompareAction;

public class CompareWithParentHandler extends SingleResourceHandler {

	@Override
	protected void run(IResource resource) throws Exception {
		if (resource instanceof IFile) {
			new CompareAction((IFile) resource).run(null);
		}
	}
}
@@ -591,23 +591,134 @@
 ore.
-resources.IFile
+commands.AbstractHandler;%0Aimport org.eclipse.core.commands.ExecutionEvent;%0Aimport org.eclipse.core.commands.ExecutionException
 ;%0Aim
@@ -750,23 +750,19 @@
 ources.I
-Resourc
+Fil
 e;%0A%0Aimpo
@@ -813,16 +813,74 @@
 eAction;
+%0Aimport com.vectrace.MercurialEclipse.utils.ResourceUtils;
 %0A%0Apublic
@@ -923,82 +923,70 @@
 nds 
-SingleResourceHandler %7B%0A%0A%09@Override%0A%09prot
+AbstractHandler %7B%0A%0A%09public Object ex
 ec
+u
 te
-d void run(IResource resource
+(ExecutionEvent event
 ) th
@@ -990,16 +990,25 @@
  throws 
+Execution
 Exceptio
@@ -1017,37 +1017,85 @@
 %7B%0A%09%09
-if (resource instanceof IFile
+IFile file = ResourceUtils.getActiveResourceFromEditor();%0A%0A%09%09if (file != null
 ) %7B%0A
@@ -1119,25 +1119,13 @@
 ion(
-(IF
+f
 ile)
- resource)
 .run
@@ -1135,13 +1135,29 @@
 ll);%0A%09%09%7D
+%0A%0A%09%09return null;
 %0A%09%7D%0A%7D

Fix selection for "Compare with Parent" keyboard shortcut