PageRenderTime 54ms CodeModel.GetById 50ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/1.0.1/src/org/getopt/luke/SlowThread.java

http://luke.googlecode.com/
Java | 25 lines | 21 code | 4 blank | 0 comment | 0 complexity | 771d4fb53634378c5daf78d8eeaa3c21 MD5 | raw file
 1package org.getopt.luke;
 2
 3public abstract class SlowThread extends Thread {
 4  private Object ui;
 5  private Luke app;
 6
 7  public SlowThread(Luke app) {
 8    this.app = app;
 9    ui = app.addComponent(null, "/xml/wait.xml", null, null);    
10  }
11  
12  public abstract void execute();
13  
14  public final void run() {
15    app.add(ui);
16    try {
17      execute();
18    } catch (Throwable t) {
19      t.printStackTrace();
20      app.showStatus(t.getMessage());
21    }
22    app.remove(ui);
23    app.repaint();
24  }
25}