public TemplateManager getTemplateManager() {
    TemplateManager tm=null;
    int foo=getTemplateType();
    if (foo==FILE_TEMPLATE)
      tm=Global.getFileTemplateManager();
    else
    if (foo==CLASS_TEMPLATE)
      tm=Global.getClassTemplateManager();
    else
      throw new RuntimeException("Invalid template type "+foo);
    return tm;
  }