当前位置: 首页>>代码示例>>Java>>正文


Java Module.getName方法代码示例

本文整理汇总了Java中com.intellij.openapi.module.Module.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Module.getName方法的具体用法?Java Module.getName怎么用?Java Module.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.module.Module的用法示例。


在下文中一共展示了Module.getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: update

import com.intellij.openapi.module.Module; //导入方法依赖的package包/类
@Override
public void update(final AnActionEvent e) {
    final DataContext dataContext = e.getDataContext();
    final Presentation presentation = e.getPresentation();

    final boolean enabled = isAvailable(dataContext);

    presentation.setVisible(enabled);
    presentation.setEnabled(enabled);

    if (enabled) {
        final Module module = LangDataKeys.MODULE.getData(dataContext);
        String moduleName = module == null ? "" : module.getName();
        presentation.setText(Text + " (" + moduleName + ")");
    }
}
 
开发者ID:PioBeat,项目名称:GravSupport,代码行数:17,代码来源:CreateNewThemeAction.java

示例2: computeIJDependencyFingerprint

import com.intellij.openapi.module.Module; //导入方法依赖的package包/类
private FP64 computeIJDependencyFingerprint( Project project )
{
  List<String> strings = new ArrayList<>();
  Module[] ijModules = ModuleManager.getInstance( project ).getModules();
  for( Module ijModule : ijModules )
  {
    String s = ijModule.getName() + ARROW;
    for( Module child : ModuleRootManager.getInstance( ijModule ).getDependencies() )
    {
      s += child.getName() + (ManProject.isExported( ijModule, child ) ? EXPORT : NOT_EXPORT);
    }
    strings.add( s );
  }
  return computeOrderIndependentFingerprint( strings );
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:16,代码来源:ModuleClasspathListener.java

示例3: getFileTitle

import com.intellij.openapi.module.Module; //导入方法依赖的package包/类
@Override
public String getFileTitle(@NotNull Project project, @NotNull VirtualFile virtualFile) {

    String fileCustomTitle;
    try {
        Module fileModule = FileIndexFacade.getInstance(project).getModuleForFile(virtualFile);

        String projectDefaultTitle = defaultBuilder.getProjectTitle(project);
        String projectName = project.getName();
        String projectPath = project.getBasePath();

        String fileDefaultTitle = defaultBuilder.getFileTitle(project, virtualFile);
        String fileName = virtualFile.getName();
        String filePath = virtualFile.getPath();
        String fileExt = virtualFile.getExtension();

        String moduleName = null;
        String modulePath = null;
        if (fileModule != null) {
            moduleName = fileModule.getName();
            modulePath = fileModule.getModuleFilePath();
        }

        fileCustomTitle = engine.eval("fileTemplate({" +
                "projectDefaultTitle: '" + projectDefaultTitle + "'," +
                "projectName: '" + projectName + "'," +
                "projectPath: '" + projectPath + "'," +
                "fileDefaultTitle: '" + fileDefaultTitle + "'," +
                "fileName: '" + fileName + "'," +
                "filePath: '" + filePath + "'," +
                "fileExt: '" + fileExt + "'," +
                "moduleName: '" + moduleName + "'," +
                "modulePath: '" + modulePath + "'" +
                "})").toString();

    } catch (Exception e) {
        fileCustomTitle = defaultBuilder.getFileTitle(project, virtualFile);
    }

    return fileCustomTitle;
}
 
开发者ID:mabdurrahman,项目名称:custom-title-plugin,代码行数:42,代码来源:CustomFrameTitleBuilder.java

示例4: createTheme

import com.intellij.openapi.module.Module; //导入方法依赖的package包/类
private void createTheme(@NotNull Project project, Module module) {
    String[] commands = {"echo", "0", "|", "php", "bin/plugin", "devtools", "new-theme",
            "--name", themeData.getName(),
            "--description", themeData.getDescription(),
            "--developer", themeData.getDeveloper(),
            "--email", themeData.getEmail()};

    GravProjectSettings settings = GravProjectSettings.getInstance(project);
    ModuleRootManager root = ModuleRootManager.getInstance(module);
    VirtualFile srcFile = null;
    for (VirtualFile file : root.getSourceRoots()) {
        if (file.isDirectory() && file.getName().contentEquals("src")) {
            srcFile = file;
            break;
        }
    }

    if (srcFile == null) {
        if (settings != null && settings.withSrcDirectory) {
            NotificationHelper.showBaloon("No source root found in module '" + module.getName() + "'",
                    MessageType.ERROR, project);
            return;
        } else {
            srcFile = FileCreateUtil.getParentDirectory(module.getModuleFile(), module.getName());
        }
    }

    VirtualFile finalSrcFile = srcFile;
    ProcessUtils processUtils = new ProcessUtils(commands, new File(finalSrcFile.getPath()));
    Task.Backgroundable t = new Task.Backgroundable(project, "Create New Grav Theme in Module '" + module.getName() + "'") {
        @Override
        public boolean shouldStartInBackground() {
            return true;
        }

        @Override
        public void onSuccess() {
            super.onSuccess();
            String output = processUtils.getOutputAsString();
            if (processUtils.getErrorOutput() != null) {
                NotificationHelper.showBaloon(processUtils.getErrorOutput(), MessageType.ERROR, project);
            } else {
                NotificationHelper.showBaloon("Theme '" + themeData.getName() + "' was created", MessageType.INFO, project);
            }
        }

        @Override
        public void run(@NotNull ProgressIndicator indicator) {
            processUtils.execute();
        }
    };
    ProgressManager.getInstance().run(t);

}
 
开发者ID:PioBeat,项目名称:GravSupport,代码行数:55,代码来源:CreateNewThemeAction.java


注:本文中的com.intellij.openapi.module.Module.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。