mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-02 22:55:26 +02:00
[cleanup][189262] Avoid unnecessary casts
This commit is contained in:
parent
ec4f6c3b2a
commit
37cacfc24b
1 changed files with 7 additions and 9 deletions
|
@ -2920,9 +2920,10 @@ public class SystemView extends SafeTreeViewer
|
|||
Widget match = (Widget) matches.get(idx);
|
||||
// a reference to this remote object
|
||||
if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) {
|
||||
Object data = match.getData();
|
||||
boolean wasExpanded = ((TreeItem)match).getExpanded();
|
||||
smartRefresh(new TreeItem[] { (TreeItem) match }); // refresh the remote object
|
||||
TreeItem matchedItem = (TreeItem)match;
|
||||
Object data = matchedItem.getData();
|
||||
boolean wasExpanded = matchedItem.getExpanded();
|
||||
smartRefresh(new TreeItem[] { matchedItem }); // refresh the remote object
|
||||
if (firstSelection && // for now, we just select the first binary occurrence we find
|
||||
(data == remoteObject)) // same binary object as given?
|
||||
{
|
||||
|
@ -2934,13 +2935,10 @@ public class SystemView extends SafeTreeViewer
|
|||
{
|
||||
allowExpand = rmtAdapter.hasChildren((IAdaptable)data);
|
||||
}
|
||||
if (match instanceof Item)
|
||||
if (allowExpand && wasExpanded && !getExpanded(matchedItem)) // assume if callers wants to select kids that they want to expand parent
|
||||
{
|
||||
if (allowExpand && wasExpanded && !getExpanded((Item)match)) // assume if callers wants to select kids that they want to expand parent
|
||||
{
|
||||
createChildren(match);
|
||||
setExpanded((Item)match, true);
|
||||
}
|
||||
createChildren(matchedItem);
|
||||
setExpanded(matchedItem, true);
|
||||
}
|
||||
// todo: handle cumulative selections.
|
||||
// STEP 4: If requested, select the kids in the newly refreshed object.
|
||||
|
|
Loading…
Add table
Reference in a new issue