Search in sources :

Example 1 with AttributesDefaults

use of com.intellij.ide.fileTemplates.actions.AttributesDefaults in project intellij-community by JetBrains.

the class CreateSetupPyAction method getAttributesDefaults.

@Override
public AttributesDefaults getAttributesDefaults(DataContext dataContext) {
    Project project = CommonDataKeys.PROJECT.getData(dataContext);
    final AttributesDefaults defaults = new AttributesDefaults("setup.py").withFixedName(true);
    if (project != null) {
        defaults.add("Package_name", project.getName());
        final PropertiesComponent properties = PropertiesComponent.getInstance();
        defaults.add("Author", properties.getOrInit(AUTHOR_PROPERTY, SystemProperties.getUserName()));
        defaults.add("Author_email", properties.getOrInit(EMAIL_PROPERTY, ""));
        defaults.addPredefined("PackageList", getPackageList(dataContext));
        defaults.addPredefined("PackageDirs", getPackageDirs(dataContext));
    }
    return defaults;
}
Also used : Project(com.intellij.openapi.project.Project) AttributesDefaults(com.intellij.ide.fileTemplates.actions.AttributesDefaults) PropertiesComponent(com.intellij.ide.util.PropertiesComponent)

Aggregations

AttributesDefaults (com.intellij.ide.fileTemplates.actions.AttributesDefaults)1 PropertiesComponent (com.intellij.ide.util.PropertiesComponent)1 Project (com.intellij.openapi.project.Project)1