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