AppCode:Project Settings: correctly handle multiple values, default values and cancels

(cherry-picked from e1c1c98)
This commit is contained in:
Anton Makeev
2012-08-14 12:58:23 +02:00
parent cd0aad8fe5
commit 94135f22aa
3 changed files with 7 additions and 6 deletions
@@ -236,6 +236,7 @@ public abstract class AddEditRemovePanel<T> extends PanelWithButtons implements
public abstract static class TableModel<T> {
public abstract int getColumnCount();
@Nullable
public abstract String getColumnName(int columnIndex);
public abstract Object getField(T o, int columnIndex);
@@ -90,13 +90,13 @@ public abstract class Property<T extends PropertiesContainer> {
}
public boolean showAsDefault(@NotNull T container) throws Exception {
return isRecursiveDefault(container);
return isDefaultRecursively(container);
}
public final boolean isRecursiveDefault(@NotNull T container) throws Exception {
public final boolean isDefaultRecursively(@NotNull T container) throws Exception {
if (!isDefaultValue(container)) return false;
for (Property<T> child : getChildren(container)) {
if (!child.isRecursiveDefault(container)) return false;
if (!child.isDefaultRecursively(container)) return false;
}
return true;
}
@@ -216,7 +216,7 @@ public abstract class PropertyTable extends JBTable {
@Override
public void run() throws Exception {
for (PropertiesContainer component : myContainers) {
if (!property.isRecursiveDefault(component)) {
if (!property.isDefaultRecursively(component)) {
property.setDefaultValue(component);
}
}
@@ -478,7 +478,7 @@ public abstract class PropertyTable extends JBTable {
private boolean addIfNeeded(PropertiesContainer<?> component, Property property, List<Property> properties) {
if (property.isExpert() && !myShowExpertProperties) {
try {
if (property.isRecursiveDefault(component)) {
if (property.isDefaultRecursively(component)) {
return false;
}
}
@@ -592,7 +592,7 @@ public abstract class PropertyTable extends JBTable {
public boolean isDefault(Property property) throws Exception {
for (PropertiesContainer component : myContainers) {
if (!property.isRecursiveDefault(component)) {
if (!property.isDefaultRecursively(component)) {
return false;
}
}