|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DragHandler
Handles the 'drag' part of a drag-and-drop operation of a local object of given type.
Used in conjunction with LocalTransferHandler
.
Method Summary | |
---|---|
void |
exportDone(javax.swing.JComponent source,
javax.swing.JComponent target,
java.lang.Object[] objects,
java.lang.Class<?> type,
int action)
Invoked after data has been dragged from the given source component and dropped onto the given target component. |
java.lang.Class |
getExportedClass(javax.swing.JComponent source)
Return the class of objects being exported from the given source. |
java.lang.Object |
getExportedObjects(javax.swing.JComponent source)
Return the object(s) to be exported by a drag or cut-and-paste operation from the given source. |
int |
getSourceActions(javax.swing.JComponent source)
Returns the type of transfer actions supported by the given component. |
boolean |
isTransferAllowed(javax.swing.JComponent source,
javax.swing.JComponent target)
Indicates whether this handler allows a transfer from the given source to the given target. |
Method Detail |
---|
boolean isTransferAllowed(javax.swing.JComponent source, javax.swing.JComponent target)
true
always, or returns
true if and only if the source and target are different.
A more sophisticated implementation
would instead compare the underlying models of the components.
LocalTransferHandler.isTransferAllowed(javax.swing.JComponent, javax.swing.JComponent)
int getSourceActions(javax.swing.JComponent source)
COPY
, MOVE
,
COPY_OR_MOVE
, LINK
or NONE
, cf. LocalTransferHandler
.
LocalTransferHandler.getSourceActions(javax.swing.JComponent)
void exportDone(javax.swing.JComponent source, javax.swing.JComponent target, java.lang.Object[] objects, java.lang.Class<?> type, int action)
MOVE
and source and target are not the same (or are not views
of the same model),
the objects need to be removed from the source. When the
action is COPY
or LINK
, nothing needs to be done.
objects
- Array of objects which have been exportedtype
- Element type of this arrayaction
- the actual action that was performedsource
- The component that was the source of the data.target
- The component that was the target of the data, or null
if the target is not a LocalTransferHandler
.LocalTransferHandler.exportDone(javax.swing.JComponent, javax.swing.JComponent, java.lang.Object[], java.lang.Class>, int)
java.lang.Object getExportedObjects(javax.swing.JComponent source)
LocalTransferHandler.getExportedObjects(javax.swing.JComponent)
java.lang.Class getExportedClass(javax.swing.JComponent source)
getExportedObjects(javax.swing.JComponent)
is used, or the element type if an array is returned.
LocalTransferHandler.getExportedClass(javax.swing.JComponent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |