Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: fb20ee888cf730890f98c6ff17107c0131981580 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*******************************************************************************
 * Copyright (c) 2008, 2011 Aleksandra Wozniak 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:
 *    Aleksandra Wozniak (aleksandra.k.wozniak@gmail.com) - initial implementation
 *    IBM Corporation - maintenance
 *******************************************************************************/
package org.eclipse.compare.internal;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;

/**
 * The "Compare with other resource" action.
 *
 * @deprecated Temporarily replaced by CompareWithOtherResourceHandler. See bug
 *             264498.
 */
public class CompareWithOtherResourceAction extends CompareAction {

	public void run(ISelection selection) {
		// Show CompareWithOtherResourceDialog which return resources to compare
		// and ancestor if specified. Don't need to display the other dialog
		showSelectAncestorDialog = false;
		super.run(selection);
	}

	protected boolean isEnabled(ISelection selection) {
		int selectionSize = 0;
		if (selection instanceof IStructuredSelection) {
			selectionSize = ((IStructuredSelection) selection).toArray().length;
		}
		// enable for a single selection
		return super.isEnabled(selection) || selectionSize == 1;
	}

}

Back to the top