i have product which is built on eclipse sdk 3.5, this is not a RCP. The requirement is to minimize the application to the tray with an icon when the close button is clicked.

i know how to do this with an RCP
Java Code:
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());

since a new display is created and a new ApplicationWorkbenchAdvisor is passed createAndRunWorkbench, the methods in ApplicationWorkbenchAdvisor can be overridden, thus the overridden methods will be called when the event occurs.

How can i do the same for a product which is not and RCP?