Class EditorSiteDragAndDropServiceImpl
- All Implemented Interfaces:
IDragAndDropService
,IDisposable
Implementation for the IDragAndDropService
to be used from
EditorSite
's.
Adds a drop target to the given control that merges the site's drop behaviour
with that specified by the addMergedDropTarget
call.
The current implementation is only defined for EditorSite's and merges the given drop handling with the existing EditorSashContainer's behaviour.
NOTE: There is no cleanup (i.e. 'dispose') handling necessary for merged Drop Targets but the hooks are put into place to maintain the consistency of the implementation pattern.
- Since:
- 3.3
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMergedDropTarget
(Control control, int ops, Transfer[] transfers, DropTargetListener listener) Causes a drop target to be added to the given control that respects the existing site's drop behaviour in addition to the behaviour being specified for the given control.void
dispose()
Disposes of this service.void
removeMergedDropTarget
(Control control) Remove any previously 'merged' drop target for this Control
-
Constructor Details
-
EditorSiteDragAndDropServiceImpl
public EditorSiteDragAndDropServiceImpl()
-
-
Method Details
-
addMergedDropTarget
public void addMergedDropTarget(Control control, int ops, Transfer[] transfers, DropTargetListener listener) Description copied from interface:IDragAndDropService
Causes a drop target to be added to the given control that respects the existing site's drop behaviour in addition to the behaviour being specified for the given control.If a transfer type specified for the control matches one used by the site then the control's listener is called (the client is overriding the existing site behaviour which will no longer work).
NOTE: Site authors must use this method to add drop behaviour; directly adding drop targets using SWT onto a site will cause the standard site behaviour (i.e. dragging files / markers into the EditorSite...) to not work when that editor is active.
Note that this method may be used more than once should the part author wish to register different drop targets for internal controls (i.e. to support internal DnD).
- Specified by:
addMergedDropTarget
in interfaceIDragAndDropService
- Parameters:
control
- The control to add the drop behaviour toops
- The Drop operations used by this targettransfers
- The TransferTypes used by this targetlistener
- The listener controlling the target's behaviour
-
removeMergedDropTarget
Description copied from interface:IDragAndDropService
Remove any previously 'merged' drop target for this Control- Specified by:
removeMergedDropTarget
in interfaceIDragAndDropService
- Parameters:
control
- The control to remove the drop target for
-
dispose
public void dispose()Description copied from interface:IDisposable
Disposes of this service. All resources must be freed. All listeners must be detached. Dispose will only be called once during the life cycle of a service.- Specified by:
dispose
in interfaceIDisposable
-