mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 21:15:23 +02:00
[187739] changed getContextObject() to return ContextObjectWithViewer and removed unnecessary casts
This commit is contained in:
parent
a1992ec815
commit
7658fb8a5b
1 changed files with 8 additions and 8 deletions
|
@ -3423,7 +3423,7 @@ public class SystemView extends SafeTreeViewer
|
||||||
protected void internalRefreshStruct(Widget widget, Object element, boolean updateLabels) {
|
protected void internalRefreshStruct(Widget widget, Object element, boolean updateLabels) {
|
||||||
if (widget instanceof TreeItem)
|
if (widget instanceof TreeItem)
|
||||||
{
|
{
|
||||||
ContextObjectWithViewer contextObject = (ContextObjectWithViewer)getContextObject((TreeItem)widget);
|
ContextObjectWithViewer contextObject = getContextObject((TreeItem)widget);
|
||||||
IRSECallback callback = null;
|
IRSECallback callback = null;
|
||||||
|
|
||||||
ArrayList expandedChildren = new ArrayList();
|
ArrayList expandedChildren = new ArrayList();
|
||||||
|
@ -6291,7 +6291,7 @@ public class SystemView extends SafeTreeViewer
|
||||||
Object[] newChildren = null;
|
Object[] newChildren = null;
|
||||||
if (match instanceof TreeItem)
|
if (match instanceof TreeItem)
|
||||||
{
|
{
|
||||||
IContextObject context = getContextObject((TreeItem)match);
|
ContextObjectWithViewer context = getContextObject((TreeItem)match);
|
||||||
newChildren = adapter.getChildren(context, new NullProgressMonitor());
|
newChildren = adapter.getChildren(context, new NullProgressMonitor());
|
||||||
internalAdd(match, parentElementOrTreePath, newChildren);
|
internalAdd(match, parentElementOrTreePath, newChildren);
|
||||||
}
|
}
|
||||||
|
@ -6319,7 +6319,7 @@ public class SystemView extends SafeTreeViewer
|
||||||
TreeItem parentItem = ((TreeItem)match).getParentItem();
|
TreeItem parentItem = ((TreeItem)match).getParentItem();
|
||||||
if (parentItem != null)
|
if (parentItem != null)
|
||||||
{
|
{
|
||||||
IContextObject context = getContextObject(parentItem);
|
ContextObjectWithViewer context = getContextObject(parentItem);
|
||||||
if (adapter.supportsDeferredQueries(context.getSubSystem())) {
|
if (adapter.supportsDeferredQueries(context.getSubSystem())) {
|
||||||
CheckExistenceJob job = new CheckExistenceJob((IAdaptable)parentElementOrTreePath, parentItem, context);
|
CheckExistenceJob job = new CheckExistenceJob((IAdaptable)parentElementOrTreePath, parentItem, context);
|
||||||
job.schedule();
|
job.schedule();
|
||||||
|
@ -6434,7 +6434,7 @@ public class SystemView extends SafeTreeViewer
|
||||||
* @param item the item to get the context for
|
* @param item the item to get the context for
|
||||||
* @return the context object
|
* @return the context object
|
||||||
*/
|
*/
|
||||||
public IContextObject getContextObject(TreeItem item)
|
public ContextObjectWithViewer getContextObject(TreeItem item)
|
||||||
{
|
{
|
||||||
Object data = item.getData();
|
Object data = item.getData();
|
||||||
ISystemFilterReference filterReference = getContainingFilterReference(item);
|
ISystemFilterReference filterReference = getContainingFilterReference(item);
|
||||||
|
@ -6518,9 +6518,9 @@ public class SystemView extends SafeTreeViewer
|
||||||
Object d = widget.getData();
|
Object d = widget.getData();
|
||||||
if (d != null)
|
if (d != null)
|
||||||
{
|
{
|
||||||
Object parentElement = getContextObject((TreeItem)widget);
|
ContextObjectWithViewer parentElement = getContextObject((TreeItem)widget);
|
||||||
if (cb != null && parentElement instanceof ContextObjectWithViewer){
|
if (cb != null){
|
||||||
((ContextObjectWithViewer)parentElement).setCallback(cb);
|
parentElement.setCallback(cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
Object[] children = getSortedChildren(parentElement);
|
Object[] children = getSortedChildren(parentElement);
|
||||||
|
@ -6586,7 +6586,7 @@ public class SystemView extends SafeTreeViewer
|
||||||
ITreeContentProvider tcp = (ITreeContentProvider) cp;
|
ITreeContentProvider tcp = (ITreeContentProvider) cp;
|
||||||
if (elementOrTreePath instanceof TreeItem)
|
if (elementOrTreePath instanceof TreeItem)
|
||||||
{
|
{
|
||||||
IContextObject context = getContextObject((TreeItem)elementOrTreePath);
|
ContextObjectWithViewer context = getContextObject((TreeItem)elementOrTreePath);
|
||||||
return tcp.hasChildren(context);
|
return tcp.hasChildren(context);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue