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

Collapse All | Expand All

(-)compare/org/eclipse/compare/CompareEditorInput.java (+4 lines)
Lines 775-785 Link Here
775
						Object input= fStructureInputPane.getInput();
775
						Object input= fStructureInputPane.getInput();
776
						if (input != null)
776
						if (input != null)
777
							internalSetContentPaneInput(input);
777
							internalSetContentPaneInput(input);
778
						if (!Utilities.okToUse(fStructurePane1) || !Utilities.okToUse(fStructurePane2))
779
							return;
778
						fStructurePane2.setInput(null); // clear downstream pane
780
						fStructurePane2.setInput(null); // clear downstream pane
779
						fStructurePane1.setInput(null);
781
						fStructurePane1.setInput(null);
780
					} else {
782
					} else {
781
						Object input= getElement(selection);
783
						Object input= getElement(selection);
782
						internalSetContentPaneInput(input);
784
						internalSetContentPaneInput(input);
785
						if (!Utilities.okToUse(fStructurePane1) || !Utilities.okToUse(fStructurePane2))
786
							return;						
783
						if (structureCompareOnSingleClick() || hasUnusableContentViewer())
787
						if (structureCompareOnSingleClick() || hasUnusableContentViewer())
784
							fStructurePane1.setInput(input);
788
							fStructurePane1.setInput(input);
785
						fStructurePane2.setInput(null); // clear downstream pane
789
						fStructurePane2.setInput(null); // clear downstream pane
(-)compare/org/eclipse/compare/CompareViewerSwitchingPane.java (-4 / +13 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 11-23 Link Here
11
package org.eclipse.compare;
11
package org.eclipse.compare;
12
12
13
import org.eclipse.compare.contentmergeviewer.IFlushable;
13
import org.eclipse.compare.contentmergeviewer.IFlushable;
14
import org.eclipse.compare.internal.*;
14
import org.eclipse.compare.internal.CompareMessages;
15
import org.eclipse.compare.internal.NullViewer;
16
import org.eclipse.compare.internal.Utilities;
15
import org.eclipse.compare.structuremergeviewer.ICompareInput;
17
import org.eclipse.compare.structuremergeviewer.ICompareInput;
16
import org.eclipse.jface.viewers.*;
18
import org.eclipse.jface.viewers.ISelection;
19
import org.eclipse.jface.viewers.StructuredViewer;
20
import org.eclipse.jface.viewers.Viewer;
17
import org.eclipse.swt.events.DisposeEvent;
21
import org.eclipse.swt.events.DisposeEvent;
18
import org.eclipse.swt.events.DisposeListener;
22
import org.eclipse.swt.events.DisposeListener;
19
import org.eclipse.swt.graphics.Image;
23
import org.eclipse.swt.graphics.Image;
20
import org.eclipse.swt.widgets.*;
24
import org.eclipse.swt.widgets.Composite;
25
import org.eclipse.swt.widgets.Control;
26
import org.eclipse.swt.widgets.Display;
21
27
22
import com.ibm.icu.text.MessageFormat;
28
import com.ibm.icu.text.MessageFormat;
23
29
Lines 269-274 Link Here
269
		// set input
275
		// set input
270
		fViewer.setInput(input);
276
		fViewer.setInput(input);
271
277
278
		if (getViewer() == null || !Utilities.okToUse(getViewer().getControl()))
279
			return;
280
272
		Image image= null;
281
		Image image= null;
273
		if (!(fViewer instanceof NullViewer) && input instanceof ICompareInput)
282
		if (!(fViewer instanceof NullViewer) && input instanceof ICompareInput)
274
			image= ((ICompareInput)input).getImage();
283
			image= ((ICompareInput)input).getImage();
(-)compare/org/eclipse/compare/internal/CompareContentViewerSwitchingPane.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
2
 * Copyright (c) 2009, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 130-135 Link Here
130
130
131
	public void setInput(Object input) {
131
	public void setInput(Object input) {
132
		super.setInput(input);
132
		super.setInput(input);
133
		if (getViewer() == null || !Utilities.okToUse(getViewer().getControl()))
134
			return;
133
		ViewerDescriptor[] vd = CompareUIPlugin.getDefault()
135
		ViewerDescriptor[] vd = CompareUIPlugin.getDefault()
134
				.findContentViewerDescriptor(getViewer(), getInput(),
136
				.findContentViewerDescriptor(getViewer(), getInput(),
135
						getCompareConfiguration());
137
						getCompareConfiguration());
(-)compare/org/eclipse/compare/internal/CompareEditor.java (-1 / +10 lines)
Lines 35-40 Link Here
35
import org.eclipse.jface.viewers.ISelectionProvider;
35
import org.eclipse.jface.viewers.ISelectionProvider;
36
import org.eclipse.osgi.util.NLS;
36
import org.eclipse.osgi.util.NLS;
37
import org.eclipse.swt.SWT;
37
import org.eclipse.swt.SWT;
38
import org.eclipse.swt.SWTException;
38
import org.eclipse.swt.graphics.Color;
39
import org.eclipse.swt.graphics.Color;
39
import org.eclipse.swt.graphics.Point;
40
import org.eclipse.swt.graphics.Point;
40
import org.eclipse.swt.layout.GridData;
41
import org.eclipse.swt.layout.GridData;
Lines 451-457 Link Here
451
				setState(CREATING_CONTROL);
452
				setState(CREATING_CONTROL);
452
				if (getSite().getSelectionProvider() == null)
453
				if (getSite().getSelectionProvider() == null)
453
					getSite().setSelectionProvider(new CompareEditorSelectionProvider());
454
					getSite().setSelectionProvider(new CompareEditorSelectionProvider());
454
				fControl= ci.createContents(fPageBook);
455
				try {
456
					fControl = ci.createContents(fPageBook);
457
				} catch (SWTException e) {
458
					// closed while creating
459
					if (e.code == SWT.ERROR_WIDGET_DISPOSED) {
460
						setState(CANCELED);
461
						return;
462
					}
463
				}
455
				fPageBook.showPage(fControl);
464
				fPageBook.showPage(fControl);
456
				PlatformUI.getWorkbench().getHelpSystem().setHelp(fControl, ICompareContextIds.COMPARE_EDITOR);
465
				PlatformUI.getWorkbench().getHelpSystem().setHelp(fControl, ICompareContextIds.COMPARE_EDITOR);
457
				if (isActive()) {
466
				if (isActive()) {
(-)compare/org/eclipse/compare/internal/CompareStructureViewerSwitchingPane.java (-1 / +3 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2009 IBM Corporation and others.
2
 * Copyright (c) 2009, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 130-135 Link Here
130
130
131
	public void setInput(Object input) {
131
	public void setInput(Object input) {
132
		super.setInput(input);
132
		super.setInput(input);
133
		if (getViewer() == null || !Utilities.okToUse(getViewer().getControl()))
134
			return;
133
		ViewerDescriptor[] vd = null;
135
		ViewerDescriptor[] vd = null;
134
		if (getInput() instanceof ICompareInput) {
136
		if (getInput() instanceof ICompareInput) {
135
			vd = CompareUIPlugin.getDefault().findStructureViewerDescriptor(
137
			vd = CompareUIPlugin.getDefault().findStructureViewerDescriptor(

Return to bug 273951