Bug 215743 - Allow Drag & Drop for modal Dialogs
Allow Drag & Drop for modal Dialogs
Status: RESOLVED FIXED
Product: platform
Classification: Unclassified
Component: Explorer
7.1.2
All All
: P3 (vote)
: 7.3
Assigned To: Jaroslav Tulach
issues@platform
: PLAN
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-20 05:23 UTC by maxnitribitt
Modified: 2012-07-24 16:34 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maxnitribitt 2012-07-20 05:23:24 UTC
Perceived Behaviour:

DnD of nodes doesn't work in modal dialogs. I've got a panel with a BeanTreeView and DnD enabled Nodes. DnD works when I put it in a TopComponent or a non-modal dialog. It silently fails when in a modal dialog.

Expected behaviour:

DnD should work in modal dialogs.

Workaround:

None

Usecase: 

My usecase is a custom PropertyEditor which uses an explorerview and node reordering for setting the property.

Bug Analyis:

DnD in modal Dialogs was removed in 2002:
http://netbeans.org/bugzilla/show_bug.cgi?id=22618

The reason was a bug in  JDK 1.4.0:

"DnD in modal dialogs freezes the JVM in
JDK 1.4.0.  We detect the situation, log it and don't allow DnD.  This
is a bug in JDK which has been fixed for 1.4.1."
http://netbeans.org/bugzilla/show_bug.cgi?id=25848

Since the bug has been fixed and NB requires at least JDK 1.6, could you replace these lines from ExplorerDragSupport, which prevent using DnD in modal dialogs:

Dialog d = (Dialog) SwingUtilities.getAncestorOfClass(Dialog.class, comp);

            if ((d != null) && d.isModal()) {
                exDnD.setDnDActive(false);

                return;
            } else {
                exDnD.setDnDActive(true);
                dge.startDrag(null, transferable, this);
            }

with something like:
exDnD.setDnDActive(true);
dge.startDrag(null, transferable, this);
Comment 1 Stanislav Aubrecht 2012-07-23 12:22:15 UTC
core-main f72a1fe1bd6d
Comment 2 Quality Engineering 2012-07-24 16:34:33 UTC
Integrated into 'main-golden', will be available in build *201207241500* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f72a1fe1bd6d
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #215743 - Allow Drag & Drop for modal Dialogs


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo