Java 类com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails 实例源码

项目:metl    文件:EditFlowSettingsDialog.java   
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();
    }
}
项目:metl    文件:EditDeduperPanel.java   
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));
    }
}
项目:metl    文件:EditDataDiffPanel.java   
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));
    }
}
项目:metl    文件:EditSorterPanel.java   
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));
    }
}
项目:metl    文件:EditExcelWriterPanel.java   
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));
    }
}
项目:metl    文件:EditFormatPanel.java   
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));
    }
}
项目:XACML    文件:PolicyWorkspace.java   
@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);
        }
    }
}