Package edu.pitt.dbmi.nlp.noble.extract.model

Examples of edu.pitt.dbmi.nlp.noble.extract.model.Template


 
  /**
   * do preview
   */
  private void doPreview() {
    Template t = templateList.getSelectedValue();
    if(t == null)
      return;
   
    StringBuffer b = new StringBuffer();
    b.append("<h2>"+t.getName()+"</h2>");
    b.append(t.getDescription()+"<hr>");
    b.append("<ul>");
    for(TemplateItem i: t.getTemplateItems()){
      b.append("<li><b>"+i.getName()+"</b>");
    }
    b.append("</ul>");
   
    JEditorPane text = new JEditorPane();
View Full Code Here


  /**
   * do export of highlighted template
   */
  private void doExport() {
    Template template = templateList.getSelectedValue();
    if(template != null){
      JFileChooser chooser = new JFileChooser();
      chooser.setFileFilter(new FileFilter(){
        public boolean accept(File f) {
          return f.isDirectory() || f.getName().endsWith(".template");
        }
        public String getDescription() {
          return "Template XML File";
        }
       
      });
      chooser.setSelectedFile(new File(template.getName()+".template"));
      int r = chooser.showSaveDialog(frame);
      if(r == JFileChooser.APPROVE_OPTION){
        try{
          File f = chooser.getSelectedFile();
          FileOutputStream out = new FileOutputStream(f);
View Full Code Here

    if(url.startsWith("http://"))
      is = new URL(url).openStream();
    else
      is = new FileInputStream(new File(url));
    if(is != null){
      Template t =  templateFactory.importTemplate(is);
      is.close();
      return t;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of edu.pitt.dbmi.nlp.noble.extract.model.Template

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.