Top Description Fields Constructors Methods
org.eclipse.swt.custom

public Class StyledTextDropTargetEffect

extends DropTargetEffect
Class Inheritance
Imports
org.eclipse.swt.*, org.eclipse.swt.dnd.*, org.eclipse.swt.graphics.*, org.eclipse.swt.widgets.*

This adapter class provides a default drag under effect (eg. select and scroll) when a drag occurs over a StyledText.

Classes that wish to provide their own drag under effect for a StyledText can extend this class, override the StyledTextDropTargetEffect.dragOver method and override any other applicable methods in StyledTextDropTargetEffect to display their own drag under effect.

Subclasses that override any methods of this class should call the corresponding super method to get the default drag under effect implementation.

The feedback value is either one of the FEEDBACK constants defined in class DND which is applicable to instances of this class, or it must be built by bitwise OR'ing together (that is, using the int "|" operator) two or more of those DND effect constants.

Feedback:
FEEDBACK_SELECT, FEEDBACK_SCROLL
Since
3.3
See Also
DropTargetAdapter, DropTargetEvent, Sample code and further information

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv int
pack-priv Listener
pack-priv static final int
pack-priv static final int
pack-priv long
pack-priv int
pack-priv int

Constructor Summary

AccessConstructor and Description
public
StyledTextDropTargetEffect(StyledText
the StyledText over which the user positions the cursor to drop the data
styledText
)

Creates a new StyledTextDropTargetEffect to handle the drag under effect on the specified StyledText.

Method Summary

Modifier and TypeMethod and Description
public void
dragEnter(DropTargetEvent
the information associated with the drag start event
event
)

Overrides org.eclipse.swt.dnd.DropTargetAdapter.dragEnter.

Implements org.eclipse.swt.dnd.DropTargetListener.dragEnter.

This implementation of dragEnter provides a default drag under effect for the feedback specified in event.feedback.
public void
dragLeave(DropTargetEvent
the information associated with the drag leave event
event
)

Overrides org.eclipse.swt.dnd.DropTargetAdapter.dragLeave.

Implements org.eclipse.swt.dnd.DropTargetListener.dragLeave.

This implementation of dragLeave provides a default drag under effect for the feedback specified in event.feedback.
public void
dragOver(DropTargetEvent
the information associated with the drag over event
event
)

Overrides org.eclipse.swt.dnd.DropTargetAdapter.dragOver.

Implements org.eclipse.swt.dnd.DropTargetListener.dragOver.

This implementation of dragOver provides a default drag under effect for the feedback specified in event.feedback.
public void
dropAccept(DropTargetEvent
the information associated with the drop accept event
event
)

Overrides org.eclipse.swt.dnd.DropTargetAdapter.dropAccept.

Implements org.eclipse.swt.dnd.DropTargetListener.dropAccept.

This implementation of dropAccept provides a default drag under effect for the feedback specified in event.feedback.
pack-priv void
refreshCaret(StyledText text, int oldOffset, int newOffset)

Inherited from org.eclipse.swt.dnd.DropTargetEffect:
getControlgetItem

Field Detail

CARET_WIDTHback to summary
pack-priv static final int CARET_WIDTH
currentOffsetback to summary
pack-priv int currentOffset
paintListenerback to summary
pack-priv Listener paintListener
SCROLL_HYSTERESISback to summary
pack-priv static final int SCROLL_HYSTERESIS
SCROLL_TOLERANCEback to summary
pack-priv static final int SCROLL_TOLERANCE
scrollBeginTimeback to summary
pack-priv long scrollBeginTime
scrollXback to summary
pack-priv int scrollX
scrollYback to summary
pack-priv int scrollY

Constructor Detail

StyledTextDropTargetEffectback to summary
public StyledTextDropTargetEffect(StyledText styledText)

Creates a new StyledTextDropTargetEffect to handle the drag under effect on the specified StyledText.

Parameters
styledText:StyledText

the StyledText over which the user positions the cursor to drop the data

Method Detail

dragEnterback to summary
public void dragEnter(DropTargetEvent event)

Overrides org.eclipse.swt.dnd.DropTargetAdapter.dragEnter.

Implements org.eclipse.swt.dnd.DropTargetListener.dragEnter.

This implementation of dragEnter provides a default drag under effect for the feedback specified in event.feedback. For additional information see DropTargetAdapter.dragEnter. Subclasses that override this method should call super.dragEnter(event) to get the default drag under effect implementation.

Parameters
event:DropTargetEvent

the information associated with the drag start event

Annotations
@Override
See Also
DropTargetAdapter, DropTargetEvent
dragLeaveback to summary
public void dragLeave(DropTargetEvent event)

Overrides org.eclipse.swt.dnd.DropTargetAdapter.dragLeave.

Implements org.eclipse.swt.dnd.DropTargetListener.dragLeave.

This implementation of dragLeave provides a default drag under effect for the feedback specified in event.feedback. For additional information see DropTargetAdapter.dragLeave. Subclasses that override this method should call super.dragLeave(event) to get the default drag under effect implementation.

Parameters
event:DropTargetEvent

the information associated with the drag leave event

Annotations
@Override
See Also
DropTargetAdapter, DropTargetEvent
dragOverback to summary
public void dragOver(DropTargetEvent event)

Overrides org.eclipse.swt.dnd.DropTargetAdapter.dragOver.

Implements org.eclipse.swt.dnd.DropTargetListener.dragOver.

This implementation of dragOver provides a default drag under effect for the feedback specified in event.feedback. For additional information see DropTargetAdapter.dragOver. Subclasses that override this method should call super.dragOver(event) to get the default drag under effect implementation.

Parameters
event:DropTargetEvent

the information associated with the drag over event

Annotations
@Override
See Also
DropTargetAdapter, DropTargetEvent, DND#FEEDBACK_SELECT, DND#FEEDBACK_SCROLL
dropAcceptback to summary
public void dropAccept(DropTargetEvent event)

Overrides org.eclipse.swt.dnd.DropTargetAdapter.dropAccept.

Implements org.eclipse.swt.dnd.DropTargetListener.dropAccept.

This implementation of dropAccept provides a default drag under effect for the feedback specified in event.feedback. For additional information see DropTargetAdapter.dropAccept. Subclasses that override this method should call super.dropAccept(event) to get the default drag under effect implementation.

Parameters
event:DropTargetEvent

the information associated with the drop accept event

Annotations
@Override
See Also
DropTargetAdapter, DropTargetEvent
refreshCaretback to summary
pack-priv void refreshCaret(StyledText text, int oldOffset, int newOffset)