Java 8 DragSourceDropEvent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 DragSourceDropEvent class.

This code example shows how to use the following methods:getDropAction, getDropSuccess, getDragSourceContext
        this.scrolled = scrolled;
    } 
 
    /** Notifies the TransferHandler that the xport is finished. */ 
    public void dragDropEnd(DragSourceDropEvent dsde) {
        DragSourceContext dsc = dsde.getDragSourceContext();
        JComponent c = (JComponent)dsc.getComponent();
        if (dsde.getDropSuccess()) {
            ((LimeTransferHandler)c.getTransferHandler()).exportDone(c, dsc.getTransferable(), dsde.getDropAction());
        } else { 
            ((LimeTransferHandler)c.getTransferHandler()).exportDone(c, dsc.getTransferable(), TransferHandler.NONE);
        } 
        c.setAutoscrolls(scrolled);
    } 
     
    public void dragEnter(DragSourceDragEvent dsde) {}
    public void dragExit(DragSourceEvent dse) {}
    public void dragOver(DragSourceDragEvent dsde) {}
    public void dropActionChanged(DragSourceDragEvent dsde) {}
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getDropAction, getDropSuccess
        dragSource.createDefaultDragGestureRecognizer( table, action, this );
//    dt = new DropTarget(table, this); 
    } 
 
    public void dragDropEnd( DragSourceDropEvent dsde ) {
        if( dsde.getDropSuccess() && dsde.getDropAction() == DnDConstants.ACTION_MOVE ) {
            sourceModel.fireTableDataChanged();
        } 
    } 
 
    public final void dragEnter( DragSourceDragEvent dsde ) {
        int action = dsde.getDropAction();
        if( action == DnDConstants.ACTION_COPY ) {
            dsde.getDragSourceContext().setCursor( DragSource.DefaultCopyDrop );
        } else { 
            if( action == DnDConstants.ACTION_MOVE ) {
                dsde.getDragSourceContext().setCursor( DragSource.DefaultMoveDrop );
            } else { 
                dsde.getDragSourceContext().setCursor( DragSource.DefaultMoveNoDrop );
            } 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getDropSuccess
     * this message goes to DragSourceListener, informing it that the dragging 
     * has ended 
     */ 
 
    public void dragDropEnd(DragSourceDropEvent event) {
        if (event.getDropSuccess()) {
            removeElement(); 
        } 
    } 
 
    /** 
     * this message goes to DragSourceListener, informing it that the dragging 
     * has entered the DropSite 
     */ 
 
    public void dragEnter(DragSourceDragEvent event) {
        System.out.println(" dragEnter");
    } 
 
    /** 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Java 8 DragSourceDropEvent Methods: