def METHOD_NAME(self, itemName, x, y):
    parent = self.GetRootItem()
    item = self.traverse(parent, itemName)
    if item is None:
        return
    dragToItem, flags = self.HitTest(wx.Point(x, y))
    if dragToItem.IsOk():
        # prevent draging into itself
        if dragToItem == item:
            return
        dragToItemName = self.GetItemText(dragToItem)
        if isinstance(self.paletteUI.palette.findItem(dragToItemName), ObjectBase):
            # this is a file node, bailing out
            return
        newItem = self.AppendItem(dragToItem, itemName)
        itemObj = self.paletteUI.palette.findItem(itemName)
        if itemObj is not None:
            # reparenting the data objects...
            if dragToItemName == self.rootName:
                self.paletteUI.palette.add(itemObj)
            else:
                self.paletteUI.palette.add(itemObj, dragToItemName)
        self.ReParent(item, newItem)
        self.Delete(item)