Esempio n. 1
0
    protected String resolve(TemplateContext context) {
      String name = null;
      ISourceModule module = getSourceModule(context);
      IDLTKLanguageToolkit toolkit = DLTKLanguageManager.getLanguageToolkit(module);

      name = toolkit.getLanguageName();

      return name;
    }
Esempio n. 2
0
 protected ISourceModuleFactory getSourceModuleFactory(String moduleName) {
   IPath modulePath = path.append(moduleName);
   IDLTKLanguageToolkit toolkit = DLTKLanguageManager.findToolkit(modulePath);
   ISourceModuleFactory factory = null;
   if (toolkit != null) {
     String natureId = toolkit.getNatureId();
     factory = DLTKLanguageManager.getSourceModuleFactory(natureId);
   }
   return factory;
 }
Esempio n. 3
0
  public IScriptProject[] getScriptProjects(String nature) throws ModelException {
    final List list = getChildrenOfType(SCRIPT_PROJECT);
    final List result = new ArrayList();
    for (int i = 0; i < list.size(); i++) {
      IScriptProject project = (IScriptProject) list.get(i);
      IDLTKLanguageToolkit toolkit = DLTKLanguageManager.getLanguageToolkit(project);
      if (toolkit.getNatureId().equals(nature)) {
        result.add(project);
      }
    }

    return (IScriptProject[]) result.toArray(new IScriptProject[result.size()]);
  }