1
0
Fork 0
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:
Martin Oberhuber 2007-06-04 09:54:06 +00:00
parent ec4f6c3b2a
commit 37cacfc24b

View file

@ -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.