Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SWTBot/GSOC dragndrop"

 
Line 34: Line 34:
  
 
Requirements support:
 
Requirements support:
* Usage must be consistent with current SWTBot APIs. <span style="color:#00FF00;font-weight:bold">YES</span>
+
* Usage must be consistent with current SWTBot APIs. <span style="color:green;font-weight:bold">YES</span>
* Usage must be homogeneous in SWTBot, and must be the same for all possible controls and concepts <span style="color:#00FF00;font-weight:bold">YES</span>
+
* Usage must be homogeneous in SWTBot, and must be the same for all possible controls and concepts <span style="color:green;font-weight:bold">YES</span>
* It must support SWT and GEF <span style="color:#FF0000;font-weight:bold">NO</span>
+
* It must support SWT and GEF <span style="color:orange;font-weight:bold">NOT IMPLEMENTED</span>
* This must be supported by Test Recorder and Generator (addition of rules) <span style="color:#FF0000;font-weight:bold">NO</span>
+
* This must be supported by Test Recorder and Generator (addition of rules) <span style="color:orange;font-weight:bold">NOT IMPLEMENTED</span>
* It should support the concept of path (allow intermediary drags to before a drop) <span style="color:#FF0000;font-weight:bold">NO</span>
+
* It should support the concept of path (allow intermediary drags to before a drop) <span style="color:orange;font-weight:bold">NOT IMPLEMENTED</span>
* Support for Transfer in order to test drops coming from external applications. <span style="color:#FF0000;font-weight:bold">NO</span>
+
* Support for Transfer in order to test drops coming from external applications. <span style="color:orange;font-weight:bold">NOT IMPLEMENTED</span>
  
  
Line 56: Line 56:
  
 
Requirements support:
 
Requirements support:
* Usage must be consistent with current SWTBot APIs. <span style="color:#FF0000;font-weight:bold">NO</span>
+
* Usage must be consistent with current SWTBot APIs. <span style="color:red;font-weight:bold">NO</span>
* Usage must be homogeneous in SWTBot, and must be the same for all possible controls and concepts <span style="color:#00FF00;font-weight:bold">YES</span>
+
* Usage must be homogeneous in SWTBot, and must be the same for all possible controls and concepts <span style="color:green;font-weight:bold">YES</span>
* It must support SWT and GEF <span style="color:#00FF00;font-weight:bold">YES<span>
+
* It must support SWT and GEF <span style="color:green;font-weight:bold">YES<span>
* This must be supported by Test Recorder and Generator (addition of rules) <span style="color:#FF0000;font-weight:bold">NO</span>
+
* This must be supported by Test Recorder and Generator (addition of rules) <span style="color:orange;font-weight:bold">NOT IMPLEMENTED</span>
* It should support the concept of path (allow intermediary drags to before a drop) <span style="color:#FF0000;font-weight:bold">NO</span>
+
* It should support the concept of path (allow intermediary drags to before a drop) <span style="color:orange;font-weight:bold">NOT IMPLEMENTED</span>
* Support for Transfer in order to test drops coming from external applications. <span style="color:#FF0000;font-weight:bold">NO</span>
+
* Support for Transfer in order to test drops coming from external applications. <span style="color:orange;font-weight:bold">NOT IMPLEMENTED</span>
  
 
=== DragSource and DropTarget object ===
 
=== DragSource and DropTarget object ===
Line 75: Line 75:
  
 
Requirements support:
 
Requirements support:
* Usage must be consistent with current SWTBot APIs. <span style="color:#FF0000;font-weight:bold">NO</span>
+
* Usage must be consistent with current SWTBot APIs. <span style="color:red;font-weight:bold">NO</span>
* Usage must be homogeneous in SWTBot, and must be the same for all possible controls and concepts <span style="color:#00FF00;font-weight:bold">YES</span>
+
* Usage must be homogeneous in SWTBot, and must be the same for all possible controls and concepts <span style="color:green;font-weight:bold">YES</span>
* It must support SWT and GEF
+
* It must support SWT and GEF <span style="color:orange;font-weight:bold">NOT IMPLEMENTED</span>
* This must be supported by Test Recorder and Generator (addition of rules)
+
* This must be supported by Test Recorder and Generator (addition of rules) <span style="color:orange;font-weight:bold">NOT IMPLEMENTED</span>
* It should support the concept of path (allow intermediary drags to before a drop)
+
* It should support the concept of path (allow intermediary drags to before a drop) <span style="color:orange;font-weight:bold">NOT IMPLEMENTED</span>
* Support for Transfer in order to test drops coming from external applications.
+
* Support for Transfer in order to test drops coming from external applications. <span style="color:green;font-weight:bold">YES</span>

Latest revision as of 06:53, 5 July 2013

This page contains various thoughts/proposals/snippets developed in order to support Drag'n'Drop in SWTBot in a smart and efficient way. Most of this was produced by Rohit AGRAWAL as part of Google Summer of Code 2013. See Rohit's proposal.

Requirements

  • Usage must be consistent with current SWTBot APIs (
    widget.action()
    ). We can expect a method on AbstractSWTBot.
  • Usage must be homogeneous in SWTBot, and must be the same for all possible controls and concepts
  • It must support SWT and GEF
  • This must be supported by Test Recorder and Generator (addition of rules)

Optional, if supported those features should be considered as secondary, and should not be necessary to deal with simple DND API.

  • It should support the concept of path (allow intermediary drags to before a drop)
  • Support for Transfer in order to test drops coming from external applications.

Main use-cases

So far, here are the 2 main use-cases that were identified based on community feedback:

  • Drag'n'Drop of Tree elements
  • Drag'n'Drop of GEF elements

Proposals

AbstractSWTBot<? extends Widget> dragAndDrop

This is a patch that was proposed early on https://bugs.eclipse.org/bugs/show_bug.cgi?id=285271: Example:

final SWTBotTree sourceTree = bot.tree(0);
final SWTBotTree targetTree = bot.tree(1);
final SWTBotTreeItem sourceItem = sourceTree.getTreeItem("Drag Source name 0");
final SWTBotTreeItem targetItem = targetTree.getTreeItem("Drop Target name 0");
 
sourceItem.dragAndDrop(targetItem);

Requirements support:

  • Usage must be consistent with current SWTBot APIs. YES
  • Usage must be homogeneous in SWTBot, and must be the same for all possible controls and concepts YES
  • It must support SWT and GEF NOT IMPLEMENTED
  • This must be supported by Test Recorder and Generator (addition of rules) NOT IMPLEMENTED
  • It should support the concept of path (allow intermediary drags to before a drop) NOT IMPLEMENTED
  • Support for Transfer in order to test drops coming from external applications. NOT IMPLEMENTED


DNDUtils

This is the workaround that has been extensively used so far. It's an utility class that is attached to https://bugs.eclipse.org/bugs/show_bug.cgi?id=285271:

final SWTBotTree sourceTree = bot.tree(0);
final SWTBotTree targetTree = bot.tree(1);
final SWTBotTreeItem sourceItem = sourceTree.getTreeItem("Drag Source name 0");
final SWTBotTreeItem targetItem = targetTree.getTreeItem("Drop Target name 0");
 
DNDUtils.dragAndDrop(sourceItem, targetItem)

Requirements support:

  • Usage must be consistent with current SWTBot APIs. NO
  • Usage must be homogeneous in SWTBot, and must be the same for all possible controls and concepts YES
  • It must support SWT and GEF YES
  • This must be supported by Test Recorder and Generator (addition of rules) NOT IMPLEMENTED
  • It should support the concept of path (allow intermediary drags to before a drop) NOT IMPLEMENTED
  • Support for Transfer in order to test drops coming from external applications. NOT IMPLEMENTED

DragSource and DropTarget object

This API is somewhat similar to how DND is implemented in SWT.

DragSource source = new DragSource(dragWidget, operations);
DropTarget target = new DropTarget(dropWidget, operations);
source.setTransfer(dragTransferType);
target.setTransfer(dropTransferType);
DragAndDrop(source,target);

Requirements support:

  • Usage must be consistent with current SWTBot APIs. NO
  • Usage must be homogeneous in SWTBot, and must be the same for all possible controls and concepts YES
  • It must support SWT and GEF NOT IMPLEMENTED
  • This must be supported by Test Recorder and Generator (addition of rules) NOT IMPLEMENTED
  • It should support the concept of path (allow intermediary drags to before a drop) NOT IMPLEMENTED
  • Support for Transfer in order to test drops coming from external applications. YES

Back to the top