Layout & Properties

This commit is contained in:
Alexander Lobas
2012-04-01 13:48:16 +04:00
parent 234fa81ae1
commit 50ef46f5ed
4 changed files with 20 additions and 10 deletions
@@ -155,16 +155,15 @@ public class PropertyParser {
}
if (model != null) {
property.setImportant(model.isImportantProperty(name));
property.setExpert(model.isExpertProperty(name));
property.setDeprecated(model.isDeprecatedProperty(name));
model.decorate(property, name);
}
properties.add(property);
}
if (padding != null) {
List children = padding.getChildren(null);
List<Property> children = padding.getChildren(null);
children.add(PropertyTable.extractProperty(properties, "paddingLeft"));
children.add(PropertyTable.extractProperty(properties, "paddingTop"));
children.add(PropertyTable.extractProperty(properties, "paddingRight"));
@@ -267,13 +266,20 @@ public class PropertyParser {
}
if (margin != null) {
List children = margin.getChildren(null);
List<Property> children = margin.getChildren(null);
children.add(PropertyTable.extractProperty(properties, "marginLeft"));
children.add(PropertyTable.extractProperty(properties, "marginTop"));
children.add(PropertyTable.extractProperty(properties, "marginRight"));
children.add(PropertyTable.extractProperty(properties, "marginBottom"));
children.add(PropertyTable.extractProperty(properties, "marginStart"));
children.add(PropertyTable.extractProperty(properties, "marginEnd"));
if (model != null) {
for (Property child : children) {
model.decorate(child, "layout:margin." + child.getName());
}
}
}
}
@@ -1013,7 +1013,7 @@
tooltip="FrameLayout is designed to block out an area on the screen to display a single item."/>
<properties important="foreground foregroundGravity"
expert="layout:gravity.fill layout:gravity.fill_horizontal layout:gravity.fill_vertical layout:gravity.clip_vertical layout:gravity.clip_horizontal"
expert="layout:gravity.fill layout:gravity.fill_horizontal layout:gravity.fill_vertical layout:gravity.clip_vertical layout:gravity.clip_horizontal layout:margin.marginStart layout:margin.marginEnd"
/>
<creation>
@@ -50,10 +50,7 @@ public class FlagProperty extends Property<RadViewComponent> {
if (model != null) {
for (Property option : myOptions) {
String optionName = name + "." + option.getName();
option.setImportant(model.isImportantProperty(optionName));
option.setExpert(model.isExpertProperty(optionName));
option.setDeprecated(model.isDeprecatedProperty(optionName));
model.decorate(option, name + "." + option.getName());
}
}
}
@@ -16,6 +16,7 @@
package com.intellij.designer.model;
import com.intellij.designer.palette.Item;
import com.intellij.designer.propertyTable.Property;
import com.intellij.openapi.util.IconLoader;
import org.jetbrains.annotations.NotNull;
@@ -144,4 +145,10 @@ public class MetaModel {
public void setDeprecatedProperties(List<String> deprecatedProperties) {
myDeprecatedProperties = deprecatedProperties;
}
public void decorate(Property property, String name) {
property.setImportant(isImportantProperty(name));
property.setExpert(isExpertProperty(name));
property.setDeprecated(isDeprecatedProperty(name));
}
}