View | Details | Raw Unified | Return to bug 239959 | Differences between
and this patch

Collapse All | Expand All

(-)compare/org/eclipse/compare/internal/CompareMessages.java (+1 lines)
Lines 118-123 Link Here
118
	public static String CompareWithOther_error_empty;
118
	public static String CompareWithOther_error_empty;
119
	public static String CompareWithOther_clear;
119
	public static String CompareWithOther_clear;
120
	public static String CompareWithOther_warning_two_way;
120
	public static String CompareWithOther_warning_two_way;
121
	public static String CompareWithOther_info;
121
122
122
	static {
123
	static {
123
		NLS.initializeMessages(BUNDLE_NAME, CompareMessages.class);
124
		NLS.initializeMessages(BUNDLE_NAME, CompareMessages.class);
(-)compare/org/eclipse/compare/internal/CompareWithOtherResourceDialog.java (-1 / +2 lines)
Lines 398-403 Link Here
398
		super.createButtonsForButtonBar(parent);
398
		super.createButtonsForButtonBar(parent);
399
		okButton = getButton(IDialogConstants.OK_ID);
399
		okButton = getButton(IDialogConstants.OK_ID);
400
		updateErrorInfo();
400
		updateErrorInfo();
401
		setMessage(CompareMessages.CompareWithOther_info);
401
	}
402
	}
402
403
403
	private void setSelection(ISelection selection) {
404
	private void setSelection(ISelection selection) {
Lines 451-457 Link Here
451
						IMessageProvider.ERROR);
452
						IMessageProvider.ERROR);
452
				okButton.setEnabled(false);
453
				okButton.setEnabled(false);
453
			} else {
454
			} else {
454
				setMessage(null);
455
				setMessage(CompareMessages.CompareWithOther_info);
455
				okButton.setEnabled(true);
456
				okButton.setEnabled(true);
456
			}
457
			}
457
		}
458
		}
(-)compare/org/eclipse/compare/internal/CompareWithOtherResourceAction.java (-1 / +2 lines)
Lines 22-28 Link Here
22
22
23
/**
23
/**
24
 * The "Compare with other resource" action
24
 * The "Compare with other resource" action
25
 * 
25
 *
26
 * @since 3.4
26
 * @since 3.4
27
 */
27
 */
28
public class CompareWithOtherResourceAction implements IObjectActionDelegate {
28
public class CompareWithOtherResourceAction implements IObjectActionDelegate {
Lines 48-53 Link Here
48
			StructuredSelection ss = new StructuredSelection(resources);
48
			StructuredSelection ss = new StructuredSelection(resources);
49
			CompareAction ca = new CompareAction();
49
			CompareAction ca = new CompareAction();
50
			ca.setActivePart(null, fWorkbenchPart);
50
			ca.setActivePart(null, fWorkbenchPart);
51
			ca.doesntNeedSelection();
51
			if (ca.isEnabled(ss))
52
			if (ca.isEnabled(ss))
52
				ca.run(ss);
53
				ca.run(ss);
53
		}
54
		}
(-)compare/org/eclipse/compare/internal/CompareMessages.properties (-2 / +3 lines)
Lines 128-132 Link Here
128
CompareWithOther_dialogMessage=Select resources to compare
128
CompareWithOther_dialogMessage=Select resources to compare
129
CompareWithOther_error_not_comparable=Selected resources are not comparable.
129
CompareWithOther_error_not_comparable=Selected resources are not comparable.
130
CompareWithOther_error_empty=Both left and right panel must contain a valid path.
130
CompareWithOther_error_empty=Both left and right panel must contain a valid path.
131
CompareWithOther_warning_two_way=Ancestor is not a valid resource. Two-way compare will be performed. 
131
CompareWithOther_warning_two_way=Ancestor is not a valid resource. Two-way compare will be performed.
132
CompareWithOther_clear=Clear
132
CompareWithOther_clear=Clear
133
CompareWithOther_info=Drag files from Package Explorer or from another field within the dialog.
(-)compare/org/eclipse/compare/internal/CompareAction.java (-4 / +13 lines)
Lines 28-41 Link Here
28
28
29
	private ResourceCompareInput fInput;
29
	private ResourceCompareInput fInput;
30
	private IWorkbenchPage fWorkbenchPage;
30
	private IWorkbenchPage fWorkbenchPage;
31
	private boolean needsSelectionSetting = true;
31
32
32
33
33
	public void run(ISelection selection) {
34
	public void run(ISelection selection) {
35
		boolean ok;
34
		if (fInput != null) {
36
		if (fInput != null) {
35
			// Pass the shell so setSelection can prompt the user for which
37
			if (needsSelectionSetting)
36
			// resource should be the ancestor
38
				// Pass the shell so setSelection can prompt the user for which
37
			boolean ok = fInput.setSelection(selection,
39
				// resource should be the ancestor
38
				fWorkbenchPage.getWorkbenchWindow().getShell());
40
				ok = fInput.setSelection(selection,
41
						fWorkbenchPage.getWorkbenchWindow().getShell());
42
			else
43
				ok = fInput.setSelection(selection, null);
39
			if (!ok) return;
44
			if (!ok) return;
40
			fInput.initializeCompareConfiguration();
45
			fInput.initializeCompareConfiguration();
41
			CompareUI.openCompareEditorOnPage(fInput, fWorkbenchPage);
46
			CompareUI.openCompareEditorOnPage(fInput, fWorkbenchPage);
Lines 61-64 Link Here
61
	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
66
	public void setActivePart(IAction action, IWorkbenchPart targetPart) {
62
		fWorkbenchPage= targetPart.getSite().getPage();
67
		fWorkbenchPage= targetPart.getSite().getPage();
63
	}
68
	}
69
70
	public void doesntNeedSelection() {
71
		needsSelectionSetting = false;
72
	}
64
}
73
}
(-)compare/org/eclipse/compare/internal/ResourceCompareInput.java (-10 / +17 lines)
Lines 207-222 Link Here
207
		fThreeWay= selection.length == 3;
207
		fThreeWay= selection.length == 3;
208
		
208
		
209
		if (fThreeWay) {
209
		if (fThreeWay) {
210
			SelectAncestorDialog dialog =
210
			if (shell != null) {
211
				new SelectAncestorDialog(shell, selection);
211
				SelectAncestorDialog dialog =
212
			int code = dialog.open();
212
					new SelectAncestorDialog(shell, selection);
213
			if (code == Window.CANCEL)
213
				int code = dialog.open();
214
				return false;
214
				if (code == Window.CANCEL)
215
			
215
					return false;
216
			fAncestorResource= dialog.ancestorResource;
216
217
			fAncestor= getStructure(fAncestorResource);
217
				fAncestorResource= dialog.ancestorResource;
218
			fLeftResource= dialog.leftResource;
218
				fAncestor= getStructure(fAncestorResource);
219
			fRightResource= dialog.rightResource;
219
				fLeftResource= dialog.leftResource;
220
				fRightResource= dialog.rightResource;
221
			} else {
222
				fAncestorResource = selection[0];
223
				fAncestor = getStructure(selection[0]);
224
				fLeftResource= selection[1];
225
				fRightResource= selection[2];
226
			}
220
		} else {
227
		} else {
221
			fAncestorResource= null;
228
			fAncestorResource= null;
222
			fAncestor= null;
229
			fAncestor= null;

Return to bug 239959