其他 Windchill 功能 > 制造过程管理 > 自定义产品结构浏览器 (PSE) > 在区段标题内定义属性显示
  
在区段标题内定义属性显示
您可以通过自定义 SectionHeading 标记来控制属性的显示。本部分包含以下主题:
自定义组内属性的显示
展开/折叠显示分组
自定义显示的列数
自定义组内属性的显示
SectionHeading 元素中有可供您编辑属性组详细信息的子句。您可以使用此子句在显示的面板中隐藏或显示特定属性,例如“创建部件向导”、“插入现有的部件向导”或“信息选项卡”。
在以下示例代码中,"allowAttrDetails=true" 子句已添加到“插入现有的部件向导”所用的 CreateChildPartTab2 属性组的 SectionHeading 元素中。
示例代码:
<AttributeGroup id="ptc.wnc.exp.CreateChildPartTab2"
scrollable="true" displayMode="edit">
<SectionHeading allowAttrDetails="true">
<Label>
<Resource key="Properties Top"/>
</Label>
</SectionHeading>
<CellDefinition id="name">
<AttributeDefinition attributeId="name"/>
</CellDefinition>
<CellDefinition id="number">
<AttributeDefinition attributeId="number"
rendererClass="com.ptc.windchill.explorer.structureexplorer.render
er.component.PartNumberComponent"/>
</CellDefinition>
<SectionHeading allowAttrDetails="true">
<Label>
<Resource key="Properties 1"/>
</Label>
</SectionHeading>
<CellDefinition id="view">
<AttributeDefinition attributeId="view"
rendererClass="com.ptc.windchill.explorer.structureexplorer.render
er.component.ViewComponent"/>
</CellDefinition>
<CellDefinition id="folder">
<AttributeDefinition attributeId="folder"
rendererClass="com.ptc.windchill.explorer.structureexplorer.render
er.component.DefaultcontextFolderBrowserComponent"/>
</CellDefinition>
<CellDefinition id="source">
<AttributeDefinition attributeId="source"/>
</CellDefinition>
<CellDefinition id="partType">
<AttributeDefinition attributeId="partType"/>
</CellDefinition>
<SectionHeading allowAttrDetails="true">
<Label>
<Resource key="Properties 2"/>
</Label>
</SectionHeading>
<CellDefinition id="usedQuantityAmount">
<AttributeDefinition attributeId="usedQuantityAmount"/>
</CellDefinition>
<CellDefinition id="usedQuantityUnit">
<AttributeDefinition attributeId="usedQuantityUnit"/>
</CellDefinition>
<CellDefinition id="usedTraceCode">
<AttributeDefinition attributeId="usedTraceCode"/>
</CellDefinition>
<CellDefinition id="effPropagationStop">
<AttributeDefinition attributeId="effPropagationStop"/>
</CellDefinition>
<CellDefinition id="jobAuthorizationNumber">
<AttributeDefinition
attributeId="jobAuthorizationNumber"/>
<EnabledDependency inverted="false">
<Assembly assembly="wadm"/>
</EnabledDependency>
</CellDefinition>
<CellDefinition id="contractNumber">
<AttributeDefinition attributeId="contractNumber"/>
<EnabledDependency inverted="false">
<Assembly assembly="wadm"/>
</EnabledDependency>
</CellDefinition>
<CellDefinition id="phase">
<AttributeDefinition attributeId="phase"/>
<EnabledDependency inverted="false">
<Assembly assembly="wadm"/>
</EnabledDependency>
</CellDefinition>
</AttributeGroup>
添加 "allowAttrDetails=true" 子句后,会在 UI 中产生以下输出。
添加 SectionHeading 会在 SectionHeading 后的属性组周围创建一个框。
SectionHeading 的 Label 子句会提供框文本。
allowAttrDetails="true" 子句可启用“详细信息”图标,使其显示在标签后面,也可启用面板的弹出式菜单。
这是单击标签后面的“详细信息”图标之后所显示的“详细信息”对话框。用户可以隐藏或显示各个属性,但不能更改属性的顺序。
例如,用户可以选择隐藏“属性 1”部分中的“位置”属性。现在已另存为此用户的首选项,并在下次用户加载 PSE 之前一直保持这种状态。
展开/折叠显示分组
如果多个组显示在选项卡或向导的某一步骤中,将会导致帧内容滚动。这可能会对用户造成困扰 (尤其当用户只想输入最少数量的属性时)。您可以自定义“标题”,以允许用户展开/折叠所显示的属性组。在会话间切换时,系统会记住此设置。
这是 UI 可能外观的示例。“责任”组会折叠,因此,"+" 图标可以展开该组。“生产数据”组会展开,因此,"-" 图标可以折叠该组。
示例代码:
<AttributeGroup id="ptc.wnc.exp.CreateChild" displayMode="edit">
<SectionHeading id="ptc.wnc.exp.CreateChild.Responsibilities"
allowAttrDetails="true" allowCollapsable="true">
<Label>
<Resource key="responsibilitiesSectionLabel"/>
</Label>
</SectionHeading>
… cell definitions for the group here…
</AttributeGroup>
自定义显示的列数
您可以自定义 SectionHeading 标记内显示的列数。您可以创建与以下示例类似的布局。
如果在某属性组前指定 SectionHeading,这些属性将会被一个框围住,并附有 <Label> 标记指定的标题。有关 <Label> 标记的详细信息,请参阅自定义组内属性的显示
如果 numberOfColumns 设置为 "1",将会显示单个属性列;如果设置为 "2",将会显示两个属性列。
在上述示例屏幕截图中,URL0: 是具有两个输入字段的单一属性。请注意,如果需要某部分中的所有属性,框上的标签也会被标记为需要。
示例代码:
<AttributeGroup id="ptc.wnc.exp.CreatePartTab4"
scrollable="true" displayMode="edit">
<SectionHeading numberOfColumns="1">
<Label>
<Resource key="checkoutInfoStateLabel"/>
</Label>
</SectionHeading>
<CellDefinition id="String0">
<AttributeDefinition attributeId="IBA|String0"/>
</CellDefinition>
<CellDefinition id="URL0">
<AttributeDefinition attributeId="IBA|URL0"/>
</CellDefinition>
<SectionHeading numberOfColumns="2">
<Label>
<Resource key="serialNumberValueLabel"/>
</Label>
</SectionHeading>
<CellDefinition id="Boolean0">
<AttributeDefinition attributeId="IBA|Boolean0"
required="true"/>
</CellDefinition>
<CellDefinition id="Integer0">
<AttributeDefinition attributeId="IBA|Integer0"
required="true"/>
</CellDefinition>
<CellDefinition id="Real0">
<AttributeDefinition attributeId="IBA|Real0"/>
</CellDefinition>
<CellDefinition id="DateTime0">
<AttributeDefinition attributeId="IBA|DateTime0"/>
</CellDefinition>
</AttributeGroup>