Component edit dialog allows changing property values even when they are not the same

This commit is contained in:
bancika
2011-08-28 16:10:38 +00:00
parent 69e2296c23
commit bd79ef2817
14 changed files with 130 additions and 31 deletions
@@ -182,6 +182,19 @@ public class ComponentProcessor {
property.readFrom(component);
}
properties.retainAll(newProperties);
// Try to find matching properties in old and new lists and see if
// their values match.
for (PropertyWrapper oldProperty : properties) {
if (newProperties.contains(oldProperty)) {
PropertyWrapper newProperty = newProperties.get(newProperties
.indexOf(oldProperty));
if ((newProperty.getValue() != null && newProperty.getValue() == null)
|| !newProperty.getValue().equals(oldProperty.getValue())) {
// Values don't match, so the property is not unique valued.
oldProperty.setUnique(false);
}
}
}
// for (PropertyWrapper property : properties) {
// try {
// property.readUniqueFrom(component);
@@ -1213,7 +1213,9 @@ public class Presenter implements IPlugInPort {
for (IDIYComponent<?> component : selectedComponents) {
drawingManager.invalidateComponent(component);
for (PropertyWrapper property : properties) {
property.writeTo(component);
if (property.isChanged()) {
property.writeTo(component);
}
}
}
} catch (Exception e) {