1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 398611 - Set input for the Outline page conditionally to avoid

unnecessary updates.
This commit is contained in:
Sergey Prigogin 2013-01-20 20:51:40 -08:00
parent c1a87bc4a7
commit ca03d0d23a

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2012 IBM Corporation and others.
* Copyright (c) 2005, 2013 IBM Corporation 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
@ -1637,7 +1637,7 @@ public class CEditor extends TextEditor implements ICEditor, ISelectionChangedLi
fOutlinePage = new CContentOutlinePage(this);
fOutlinePage.addSelectionChangedListener(this);
}
setOutlinePageInput(fOutlinePage, getEditorInput());
setOutlinePageInputIfNotSame(fOutlinePage, getEditorInput());
return fOutlinePage;
}
@ -2567,6 +2567,16 @@ public class CEditor extends TextEditor implements ICEditor, ISelectionChangedLi
}
}
private static void setOutlinePageInputIfNotSame(CContentOutlinePage page, IEditorInput input) {
if (page != null) {
IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager();
IWorkingCopy workingCopy = manager.getWorkingCopy(input);
if (workingCopy != page.getRoot()) {
page.setInput(workingCopy);
}
}
}
/**
* Determines if folding is enabled.
* @return <code>true</code> if folding is enabled, <code>false</code> otherwise.