其他 Windchill 功能 > 製造流程管理 > 自訂產品結構總管 (PSE) > 自訂 PSE 選單、工具列和快顯選單
  
自訂 PSE 選單、工具列和快顯選單
目標
您要變更 PSE 選單、工具列或快顯選單的內容。
背景
PSE 選單、工具列與快顯選單的定義彼此相關。顯示在工具列和快顯選單中的使用者介面動作的定義是繼承自選單列的 ActionAccess 定義。
顯示的功能表列和選單項目不會依 PSE 所處理的模式 (「編輯」「草會」或「註解」) 而變更,但若項目與該模式不相關,可能會遭到禁用。工具列不會依模式而變更,如同顯示在表格中的快顯選單。只有具有相關聯圖示的選單項目才會出現在工作列中。
在 PSE 的「任務標籤」中,已定義了幾個有工具列和快顯選單的表格。它們的實行方法與主選單完全一樣 (透過 ActionAccess 定義來實行),但選單不會顯示。
範圍/適用性/假設
預期結果
您可能需要變更特定模式的工具列內容;例如,您可能需要將「新建查詢」圖示新增至主 PSE 視窗中以「草稿模式」顯示的工具列 (在「說明」圖示之前),並且新增「插入現有的」及「插入新的」動作至「使用標籤」快顯選單」:
解決方案
欲將「新建查詢」動作新增至工具列,請於下列位置變更相應元素:
<Windchill>/codebase/config/logicrepository/xml/explorer/productstructure/
PDMLinkExplorerMenus.xml
欲將快顯選單項目新增至「使用」標籤,請於下列位置變更相應元素:
<Windchill>/codebase/config/logicrepository/xml/explorer/structureexplorer/
ExplorerMenusForUsesTab.xml
必備知識
欲達成此目標,您需瞭解下列事項:
XML 檔案自訂的管理
解決方案元素
元素
類型
描述 (Description)
PDMLinkExplorerMenus. xml
XML 檔案
保留顯示在樹狀結構顯示畫面中的主 PSE 應用程式選單、工具列和快顯選單的定義。
位於:
<Windchill>/codebase/config/logicrepository/xm
l/explorer/productstructure
ExplorerMenuIt ems.xml
XML 檔案
保留參照自主應用程式選單 (PDMLinkExplorerMenus.xml) 和 ExplorerMenus.xml 的選單項目定義
位於:
<Windchill>/codebase/config/logicrepository/xm
l/explorer/structureexplorer
ExplorerMenus.x ml
XML 檔案
保留參照自主應用程式選單 (PDMLinkExplorerMenus.xml) 的子選單的選單定義
位於:
<Windchill>/codebase/config/logicrepository/xm
l/explorer/structureexplorer
ExplorerMenusF orAttributeTable. xml
XML 檔案
保留「資訊標籤」上「屬性表格」的工具列和快顯選單定義。
位於:
<Windchill>/codebase/config/logicrepository/xm
l/explorer/structureexplorer
ExplorerMenusF orDocumuntsTab .xml
XML 檔案
保留「文件標籤」上表格的工具列和快顯選單定義。
位於:
<Windchill>/codebase/config/logicrepository/xm
l/explorer/structureexplorer
ExplorerMenusF orReplacements Tab.xml
XML 檔案
保留「取代物標籤」上所有表格的工具列和快顯選單定義。
位於:
<Windchill>/codebase/config/logicrepository/xm
l/explorer/structureexplorer
ExplorerMenusF orUsesTab.xml
XML 檔案
保留「使用標籤」上所有表格的工具列和快顯選單定義。
位於:
<Windchill>/codebase/config/logicrepository/xm
l/explorer/structureexplorer
ActionAccess
XML 元素
保留功能表列、相關選單及選單項目的定義。每個 ActionAccess 元素 (即選單項目定義) 都必須包含將用於相關工具列和快顯選單的所有動作。
* 
新增新動作至選單項目定義的操作不受支援。
包含在 PDMLinkExplorerMenus.xml 和 ExplorerMenus*.xml 內
ModeToolBar
XML 元素
定義特定模式的工具列。指定 ApplicationMode (透過「匯入」) 與 MenuItemIdentifier 清單。
ModePopupMe nu
XML 元素
定義特定模式的快顯選單。僅指定模式及 MenuItemIdentifier 清單。
ExplorerMode
XML 元素
ModeToolBar 或 ModePopupMenu 的子元素。指定模式。
MenuItemIdentifi er
XML 元素
ModeToolBar 或 ModePopupMenu 的子元素。識別 (透過 ID 參數) 已定義的動作。
程序 - 自訂工具列
可變更特定模式下工具列的內容。在定義中新增現有項目、刪除和重新排序項目皆受支援。
請考慮主 PSE 視窗中以「草稿模式」顯示的工具列。舉例來說,欲將「新建查詢」動作新增至工具列,只需將該項目的 MenuItemIdentifier 插入 XML 即可
<ModeToolBar id="ToolBarB">
<Import id="ptc.wnc.exp.DraftAppMode"/>
<MenuItemIdentifier id="FileNewPartMI"/>
<MenuItemIdentifier id="FileOpenPartMI"/>
<Separator/>
<MenuItemIdentifier id="FileSaveChangesMI"/>
<MenuItemIdentifier id="FileAnnotationValidationMI"/>
<MenuItemIdentifier id="ptc.wnc.exp.CloseMI"/>
<MenuItemIdentifier id="ptc.wnc.exp.LaunchNewPSEMI"/>
<MenuItemIdentifier id="SetConfigSpecMI"/>
<Separator/>
<MenuItemIdentifier id="ptc.wnc.exp.InfoPageMI"/>
<MenuItemIdentifier id="ptc.wnc.exp.CutMI"/>
<MenuItemIdentifier id="ptc.wnc.exp.CopyMI"/>
<MenuItemIdentifier id="ptc.wnc.exp.PasteMI"/>
<Separator/>
<MenuItemIdentifier id="ptc.wnc.exp.CopyToWindchillClipboardMI"/>
<MenuItemIdentifier id="ptc.wnc.exp.CopyFromWindchillClipboardMI"/>
<Separator/>
<MenuItemIdentifier id="SelectedAddChildMI"/>
<MenuItemIdentifier id="SelectedAddNewChildMI"/>
<MenuItemIdentifier id="SelectedAddInsertNewMI"/>
<Separator/>
<MenuItemIdentifier id="SelectedReplaceExistingMI"/>
<MenuItemIdentifier id="SelectedReplaceCreateAndReplaceMI"/>
<MenuItemIdentifier id="SelectedReplaceNewMI"/>
<MenuItemIdentifier id="SelectedReplaceAlternateMI"/>
<Separator/>
<MenuItemIdentifier id="FileSpecEditorLaunchMI"/>
<MenuItemIdentifier id="ptc.wnc.exp.ReviseMI"/>
<MenuItemIdentifier id="SelectedRemoveMI"/>
<Separator/>
<MenuItemIdentifier id="ptc.wnc.exp.SelectParentMI"/>
<MenuItemIdentifier id="ptc.wnc.exp.ExpandAllMI"/>
<Separator/>
<MenuItemIdentifier id="EditEditModeMI"/>
<Separator/>
<MenuItemIdentifier id="ptc.wnc.exp.FindInStructureMI"/>
<MenuItemIdentifier id="NewQueryMI"/>
<Separator/>
<MenuItemIdentifier id="HelpTopicsMI"/>
</ModeToolBar>
此舉可使「新建查詢」圖示出現在工具列中,如「預期結果」部份所示。
自訂點
自訂快顯選單
可變更特定模式下快顯選單的內容。在定義中新增現有動作、刪除和重新排序項目皆受支援。
考慮「使用」標籤。表格的快顯選單並非現成;包括「草稿」模式下的「插入現有的」「插入新的」動作。欲將它們新增至快顯選單,只需變更 ExplorerMenusForUsesTab.xml 中的 XML 即可插入這些 MenuItemIdentifier。
<ModePopupMenu id="PopupMenuB">
<Import id="ptc.wnc.exp.DraftAppMode"/>
<Import id="ptc.wnc.exp.AnnotateAppMode"/>
<MenuItemIdentifier id="ptc.wnc.exp.CutAssocMI"/>
<MenuItemIdentifier id="ptc.wnc.exp.CopyAssocMI"/>
<MenuItemIdentifier id="ptc.wnc.exp.PasteAssocMI"/>
<Separator/>
<MenuItemIdentifier id="AddChildMI"/>
<MenuItemIdentifier id="NewChildMI"/>
<Separator/>
<MenuItemIdentifier id="ReplaceExistingMI"/>
<MenuItemIdentifier id="CreateAndReplaceMI"/>
<MenuItemIdentifier id="ReplaceNewMI"/>
<MenuItemIdentifier id="ReplaceAlternateMI"/>
<Separator/>
<MenuItemIdentifier id="ptc.wnc.exp.RevertAssocMI"/>
<MenuItemIdentifier id="ptc.wnc.exp.CommentAssocMI"/>
</ModePopupMenu>
這將使「以全域替代物/特定替代物取代」顯示在「使用標籤」的快顯選單中,如「預期結果」中所示。
限制
針對未定義動作將新的選單項目新增至選單、工具列或快顯選單的操作不受支援,因為 PSE 目前並沒有受支援的 API 可供建立自訂動作。此外,將動作新增至未經設計的表格也不受支援。