本文整理汇总了Java中org.javarosa.core.model.condition.Condition.ACTION_SHOW属性的典型用法代码示例。如果您正苦于以下问题:Java Condition.ACTION_SHOW属性的具体用法?Java Condition.ACTION_SHOW怎么用?Java Condition.ACTION_SHOW使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.javarosa.core.model.condition.Condition
的用法示例。
在下文中一共展示了Condition.ACTION_SHOW属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printConditionalProperty
private static String printConditionalProperty (String property, FormDef f, TreeElement instanceNode) {
int action = -1;
String conditionHeader = null;
boolean absolute = false;
boolean absoluteReportable = false;
String absoluteHeader = null;
if (property.equals("relevant")) {
action = Condition.ACTION_SHOW;
conditionHeader = "Relevant if";
absolute = instanceNode.isRelevant();
absoluteReportable = false;
absoluteHeader = "Never relevant";
} else if (property.equals("required")) {
action = Condition.ACTION_REQUIRE;
conditionHeader = "Conditionally Required";
absolute = instanceNode.isRequired();
absoluteReportable = true;
absoluteHeader = "Required";
} else if (property.equals("readonly")) {
action = Condition.ACTION_DISABLE;
conditionHeader = "Conditionally Read-only";
absolute = instanceNode.isEnabled();
absoluteReportable = false;
absoluteHeader = "Read-only";
}
IConditionExpr expr = f.getConditionExpressionForTrueAction(instanceNode, action);
String line = null;
if (expr != null) {
line = conditionHeader + ": " + printCondition(expr);
} else if (absolute == absoluteReportable) {
line = absoluteHeader;
}
return line;
}
示例2: printConditionalProperty
private static String printConditionalProperty (String property, FormDef f, TreeElement instanceNode) {
int action = -1;
String conditionHeader = null;
boolean absolute = false;
boolean absoluteReportable = false;
String absoluteHeader = null;
if (property.equals("relevant")) {
action = Condition.ACTION_SHOW;
conditionHeader = "Relevant if";
absolute = instanceNode.isRelevant();
absoluteReportable = false;
absoluteHeader = "Never relevant";
} else if (property.equals("required")) {
action = Condition.ACTION_REQUIRE;
conditionHeader = "Conditionally Required";
absolute = instanceNode.isRequired();
absoluteReportable = true;
absoluteHeader = "Required";
} else if (property.equals("readonly")) {
action = Condition.ACTION_DISABLE;
conditionHeader = "Conditionally Read-only";
absolute = instanceNode.isEnabled();
absoluteReportable = false;
absoluteHeader = "Read-only";
}
IConditionExpr expr = null;
triggerLoop:
for (Enumeration<Triggerable> e = f.getTriggerables(); e.hasMoreElements();) {
Triggerable trig = e.nextElement();
// Clayton Sims - Jun 1, 2009 : Not sure how legitimate this
// cast is. It might work now, but break later.
// Clayton Sims - Jun 24, 2009 : Yeah, that change broke things.
// For now, we won't bother to print out anything that isn't
// a condition.
if (trig instanceof Condition) {
Condition c = (Condition)trig;
if (c.trueAction == action) {
for (TreeReference target : c.targets) {
if (instanceNode == getInstanceNode(f.getInstance(), new XPathReference(target))) {
expr = c.expr;
break triggerLoop;
}
}
}
}
}
String line = null;
if (expr != null) {
line = conditionHeader + ": " + printCondition(expr);
} else if (absolute == absoluteReportable) {
line = absoluteHeader;
}
return line;
}
示例3: printConditionalProperty
private static String printConditionalProperty (String property, FormDef f, TreeElement instanceNode) {
int action = -1;
String conditionHeader = null;
boolean absolute = false;
boolean absoluteReportable = false;
String absoluteHeader = null;
if (property.equals("relevant")) {
action = Condition.ACTION_SHOW;
conditionHeader = "Relevant if";
absolute = instanceNode.isRelevant();
absoluteReportable = false;
absoluteHeader = "Never relevant";
} else if (property.equals("required")) {
action = Condition.ACTION_REQUIRE;
conditionHeader = "Conditionally Required";
absolute = instanceNode.isRequired();
absoluteReportable = true;
absoluteHeader = "Required";
} else if (property.equals("readonly")) {
action = Condition.ACTION_DISABLE;
conditionHeader = "Conditionally Read-only";
absolute = instanceNode.isEnabled();
absoluteReportable = false;
absoluteHeader = "Read-only";
}
IConditionExpr expr = null;
triggerLoop:
for (Iterator<Triggerable> e = f.getTriggerables(); e.hasNext();) {
Triggerable trig = e.next();
// Clayton Sims - Jun 1, 2009 : Not sure how legitimate this
// cast is. It might work now, but break later.
// Clayton Sims - Jun 24, 2009 : Yeah, that change broke things.
// For now, we won't bother to print out anything that isn't
// a condition.
if (trig instanceof Condition) {
Condition c = (Condition)trig;
if (c.trueAction == action) {
for (TreeReference target : c.targets) {
if (instanceNode == getInstanceNode(f.getInstance(), new XPathReference(target))) {
expr = c.expr;
break triggerLoop;
}
}
}
}
}
String line = null;
if (expr != null) {
line = conditionHeader + ": " + printCondition(expr);
} else if (absolute == absoluteReportable) {
line = absoluteHeader;
}
return line;
}