public static boolean containsCeylonTestImport(Module module) {
   if (module != null) {
     for (ModuleImport moduleImport : module.getImports()) {
       if (moduleImport.getModule().getNameAsString().equals(CEYLON_TEST_MODULE_NAME)) {
         return true;
       }
     }
   }
   return false;
 }
示例#2
0
  private void writeDependencies() throws IOException {
    List<ModuleImport> moduleImports = new ArrayList<ModuleImport>(module.getImports());

    Iterator<ModuleImport> moduleImportIterator = moduleImports.listIterator();
    while (moduleImportIterator.hasNext()) {
      ModuleImport moduleImport = moduleImportIterator.next();
      if (moduleImport.getModule().getNameAsString().equals(AbstractModelLoader.CEYLON_LANGUAGE)) {
        moduleImportIterator.remove();
      }
    }

    Collections.sort(moduleImports, ModuleImportComparatorByName.INSTANCE);

    if (!moduleImports.isEmpty()) {
      openTable("section-dependencies", "Dependencies", 3, false);
      for (ModuleImport moduleImport : moduleImports) {
        writeDependencyRow(moduleImport);
      }
      closeTable();
    }
  }
示例#3
0
  private void writeDependencyRow(ModuleImport moduleImport) throws IOException {
    StringBuilder tooltip = new StringBuilder();
    if (moduleImport.isExport()) {
      tooltip.append("shared ");
    }
    if (moduleImport.isOptional()) {
      tooltip.append("optional ");
    }
    tooltip.append("import of module ");
    tooltip.append(moduleImport.getModule().getNameAsString());
    tooltip.append(" ");
    tooltip.append(moduleImport.getModule().getVersion());

    open("tr");

    open("td class='shrink'");
    open("span title='" + tooltip + "'");
    writeIcon(moduleImport);
    close("span");
    open("code class='decl-label'");
    linkRenderer().to(moduleImport.getModule()).write();
    Backends backends = moduleImport.getNativeBackends();
    if (!backends.none()) {
      write(" (");
      write(backends.names());
      write(")");
    }
    close("code");
    close("td");

    open("td class='shrink'");
    open("code");
    write(moduleImport.getModule().getVersion());
    close("code");
    close("td");

    open("td");
    open("div class='description import-description'");
    write(getDoc(moduleImport, linkRenderer()));
    close("div");
    close("td");

    close("tr");
  }