當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。