Extending : Processor editor extension : Extending the Processor editor : Creating editor objects by dragging and dropping items
  
Creating editor objects by dragging and dropping items
In the UDTT Processor editor, you can drag-and-drop an XUI page to create a Page state, a flow to create a SubFlow state, and an operation to create an Operation state. You can provide your own D&D code to extend Processor editor to accept another type drop as well as to override the default D&D support for dragging and dropping pages, flows, and operations.
The extension point is com.ibm.btt.tools.transaction.diagram.fileDrop
This graphic is described in the surrounding text.
The drag-and-drop handler has the following attributes:
class
The implementation class of the com.ibm.btt.tools.transaction.diagram.file.drop.IDiagramEditorDropFileHandler interface.
It defines two methods: accepts and parseDroppedFile. The accepts method is used to check whether the handler can accept the dropped item, and the parseDroppedFile file defines the action that occurs when the item is dropped. It is recommended that the class inherit from com.ibm.btt.tools.transaction.diagram.file.drop.DefaultDiagramEditorDropFileHandler.
priority
The priority of the handler. When an item is dropped, the Processor editor uses the handler with the highest priority to treat the current drop action. Valid values are low, medium, and high.
If you want to override the default drop actions of page, flow, and operation items, you must specify a drag-and-drop handler with medium or high priority because the priority of the default handler is low.
samples
FlowEditorJSFileDragAndDropHandler and FlowEditorXUIFileDragAndDropHandler are two customized drag-and-drop handlers registered to the Processor editor. The handlers allow to accept the javascript file(.js) to create a new customized JSSate state in the processor and override the default XUI drop by adding a comment to the page state created.
The implementation items for this sample are in the Drop4Extension project.
Implementation items for the drag-and-drop samples in the Drop4Extension project
 
Item name
Description
Reference information
Location
JSState.xml
State configuration file
Creating a configuration file for a palette object
palette folder in Drop4Extension project
Info16.PNG and Info32.PNG
Icons used to show State in Processor Palette and Canvas
Registering a palette object
icons folder in Drop4Extension project
JSStateMapping.xml
Palette object mapping file
Creating and registering an object mapping file
config folder in Drop4Extension project
JSStateRule.java
Property generation rule for JSState
Creating and registering an object mapping file
src/com/ibm/btt/tools/drop4extension./ransaction./generator/ule folder in the Drop4Extension project
FlowEditorXUIFileDragAndDropHandler.java
Drag-and-drop implementation class in runtime
 
src/com/ibm/btt/tools/drop4extension/transaction/presentation folder in the Drop4Extension project
FlowEditorJSFileDragAndDropHandler.java
Drag-and-drop implementation class in runtime
 
src/com/ibm/btt/tools/drop4extension/transaction/presentation folder in the Drop4Extension project
Go up to
Extending the Processor editor