mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
AppCode:Project Settings: correctly handle multiple values, default values and cancels
(cherry-picked from e1c1c98)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user