本文整理汇总了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);
}
示例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);
}
}
示例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));
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例10: getTargetDataKey
import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
@NotNull
@Override
public Key<LibraryDependencyData> getTargetDataKey() {
return ProjectKeys.LIBRARY_DEPENDENCY;
}
示例11: LibraryDependencyDataExternalSystemNode
import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
public LibraryDependencyDataExternalSystemNode(ExternalProjectsView externalProjectsView, DataNode<LibraryDependencyData> dataNode) {
super(externalProjectsView, null, dataNode);
}
示例12: getName
import com.intellij.openapi.externalSystem.model.project.LibraryDependencyData; //导入依赖的package包/类
@Override
public String getName() {
final LibraryDependencyData data = getData();
return data != null ? data.getExternalName() : "";
}
示例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);
}
}
示例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);
}
示例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);