Changeset 1308


Ignore:
Timestamp:
08/21/06 12:49:36 (14 years ago)
Author:
chris
Message:

Switch TemplateParser to use getResourceAsStream.

Location:
trunk/loci/ome/notebook
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/ome/notebook/MetadataNotebook.java

    r1301 r1308  
    6868 
    6969    //give the Template.xml file to the parser to feed on 
    70     File f = new File("Template.xml"); 
    71     TemplateParser tp = new TemplateParser(f); 
     70    TemplateParser tp = new TemplateParser("Template.xml"); 
    7271 
    7372    mdp = new loci.ome.viewer.MetadataPane(); 
  • trunk/loci/ome/notebook/MetadataPane.java

    r1301 r1308  
    147147    panelsWithID = new Vector(); 
    148148    addItems = new Vector(); 
    149     File f = new File("Template.xml"); 
    150     tParse = new TemplateParser(f); 
     149    tParse = new TemplateParser("Template.xml"); 
    151150    thisOmeNode = null; 
    152151    internalDefs = null; 
     
    13531352          } 
    13541353        } 
    1355  
    1356 /* 
    1357         refColumn.setCellEditor(new VariableComboEditor(panelsWithID, 
    1358           addItems, this, internalDefs)); 
    1359         TableColumn gotoColumn = table.getColumnModel().getColumn(2); 
    1360         gotoColumn.setCellEditor(new GotoEditor(this)); 
    1361 */ 
    13621354      } 
    13631355    } 
  • trunk/loci/ome/notebook/TemplateParser.java

    r1301 r1308  
    7878   * MetadataPane 
    7979   */ 
    80   public TemplateParser(File file) { 
     80  public TemplateParser(String filename) { 
    8181    // Parse the specified xml file (should be Template.xml) using the DOM 
    8282    try { 
    8383      DocumentBuilder db = DOC_FACT.newDocumentBuilder(); 
    84       templateDoc = db.parse(file); 
     84      templateDoc = db.parse(getClass().getResourceAsStream(filename)); 
    8585    } 
    8686    catch (Exception e) { 
     
    230230  /** used for debugging */ 
    231231  public static void main(String[] args) { 
    232     File f = new File("Template.xml"); 
    233     TemplateParser tp = new TemplateParser(f); 
     232    TemplateParser tp = new TemplateParser("Template.xml"); 
    234233    Element[] eList = tp.getTabs(); 
    235234    for (int i = 0;i<eList.length;i++) { 
Note: See TracChangeset for help on using the changeset viewer.