View | Details | Raw Unified | Return to bug 136340
Collapse All | Expand All

(-)compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java (-3 / +25 lines)
Lines 14-20 Link Here
14
import java.io.ByteArrayInputStream;
14
import java.io.ByteArrayInputStream;
15
import java.io.InputStream;
15
import java.io.InputStream;
16
import java.lang.reflect.InvocationTargetException;
16
import java.lang.reflect.InvocationTargetException;
17
import com.ibm.icu.text.MessageFormat;
18
import java.util.ArrayList;
17
import java.util.ArrayList;
19
import java.util.Iterator;
18
import java.util.Iterator;
20
import java.util.List;
19
import java.util.List;
Lines 50-55 Link Here
50
import org.eclipse.jface.viewers.IStructuredSelection;
49
import org.eclipse.jface.viewers.IStructuredSelection;
51
import org.eclipse.jface.viewers.SelectionChangedEvent;
50
import org.eclipse.jface.viewers.SelectionChangedEvent;
52
import org.eclipse.jface.viewers.StructuredSelection;
51
import org.eclipse.jface.viewers.StructuredSelection;
52
import org.eclipse.jface.viewers.TreeSelection;
53
import org.eclipse.jface.viewers.TreeViewer;
53
import org.eclipse.jface.viewers.TreeViewer;
54
import org.eclipse.jface.viewers.Viewer;
54
import org.eclipse.jface.viewers.Viewer;
55
import org.eclipse.jface.wizard.WizardPage;
55
import org.eclipse.jface.wizard.WizardPage;
Lines 78-83 Link Here
78
import org.eclipse.ui.model.WorkbenchViewerSorter;
78
import org.eclipse.ui.model.WorkbenchViewerSorter;
79
import org.eclipse.ui.views.navigator.ResourceSorter;
79
import org.eclipse.ui.views.navigator.ResourceSorter;
80
80
81
import com.ibm.icu.text.MessageFormat;
82
81
/**
83
/**
82
 * Shows the parsed patch file and any mismatches
84
 * Shows the parsed patch file and any mismatches
83
 * between files, hunks and the currently selected
85
 * between files, hunks and the currently selected
Lines 284-290 Link Here
284
		composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL|GridData.HORIZONTAL_ALIGN_FILL));
286
		composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL|GridData.HORIZONTAL_ALIGN_FILL));
285
287
286
		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_PREVIEW_WIZARD_PAGE);
288
		PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICompareContextIds.PATCH_PREVIEW_WIZARD_PAGE);
287
289
		
288
		setControl(composite);
290
		setControl(composite);
289
291
290
		initializeDialogUnits(parent);
292
		initializeDialogUnits(parent);
Lines 372-377 Link Here
372
			}
374
			}
373
		});
375
		});
374
376
377
		fTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
378
			public void doubleClick(DoubleClickEvent event) {
379
				ISelection selection= event.getSelection();
380
				if (selection instanceof TreeSelection) {
381
					TreeSelection treeSel= (TreeSelection) selection;
382
					Object res= treeSel.getFirstElement();
383
					if (res != null) {
384
						if (res instanceof DiffProject || res instanceof Diff) {
385
							if (fTreeViewer.getExpandedState(res))
386
								fTreeViewer.collapseToLevel(res, 1);
387
							else
388
								fTreeViewer.expandToLevel(res, 1);
389
						}
390
					}
391
				}
392
			}
393
		});
394
		
395
		
375
		fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
396
		fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
376
397
377
			public void selectionChanged(SelectionChangedEvent event) {
398
			public void selectionChanged(SelectionChangedEvent event) {
Lines 382-388 Link Here
382
					PreviewPatchPage.this.fHunkViewer.setInput(createInput((Hunk) obj));
403
					PreviewPatchPage.this.fHunkViewer.setInput(createInput((Hunk) obj));
383
				} else
404
				} else
384
					PreviewPatchPage.this.fHunkViewer.setInput(null);
405
					PreviewPatchPage.this.fHunkViewer.setInput(null);
385
406
				
386
				fMatchProject.setEnabled(false);
407
				fMatchProject.setEnabled(false);
387
				//See if we need to enable match project button
408
				//See if we need to enable match project button
388
				if (fPatchWizard.getPatcher().isWorkspacePatch()&&obj instanceof DiffProject) {
409
				if (fPatchWizard.getPatcher().isWorkspacePatch()&&obj instanceof DiffProject) {
Lines 392-397 Link Here
392
			}
413
			}
393
414
394
		});
415
		});
416
		
395
		fTreeViewer.setInput(null);
417
		fTreeViewer.setInput(null);
396
	}
418
	}
397
419

Return to bug 136340