mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 08:46:02 +02:00
Bug 398611 - Set input for the Outline page conditionally to avoid
unnecessary updates.
This commit is contained in:
parent
c1a87bc4a7
commit
ca03d0d23a
1 changed files with 12 additions and 2 deletions
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* 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 = new CContentOutlinePage(this);
|
||||||
fOutlinePage.addSelectionChangedListener(this);
|
fOutlinePage.addSelectionChangedListener(this);
|
||||||
}
|
}
|
||||||
setOutlinePageInput(fOutlinePage, getEditorInput());
|
setOutlinePageInputIfNotSame(fOutlinePage, getEditorInput());
|
||||||
return fOutlinePage;
|
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.
|
* Determines if folding is enabled.
|
||||||
* @return <code>true</code> if folding is enabled, <code>false</code> otherwise.
|
* @return <code>true</code> if folding is enabled, <code>false</code> otherwise.
|
||||||
|
|
Loading…
Add table
Reference in a new issue