62,616
社区成员
发帖
与我相关
我的任务
分享
public class NewChannelWizard extends Wizard {
public static String cb;
private NewChannelOne one = new NewChannelOne();
private NewChannelTwo two = new NewChannelTwo();
test t=new test();
public NewChannelWizard() {
this.addPage(one);
this.addPage(two);
this.setWindowTitle("New Channel");
}
@Override
public boolean performFinish() {
String channelurl ;
String channel_name ;
String category_name ;
URL feedUrl = null;
System.out.println("1");
channelurl = one.text.getText();
channel_name = two.text.getText();
category_name = two.combo.getText();
try {
t.done(feedUrl,category_name);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
System.out.println("2");
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("3");
e.printStackTrace();
} catch (FeedException e) {
// TODO Auto-generated catch block
System.out.println("4");
e.printStackTrace();
}
ChannelView.db.addChannel(channelurl, channel_name, category_name,null );// 作者从解析器获取
ChannelView.initdata();
ChannelView.tree.setInput(ChannelView.data);
ChannelView.tree.refresh();
return true;
}
public boolean canFinish(){
if(this.getContainer().getCurrentPage()==two){
return true;
}
else
return false;
}
}
public class test {
public test(){
System.out.println("test");
}
public void done(URL channelurl,String category_name) throws IllegalArgumentException, IOException, FeedException{
int articlecount;
String author = null;
String content= null;
String pubdate= null;
String articleurl= null;
String title = null;
URL feedUrl = null;
Listen lis=new Listen(feedUrl);
List entry=lis.parseroutput.getEntries();
articlecount=entry.size();
for(int i=0;i<articlecount;i++){
articleurl=lis.parseroutput.getLink(i);
title=lis.parseroutput.getTitle(i);
pubdate=lis.parseroutput.getPubDate(i).toString();
content=lis.parseroutput.getDescription(i);
author=lis.parseroutput.getAuthor(i);
ChannelView.db.addArticle(articleurl,title, pubdate, content, channelurl.toString(), category_name, author);
}
}
}