iDempiere
iDempiere Technical Guide: How to Add Custom Toolbar Buttons
實戰案例:實作「列印傳票」按鈕。本指南將帶您了解如何使用 OSGi 在 iDempiere 視窗工具列中新增自訂按鈕。 架構概觀 iDempiere 中的自訂工具列按鈕採用 OSGi 宣告式服務(DS)機制。具體做法是將您插件中的 Java 類別註冊為 IAction 服務。當 ADWindowToolbar 載入時,它會讀取 AD_ToolBarButton 資料表中 IsCustomization=Y 的記錄,然後透過 OSGi 查找對應的 IAction 實作,並動態建立按鈕。 graph LR A["AD_ToolBarButton<br/>(資料庫設定)"] --> B["ADWindowToolbar<br/>(載入按鈕)"] B --> C["Actions.getAction()<br/>(OSGi 查詢)"] C --> D["IAction 實作<br/>(你的插件)"] B --> E["Actions.getActionImage()<br/>(載入圖示)"]...
2026-02-10 · 閱讀 94 分鐘