RSS news reader; initially copied from "all the news"
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.news / src / net / sourceforge / phpeclipse / news / UpdateThread.java
1 package net.sourceforge.phpeclipse.news;
2
3 import java.util.Iterator;
4
5 public class UpdateThread extends Thread {
6
7
8     /**
9      * Constructor for UpdateThread
10      */
11     public UpdateThread() {
12         super();
13         this.setDaemon(true);
14     }
15
16     /**
17      * @see Runnable#run()
18      */
19     public void run() {
20         try {
21                 Plugin plugin = Plugin.getDefault();
22             Iterator iterator = Plugin.getDefault().getChannelList().iterator();
23             while(iterator.hasNext()) {
24                 Channel channel = (Channel)iterator.next();
25                 channel.setRefreshing(true);
26                 plugin.notifyChannelStatusChanged(channel, null);
27                 channel.update();
28                 channel.setRefreshing(false);
29                 plugin.notifyChannelStatusChanged(channel, null);
30             }
31         } finally {
32             Plugin.getDefault().updateThread = null;
33         }
34     }
35
36 }