public class OleDragDropHelper
extends java.lang.Object
OLEStartDrag Occurs when an OLE drag-drop operation is initiated either manually or automatically. This event is initiated as soon as the control's OLEDrag method is invoked. If a value is not assigned to the Data parameter then the GetData method of the fpDataObject initiates the OLESetData event to obtain the data.
OLESetData Occurs at the drag-drop source control when the drop target requests data that was not provided to the fpDataObject. This event is initiated when the target control requests data and the fpDataObject does not have data for that format because delayed rendering was used in the OLEStartDrag event.
OLEDragOver Occurs when the mouse is moved over the target control during an OLE drag-drop operation. The OLEDropMode property must be set to 1 (fpOLEDropModeManual) for the OLEDragOver event to occur. The Effect parameter is passed to this event from the OLEDragOver event (target control). Note: If the State parameter is set to 2 (fpLeave), indicating the pointer is outside of the control, then the X and Y parameters will be set to zero. Fired after every OLEDragOver event to allow the source component to provide visual feedback to the user.
OLEGiveFeedback Provides visual feedback through the pointer, by the source control for a drag-drop operation. If the DefaultCursors parameter is set to False, use the MousePointer property of the Screen object to specify the customized pointer.
OLEDragDrop Occurs when data is dropped onto the control. The OLEDropMode property must be set to 1 (fpOLEDropModeManual) for the OLEDragDrop event to occur. The OLEDragDrop event occurs at the target control when the mouse button is released. After this event occurs, call the GetFormat method of the fpDataObject to query whether or not the desired format is available, then call the GetData method of the fpDataObject to retrieve the data. The Effect parameters are passed to this event from the OLEStartDrag event (source control).
OLECompleteDrag Occurs at the source control after an OLE drag-drop operation has been completed or canceled. This is the last event to occur in an OLE drag-drop operation. The Effect parameter value is passed in from the target control's OLEDragDrop event. If the Effect parameter contains a value of 0, the drag-drop operation did not complete successfully.
Constructor and Description |
---|
OleDragDropHelper() |
Modifier and Type | Method and Description |
---|---|
private static void |
getMouseOleEventValues(Widget widget,
java.awt.event.MouseEvent e,
boolean isMouseOver)
Collect mouse event values which are used as parameters for OLE triggers.
|
static boolean |
isMouseOver(Widget<?> widget,
java.awt.event.MouseEvent e)
Check if mouse is over widget surface.
|
static void |
oleCompleteDrag(Widget<?> widget)
Fire OLE_COMPLETE_DRAG trigger.
|
static void |
oleDragDrop(Widget<?> widget,
java.awt.event.MouseEvent e)
Fire OLE_DRAG_DROP trigger.
|
static void |
oleDragOver(Widget<?> widget,
java.awt.event.MouseEvent e)
Fire OLE_DRAG_OVER followed by OLE_GIVE_FEEDBACK trigger.
|
static void |
oleSetData(int id,
int format)
Fire OLE_SET_DATA trigger.
|
static void |
oleStartDrag(Widget<?> widget)
Fire OLE_START_DRAG trigger.
|
static boolean |
supportOleDragDrop(Widget<?> widget)
Check if a widget support OLE Drag&Drop.
|
public static boolean supportOleDragDrop(Widget<?> widget)
widget
- Widget instance.true
if widget support OLE Drag&Draop false
if not.public static void oleStartDrag(Widget<?> widget)
widget
- Widget sourcepublic static void oleSetData(int id, int format)
id
- Widget source IDformat
- Requested format.public static void oleDragDrop(Widget<?> widget, java.awt.event.MouseEvent e)
widget
- Widget sourcee
- Mouse eventpublic static void oleDragOver(Widget<?> widget, java.awt.event.MouseEvent e)
widget
- Widget sourcee
- Mouse eventpublic static void oleCompleteDrag(Widget<?> widget)
widget
- Widget sourceprivate static void getMouseOleEventValues(Widget widget, java.awt.event.MouseEvent e, boolean isMouseOver)
widget
- the widgete
- The mouse event.isMouseOver
- true
if mouse cursor is over.public static boolean isMouseOver(Widget<?> widget, java.awt.event.MouseEvent e)
widget
- Widget sourcee
- Mouse eventtrue
if mouse is over widget area