KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > core > command > TestCommand


1 package org.columba.core.command;
2
3 import org.columba.api.command.IWorkerStatusController;
4
5 public class TestCommand extends Command {
6   private int id;
7
8   private DefaultProcessorTest test;
9
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) throws Exception JavaDoc {
31     test.executedID = id;
32     Thread.sleep(50);
33   }
34
35   /**
36    * @return Returns the id.
37    */

38   public int getId() {
39     return id;
40   }
41
42   /**
43    * @param id
44    * The id to set.
45    */

46   public void setId(int id) {
47     this.id = id;
48   }
49 }
Popular Tags