其他 Windchill 功能 > 制造过程管理 > 自定义 MPMLink 浏览器 > 将操作图标添加到关联结构浏览器
  
将操作图标添加到关联结构浏览器
可通过以下方式自定义“关联结构浏览器”中的表格:
通过添加新状况列。有关详细信息,请参阅属性自定义
通过添加操作图标
添加操作图标
要创建一个可启动单独自定义操作的图标,请按下列步骤操作:
1. 创建一个可实施 LogicSeparatedDataUtility 的类,然后覆盖 getPlainDataValue 方法,以将图标组件添加到表格组件中。例如,使用名为 CustomStatusDataUtility 的子类:
@Override
public Object getPlainDataValue(String component_id, Object datum, ModelContext mc) throws WTException {
JSONObject icon_object = new JSONObject();
try {
WTProperties serverProperties = null;
serverProperties = WTProperties.getServerProperties();
String serverBaseURL = serverProperties.getProperty("wt.server.codebase");
icon_object.put("type", "icon");
icon_object.put("iconPath", serverBaseURL + "/netmarkets/images/<icon_file>");
icon_object.put("tooltip", getLabel(component_id, mc));
icon_object.put("target", "_top");
NmObject obj = getNmObject(mc);
String oid = obj.getOid().toString();
icon_object.put("link", "app/#ptc1/tcomp/infoPage?oid=" + oid);
} catch (Exception e) {
throw new WTException(e);
}
return icon_object.toJSONString();
2. CustomStatusDataUtility 子类配置为实施 getColumnId 方法并返回唯一标识符。在本示例中:customStatusAction789
@Override
protected String getColumnId() {
return "customStatusAction789";
}
3. 类型和属性管理实用程序中,创建“计算的”属性。例如,customStatusAction789。将此条目添加到以下位置:<Windchill>\codebase\LogicalAttributes.xml
<class name="wt.part.WTPart">
...
<Property>
<LogicalForm>customStatusAction789</LogicalForm>
<ExternalForm>NPA|customStatusAction789</ExternalForm>
</Property>
</class>
4. 通过将新创建的计算的属性添加到以下位置可启用该属性:<Windchill>\codebase\com\ptc\core\htmlcomp\createtableview\AvailableAttributes.xml
<Class name="wt.part.WTPart">
...
<Attribute id="customStatusAction789"/>
</Class>