* columns are altered to ensure against duplications.
* @param newIndex index to move to.
* @param oldIndex index to move from */
public synchronized void changeOrder(int newIndex, int oldIndex)
{
ColumnSettingsManager manager = ColumnSettingsManager.getInstance();
ColumnState target = states.get(oldIndex);
states.remove(oldIndex);
states.add(newIndex, target);
for (int i = 0; i < states.size(); i++)
{
ColumnState tmp = states.get(i);
ColumnState required = manager.get(tmp.getKey());
if (!required.getKey().equals(target.getKey()))
{
required.setIndex(i);
tmp.setIndex(i);
}