mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 10:45:37 +02:00
[182622] dont' expand things that dont' have children
This commit is contained in:
parent
5923ec7386
commit
9c2d3393e7
1 changed files with 19 additions and 4 deletions
|
@ -2244,8 +2244,17 @@ ISelectionChangedListener, ITreeViewerListener, ISystemResourceChangeEvents, ISy
|
||||||
// first, restore previous selection...
|
// first, restore previous selection...
|
||||||
if (prevSelection != null) selectRemoteObjects(prevSelection, ss, parentSelectionItem);
|
if (prevSelection != null) selectRemoteObjects(prevSelection, ss, parentSelectionItem);
|
||||||
TreeItem selectedItem = getFirstSelectedTreeItem();
|
TreeItem selectedItem = getFirstSelectedTreeItem();
|
||||||
if (selectedItem != null) {
|
if (selectedItem != null)
|
||||||
if (!selectedItem.getExpanded()) // if the filter is expanded, then we already refreshed it...
|
{
|
||||||
|
Object data = selectedItem.getData();
|
||||||
|
boolean allowExpand = true;
|
||||||
|
ISystemViewElementAdapter adapter = getViewAdapter(data);
|
||||||
|
|
||||||
|
if (adapter != null && data instanceof IAdaptable)
|
||||||
|
{
|
||||||
|
allowExpand = adapter.hasChildren((IAdaptable)data);
|
||||||
|
}
|
||||||
|
if (allowExpand && !selectedItem.getExpanded()) // if the filter is expanded, then we already refreshed it...
|
||||||
{
|
{
|
||||||
createChildren(selectedItem);
|
createChildren(selectedItem);
|
||||||
selectedItem.setExpanded(true);
|
selectedItem.setExpanded(true);
|
||||||
|
@ -2805,8 +2814,14 @@ ISelectionChangedListener, ITreeViewerListener, ISystemResourceChangeEvents, ISy
|
||||||
(data == remoteObject)) // same binary object as given?
|
(data == remoteObject)) // same binary object as given?
|
||||||
{
|
{
|
||||||
firstSelection = false;
|
firstSelection = false;
|
||||||
if ((toSelect != null) && originatedHere) {
|
if ((toSelect != null) && originatedHere)
|
||||||
if (!getExpanded(match)) // assume if callers wants to select kids that they want to expand parent
|
{
|
||||||
|
boolean allowExpand = true;
|
||||||
|
if (rmtAdapter != null && data instanceof IAdaptable)
|
||||||
|
{
|
||||||
|
allowExpand = rmtAdapter.hasChildren((IAdaptable)data);
|
||||||
|
}
|
||||||
|
if (allowExpand && !getExpanded(match)) // assume if callers wants to select kids that they want to expand parent
|
||||||
{
|
{
|
||||||
createChildren(match);
|
createChildren(match);
|
||||||
setExpanded(match, true);
|
setExpanded(match, true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue