}
@Override
@SuppressWarnings("rawtypes")
protected Command getMoveChildrenCommand(ChangeBoundsRequest request){
CompoundCommand command = new CompoundCommand();
List editparts = request.getEditParts();
List children = getHost().getChildren();
int newIndex = findIndexOfTreeItemAt(request.getLocation());
for(int i = 0; i < editparts.size(); i++){
EditPart child = (EditPart)editparts.get(i);
int tempIndex = newIndex;
int oldIndex = children.indexOf(child);
if(oldIndex == tempIndex || oldIndex + 1 == tempIndex){
command.add(UnexecutableCommand.INSTANCE);
return command;
} else if(oldIndex <= tempIndex){
tempIndex--;
}
command.add(new ReorderPartCommand(
(BasicElement)child.getModel(),
(MusicContainerForm)getHost().getModel(),
tempIndex));
}
return command;