mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
AppCode:Build Settings: build settings per configuration
This commit is contained in:
@@ -17,6 +17,6 @@ package com.intellij.designer.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class PropertiesContainer {
|
||||
public abstract List<Property> getProperties();
|
||||
public abstract class PropertiesContainer<T extends Property> {
|
||||
public abstract List<T> getProperties();
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public abstract class Property<T extends PropertiesContainer> {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<Property<T>> getChildren(@Nullable T component) {
|
||||
public List<? extends Property<T>> getChildren(@Nullable T container) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -83,18 +83,18 @@ public abstract class Property<T extends PropertiesContainer> {
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Nullable
|
||||
public Object getValue(T component) throws Exception {
|
||||
public Object getValue(@NotNull T container) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setValue(T component, @Nullable Object value) throws Exception {
|
||||
public void setValue(@NotNull T container, @Nullable Object value) throws Exception {
|
||||
}
|
||||
|
||||
public boolean isDefaultValue(T component) throws Exception {
|
||||
public boolean isDefaultValue(@NotNull T container) throws Exception {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setDefaultValue(T component) throws Exception {
|
||||
public void setDefaultValue(@NotNull T container) throws Exception {
|
||||
}
|
||||
|
||||
public boolean availableFor(List<PropertiesContainer> components) {
|
||||
|
||||
@@ -327,7 +327,7 @@ public abstract class PropertyTable extends JBTable {
|
||||
}
|
||||
}
|
||||
|
||||
private void fillProperties(PropertiesContainer component, List<Property> properties) {
|
||||
private void fillProperties(PropertiesContainer<?> component, List<Property> properties) {
|
||||
for (Property property : component.getProperties()) {
|
||||
addProperty(property, properties);
|
||||
}
|
||||
|
||||
+4
-4
@@ -50,7 +50,7 @@ public class CenterProperty extends Property<RadViewComponent> implements IXmlAt
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadViewComponent component) throws Exception {
|
||||
XmlTag tag = component.getTag();
|
||||
boolean[] values = new boolean[3];
|
||||
for (int i = 0; i < ATTR_ITEMS.length; i++) {
|
||||
@@ -69,7 +69,7 @@ public class CenterProperty extends Property<RadViewComponent> implements IXmlAt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final RadViewComponent component, Object value) throws Exception {
|
||||
public void setValue(@NotNull final RadViewComponent component, Object value) throws Exception {
|
||||
final int index = ArrayUtil.indexOf(COMBO_ITEMS, value);
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
@@ -88,7 +88,7 @@ public class CenterProperty extends Property<RadViewComponent> implements IXmlAt
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadViewComponent component) throws Exception {
|
||||
public boolean isDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
XmlTag tag = component.getTag();
|
||||
for (String attribute : ATTR_ITEMS) {
|
||||
if (tag.getAttribute(attribute, SdkConstants.NS_RESOURCES) != null) {
|
||||
@@ -99,7 +99,7 @@ public class CenterProperty extends Property<RadViewComponent> implements IXmlAt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultValue(RadViewComponent component) throws Exception {
|
||||
public void setDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
setValue(component, null);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class CompoundProperty extends com.intellij.android.designer.propertyTabl
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadViewComponent component) throws Exception {
|
||||
StringBuilder value = new StringBuilder("[");
|
||||
int index = 0;
|
||||
for (Property<RadViewComponent> child : getChildren(component)) {
|
||||
|
||||
+4
-4
@@ -104,7 +104,7 @@ public class AttributeProperty extends Property<RadViewComponent> implements IXm
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadViewComponent component) throws Exception {
|
||||
Object value = null;
|
||||
|
||||
XmlAttribute attribute = getAttribute(component);
|
||||
@@ -116,7 +116,7 @@ public class AttributeProperty extends Property<RadViewComponent> implements IXm
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final RadViewComponent component, final Object value) throws Exception {
|
||||
public void setValue(@NotNull final RadViewComponent component, final Object value) throws Exception {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -134,12 +134,12 @@ public class AttributeProperty extends Property<RadViewComponent> implements IXm
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadViewComponent component) throws Exception {
|
||||
public boolean isDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
return getAttribute(component) == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultValue(RadViewComponent component) throws Exception {
|
||||
public void setDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
if (getAttribute(component) != null) {
|
||||
setValue(component, null);
|
||||
}
|
||||
|
||||
+2
-2
@@ -46,12 +46,12 @@ public class AttributePropertyWithDefault extends AttributeProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadViewComponent component) throws Exception {
|
||||
public boolean isDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
return myDefaultValue.equals(getValue(component));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(RadViewComponent component, Object value) throws Exception {
|
||||
public void setValue(@NotNull RadViewComponent component, Object value) throws Exception {
|
||||
if (StringUtil.isEmpty((String)value)) {
|
||||
value = myDefaultValue;
|
||||
}
|
||||
|
||||
+3
-3
@@ -70,7 +70,7 @@ public class CompoundProperty extends Property<RadViewComponent> implements IPro
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadViewComponent component) throws Exception {
|
||||
StringBuilder value = new StringBuilder();
|
||||
int index = 0;
|
||||
int empty = 0;
|
||||
@@ -94,7 +94,7 @@ public class CompoundProperty extends Property<RadViewComponent> implements IPro
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadViewComponent component) throws Exception {
|
||||
public boolean isDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
for (Property<RadViewComponent> childProperty : myChildren) {
|
||||
if (!childProperty.isDefaultValue(component)) {
|
||||
return false;
|
||||
@@ -104,7 +104,7 @@ public class CompoundProperty extends Property<RadViewComponent> implements IPro
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultValue(RadViewComponent component) throws Exception {
|
||||
public void setDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
for (Property<RadViewComponent> childProperty : myChildren) {
|
||||
childProperty.setDefaultValue(component);
|
||||
}
|
||||
|
||||
+4
-4
@@ -62,13 +62,13 @@ public class CustomViewProperty extends Property<RadCustomViewComponent> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadCustomViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadCustomViewComponent component) throws Exception {
|
||||
String viewClass = component.getViewClass();
|
||||
return viewClass == null ? "" : viewClass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final RadCustomViewComponent component, final Object value) throws Exception {
|
||||
public void setValue(@NotNull final RadCustomViewComponent component, final Object value) throws Exception {
|
||||
if (StringUtil.isEmpty((String)value)) {
|
||||
return;
|
||||
}
|
||||
@@ -94,12 +94,12 @@ public class CustomViewProperty extends Property<RadCustomViewComponent> impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadCustomViewComponent component) throws Exception {
|
||||
public boolean isDefaultValue(@NotNull RadCustomViewComponent component) throws Exception {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultValue(RadCustomViewComponent component) throws Exception {
|
||||
public void setDefaultValue(@NotNull RadCustomViewComponent component) throws Exception {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+7
-7
@@ -72,7 +72,7 @@ public class FlagProperty extends Property<RadViewComponent> implements IPropert
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadViewComponent component) throws Exception {
|
||||
StringBuilder value = new StringBuilder("[");
|
||||
Set<String> options = getOptions(component);
|
||||
int index = 0;
|
||||
@@ -88,12 +88,12 @@ public class FlagProperty extends Property<RadViewComponent> implements IPropert
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadViewComponent component) throws Exception {
|
||||
public boolean isDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
return getAttribute(component) == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultValue(RadViewComponent component) throws Exception {
|
||||
public void setDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
final XmlAttribute attribute = getAttribute(component);
|
||||
if (attribute != null) {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@@ -206,22 +206,22 @@ public class FlagProperty extends Property<RadViewComponent> implements IPropert
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadViewComponent component) throws Exception {
|
||||
return isOption(component, myValueName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(RadViewComponent component, Object value) throws Exception {
|
||||
public void setValue(@NotNull RadViewComponent component, Object value) throws Exception {
|
||||
setOption(component, myValueName, (Boolean)value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadViewComponent component) throws Exception {
|
||||
public boolean isDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
return !isOption(component, myValueName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultValue(RadViewComponent component) throws Exception {
|
||||
public void setDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
setValue(component, Boolean.FALSE);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -54,13 +54,13 @@ public class FragmentProperty extends Property<RadViewComponent> implements IXml
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadViewComponent component) throws Exception {
|
||||
String value = component.getTag().getAttributeValue(myAttribute, SdkConstants.NS_RESOURCES);
|
||||
return value == null ? "" : value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final RadViewComponent component, final Object value) throws Exception {
|
||||
public void setValue(@NotNull final RadViewComponent component, final Object value) throws Exception {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -75,12 +75,12 @@ public class FragmentProperty extends Property<RadViewComponent> implements IXml
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadViewComponent component) throws Exception {
|
||||
public boolean isDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
return component.getTag().getAttribute(myAttribute, SdkConstants.NS_RESOURCES) == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultValue(RadViewComponent component) throws Exception {
|
||||
public void setDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
if (component.getTag().getAttribute(myAttribute, SdkConstants.NS_RESOURCES) != null) {
|
||||
setValue(component, null);
|
||||
}
|
||||
|
||||
+5
-5
@@ -109,7 +109,7 @@ public class GravityProperty extends FlagProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadViewComponent component) throws Exception {
|
||||
StringBuilder value = new StringBuilder("[");
|
||||
Set<String> options = getOptions(component);
|
||||
int index = 0;
|
||||
@@ -188,7 +188,7 @@ public class GravityProperty extends FlagProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadViewComponent component) throws Exception {
|
||||
Set<String> options = getOptions(component);
|
||||
int lastIndex = -1;
|
||||
for (int i = 0; i < myValues.length; i++) {
|
||||
@@ -200,7 +200,7 @@ public class GravityProperty extends FlagProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(RadViewComponent component, Object value) throws Exception {
|
||||
public void setValue(@NotNull RadViewComponent component, Object value) throws Exception {
|
||||
int index = ArrayUtil.indexOf(COMBO_ITEMS, value);
|
||||
if (index == -1) {
|
||||
setOptions(component, null, myValues);
|
||||
@@ -213,7 +213,7 @@ public class GravityProperty extends FlagProperty {
|
||||
protected abstract void setValue(RadViewComponent component, int index) throws Exception;
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadViewComponent component) throws Exception {
|
||||
public boolean isDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
Set<String> options = getOptions(component);
|
||||
for (String value : myValues) {
|
||||
if (options.contains(value)) {
|
||||
@@ -224,7 +224,7 @@ public class GravityProperty extends FlagProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultValue(RadViewComponent component) throws Exception {
|
||||
public void setDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
setValue(component, null);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ public class IdProperty extends AttributeProperty {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final RadViewComponent component, final Object value) throws Exception {
|
||||
public void setValue(@NotNull final RadViewComponent component, final Object value) throws Exception {
|
||||
IdManager idManager = IdManager.get(component);
|
||||
final String oldId = component.getId();
|
||||
|
||||
|
||||
+2
-2
@@ -59,13 +59,13 @@ public class IncludeLayoutProperty extends Property<RadViewComponent> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadViewComponent component) throws Exception {
|
||||
String layout = component.getTag().getAttributeValue("layout");
|
||||
return layout == null ? "" : layout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final RadViewComponent component, final Object value) throws Exception {
|
||||
public void setValue(@NotNull final RadViewComponent component, final Object value) throws Exception {
|
||||
if (!StringUtil.isEmpty((String)value)) {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
|
||||
+4
-4
@@ -63,7 +63,7 @@ public class StyleProperty extends Property<RadViewComponent> implements IXmlAtt
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(RadViewComponent component) throws Exception {
|
||||
public Object getValue(@NotNull RadViewComponent component) throws Exception {
|
||||
Object value = null;
|
||||
|
||||
XmlAttribute attribute = getAttribute(component);
|
||||
@@ -75,7 +75,7 @@ public class StyleProperty extends Property<RadViewComponent> implements IXmlAtt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final RadViewComponent component, final Object value) throws Exception {
|
||||
public void setValue(@NotNull final RadViewComponent component, final Object value) throws Exception {
|
||||
ApplicationManager.getApplication().runWriteAction(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -93,12 +93,12 @@ public class StyleProperty extends Property<RadViewComponent> implements IXmlAtt
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDefaultValue(RadViewComponent component) throws Exception {
|
||||
public boolean isDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
return getAttribute(component) == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDefaultValue(RadViewComponent component) throws Exception {
|
||||
public void setDefaultValue(@NotNull RadViewComponent component) throws Exception {
|
||||
if (getAttribute(component) != null) {
|
||||
setValue(component, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user