com.intellij.openapi.module.Module.getName()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(10.8k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中com.intellij.openapi.module.Module.getName()方法的一些代码示例,展示了Module.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Module.getName()方法的具体详情如下:
包路径:com.intellij.openapi.module.Module
类名称:Module
方法名:getName

Module.getName介绍

暂无

代码示例

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

public String getLibraryName() {
 return GO_LIB_NAME + " <" + myModule.getName() + ">";
}

代码示例来源:origin: ballerina-platform/ballerina-lang

public String getLibraryName() {
  return BALLERINA_LIB_NAME + " <" + myModule.getName() + ">";
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

private GoDisableVendoringInModuleQuickFix(@NotNull Module module) {
 super("Disable vendoring experiment support in module '" + module.getName() + "'", "Disable vendoring experiment support in module");
 myModule = module;
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@NotNull
private static EditorNotificationPanel createPanel(@NotNull Project project, @NotNull Module module) {
  EditorNotificationPanel panel = new EditorNotificationPanel();
  panel.setText("'" + module.getName() + "' is not a Ballerina Module. Some features will not work.");
  panel.setToolTipText("You can fix this by navigating to File -> Project Structure -> Modules and adding '"
      + module.getName() + "' as a Ballerina module.");
  return panel;
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@NotNull
  private static EditorNotificationPanel createPanel(@NotNull Module module, @NotNull String sdkVersion,
      @NotNull String pluginVersion) {
    EditorNotificationPanel panel = new EditorNotificationPanel();
    panel.setText("Your Ballerina SDK version (" + sdkVersion + ") for the Module '" + module.getName()
        + "' does not match your Ballerina plugin version (" + pluginVersion + "). Some features may "
        + "not work properly.");
    return panel;
  }
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Override
public ModuleConfigurationEditor[] createEditors(@NotNull ModuleConfigurationState state) {
 ModifiableRootModel rootModel = state.getRootModel();
 Module module = rootModel.getModule();
 if (!(ModuleType.get(module) instanceof GoModuleType)) {
  return ModuleConfigurationEditor.EMPTY;
 }
 String moduleName = module.getName();
 List<ModuleConfigurationEditor> editors = ContainerUtil.newArrayList();
 editors.add(new ContentEntriesEditor(moduleName, state));
 editors.add(new OutputEditorEx(state));
 editors.add(new ClasspathEditor(state));
 return editors.toArray(new ModuleConfigurationEditor[editors.size()]);
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Override
public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile file, @NotNull FileEditor fileEditor) {
 if (file.getFileType() != GoFileType.INSTANCE) return null;
 Module module = ModuleUtilCore.findModuleForFile(file, myProject);
 return module == null || GoSdkService.getInstance(myProject).isGoModule(module) || getIgnoredModules(myProject).contains(module.getName()) 
     ? null
     : createPanel(myProject, module);
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@Override
public ModuleConfigurationEditor[] createEditors(@NotNull ModuleConfigurationState state) {
  ModifiableRootModel rootModel = state.getRootModel();
  Module module = rootModel.getModule();
  if (!(ModuleType.get(module) instanceof BallerinaModuleType)) {
    return ModuleConfigurationEditor.EMPTY;
  }
  String moduleName = module.getName();
  List<ModuleConfigurationEditor> editors = ContainerUtil.newArrayList();
  editors.add(new ContentEntriesEditor(moduleName, state));
  editors.add(new OutputEditorEx(state));
  editors.add(new ClasspathEditor(state));
  return editors.toArray(new ModuleConfigurationEditor[editors.size()]);
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@Override
public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile file, @NotNull FileEditor fileEditor) {
  if (file.getFileType() != BallerinaFileType.INSTANCE) {
    return null;
  }
  Module module = ModuleUtilCore.findModuleForFile(file, myProject);
  return module == null || BallerinaSdkService.getInstance(myProject).isBallerinaModule(module)
      || getIgnoredModules(myProject).contains(module.getName()) ? null : createPanel(myProject, module);
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@NotNull
private static EditorNotificationPanel createPanel(@NotNull Project project, @NotNull Module module) {
 EditorNotificationPanel panel = new EditorNotificationPanel();
 panel.setText("'" + module.getName() + "' is not Go Module, some code insight might not work here");
 panel.createActionLabel("Change module type to Go and reload project", () -> {
  int message = Messages.showOkCancelDialog(project, "Updating module type requires project reload. Proceed?", "Update Module Type",
                       "Reload project", "Cancel", null);
  if (message == Messages.YES) {
   module.setOption(Module.ELEMENT_TYPE, GoModuleType.getInstance().getId());
   project.save();
   EditorNotifications.getInstance(project).updateAllNotifications();
   ProjectManager.getInstance().reloadProject(project);
  }
 });
 panel.createActionLabel("Don't show again for this module", () -> {
  Set<String> ignoredModules = getIgnoredModules(project);
  ignoredModules.add(module.getName());
  PropertiesComponent.getInstance(project).setValue(DONT_ASK_TO_CHANGE_MODULE_TYPE_KEY, StringUtil.join(ignoredModules, ","));
  EditorNotifications.getInstance(project).updateAllNotifications();
 });
 return panel;
}

代码示例来源:origin: KronicDeth/intellij-elixir

@Override
public ModuleConfigurationEditor[] createEditors(ModuleConfigurationState state) {
 Module module = state.getRootModel().getModule();
 if(ModuleType.get(module) instanceof ElixirModuleType){
  return new ModuleConfigurationEditor[]{
    new ElixirContentEntriesEditor(module.getName(), state),
    new OutputEditorEx(state),
    new ClasspathEditor(state)
  };
 }
 return ModuleConfigurationEditor.EMPTY;
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Override
public void checkConfiguration() throws RuntimeConfigurationException {
 super.checkConfiguration();
 Module module = getConfigurationModule().getModule();
 if (module != null) {
  if (!GoSdkService.getInstance(module.getProject()).isAppEngineSdk(module)) {
   throw new RuntimeConfigurationWarning("Go SDK is not specified for module '" + module.getName() + "'");
  }
 }
 checkPortValue(myPort, "Invalid port");
 checkPortValue(myAdminPort, "Invalid admin port");
 if (myConfigFile != null && !"yaml".equals(PathUtil.getFileExtension(myConfigFile))) {
  throw new RuntimeConfigurationException("Config file is not YAML");
 }
}

代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin

@Override
public void checkConfiguration() throws RuntimeConfigurationException {
 GoModuleBasedConfiguration configurationModule = getConfigurationModule();
 Module module = configurationModule.getModule();
 if (module != null) {
  if (GoSdkService.getInstance(module.getProject()).getSdkHomePath(module) == null) {
   throw new RuntimeConfigurationWarning("Go SDK is not specified for module '" + module.getName() + "'");
  }
 }
 else {
  String moduleName = configurationModule.getModuleName();
  if (moduleName != null) {
   throw new RuntimeConfigurationError(ExecutionBundle.message("module.doesn.t.exist.in.project.error.text", moduleName));
  }
  throw new RuntimeConfigurationError(ExecutionBundle.message("module.not.specified.error.text"));
 }
 if (myWorkingDirectory.isEmpty()) {
  throw new RuntimeConfigurationError("Working directory is not specified");
 }
}

代码示例来源:origin: ballerina-platform/ballerina-lang

@Override
public void checkConfiguration() throws RuntimeConfigurationException {
  BallerinaModuleBasedConfiguration configurationModule = getConfigurationModule();
  Module module = configurationModule.getModule();
  if (module != null) {
    if (BallerinaSdkService.getInstance(module.getProject()).getSdkHomePath(module) == null) {
      throw new RuntimeConfigurationError("Ballerina SDK is not specified for module '" +
          module.getName() + "'");
    }
  } else {
    String moduleName = configurationModule.getModuleName();
    if (moduleName != null) {
      throw new RuntimeConfigurationError(
          ExecutionBundle.message("module.doesn.t.exist.in.project.error.text", moduleName));
    }
    throw new RuntimeConfigurationError(ExecutionBundle.message("module.not.specified.error.text"));
  }
  if (myWorkingDirectory.isEmpty()) {
    throw new RuntimeConfigurationError("Working directory is not specified");
  }
}

代码示例来源:origin: jshiell/checkstyle-idea

public CheckStyleModulePlugin(@NotNull final Module module) {
  LOG.info("CheckStyle Module Plugin loaded for module: \"" + module.getName() + "\"");
}

代码示例来源:origin: jshiell/checkstyle-idea

CheckerFactoryCacheKey(@NotNull final ConfigurationLocation location, @Nullable final Module module) {
  this.projectName = module != null ? module.getProject().getName() : "noProject";
  this.moduleName = module != null ? module.getName() : "noModule";
  this.location = location;
}

代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin

public static AndroidFacet getCurrentFacet(Project project, Module module) {
  AndroidFacet currentFacet = null;
  if (module == null) {
    return null;
  }
  List<AndroidFacet> applicationFacets = ProjectFacetManager.getInstance(project).getFacets(AndroidFacet.ID);
  for (AndroidFacet facet : applicationFacets) {
    if (facet.getModule().getName().equals(module.getName())) {
      currentFacet = facet;
      break;
    }
  }
  return currentFacet;
}

代码示例来源:origin: jshiell/checkstyle-idea

public ClassLoader build(final Module baseModule) {
  if (baseModule == null) {
    return getClass().getClassLoader();
  }
  final Project project = baseModule.getProject();
  final List<URL> outputPaths = new ArrayList<>();
  final Set<Module> transitiveDependencies = new HashSet<>();
  ModuleUtil.getDependencies(baseModule, transitiveDependencies);
  for (Module moduleInScope : transitiveDependencies) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Adding module to classpath: " + moduleInScope.getName());
    }
    outputPaths.addAll(ModulePaths.compilerOutputPathsFor(moduleInScope));
    outputPaths.addAll(ModulePaths.libraryPathsFor(moduleInScope));
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("Creating class-loader with URLs: " + outputPaths);
  }
  URL[] effectiveClasspath = outputPaths.toArray(new URL[outputPaths.size()]);
  if (wantsCopyLibs()) {
    final Optional<File> tempDir = new TempDirProvider().forCopiedLibraries(project);
    if (tempDir.isPresent()) {
      final Path t = Paths.get(tempDir.get().toURI());
      effectiveClasspath = new ClasspathStabilizer(project, t).stabilize(outputPaths);
    }
  }
  return new URLClassLoader(effectiveClasspath, getClass().getClassLoader());
}

代码示例来源:origin: SonarSource/sonarlint-intellij

protected Module createModule() {
 Module m = mock(Module.class);
 when(m.getName()).thenReturn("testModule");
 when(m.getProject()).thenReturn(project);
 return m;
}

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

@Test
public void stage_customRuntime() throws IOException {
 AppEngineFlexibleFacet.getFacetByModule(customModule)
   .getConfiguration()
   .setDockerDirectory(dockerfile.getParent());
 deploymentConfiguration.setModuleName(customModule.getName());
 boolean result = stage.stage(stagingDirectory.toPath());
 assertThat(result).isTrue();
 assertFileIsStaged(customYaml);
 assertFileIsStaged(dockerfile);
 assertFileIsStaged(warArtifact);
}

相关文章