public static void generateFileChanges(DataModel model) {
    CreatedModifiedFiles fileChanges = new CreatedModifiedFiles(model.getProject());
    NbModuleProvider moduleInfo = model.getModuleInfo();
    final String category = model.getCategory();
    final String name = model.getName();
    final String packageName = model.getPackageName();

    HashMap<String, String> replaceTokens = new HashMap<String, String>();
    replaceTokens.put("DISPLAYNAME", category); // NOI18N

    replaceTokens.put("TEMPLATENAME", name); // NOI18N

    replaceTokens.put("PACKAGENAME", packageName); // NOI18N

    // Update project dependencies
    for (int i = 0; i < MODULES.length; i++) {
      fileChanges.add(fileChanges.addModuleDependency(MODULES[i]));
    }

    // Generate action class:
    String iteratorName =
        getRelativePath(
            moduleInfo.getSourceDirectoryPath(), packageName, name, "Action.java"); // NOI18N

    FileObject template = CreatedModifiedFiles.getTemplate("templateAction.java"); // NOI18N

    fileChanges.add(fileChanges.createFileWithSubstitutions(iteratorName, template, replaceTokens));

    // Layer entry:
    fileChanges.add(
        fileChanges.createLayerEntry(
            "VisualVM/"
                + "ExplorerPopupSelection/"
                + packageName.replace(".", "-")
                + "-"
                + name
                + "Action.instance", // NOI18N
            null,
            null,
            "",
            null));

    // Layer attr:
    fileChanges.add(
        fileChanges.createLayerAttribute(
            "VisualVM/"
                + "ExplorerPopupSelection/"
                + packageName.replace(".", "-")
                + "-"
                + name
                + "Action.instance",
            "position",
            3000));

    model.setCreatedModifiedFiles(fileChanges);
  }
 public Set instantiate() throws IOException {
   CreatedModifiedFiles cmf = data.getCreatedModifiedFiles();
   cmf.run();
   return getCreatedFiles(cmf, data.getProject());
 }