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


Java ModifiableRootModel.findLibraryOrderEntry方法代码示例

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


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

示例1: updateProjectStructure

import com.intellij.openapi.roots.ModifiableRootModel; //导入方法依赖的package包/类
@Override
public void updateProjectStructure(
    Project project,
    BlazeContext context,
    WorkspaceRoot workspaceRoot,
    ProjectViewSet projectViewSet,
    BlazeProjectData blazeProjectData,
    @Nullable BlazeProjectData oldBlazeProjectData,
    ModuleEditor moduleEditor,
    Module workspaceModule,
    ModifiableRootModel workspaceModifiableModel) {
  if (!blazeProjectData.workspaceLanguageSettings.isLanguageActive(LanguageClass.JAVASCRIPT)
      || BlazeJavascriptLibrarySource.JS_LIBRARY_KIND == null) {
    return;
  }
  for (Library lib : getJavascriptLibraries(project)) {
    if (workspaceModifiableModel.findLibraryOrderEntry(lib) == null) {
      workspaceModifiableModel.addLibraryEntry(lib);
    }
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:22,代码来源:BlazeJavascriptSyncPlugin.java

示例2: updateProjectStructure

import com.intellij.openapi.roots.ModifiableRootModel; //导入方法依赖的package包/类
@Override
public void updateProjectStructure(
    Project project,
    BlazeContext context,
    WorkspaceRoot workspaceRoot,
    ProjectViewSet projectViewSet,
    BlazeProjectData blazeProjectData,
    @Nullable BlazeProjectData oldBlazeProjectData,
    ModuleEditor moduleEditor,
    Module workspaceModule,
    ModifiableRootModel workspaceModifiableModel) {
  if (!blazeProjectData.workspaceLanguageSettings.isLanguageActive(LanguageClass.TYPESCRIPT)) {
    return;
  }

  Library tsConfigLibrary =
      ProjectLibraryTable.getInstance(project).getLibraryByName(TSCONFIG_LIBRARY_NAME);
  if (tsConfigLibrary != null) {
    if (workspaceModifiableModel.findLibraryOrderEntry(tsConfigLibrary) == null) {
      workspaceModifiableModel.addLibraryEntry(tsConfigLibrary);
    }
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:24,代码来源:BlazeTypescriptSyncPlugin.java

示例3: updateProjectStructure

import com.intellij.openapi.roots.ModifiableRootModel; //导入方法依赖的package包/类
@Override
public void updateProjectStructure(
    Project project,
    BlazeContext context,
    WorkspaceRoot workspaceRoot,
    ProjectViewSet projectViewSet,
    BlazeProjectData blazeProjectData,
    @Nullable BlazeProjectData oldBlazeProjectData,
    ModuleEditor moduleEditor,
    Module workspaceModule,
    ModifiableRootModel workspaceModifiableModel) {
  if (!blazeProjectData.workspaceLanguageSettings.isLanguageActive(LanguageClass.GO)) {
    return;
  }
  for (Library lib : getGoLibraries(project)) {
    if (workspaceModifiableModel.findLibraryOrderEntry(lib) == null) {
      workspaceModifiableModel.addLibraryEntry(lib);
    }
  }
  Scope.push(
      context,
      (childContext) -> {
        childContext.push(new TimingScope("BuildGoSymbolicLinks", EventType.Other));
        BlazeGoRootsProvider.createGoPathSourceRoot(project);
      });
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:27,代码来源:BlazeGoSyncPlugin.java

示例4: updateProjectStructure

import com.intellij.openapi.roots.ModifiableRootModel; //导入方法依赖的package包/类
@Override
public void updateProjectStructure(
    Project project,
    BlazeContext context,
    WorkspaceRoot workspaceRoot,
    ProjectViewSet projectViewSet,
    BlazeProjectData blazeProjectData,
    @Nullable BlazeProjectData oldBlazeProjectData,
    ModuleEditor moduleEditor,
    Module workspaceModule,
    ModifiableRootModel workspaceModifiableModel) {
  if (!blazeProjectData.workspaceLanguageSettings.isLanguageActive(LanguageClass.DART)) {
    return;
  }

  Library dartSdkLibrary = DartSdkUtils.findDartLibrary(project);
  if (dartSdkLibrary != null) {
    if (workspaceModifiableModel.findLibraryOrderEntry(dartSdkLibrary) == null) {
      workspaceModifiableModel.addLibraryEntry(dartSdkLibrary);
    }
  } else {
    IssueOutput.error(
            "Dart language support is requested, but the Dart SDK was not found. "
                + "You must manually enable Dart support from "
                + "File > Settings > Languages & Frameworks > Dart.")
        .submit(context);
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:29,代码来源:BlazeDartSyncPlugin.java

示例5: updateProjectStructure

import com.intellij.openapi.roots.ModifiableRootModel; //导入方法依赖的package包/类
@Override
public void updateProjectStructure(
    Project project,
    BlazeContext context,
    WorkspaceRoot workspaceRoot,
    ProjectViewSet projectViewSet,
    BlazeProjectData blazeProjectData,
    @Nullable BlazeProjectData oldBlazeProjectData,
    ModuleEditor moduleEditor,
    Module workspaceModule,
    ModifiableRootModel workspaceModifiableModel) {
  if (!blazeProjectData.workspaceLanguageSettings.isLanguageActive(LanguageClass.KOTLIN)) {
    return;
  }

  Library kotlinJavaRuntimeLibrary = KotlinSdkUtils.findKotlinJavaRuntime(project);
  if (kotlinJavaRuntimeLibrary != null) {
    if (workspaceModifiableModel.findLibraryOrderEntry(kotlinJavaRuntimeLibrary) == null) {
      workspaceModifiableModel.addLibraryEntry(kotlinJavaRuntimeLibrary);
    }
  } else {
    // since the runtime library was not found remove the kotlin-runtime ijar if present -- it
    // prevents the kotlin plugin from kicking in and offering to setup the kotlin std library.
    removeKotlinRuntimeIjar(project, workspaceModifiableModel);
    IssueOutput.error(
            "Kotlin JVM runtime libraries not found in workspace libraries, setup the Kotlin "
                + "plugin.")
        .submit(context);
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:31,代码来源:BlazeKotlinSyncPlugin.java

示例6: removeKotlinRuntimeIjar

import com.intellij.openapi.roots.ModifiableRootModel; //导入方法依赖的package包/类
private static void removeKotlinRuntimeIjar(
    Project project, ModifiableRootModel workspaceModifiableModel) {
  Library ijar = KotlinSdkUtils.findKotlinJavaRuntimeIjar(project);
  if (ijar == null) {
    return;
  }
  LibraryOrderEntry entry = workspaceModifiableModel.findLibraryOrderEntry(ijar);
  if (entry != null) {
    workspaceModifiableModel.removeOrderEntry(entry);
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:12,代码来源:BlazeKotlinSyncPlugin.java


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