Search in sources :

Example 1 with GenerateGroovyDocDialog

use of org.jetbrains.plugins.groovy.doc.GenerateGroovyDocDialog in project intellij-community by JetBrains.

the class GenerateGroovyDocAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent e) {
    final DataContext dataContext = e.getDataContext();
    final Project project = CommonDataKeys.PROJECT.getData(dataContext);
    final Module module = LangDataKeys.MODULE.getData(dataContext);
    if (module == null)
        return;
    GroovyDocConfiguration configuration = new GroovyDocConfiguration();
    final VirtualFile[] files = ModuleRootManager.getInstance(module).getContentRoots();
    if (files.length == 1) {
        configuration.INPUT_DIRECTORY = files[0].getPath();
    }
    final GenerateGroovyDocDialog dialog = new GenerateGroovyDocDialog(project, configuration);
    if (!dialog.showAndGet()) {
        return;
    }
    generateGroovydoc(configuration, project);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Project(com.intellij.openapi.project.Project) GenerateGroovyDocDialog(org.jetbrains.plugins.groovy.doc.GenerateGroovyDocDialog) Module(com.intellij.openapi.module.Module) GroovyDocConfiguration(org.jetbrains.plugins.groovy.doc.GroovyDocConfiguration)

Aggregations

Module (com.intellij.openapi.module.Module)1 Project (com.intellij.openapi.project.Project)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 GenerateGroovyDocDialog (org.jetbrains.plugins.groovy.doc.GenerateGroovyDocDialog)1 GroovyDocConfiguration (org.jetbrains.plugins.groovy.doc.GroovyDocConfiguration)1