其他 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>