Add dependent rendering attribute

This commit is contained in:
Victor Shcherb 2015-01-08 22:53:25 +01:00
parent 95364cb9e7
commit b442252e0c
2 changed files with 11 additions and 1 deletions

View file

@ -160,6 +160,13 @@ public class RenderingRule {
ifElseChildren.add(rr);
}
public void addToBeginIfElseChildren(RenderingRule rr){
if(ifElseChildren == null){
ifElseChildren = new ArrayList<RenderingRule>();
}
ifElseChildren.add(0, rr);
}
public boolean isGroup() {
return isGroup;
}

View file

@ -107,9 +107,12 @@ public class RenderingRulesStorage {
if (renderingAttributes.containsKey(e.getKey())) {
RenderingRule root = renderingAttributes.get(e.getKey());
List<RenderingRule> list = e.getValue().getIfElseChildren();
e.getValue().addToBeginIfElseChildren(root);
for (RenderingRule every : list) {
if(every != root) {
root.addIfElseChildren(every);
}
}
} else {
renderingAttributes.put(e.getKey(), e.getValue());
}