01: package org.columba.core.command;
02:
03: import org.columba.api.command.IWorkerStatusController;
04:
05: public class TestCommand extends Command {
06: private int id;
07:
08: private DefaultProcessorTest test;
09:
10: public TestCommand(DefaultProcessorTest test, int id) {
11: this (test, id, Command.NORMAL_PRIORITY);
12: }
13:
14: public TestCommand() {
15: super (null);
16: // nothing to do
17: }
18:
19: public TestCommand(DefaultProcessorTest test, int id, int priority) {
20: super (null);
21: this .id = id;
22: this .test = test;
23: this .priority = priority;
24: }
25:
26: public void updateGUI() {
27: test.finishedID = id;
28: }
29:
30: public void execute(IWorkerStatusController worker)
31: throws Exception {
32: test.executedID = id;
33: Thread.sleep(50);
34: }
35:
36: /**
37: * @return Returns the id.
38: */
39: public int getId() {
40: return id;
41: }
42:
43: /**
44: * @param id
45: * The id to set.
46: */
47: public void setId(int id) {
48: this.id = id;
49: }
50: }
|