显示离散列表的示例
下列算法可用于显示离散列表:
GetDiscreteSetConstraints
DiscreteLifecycleTemplateSetAlgorithm
DiscreteTeamTemplateSetAlgorithm
使用何种算法取决于要在列表中显示的值的类型。例如,以下 XML 嵌套在 wt.part.WTPart 对象类型的 AttributeValues 标记中,它显示了用户可从中进行选择的生命周期模板的离散列表:
<AttrConstraint id="lifeCycle.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value algorithm="com.ptc.core.foundation.lifecycle.server.impl.DiscreteLifecycleTemplateSetAlgorithm">
<Arg>Default</Arg>
<Arg>Basic</Arg>
<Arg>Change Activity Life Cycle</Arg>
</Value>
</AttrConstraint>
包含以上任一算法都只能决定属性在用户界面中的显示方式;您必须确保用作自变量的值有效。例如,在之前的示例中,Arg 标记中的生命周期名称必须是现有的生命周期模板。
这对您有帮助吗?