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


Java Trinity.getFirst方法代码示例

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


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

示例1: prepareRenaming

import com.intellij.openapi.util.Trinity; //导入方法依赖的package包/类
public void prepareRenaming(PsiElement element, String newName, Map<PsiElement, String> allRenames) {
  final AntDomElement antElement = convertToAntDomElement(element);
  String propName = null;
  if (antElement instanceof AntDomProperty) {
    propName = ((AntDomProperty)antElement).getName().getStringValue();
  }
  else if (antElement instanceof AntDomAntCallParam) {
    propName = ((AntDomAntCallParam)antElement).getName().getStringValue();
  }
  if (propName != null) {
    final AntDomProject contextProject = antElement.getContextAntProject();
    final List<PsiElement> additional = AntCallParamsFinder.resolve(contextProject, propName);
    for (PsiElement psiElement : additional) {
      allRenames.put(psiElement, newName);
    }
    if (antElement instanceof AntDomAntCallParam) {
      final Trinity<PsiElement, Collection<String>, PropertiesProvider> result = PropertyResolver.resolve(contextProject, propName, null);
      if (result.getFirst() != null) {
        allRenames.put(result.getFirst(), newName);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AntRenameProcessor.java

示例2: resolve

import com.intellij.openapi.util.Trinity; //导入方法依赖的package包/类
@NotNull
public ResolveResult[] resolve(@NotNull AntDomPropertyReference antDomPropertyReference, boolean incompleteCode) {
  final List<ResolveResult> result = new ArrayList<ResolveResult>();
  final AntDomProject project = antDomPropertyReference.myInvocationContextElement.getParentOfType(AntDomProject.class, true);
  if (project != null) {
    final AntDomProject contextAntProject = project.getContextAntProject();
    final String propertyName = antDomPropertyReference.getCanonicalText();
    final Trinity<PsiElement,Collection<String>,PropertiesProvider> resolved = 
      PropertyResolver.resolve(contextAntProject, propertyName, antDomPropertyReference.myInvocationContextElement);
    final PsiElement mainDeclaration = resolved.getFirst();

    if (mainDeclaration != null) {
      result.add(new MyResolveResult(mainDeclaration, resolved.getThird()));
    }

    final List<PsiElement> antCallParams = AntCallParamsFinder.resolve(project, propertyName);
    for (PsiElement param : antCallParams) {
      result.add(new MyResolveResult(param, null));
    }
  }
  return ContainerUtil.toArray(result, new ResolveResult[result.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AntDomPropertyReference.java

示例3: packageFile

import com.intellij.openapi.util.Trinity; //导入方法依赖的package包/类
public static void packageFile(@NotNull VirtualFile file, @NotNull Project project, final Artifact[] artifacts,
                               final boolean packIntoArchives) throws IOException {
  LOG.debug("Start packaging file: " + file.getPath());
  final Collection<Trinity<Artifact, PackagingElementPath, String>> items = ArtifactUtil.findContainingArtifactsWithOutputPaths(file, project, artifacts);
  File ioFile = VfsUtilCore.virtualToIoFile(file);
  for (Trinity<Artifact, PackagingElementPath, String> item : items) {
    final Artifact artifact = item.getFirst();
    final String outputPath = artifact.getOutputPath();
    if (!StringUtil.isEmpty(outputPath)) {
      PackageFileWorker worker = new PackageFileWorker(ioFile, item.getThird(), packIntoArchives);
      LOG.debug(" package to " + outputPath);
      worker.packageFile(outputPath, item.getSecond().getParents());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:PackageFileWorker.java


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