Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SWT on OS X: how to add badges to the dock icon

Tags:

java

macos

swt

dock

IntelliJ IDEA, a Swing based application, for example, can show a progress indicator on the dock icon when compiling and checkmark when finishes. How can this be done for the dock icon of an SWT application?

like image 745
Mot Avatar asked Jan 18 '26 20:01

Mot


1 Answers

Have a look at the TaskBar and TaskItem classes of SWT.

It's basically:

display.getSystemTaskBar().getItem(shell).setProgress(66);

where display is the current display and shell is the window associated with the dock icon.

There's also a code snippet for how to access the task bar.

like image 146
Codo Avatar answered Jan 21 '26 10:01

Codo