/** Actions constants from {@link java.awt.dnd.DnDConstants}. * @param t The transferable for which the allowed drop actions are requested * @return int representing set of actions which are allowed when dropping * into the associated component. By default it returns {@link #getAllowedDropActions()}. */ protected int getAllowedDropActions(Transferable t) { return getAllowedDropActions(); }
int getAllowedDropActions() { return view.getAllowedDropActions(); }
/** Safe accessor to the drop target which is asociated * with the table */ DropTarget getDropTarget() { if (dropTarget == null) { dropTarget = new DropTarget(table, view.getAllowedDropActions(), this, false); } return dropTarget; }
/** Activates or deactivates Drag support on asociated JTree * component * @param active true if the support should be active, false * otherwise */ public void activate(boolean active) { if (this.active == active) { return; } this.active = active; if (GraphicsEnvironment.isHeadless()) { return; } getDropTarget().setActive(active); //we want to support drop into scroll pane's free area and treat it as 'root node drop' if( null == outerDropTarget ) { outerDropTarget = new DropTarget(view.getViewport(), view.getAllowedDropActions(), this, false); } outerDropTarget.setActive(active); }
public void dropActionChanged(DropTargetDragEvent dtde) { // check if the nodes are willing to do selected action Node[] nodes = ExplorerDnDManager.getDefault().getDraggedNodes(); if( null == nodes ) return; int dropAction = ExplorerDnDManager.getDefault().getAdjustedDropAction( dtde.getDropAction(), view.getAllowedDropActions(dtde.getTransferable()) ); for (int i = 0; i < nodes.length; i++) { if ( ((view.getAllowedDropActions(dtde.getTransferable()) & dropAction) == 0) || !DragDropUtilities.checkNodeForAction(nodes[i], dropAction) ) { // this action is not supported dtde.rejectDrag(); return; } } return; }
if ((view.getAllowedDropActions(dndEventTransferable) & dropAction) == 0) { return false;
dtde.getDropAction(), view.getAllowedDropActions(dtde.getTransferable()) );
int allowedDropActions = view.getAllowedDropActions(dtde.getTransferable()); dropAction = ExplorerDnDManager.getDefault().getAdjustedDropAction( dropAction, allowedDropActions);