2,209
社区成员
发帖
与我相关
我的任务
分享
public class NewCategoryAction extends Action{
public NewCategoryAction(){
super("New Category");
}
public void run(){
InputDialog input=new InputDialog(Display.getCurrent().getActiveShell(),"New Category","Category Name","",null);
if(input.open()==InputDialog.OK){
if(!ChannelView.db.isHave(input.getValue(), "category")){
Category c=new Category(input.getValue());
DB db=new DB();
db.addCategory(input.getValue());
ChannelView.data.add(c);
ChannelView.tree.refresh();
System.out.println("you wan to add new category is: "+input.getValue());
}
else{
System.out.println("the category you want add has existed");
}
}
}
}