mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Component edit dialog allows changing property values even when they are not the same
This commit is contained in:
+13
@@ -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);
|
||||
|
||||
+3
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user