本文整理汇总了Java中net.sf.memoranda.util.Util.error方法的典型用法代码示例。如果您正苦于以下问题:Java Util.error方法的具体用法?Java Util.error怎么用?Java Util.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.memoranda.util.Util
的用法示例。
在下文中一共展示了Util.error方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTagList
import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
public static String getTagList(Project pjr){
try {
String filepath = FileStorage.JN_DOCPATH + ".projects";
Builder builder = new Builder();
Document projects = builder.build(new InputStreamReader(new FileInputStream(filepath)), "UTF-8");
String taglist="";
Elements prjs = projects.getRootElement().getChildElements("project");
for (int i = 0; i < prjs.size(); i++) {
String pid = ((Element) prjs.get(i)).getAttribute("id").getValue();
if (pid.equals(pjr.getID())){
Element tags=prjs.get(i).getFirstChildElement("tags");
Elements tagli=tags.getChildElements("tag");
if (tagli.size()<=0) return "no";
for (int j = 0; j < tagli.size(); j++) {
taglist+=tagli.get(j).getAttributeValue("name")+" - ";
}
break;
}
}
return taglist;
} catch (Exception e) {
Util.error(e);
return "no";
}
}
示例2: init
import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
public static void init() {
tags = new HashSet<String>();
try {
Vector<Project> projects = ProjectManager.getAllProjects();
for (int i = 0; i < projects.size(); i++) {
Elements tagElements = projects.get(i).getTags();
for (int j = 0; j < tagElements.size(); j++) {
tags.add(tagElements.get(j).getAttributeValue("name").toLowerCase());
}
}
tags.add(" ");
} catch (Exception e) {
Util.error(e);
}
}
示例3: search
import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
private void search() {
try {
DefaultTableModel model = (DefaultTableModel)results.getModel();
Vector<Project> projects = new Vector<Project>();
String selectedItem = tagSelectBox.getSelectedItem().toString();
if(!selectedItem.equals("") && !selectedItem.equals(" ")){
projects=ProjectImpl.findProjectByAllTagName(tagSelectBox.getSelectedItem().toString());
}
else if (!manualTagTextField.getText().toString().equals("")){
projects=ProjectImpl.findProjectByAllTagName(manualTagTextField.getText().toString());
}
if(projects.size()==0){
JOptionPane.showMessageDialog(null, Local.getString("No project found for this tag"));
}
else {
model.setRowCount(0);
for(int i=0;i < projects.size();i++){
model.addRow(new Object[]{projects.get(i).getTitle(), projects.get(i).getTagsAsString()});
}
}
} catch (NullPointerException e) {
Util.error(e);
JOptionPane.showMessageDialog(null, Local.getString("No project found for this tag"));
}
}
示例4: addTagToProject
import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
public static boolean addTagToProject(String tag, Project prj) {
if (tag==null || prj == null) return false;
tag = tag.toLowerCase();
try{
if (!tags.contains(tag)) {
tags.add(tag);
}
return prj.addTag(tag);
}
catch(Exception e){
Util.error(e);
return false;
}
}
示例5: removeTagFromProject
import net.sf.memoranda.util.Util; //导入方法依赖的package包/类
public static boolean removeTagFromProject(String tag, Project prj) {
if (tag==null || prj==null) return false;
tag = tag.toLowerCase();
try {
if (!tags.contains(tag)) {
return false;
}
return prj.removeTag(tag);
} catch (Exception e) {
Util.error(e);
return false;
}
}