int index = modes.indexOf( id );
if( index != -1 ){
Path[] order = modes.getHistory( index );
Map<Path, Location> locations = modes.getProperties( index );
LocationHistory history = dockable.getLocationHistory();
for( Path item : order ){
ExtendedMode mode = getMode( item );
if( mode == null ){
throw new IllegalStateException( "unknown ExtendedMode with id='" + item + "'" );
}
Location location = locations.get( item );
if( location != null ){
history.add( mode, location );
}
}
}
}
}