* @param profileId The ID of the profile to replace the existing component
* @throws IOException
*/
public void updateProfile(int profileId) throws IOException {
// Find the new profile from the data set.
Profile newProfile = dataSet.findProfile(profileId);
if (newProfile != null) {
// Loop through the profiles found so far and replace the
// profile for the same component with the new one.
for (int i = 0; i < getProfiles().length; i++) {
// Compare by component Id incase the stream data source is
// used and we have different instances of the same component
// being used.
if (profiles[i].getComponent().getComponentId()
== newProfile.getComponent().getComponentId()) {
profiles[i] = newProfile;
break;
}
}
}