From 94135f22aaaf73e4b27d71263a4bbc07421b9ee7 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Tue, 14 Aug 2012 12:45:53 +0200 Subject: [PATCH] AppCode:Project Settings: correctly handle multiple values, default values and cancels (cherry-picked from e1c1c98) --- .../src/com/intellij/ui/AddEditRemovePanel.java | 1 + .../src/com/intellij/designer/model/Property.java | 6 +++--- .../com/intellij/designer/propertyTable/PropertyTable.java | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/platform/platform-api/src/com/intellij/ui/AddEditRemovePanel.java b/platform/platform-api/src/com/intellij/ui/AddEditRemovePanel.java index c16dbb13b8b4..b8d7ce081a9b 100644 --- a/platform/platform-api/src/com/intellij/ui/AddEditRemovePanel.java +++ b/platform/platform-api/src/com/intellij/ui/AddEditRemovePanel.java @@ -236,6 +236,7 @@ public abstract class AddEditRemovePanel extends PanelWithButtons implements public abstract static class TableModel { public abstract int getColumnCount(); + @Nullable public abstract String getColumnName(int columnIndex); public abstract Object getField(T o, int columnIndex); diff --git a/platform/platform-impl/src/com/intellij/designer/model/Property.java b/platform/platform-impl/src/com/intellij/designer/model/Property.java index e6be20f01982..b3fc008eb3f4 100644 --- a/platform/platform-impl/src/com/intellij/designer/model/Property.java +++ b/platform/platform-impl/src/com/intellij/designer/model/Property.java @@ -90,13 +90,13 @@ public abstract class Property { } 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 child : getChildren(container)) { - if (!child.isRecursiveDefault(container)) return false; + if (!child.isDefaultRecursively(container)) return false; } return true; } diff --git a/platform/platform-impl/src/com/intellij/designer/propertyTable/PropertyTable.java b/platform/platform-impl/src/com/intellij/designer/propertyTable/PropertyTable.java index 1a1cd0075743..441fa6944a1d 100644 --- a/platform/platform-impl/src/com/intellij/designer/propertyTable/PropertyTable.java +++ b/platform/platform-impl/src/com/intellij/designer/propertyTable/PropertyTable.java @@ -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 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; } }