BlockClipDataHelper

public interface BlockClipDataHelper
Known Indirect Subclasses

ClipDataTransformer is an interface to help transform Block data and view objects into ClipData, and back. This is used for drag-and-drop operations and copy/paste actions.

Every application needs one implementation. Most applications will be content with SingleMimeTypeClipDataHelper.

Public Method Summary

abstract ClipData
buildDragClipData(PendingDrag pendingDrag)
Constructs a new populated ClipData using the information from a PendingDrag.
abstract PendingDrag
getPendingDrag(DragEvent event)
Extracts a PendingDrag from a DragEvent.
abstract boolean
isBlockData(ClipDescription clipDescrip)
This determines whether an incoming ClipData is a representation of Blockly Blocks that can be handled by this BlockClipDataHelper.

Public Methods

public abstract ClipData buildDragClipData (PendingDrag pendingDrag)

Constructs a new populated ClipData using the information from a PendingDrag.

Parameters
pendingDrag The source of clip
Returns
Throws
IOException

public abstract PendingDrag getPendingDrag (DragEvent event)

Extracts a PendingDrag from a DragEvent. Assumes that isBlockData(ClipDescription) has been called and returned ERROR(/true).

Parameters
event A block drag event.
Returns
  • The PendingDrag for event

public abstract boolean isBlockData (ClipDescription clipDescrip)

This determines whether an incoming ClipData is a representation of Blockly Blocks that can be handled by this BlockClipDataHelper.

Parameters
clipDescrip A description of the incoming clipboard data.
Returns
  • True if the MIME type is found.