public void drop(DragAndDropEvent event) { AbstractSelectTargetDetails targetDetails = (AbstractSelectTargetDetails) event.getTargetDetails(); Transferable transferable = event.getTransferable(); if (transferable.getSourceComponent() == table) { FlowParameter target = (FlowParameter) targetDetails.getItemIdOver(); int targetIndex = container.indexOfId(target); FlowParameter source = (FlowParameter) transferable.getData("itemId"); if (targetIndex == -1) { targetIndex = 0; } container.removeItem(source); container.addItemAt(targetIndex, source); table.select(source); saveAllPositions(); } }
public void drop(DragAndDropEvent event) { AbstractSelectTargetDetails targetDetails = (AbstractSelectTargetDetails) event.getTargetDetails(); Transferable transferable = event.getTransferable(); if (transferable.getSourceComponent() == entityTable) { EntitySettings target = (EntitySettings) targetDetails.getItemIdOver(); moveItemsTo(getSelectedItems(), entitySettingsContainer.indexOfId(target)); } }
public void drop(DragAndDropEvent event) { AbstractSelectTargetDetails targetDetails = (AbstractSelectTargetDetails) event.getTargetDetails(); Transferable transferable = event.getTransferable(); if (transferable.getSourceComponent() == table) { RecordFormat target = (RecordFormat) targetDetails.getItemIdOver(); moveItemsTo(getSelectedItems(), container.indexOfId(target)); } }
@Override public void drop(DragAndDropEvent event) { Transferable t = event.getTransferable(); Component source = t.getSourceComponent(); if (source != this.treeWorkspace) { assert(false); throw new IllegalArgumentException(); } TableTransferable tt = (TableTransferable) t; File sourceFile = (File) tt.getItemId(); AbstractSelectTargetDetails target = (AbstractSelectTargetDetails)event.getTargetDetails(); File targetFile = (File) target.getItemIdOver(); if (sourceFile.isFile() && targetFile != null && targetFile.isDirectory()) { // // Construct destination filename // Path dest = targetFile.toPath().resolve(sourceFile.getName()); // // Check if the target domain exists // if (Files.exists(dest)) { // // Prompt the user // Notification.show("A policy file with that name already exists in that directory.", Notification.Type.ERROR_MESSAGE); } else { // // Go ahead and rename it // this.renamePolicyFile(sourceFile, dest.toFile(), targetFile); } } }