Update needRefreshPropertyList api

This commit is contained in:
Alexander Lobas
2012-12-06 11:54:35 +04:00
parent b6d492c371
commit e83cece3c6
2 changed files with 7 additions and 1 deletions
@@ -112,6 +112,10 @@ public abstract class Property<T extends PropertiesContainer> {
return true;
}
public boolean needRefreshPropertyList(@NotNull T container, @Nullable Object value) throws Exception {
return false;
}
public boolean needRefreshPropertyList() {
return false;
}
@@ -811,6 +811,7 @@ public abstract class PropertyTable extends JBTable {
}
boolean isSetValue = true;
final boolean[] needRefresh = new boolean[1];
if (isNewValue) {
isSetValue = doSetValue(new ThrowableRunnable<Exception>() {
@@ -818,13 +819,14 @@ public abstract class PropertyTable extends JBTable {
public void run() throws Exception {
for (PropertiesContainer component : myContainers) {
property.setValue(component, newValue);
needRefresh[0] |= property.needRefreshPropertyList(component, newValue);
}
}
});
}
if (isSetValue) {
if (property.needRefreshPropertyList()) {
if (property.needRefreshPropertyList() || needRefresh[0]) {
update();
}
else {