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 57972
Collapse All | Expand All

(-)DragDropUtilities.java (-22 / +18 lines)
Lines 174-206 Link Here
174
        Transferable[] tArray = new Transferable[nodes.length];
174
        Transferable[] tArray = new Transferable[nodes.length];
175
        //System.out.println("Sel count: " + nodes.length); // NOI18N
175
        //System.out.println("Sel count: " + nodes.length); // NOI18N
176
        for (int i = 0; i < nodes.length; i++) {
176
        for (int i = 0; i < nodes.length; i++) {
177
            Clipboard c = getClipboard();
177
            if ((dragAction & DnDConstants.ACTION_MOVE) != 0) {
178
            if (c instanceof ExClipboard) {
178
                tArray[i] = nodes[i].clipboardCut();
179
                ExClipboard cb = (ExClipboard)c;
179
                //System.out.println("Clipboard CUT for node: "+nodes[0]);
180
                if ((dragAction & DnDConstants.ACTION_MOVE) != 0) {
181
                    tArray[i] = cb.convert (nodes[i].clipboardCut());
182
                    //System.out.println("Clipboard CUT for node: "+nodes[0]);
183
                } else {
184
                    tArray[i] = cb.convert (nodes[i].clipboardCopy());
185
                    //System.out.println("Clipboard COPY for node: "+nodes[0]);
186
                }
187
            } else {
180
            } else {
188
                // In case of standalone library we cannot do
181
                tArray[i] = nodes[i].clipboardCopy();
189
                // conversion here. Is this ok?
182
                //System.out.println("Clipboard COPY for node: "+nodes[0]);
190
                if ((dragAction & DnDConstants.ACTION_MOVE) != 0) {
191
                    tArray[i] = nodes[i].clipboardCut();
192
                    //System.out.println("Clipboard CUT for node: "+nodes[0]);
193
                } else {
194
                    tArray[i] = nodes[i].clipboardCopy();
195
                    //System.out.println("Clipboard COPY for node: "+nodes[0]);
196
                }
197
            }
183
            }
198
        }
184
        }
185
        
186
        Transferable result;
187
199
        if (tArray.length == 1)
188
        if (tArray.length == 1)
200
            // only one node, so return regular single transferable
189
            // only one node, so return regular single transferable
201
            return tArray[0];
190
            result = tArray[0];
202
        // enclose the transferables into multi transferable
191
        else
203
        return new Multi(tArray);
192
            // enclose the transferables into multi transferable
193
            result = new Multi(tArray);
194
195
        Clipboard c = getClipboard();
196
        if (c instanceof ExClipboard)
197
            return ((ExClipboard) c).convert(result);
198
        else
199
            return result;
204
    }
200
    }
205
201
206
    /** Returns transferable of given node
202
    /** Returns transferable of given node

Return to bug 57972