I’ve just finished the Tray Icon integration of my PasswordSafeSWT app, and almost all of it was a snack. Catch the minimize window event, hide the window, show the tray icon. Catch the defaultSelection on the tray icon, show the window, hide the tray.

The only thing that caught me out was when I double click on the tray icon and show the window, it’s still minimized. Really not such a good look. The Shell object supports a setMinimized() and setMaximized(), but nothing like a setRestored()? Normally the SWT method names are so good, you can just guess. But no cigar here.

After some help from one of the guys on the RSS Owl project via the (totally awesome) SWT Newsgroup, the bit of missing information I needed was the setMinimized() call takes a boolean arg that, if false, restores the window the way it was.

If you are looking for a way to restore an SWT Shell programatically, setMinimized(false) is your guy. I though I’d write it up here so I can google for it later ;-).