This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 37802
Collapse All | Expand All

(-)openide/src/org/openide/explorer/view/VisualizerNode.java (+16 lines)
Lines 83-88 Link Here
83
83
84
    /** node. Do not modify!!! */
84
    /** node. Do not modify!!! */
85
    Node node;
85
    Node node;
86
    private final boolean debugme; // XXX
86
    /** system hashcode of the node */
87
    /** system hashcode of the node */
87
    private int hashCode;
88
    private int hashCode;
88
    /** visualizer children attached thru weak references Reference (VisualizerChildren) */
89
    /** visualizer children attached thru weak references Reference (VisualizerChildren) */
Lines 106-111 Link Here
106
    private VisualizerNode (int hashCode) {
107
    private VisualizerNode (int hashCode) {
107
        this.hashCode = hashCode;
108
        this.hashCode = hashCode;
108
        this.node = null;
109
        this.node = null;
110
        debugme = false;
109
    }
111
    }
110
112
111
    /** Creates new VisualizerNode
113
    /** Creates new VisualizerNode
Lines 123-128 Link Here
123
	name = UNKNOWN;
125
	name = UNKNOWN;
124
        displayName = UNKNOWN;
126
        displayName = UNKNOWN;
125
        shortDescription = UNKNOWN;
127
        shortDescription = UNKNOWN;
128
        debugme = node.getClass().getName().equals("org.netbeans.modules.tasklist.suggestions.SuggestionNode");
129
        if (debugme) System.err.println("created VN");
126
    }
130
    }
127
131
128
132
Lines 230-235 Link Here
230
    * @param ev event describing the action
234
    * @param ev event describing the action
231
    */
235
    */
232
    public void childrenAdded(NodeMemberEvent ev) {
236
    public void childrenAdded(NodeMemberEvent ev) {
237
        if (debugme) {
238
            new Throwable("VN.childrenAdded: " + ev).printStackTrace();
239
        }
233
        VisualizerChildren ch = (VisualizerChildren)children.get ();
240
        VisualizerChildren ch = (VisualizerChildren)children.get ();
234
        if (ch == null) return;
241
        if (ch == null) return;
235
242
Lines 242-247 Link Here
242
    * @param ev event describing the action
249
    * @param ev event describing the action
243
    */
250
    */
244
    public void childrenRemoved(NodeMemberEvent ev) {
251
    public void childrenRemoved(NodeMemberEvent ev) {
252
        if (debugme) {
253
            new Throwable("VN.childrenRemoved: " + ev).printStackTrace();
254
        }
245
        VisualizerChildren ch = (VisualizerChildren)children.get ();
255
        VisualizerChildren ch = (VisualizerChildren)children.get ();
246
        if (ch == null) return;
256
        if (ch == null) return;
247
        
257
        
Lines 252-262 Link Here
252
    * @param ev event describing the change
262
    * @param ev event describing the change
253
    */
263
    */
254
    public void childrenReordered(NodeReorderEvent ev) {
264
    public void childrenReordered(NodeReorderEvent ev) {
265
        if (debugme) {
266
            System.err.println("VN.childrenReordered: " + ev);
267
        }
255
        doChildrenReordered (ev.getPermutation ());
268
        doChildrenReordered (ev.getPermutation ());
256
    }
269
    }
257
    
270
    
258
    // helper method (called from TreeTableView.sort)
271
    // helper method (called from TreeTableView.sort)
259
    void doChildrenReordered (int[] perm) {
272
    void doChildrenReordered (int[] perm) {
273
        if (debugme) {
274
            new Throwable("VN.doChildrenReordered: " + java.util.Arrays.asList(org.openide.util.Utilities.toObjectArray(perm))).printStackTrace();
275
        }
260
        VisualizerChildren ch = (VisualizerChildren)children.get ();
276
        VisualizerChildren ch = (VisualizerChildren)children.get ();
261
        if (ch == null) return;
277
        if (ch == null) return;
262
278
(-)openide/src/org/openide/explorer/view/VisualizerChildren.java (+14 lines)
Lines 27-32 Link Here
27
    public final VisualizerNode parent;
27
    public final VisualizerNode parent;
28
    /** list of all objects here (VisualizerNode) */
28
    /** list of all objects here (VisualizerNode) */
29
    public final List list = new LinkedList ();
29
    public final List list = new LinkedList ();
30
    private final boolean debugme; // XXX
30
31
31
    /** Creates new VisualizerChildren.
32
    /** Creates new VisualizerChildren.
32
    * Can be called only from EventQueue.
33
    * Can be called only from EventQueue.
Lines 38-43 Link Here
38
            VisualizerNode v = VisualizerNode.getVisualizer (this, nodes[i]);
39
            VisualizerNode v = VisualizerNode.getVisualizer (this, nodes[i]);
39
            list.add (v);
40
            list.add (v);
40
        }
41
        }
42
        debugme = parent.node.getClass().getName().equals("org.netbeans.modules.tasklist.suggestions.SuggestionNode");
43
        if (debugme) {
44
            System.err.println("Created VC with " + Arrays.asList(nodes) + " so list=" + list + " in " + Thread.currentThread().getName());
45
        }
41
    }
46
    }
42
47
43
    /** Notification of children addded event. Modifies the list of nodes
48
    /** Notification of children addded event. Modifies the list of nodes
Lines 59-64 Link Here
59
            it.add (VisualizerNode.getVisualizer (this, nodes[inIndxs]));
64
            it.add (VisualizerNode.getVisualizer (this, nodes[inIndxs]));
60
            inIndxs++;
65
            inIndxs++;
61
        }
66
        }
67
        if (debugme) {
68
            System.err.println("VC: adding " + Arrays.asList(nodes) + " at " + Arrays.asList(org.openide.util.Utilities.toObjectArray(indxs)) + " so list=" + list + " in " + Thread.currentThread().getName());
69
        }
62
70
63
71
64
        VisualizerNode parent = this.parent;
72
        VisualizerNode parent = this.parent;
Lines 102-107 Link Here
102
            }
110
            }
103
            count++;
111
            count++;
104
        }
112
        }
113
        if (debugme) {
114
            System.err.println("VC: removing " + remList + " at " + Arrays.asList(org.openide.util.Utilities.toObjectArray(indx)) + " so list=" + list + " in " + Thread.currentThread().getName());
115
        }
105
        
116
        
106
        // notify event about changed indexes
117
        // notify event about changed indexes
107
        ev.setRemovedIndicies (indx);
118
        ev.setRemovedIndicies (indx);
Lines 162-167 Link Here
162
        list.clear ();
173
        list.clear ();
163
        list.addAll (Arrays.asList (arr));
174
        list.addAll (Arrays.asList (arr));
164
        assert !list.contains(null);
175
        assert !list.contains(null);
176
        if (debugme) {
177
            System.err.println("VC: reordering at " + Arrays.asList(org.openide.util.Utilities.toObjectArray(indxs)) + " so list=" + list + " in " + Thread.currentThread().getName());
178
        }
165
179
166
        VisualizerNode parent = this.parent;
180
        VisualizerNode parent = this.parent;
167
        while (parent != null) {
181
        while (parent != null) {

Return to bug 37802