@Override public boolean canAcceptDrop(final ChangeListDragBean dragBean) { final Change[] changes = dragBean.getChanges(); for (Change change : getUserObject().getChanges()) { for (Change incomingChange : changes) { if (change == incomingChange) return false; } } return true; }
@Override public void acceptDrop(final ChangeListOwner dragOwner, final ChangeListDragBean dragBean) { if (!(userObject instanceof LocalChangeList)) { return; } final LocalChangeList dropList = (LocalChangeList) getUserObject(); dragOwner.moveChangesTo(dropList, dragBean.getChanges()); final List<VirtualFile> toUpdate = new ArrayList<VirtualFile>(); addIfNotNull(toUpdate, dragBean.getUnversionedFiles()); addIfNotNull(toUpdate, dragBean.getIgnoredFiles()); if (!toUpdate.isEmpty()) { dragOwner.addUnversionedFiles(dropList, toUpdate); } }