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


Java LibraryDependencyData类代码示例

本文整理汇总了Java中com.intellij.openapi.externalSystem.model.project.LibraryDependencyData的典型用法代码示例。如果您正苦于以下问题:Java LibraryDependencyData类的具体用法?Java LibraryDependencyData怎么用?Java LibraryDependencyData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LibraryDependencyData类属于com.intellij.openapi.externalSystem.model.project包,在下文中一共展示了LibraryDependencyData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: refreshDependencies

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
@Override
protected void refreshDependencies(ExternalProjectRefreshCallback cbk, @Nullable Collection<DataNode<LibraryDependencyData>> libraryDependencies) {
    if (libraryDependencies != null) {
        // Change the dependencies only if there are new dependencies
        this.libraryDependencies = libraryDependencies;
        cbk.onSuccess(null);
        return;
    }
    if (this.libraryDependencies != null) {
        cbk.onSuccess(null);
        return;
    }
    ExternalSystemProcessingManager processingManager = ServiceManager.getService(ExternalSystemProcessingManager.class);
    if (processingManager != null && processingManager.findTask(ExternalSystemTaskType.RESOLVE_PROJECT, GradleConstants.SYSTEM_ID, getProjectBasePath(project)) != null) {
        // Another scan in progress
        return;
    }
    ExternalSystemUtil.refreshProject(project, GradleConstants.SYSTEM_ID, getProjectBasePath(project), cbk, false, ProgressExecutionMode.IN_BACKGROUND_ASYNC);
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:20,代码来源:GradleScanManager.java

示例2: scanAndUpdate

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
/**
 * Scan and update dependency components.
 */
private void scanAndUpdate(boolean quickScan, ProgressIndicator indicator, @Nullable Collection<DataNode<LibraryDependencyData>> libraryDependencies) {
    // Don't scan if Xray is not configured
    if (!GlobalSettings.getInstance().isCredentialsSet()) {
        Utils.notify(logger, "JFrog Xray scan failed", "Xray server is not configured.", NotificationType.ERROR);
        return;
    }
    // Prevent multiple simultaneous scans
    if (!scanInProgress.compareAndSet(false, true)) {
        if (!quickScan) {
            Utils.notify(logger, "JFrog Xray", "Scan already in progress.", NotificationType.INFORMATION);
        }
        return;
    }
    try {
        // Refresh dependencies -> Collect -> Scan and store to cache -> Update view
        refreshDependencies(getRefreshDependenciesCbk(quickScan, indicator), libraryDependencies);
    } finally {
        scanInProgress.set(false);
    }
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:24,代码来源:ScanManager.java

示例3: asyncScanAndUpdateResults

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
/**
 * Launch async dependency scan.
 */
public void asyncScanAndUpdateResults(boolean quickScan, @Nullable Collection<DataNode<LibraryDependencyData>> libraryDependencies) {
    Task.Backgroundable scanAndUpdateTask = new Task.Backgroundable(project, "Xray: Scanning for Vulnerabilities...") {
        @Override
        public void run(@NotNull ProgressIndicator indicator) {
            scanAndUpdate(quickScan, indicator, libraryDependencies);
            indicator.finishNonCancelableSection();
        }
    };
    // The progress manager is only good for foreground threads.
    if (SwingUtilities.isEventDispatchThread()) {
        ProgressManager.getInstance().run(scanAndUpdateTask);
    } else {
        // Run the scan task when the thread is in the foreground.
        SwingUtilities.invokeLater(() -> ProgressManager.getInstance().run(scanAndUpdateTask));
    }
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:20,代码来源:ScanManager.java

示例4: importData

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
/**
 * This function is called after change in the build.gradle file or refresh gradle dependencies call.
 * @param toImport the project dependencies
 * @param projectData the project data
 * @param project the current project
 * @param modelsProvider contains the project modules
 */
@Override
public void importData(@NotNull Collection<DataNode<LibraryDependencyData>> toImport,
                       @Nullable ProjectData projectData,
                       @NotNull Project project,
                       @NotNull IdeModifiableModelsProvider modelsProvider) {
    if (projectData == null || !projectData.getOwner().equals(GradleConstants.SYSTEM_ID)) {
        return;
    }

    ScanManager scanManager = ScanManagerFactory.getScanManager(project);
    if (scanManager == null) {
        ScanManagerFactory scanManagerFactory = ServiceManager.getService(project, ScanManagerFactory.class);
        scanManagerFactory.initScanManager(project);
        scanManager = ScanManagerFactory.getScanManager(project);
        if (scanManager == null) {
            return;
        }
        MessageBus messageBus = ApplicationManager.getApplication().getMessageBus();
        messageBus.syncPublisher(Events.ON_IDEA_FRAMEWORK_CHANGE).update();
    }
    if (GlobalSettings.getInstance().isCredentialsSet()) {
        scanManager.asyncScanAndUpdateResults(true, toImport);
    }
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:32,代码来源:XrayDependencyDataService.java

示例5: update

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
@Override
protected void update(PresentationData presentation) {
  super.update(presentation);
  presentation.setIcon(AllIcons.Nodes.PpLib);

  final LibraryDependencyData data = getData();
  if (data != null) {
    setNameAndTooltip(getName(), null, data.getScope().getDisplayName());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ExternalSystemViewDefaultContributor.java

示例6: getOrderEntry

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
@Nullable
private OrderEntry getOrderEntry() {
  final LibraryDependencyData data = getData();
  if (data == null) return null;
  final Project project = getProject();
  if (project == null) return null;
  return new IdeModelsProviderImpl(project).findIdeModuleOrderEntry(data);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ExternalSystemViewDefaultContributor.java

示例7: findLibraryDependency

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
@Nullable
public DataNode<LibraryDependencyData> findLibraryDependency(String moduleName, final String libraryId) {
  final DataNode<ModuleData> moduleNode = findModule(moduleName);
  return ExternalSystemApiUtil.findAll(moduleNode, ProjectKeys.LIBRARY_DEPENDENCY)
    .stream()
    .filter(node -> StringUtil.equalsIgnoreCase(libraryId, node.getData().getExternalName()))
    .findFirst()
    .orElse(null);
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:10,代码来源:PantsResolverTestBase.java

示例8: refreshDependencies

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
@Override
protected void refreshDependencies(ExternalProjectRefreshCallback cbk, @Nullable Collection<DataNode<LibraryDependencyData>> libraryDependencies) {
    cbk.onSuccess(null);
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:5,代码来源:MavenScanManager.java

示例9: isRootDependency

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
private static boolean isRootDependency(DataNode<LibraryDependencyData> dataNode) {
    return dataNode.getParent() == null || !ProjectKeys.LIBRARY_DEPENDENCY.equals(dataNode.getParent().getKey());
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:4,代码来源:GradleScanManager.java

示例10: getTargetDataKey

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
@NotNull
@Override
public Key<LibraryDependencyData> getTargetDataKey() {
    return ProjectKeys.LIBRARY_DEPENDENCY;
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:6,代码来源:XrayDependencyDataService.java

示例11: LibraryDependencyDataExternalSystemNode

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
public LibraryDependencyDataExternalSystemNode(ExternalProjectsView externalProjectsView, DataNode<LibraryDependencyData> dataNode) {
  super(externalProjectsView, null, dataNode);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:ExternalSystemViewDefaultContributor.java

示例12: getName

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
@Override
public String getName() {
  final LibraryDependencyData data = getData();
  return data != null ? data.getExternalName() : "";
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ExternalSystemViewDefaultContributor.java

示例13: resolve

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
@Override
public void resolve(
  @NotNull ProjectInfo projectInfo,
  @NotNull PantsCompileOptionsExecutor executor,
  @NotNull DataNode<ProjectData> projectDataNode,
  @NotNull Map<String, DataNode<ModuleData>> modules,
  @NotNull Optional<BuildGraph> buildGraph
) {
  for (Map.Entry<String, TargetInfo> entry : projectInfo.getSortedTargets()) {
    final TargetInfo targetInfo = entry.getValue();
    if (!targetInfo.isJarLibrary()) {
      continue;
    }

    final String jarTarget = entry.getKey();
    final LibraryData libraryData = new LibraryData(PantsConstants.SYSTEM_ID, jarTarget);

    for (String libraryId : targetInfo.getLibraries()) {
      final LibraryInfo libraryInfo = projectInfo.getLibraries(libraryId);
      if (libraryInfo == null) {
        LOG.debug("Couldn't find library " + libraryId);
        continue;
      }

      addPathLoLibrary(libraryData, executor, LibraryPathType.BINARY, libraryInfo.getDefault());
      addPathLoLibrary(libraryData, executor, LibraryPathType.SOURCE, libraryInfo.getSources());
      addPathLoLibrary(libraryData, executor, LibraryPathType.DOC, libraryInfo.getJavadoc());

      for (String otherLibraryInfo : libraryInfo.getJarsWithCustomClassifiers()) {
        addPathLoLibrary(libraryData, executor, LibraryPathType.BINARY, otherLibraryInfo);
      }
    }

    projectDataNode.createChild(ProjectKeys.LIBRARY, libraryData);
    final DataNode<ModuleData> moduleDataNode = modules.get(jarTarget);
    if (moduleDataNode == null) {
      continue;
    }

    final LibraryDependencyData library = new LibraryDependencyData(
      moduleDataNode.getData(),
      libraryData,
      LibraryLevel.PROJECT
    );
    library.setExported(true);
    moduleDataNode.createChild(ProjectKeys.LIBRARY_DEPENDENCY, library);
  }
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:49,代码来源:PantsLibrariesExtension.java

示例14: assertLibrary

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
public void assertLibrary(String moduleName, final String libraryId) {
  final DataNode<LibraryDependencyData> dependencyDataNode = findLibraryDependency(moduleName, libraryId);
  assertNotNull(String.format("%s doesn't have a dependency %s", moduleName, libraryId), dependencyDataNode);
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:5,代码来源:PantsResolverTestBase.java

示例15: refreshDependencies

import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
/**
 * Refresh project dependencies.
 */
protected abstract void refreshDependencies(ExternalProjectRefreshCallback cbk, @Nullable Collection<DataNode<LibraryDependencyData>> libraryDependencies);
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:5,代码来源:ScanManager.java


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