[
https://jira.jboss.org/jira/browse/JBIDE-3608?page=com.atlassian.jira.plu...
]
Rob Stryker commented on JBIDE-3608:
------------------------------------
Background:
CNF-based drag and drop support is pretty solid, however the API has a restriction that
1) any drop target must be an approved target (listed in plugin.xml) , and 2) the dragged
item must be an "acceptable child".
The "acceptable child" paradigm in CNF is for efficiency purposes. If each
extender declares what kind of children they'll have, the framework can more
accurately figure out for search / reveal / etc purposes what it's top-most parent
most likely is. However, this is unneccessary and undesirable for a drag-and-drop
scenerio as the dragged item might be unacceptable but the drop action may be able to
convert it properly into something it *can* have as a child.
Eclipse bugs:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=261506
https://bugs.eclipse.org/bugs/show_bug.cgi?id=261606
https://bugs.eclipse.org/bugs/show_bug.cgi?id=261865
The fix:
The fix was to override the dnd portion of CNF. In the current release that cannot be
done by overriding the DND service (which would be the optimal way to do it) because of
restrictive field access and subclassing requirements. So instead I had to override the
initDragAndDrop of the CommonViewer and replace the DropAdapter with one of my own. My
custom DropAdapter acted just like the CommonDropAdapter, except I couldn't subclass
CommonDropAdapter because the class was final. This would have been ok, except the
extension points where further contributers declare their drop assistants REQUIRES a
CommonDropAdapter.
In this way, anyone extending the JBossServersView via CNF API's to add Drop
extensions must be aware that though the API for CommonDropAdapterAssistant declares the
following method:
public abstract IStatus handleDrop(CommonDropAdapter aDropAdapter,
DropTargetEvent aDropTargetEvent, Object aTarget);
In *MY* view the first parameter, CommonDropAdapter, will *always* be null. There are
other ways to get all of the information you'll most likely need, however,
specifically source and destination, and an example of this is shown in the
ServersViewDropAdapterAssistant class.
HOW TO TEST:
1) Create a server
2) Create a plain java project with a text file (file.txt)
3) Try to drag the java project into the server
a) observe failure, dnd does not occur
4) Try to drag file.txt into the server
a) observe failure, dnd does not occur
5) right-click the text file, select "Make Deployable"
6) drag file.txt into "Filesets"
a) observe failure
7) drag file.txt onto server
a) observe server deploy and begin to startup **
At no point should you observe any obscure UI bugs, weird error messages, or a frozen UI.
** (NOTE: this functionality is how it is in the regular servers view. If you think this
is bad functionality then open a new bug for it. Do not use this one)
DND support in CNF-based Servers View
-------------------------------------
Key: JBIDE-3608
URL:
https://jira.jboss.org/jira/browse/JBIDE-3608
Project: Tools (JBoss Tools)
Issue Type: Feature Request
Affects Versions: 3.0.0.cr1
Reporter: Rob Stryker
Fix For: 3.0.0.CR2
DnD support doesn't exist. Fix it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira