I am new in E4 application development. I add System tray icon in RCP 3.7.x successfully. to add a system tray icon in e4 application. I am using the e4 application life cycle to add a system tray icon in this way:
public class LifeCycleManager {
@PostContextCreate
void postContextCreate(IApplicationContext appContext, Display display) {
SystemNotifier icon= new SystemNotifier(shell);
SystemNotifier.trayItem = icon.initTaskItem(shell);
if (SystemNotifier.trayItem != null) {
icon.hookPopupMenu();
}
}
}
How to get reference of Active Workbench Shell in e4 application. Which annotation use of e4 application life cycle to add System Tray
The application shell is not available when
@PostContextCreate
runs. You need to wait for the application startup complete event, something like:}