mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Bug 314350 - [debug view] Multi-threaded programs can cause the opening of useless and empty editors
This commit is contained in:
parent
d6992f6cfd
commit
1741dd69aa
1 changed files with 14 additions and 2 deletions
|
@ -74,6 +74,7 @@ import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.ui.IEditorDescriptor;
|
import org.eclipse.ui.IEditorDescriptor;
|
||||||
import org.eclipse.ui.IEditorInput;
|
import org.eclipse.ui.IEditorInput;
|
||||||
import org.eclipse.ui.IEditorPart;
|
import org.eclipse.ui.IEditorPart;
|
||||||
|
import org.eclipse.ui.IReusableEditor;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
import org.eclipse.ui.PartInitException;
|
import org.eclipse.ui.PartInitException;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
@ -388,10 +389,21 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
|
||||||
private IEditorPart openEditor(final IWorkbenchPage page, final IEditorInput input, final String id) {
|
private IEditorPart openEditor(final IWorkbenchPage page, final IEditorInput input, final String id) {
|
||||||
final IEditorPart[] editor = new IEditorPart[] {null};
|
final IEditorPart[] editor = new IEditorPart[] {null};
|
||||||
Runnable r = new Runnable() {
|
Runnable r = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!page.getWorkbenchWindow().getWorkbench().isClosing()) {
|
if (!page.getWorkbenchWindow().getWorkbench().isClosing()) {
|
||||||
try {
|
try {
|
||||||
editor[0] = page.openEditor(input, id, false);
|
if (input instanceof CSourceNotFoundEditorInput)
|
||||||
|
{ // Don't open additional source not found editors if
|
||||||
|
// there is one to reuse.
|
||||||
|
editor[0] = page.openEditor(input, id, false, IWorkbenchPage.MATCH_ID);
|
||||||
|
if (editor[0] instanceof IReusableEditor) {
|
||||||
|
IReusableEditor re = (IReusableEditor)editor[0];
|
||||||
|
if (! input.equals(re.getEditorInput()))
|
||||||
|
re.setInput(input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
editor[0] = page.openEditor(input, id, false);
|
||||||
} catch (PartInitException e) {}
|
} catch (PartInitException e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue