Lines 14-25
Link Here
|
14 |
|
14 |
|
15 |
import java.beans.PropertyChangeEvent; |
15 |
import java.beans.PropertyChangeEvent; |
16 |
import java.beans.PropertyChangeListener; |
16 |
import java.beans.PropertyChangeListener; |
|
|
17 |
import java.util.Collection; |
17 |
import java.util.Collections; |
18 |
import java.util.Collections; |
18 |
import java.util.LinkedList; |
19 |
import java.util.LinkedList; |
19 |
import java.util.List; |
20 |
import java.util.List; |
20 |
import java.util.ListIterator; |
21 |
import java.util.ListIterator; |
21 |
import org.openide.nodes.Node; |
22 |
import org.openide.nodes.Node; |
22 |
import org.openide.nodes.Children; |
23 |
import org.openide.nodes.Children; |
|
|
24 |
import org.openide.util.Mutex; |
23 |
|
25 |
|
24 |
|
26 |
|
25 |
/** Children object for the Task list; used to track |
27 |
/** Children object for the Task list; used to track |
Lines 38-57
Link Here
|
38 |
|
40 |
|
39 |
private void refreshKeys() { |
41 |
private void refreshKeys() { |
40 |
List subtasks = parent.getSubtasks(); |
42 |
List subtasks = parent.getSubtasks(); |
|
|
43 |
final Collection myKeys; |
41 |
if (subtasks == null) { |
44 |
if (subtasks == null) { |
42 |
setKeys(Collections.EMPTY_SET); |
45 |
myKeys = Collections.EMPTY_SET; |
43 |
return; |
46 |
} else { |
|
|
47 |
myKeys = new LinkedList(); |
48 |
ListIterator it = subtasks.listIterator(); |
49 |
while (it.hasNext()) { |
50 |
Task item = (Task)it.next(); |
51 |
myKeys.add(item); |
52 |
} |
53 |
// XXX couldn't I just do |
54 |
// setKeys(parent.getSubtasks()) ?? Check if this method |
55 |
// clones the list... if it doesn't I can do it |
44 |
} |
56 |
} |
45 |
myKeys = new LinkedList(); |
57 |
// #37802: TreeTableView apparently chokes on non-EQ children updates. |
46 |
ListIterator it = subtasks.listIterator(); |
58 |
Mutex.EVENT.readAccess(new Runnable() { |
47 |
while (it.hasNext()) { |
59 |
public void run() { |
48 |
Task item = (Task)it.next(); |
60 |
setKeys(myKeys); |
49 |
myKeys.add(item); |
61 |
} |
50 |
} |
62 |
}); |
51 |
// XXX couldn't I just do |
|
|
52 |
// setKeys(parent.getSubtasks()) ?? Check if this method |
53 |
// clones the list... if it doesn't I can do it |
54 |
setKeys(myKeys); |
55 |
} |
63 |
} |
56 |
|
64 |
|
57 |
/** Called when the parent node is expanded; now we need |
65 |
/** Called when the parent node is expanded; now we need |