blob: c7ba88ee040a0a4430df30c31dc197d9f6cc5919 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
/*******************************************************************************
* Copyright (c) 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers;
import org.eclipse.swt.widgets.Widget;
/**
* Implementation of an <code>IContainerRequestMonitor</code>. Collects whether
* an element contains children.
* <p>
* Not intended to be subclassed or instantiated by clients. For use
* speficially with <code>AsynchronousTreeViewer</code>.
* </p>
* @since 3.2
*/
class ContainerRequestMonitor extends AsynchronousRequestMonitor implements IContainerRequestMonitor {
/**
* Whether the item has children
*/
private boolean fIsChildren = false;
/**
* Constructs an update request for the given item in the given viewer.
*
* @param item item to update
* @param viewer viewer the update was issued for
*/
ContainerRequestMonitor(Widget item, AsynchronousTreeViewer viewer) {
super(item, viewer);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#performUpdate()
*/
protected void performUpdate() {
((AsynchronousTreeViewer)getViewer()).setIsContainer(getWidget(), fIsChildren);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#contains(org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor)
*/
protected boolean contains(AsynchronousRequestMonitor update) {
return (update instanceof ChildrenRequestMonitor || update instanceof ContainerRequestMonitor) && contains(update.getWidget());
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.IContainerRequestMonitor#setIsContainer(boolean)
*/
public void setIsContainer(boolean container) {
fIsChildren = container;
}
}
|