|
GEF v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.eclipse.gef.dnd.AbstractTransferDropTargetListener
An abstract implementation of TransferDropTargetListener that adds a reference to
the EditPartViewer that contains the DropTarget widget.
| Constructor Summary | |
AbstractTransferDropTargetListener(EditPartViewer viewer)
Creates a new AbstractTransferDropTargetListener with the given EditPartViewer. |
|
AbstractTransferDropTargetListener(EditPartViewer viewer,
Transfer xfer)
Creates a new AbstractTransferDropTargetListener with the given EditPartViewer and Transfer. |
|
| Method Summary | |
void |
activate()
Called when this listener becomes enabled. |
protected abstract boolean |
canHandleDrop(DropTargetEvent event)
Subclasses should return true if they can handle this drop event. |
protected Request |
createTargetRequest()
Creates and returns a new Request. |
void |
deactivate()
Called when this listener is temporarily disabled. |
void |
dragEnter(DropTargetEvent event)
Updates the DropData and then handles the event. |
void |
dragLeave(DropTargetEvent event)
Updates the DropData, handles the event, and then unloads the drag event. |
void |
dragOperationChanged(DropTargetEvent event)
Updates the DropData and then handles the event. |
void |
dragOver(DropTargetEvent event)
Updates the DropData and then handles the event. |
void |
drop(DropTargetEvent event)
Updates the DropData and then handles the event. |
void |
dropAccept(DropTargetEvent event)
Updates the DropData and then handles the event. |
protected void |
eraseTargetFeedback()
Erases the target feedback if the target EditPart is not null. |
DropTargetEvent |
getCurrentEvent()
Returns the current DropTargetEvent. |
protected Point |
getDropLocation()
Returns the current mouse location, as a Draw2d Point, relative to the Control. |
protected int |
getPreviousDropType()
|
protected EditPart |
getTargetEditPart()
Returns the target EditPart. |
protected Request |
getTargetRequest()
Returns the target request. |
Transfer |
getTransfer()
Returns the Transfer type that this listener can handle. |
EditPartViewer |
getViewer()
Returns the EditPartViewer that is the target of the drop. |
protected boolean |
handleDragEnter()
Updates the target Request and EditPart. |
protected boolean |
handleDragLeave()
Erases target feedback. |
protected boolean |
handleDragOperationChanged()
Subclasses should return true when overriding this method. |
protected boolean |
handleDragOver()
Updates the target Request and EditPart. |
protected boolean |
handleDrop()
Sets the event's detail field to DND.DROP_NONE if its
data field is null. |
protected boolean |
handleDropAccept()
Subclasses should return true when overriding this method. |
protected boolean |
handleEnteredEditPart()
Shows target feedback. |
protected boolean |
handleExitingEditPart()
Erases target feedback. |
boolean |
isEnabled(DropTargetEvent event)
Returns true if one of the TransferData types in the event is
supported by this listener. |
void |
setCurrentEvent(DropTargetEvent currentEvent)
Sets the current DropTargetEvent. |
protected void |
setTargetEditPart(EditPart ep)
Sets the target EditPart. |
void |
setTransfer(Transfer xfer)
Sets the Tranfer type that this listener can handle. |
void |
setViewer(EditPartViewer viewer)
Sets the EditPartViewer. |
protected void |
showTargetFeedback()
Asks the target EditPart to show target feedback if it is not null. |
void |
unload()
Erases target feedback and sets the request to null. |
protected void |
updateTargetEditPart()
Updates the target EditPart. |
protected abstract void |
updateTargetRequest()
Subclasses should implement this to update the target Request. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractTransferDropTargetListener(EditPartViewer viewer)
public AbstractTransferDropTargetListener(EditPartViewer viewer,
Transfer xfer)
| Method Detail |
public void activate()
TransferDropTargetListeneractivate in interface TransferDropTargetListenerTransferDropTargetListener.activate()protected abstract boolean canHandleDrop(DropTargetEvent event)
true if they can handle this drop event.protected Request createTargetRequest()
public void deactivate()
null.deactivate in interface TransferDropTargetListenerTransferDropTargetListener.deactivate()public void dragEnter(DropTargetEvent event)
handleDragEnter() to perform actions for this event.dragEnter in interface DropTargetListenerpublic void dragLeave(DropTargetEvent event)
handleDragLeave() to
perform actions for this event.dragLeave in interface DropTargetListenerpublic void dragOperationChanged(DropTargetEvent event)
handleDragOperationChanged() to perform actions for this event.dragOperationChanged in interface DropTargetListenerpublic void dragOver(DropTargetEvent event)
handleDragOver() to perform actions for this event.dragOver in interface DropTargetListenerpublic void drop(DropTargetEvent event)
handleDrop() to perform actions for this event.drop in interface DropTargetListenerpublic void dropAccept(DropTargetEvent event)
handleDropAccept() to perform actions for this event.dropAccept in interface DropTargetListenerprotected void eraseTargetFeedback()
null.EditPart.eraseTargetFeedback(Request)public DropTargetEvent getCurrentEvent()
protected Point getDropLocation()
protected int getPreviousDropType()
protected EditPart getTargetEditPart()
protected Request getTargetRequest()
createTargetRequest() is called and the newly
created request is returned.public Transfer getTransfer()
getTransfer in interface TransferDropTargetListenerpublic EditPartViewer getViewer()
protected boolean handleDragEnter()
true when overriding this method.protected boolean handleDragLeave()
true
when overriding this method.protected boolean handleDragOperationChanged()
true when overriding this method.protected boolean handleDragOver()
true when overriding this method.protected boolean handleDrop()
detail field to DND.DROP_NONE if its
data field is null. Otherwise, updates the target
Request and EditPart, gets a command from the target EditPart, then executes
that command.protected boolean handleDropAccept()
true when overriding this method.protected boolean handleEnteredEditPart()
true when
overriding this method.protected boolean handleExitingEditPart()
true when
overriding this method.public boolean isEnabled(DropTargetEvent event)
true if one of the TransferData types in the event is
supported by this listener. Also has the side effect of setting
event.currentDataType to the first supported TransferData type.isEnabled in interface TransferDropTargetListenerpublic void setCurrentEvent(DropTargetEvent currentEvent)
protected void setTargetEditPart(EditPart ep)
public void setTransfer(Transfer xfer)
public void setViewer(EditPartViewer viewer)
protected void showTargetFeedback()
null.EditPart.showTargetFeedback(Request)public void unload()
null.protected void updateTargetEditPart()
protected abstract void updateTargetRequest()
|
GEF v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||