1 | public class ImportMessageCommand extends Command {↵ | | 1 | class PlaySoundCommand extends Command {↵
|
2 | /**↵ | | 2 | ↵
|
3 | * @param references↵ | | |
|
4 | */↵ | | |
|
5 | public ImportMessageCommand(ICommandReference reference) {↵ | | 3 | public PlaySoundCommand(ICommandReference reference) {↵
|
6 | super(reference);↵ | | 4 | super(reference);↵
|
7 | }↵ | | 5 | }↵
|
|
8 | /*↵ | | 6 | ↵
|
9 | * (non-Javadoc)↵ | | |
|
10 | * ↵ | | |
|
11 | * @see org.columba.api.command.Command#execute(org.columba.api.command.Worker)↵ | | |
|
12 | */↵ | | |
|
13 | public void execute(IWorkerStatusController worker) throws Exception {↵ | | 7 | public void execute(IWorkerStatusController worker) throws Exception {↵
|
|
14 | ImportFolderCommandReference r = (ImportFolderCommandReference) getReference(↵ | | 8 | // you need a sound.wav in your program folder↵
|
15 | );↵ | | 9 | File soundFile = new File("sound.wav");↵
|
|
16 | AbstractMailboxImporter importer = r.getImporter();↵ | | 10 | ↵
|
|
17 | importer.run(worker↵ | | 11 | URL url = soundFile.toURL();↵
|
|
18 | );↵ | | 12 | PlaySound.play(url);↵
|
19 | | | 13 |
|