Skip to: Site menu | Main content

A Grails-like Rich Application Platform

TrayBuilder Plugin Print

Description

Enables SystemTray and TrayIcon support on your Griffon application.

The TrayIcon class is actually JPopupTrayIcon by Michael Biem (from the Fishfarm project), which in turn is based on Alex Potochkin's JXTrayIcon. In short words this class allows you to display a JPopupMenu in the systemTray as opposed to a regular, plain PopupMenu (AWT stuff, yuck!)

Installation

The current version of griffon-tray-builder-plugin is 0.5

To install just issue the following command

Warning

Icon

This plugin requires JDK6 to be installed, it will also constrain the running environment to JRE6 or above.

Usage

There is no standalone builder as opposed to the other builder plugins, as this one only adds 2 node factories and relies on Griffon's CompositeBuilder to be mixed&matched with other SwingBuilder based builders, those factories are

Node

Property

Type

Default

Required

Bindable

Notes

systemTray

[SystemTray]

trayIcons

TrayIcon[]

 

(error)
(error)

readonly

 

trayIconSize

Dimension

 

(error)
(error)

readonly

trayIcon

[JPopupTrayIcon]

url

URL

 

(tick)
(error)

 

 

file

File

 

(tick)
(error)

can also be a String

 

inputStream

InputStream

 

(tick)
(error)

 

 

resource

String

 

(tick)
(error)

 

 

class

Class

 

(tick)
(error)

only required if resource is specified.

 

 

 

 

 

 

specify one of url, file, inputStream, resource or use a String as node value.

 

 

 

 

 

 

accepts JPopupMenu instances as children only.

The following is an example of its usage provided by SwingPad as sample script:

Icon

A variable systemTray is available for your convenience, it points to the SystemTray instance.

Migration

Users migrating from 0.1.x to 0.2.x should note that the plugin bundles an addon an installs it in Builder.groovy. You must remove manually any references to 'griffon.builder.tray.TrayBuilder' found on Builder.groovy.

History

Version

Date

Notes

0.6

05-17-11

Release sync with Griffon 0.9.3

0.5

02-10-11

Release sync with Griffon 0.9.2

0.4

07-22-10

Release sync with Griffon 0.9

0.3

03-01-10

Upgraded to Griffon 0.3

0.2

12-01-09

Fixed GRIFFON-101 TrayBuilder now degrades gracefully when running in JRE5

0.1.1

03-09-09

Bumped version to be compatible with Griffon 0.1.0

0.1

 

 

0.1-SNAPSHOT