Skip to main content

Custom Window Toolbar Buttons

TOC

Goal: Technical

Sponsor: Trek Global

Description:

Create custom toolbar button for window using OSGi dynamic service.

Example:

OSGi bundle project for the export button action

NF001 CustomWindowToolbarButton001

Class ExportAction is implements interface org.adempiere.webui.action.IAction

OSGi Service Component - Overview

''Note that the component name is use to locate the service and also the loading of image and tooltip text.

NF001 CustomWindowToolbarButton002

OSGi Service Component- Services

NF001 CustomWindowToolbarButton003

Bundle activator for auto 2pack import

NF001 CustomWindowToolbarButton004

Create new window toolbar button record

NF001 CustomWindowToolbarButton005

Create tooltip text message

NF001 CustomWindowToolbarButton006

Pack out the toolbar button and tooltip text record

NF001 CustomWindowToolbarButton007

Testing from Eclipse

NF001 CustomWindowToolbarButton008

Result

NF001 CustomWindowToolbarButton009


Source: Wiki