Introduce tag=disable for rendering style, so we can disable features by specifying disable=true
This commit is contained in:
parent
1ef07093b3
commit
e52112636e
2 changed files with 11 additions and 0 deletions
|
@ -138,11 +138,15 @@ public class RenderingRuleSearchRequest {
|
||||||
private boolean searchInternal(int state, int tagKey, int valueKey, boolean loadOutput) {
|
private boolean searchInternal(int state, int tagKey, int valueKey, boolean loadOutput) {
|
||||||
values[storage.PROPS.R_TAG.getId()] = tagKey;
|
values[storage.PROPS.R_TAG.getId()] = tagKey;
|
||||||
values[storage.PROPS.R_VALUE.getId()] = valueKey;
|
values[storage.PROPS.R_VALUE.getId()] = valueKey;
|
||||||
|
values[storage.PROPS.R_DISABLE.getId()] = 0;
|
||||||
RenderingRule accept = storage.getRule(state, tagKey, valueKey);
|
RenderingRule accept = storage.getRule(state, tagKey, valueKey);
|
||||||
if (accept == null) {
|
if (accept == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
boolean match = visitRule(accept, loadOutput);
|
boolean match = visitRule(accept, loadOutput);
|
||||||
|
if(match && values[storage.PROPS.R_DISABLE.getId()] != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,6 +164,10 @@ public class RenderingRuleSearchRequest {
|
||||||
if (!match) {
|
if (!match) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else if(rp == storage.PROPS.R_DISABLE){
|
||||||
|
// quick disable return even without load output
|
||||||
|
RenderingRuleProperty p = storage.PROPS.R_DISABLE;
|
||||||
|
values[rp.getId()] = rule.getIntProp(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!loadOutput) {
|
if (!loadOutput) {
|
||||||
|
|
|
@ -14,6 +14,7 @@ public class RenderingRuleStorageProperties {
|
||||||
public static final String ATTR_COLOR_VALUE = "attrColorValue";
|
public static final String ATTR_COLOR_VALUE = "attrColorValue";
|
||||||
public static final String ATTR_STRING_VALUE = "attrStringValue";
|
public static final String ATTR_STRING_VALUE = "attrStringValue";
|
||||||
public static final String TEST = "test";
|
public static final String TEST = "test";
|
||||||
|
public static final String DISABLE = "disable";
|
||||||
|
|
||||||
public static final String TEXT_LENGTH = "textLength";
|
public static final String TEXT_LENGTH = "textLength";
|
||||||
public static final String NAME_TAG = "nameTag";
|
public static final String NAME_TAG = "nameTag";
|
||||||
|
@ -67,6 +68,7 @@ public class RenderingRuleStorageProperties {
|
||||||
|
|
||||||
|
|
||||||
public RenderingRuleProperty R_TEST;
|
public RenderingRuleProperty R_TEST;
|
||||||
|
public RenderingRuleProperty R_DISABLE;
|
||||||
public RenderingRuleProperty R_ATTR_INT_VALUE;
|
public RenderingRuleProperty R_ATTR_INT_VALUE;
|
||||||
public RenderingRuleProperty R_ATTR_BOOL_VALUE;
|
public RenderingRuleProperty R_ATTR_BOOL_VALUE;
|
||||||
public RenderingRuleProperty R_ATTR_COLOR_VALUE;
|
public RenderingRuleProperty R_ATTR_COLOR_VALUE;
|
||||||
|
@ -156,6 +158,7 @@ public class RenderingRuleStorageProperties {
|
||||||
R_TEXT_LENGTH = registerRuleInternal(RenderingRuleProperty.createInputIntProperty(TEXT_LENGTH));
|
R_TEXT_LENGTH = registerRuleInternal(RenderingRuleProperty.createInputIntProperty(TEXT_LENGTH));
|
||||||
R_NAME_TAG = registerRuleInternal(RenderingRuleProperty.createInputStringProperty(NAME_TAG));
|
R_NAME_TAG = registerRuleInternal(RenderingRuleProperty.createInputStringProperty(NAME_TAG));
|
||||||
|
|
||||||
|
R_DISABLE = registerRuleInternal(RenderingRuleProperty.createOutputBooleanProperty(DISABLE));
|
||||||
R_ATTR_INT_VALUE = registerRuleInternal(RenderingRuleProperty.createOutputIntProperty(ATTR_INT_VALUE));
|
R_ATTR_INT_VALUE = registerRuleInternal(RenderingRuleProperty.createOutputIntProperty(ATTR_INT_VALUE));
|
||||||
R_ATTR_BOOL_VALUE = registerRuleInternal(RenderingRuleProperty.createOutputBooleanProperty(ATTR_BOOL_VALUE));
|
R_ATTR_BOOL_VALUE = registerRuleInternal(RenderingRuleProperty.createOutputBooleanProperty(ATTR_BOOL_VALUE));
|
||||||
R_ATTR_COLOR_VALUE = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(ATTR_COLOR_VALUE));
|
R_ATTR_COLOR_VALUE = registerRuleInternal(RenderingRuleProperty.createOutputColorProperty(ATTR_COLOR_VALUE));
|
||||||
|
|
Loading…
Reference in a new issue