DragDropSimple Sample

DragDropSimple demonstrates the IDE's support for drag/drop functionality between IDE windows. Through this functionality, you can enable users to copy data from one window to another by dragging items within the IDE. The DragDropSimple sample illustrates this with a tree view of static data; you can drag nodes from the tree to a document open in Source View to copy information from the tree to the source.

For more information on implementing drag-and-drop support in your extension, see Adding Support for Drag and Drop.

Note: Drag/drop support in WebLogic Workshop is in some ways a wrapper for the more general API provided by Java. For more information on drag/drop (also known as DnD) and data transfer in Java, see Drag and Drop with Swing at Sun's Java web site.

Concepts Demonstrated by this Sample

Location of Sample Files

To view the sample code in WebLogic Workshop:

  1. Start WebLogic Workshop.
  2. Open the following application installed to your file system:
  3. BEA_HOME\weblogic81\samples\workshop\ExtensionDevKit\IdeDevKit\IdeDevKit.work

  4. In the Application window, expand the folder at IdeDevKit -> DragDropSimple.

How to Run the Sample

To run this sample, open one of its files in WebLogic Workshop and click the Start button. The sample will build, copying the resulting extension JAR file to the WORKSHOP_HOME/extensions folder, then launch a new instance of WebLogic Workshop. If you've set breakpoints in the first IDE instance, these should be hit as you exercise the sample code in the new instance.

To use the sample extension, view the Drag Source Tree frame (if it's not visible, display it by clicking View -> Windows -> Drag Source Tree). Expand the tree in the frame and drag one of the nodes onto a source file in Source View. Text corresponding to the node should be copied into the source file.

For information on debugging extension samples, see Debugging Extensions.

Related Topics

Adding Support for Drag and Drop