// Sort the indices in order to preserve the depth inside of the selection
Arrays.sort(indices);
Object tmp;
int indice;
CompoundEdit ce = new CompoundEdit();
for(i=indices.length; i>0; i--) {
indice=indices[i-1];
if(indice < getElementContainer().size()-1) {
tmp=getElementContainer().get(indice);
getElementContainer().remove(indice);
getElementContainer().add(indice+1, tmp);
ce.addEdit(new DepthChangedEdit(getElementContainer(), indice, indice+1));
}
}
ce.end();
getElementContainer().getComponent().fireUndoableEditUpdate(new UndoableEditEvent(getElementContainer(), ce));
getElementContainer().getComponent().repaint();
}