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


Java PresentationData.setLocationString方法代码示例

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


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

示例1: update

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void update(PresentationData presentation) {
  if (getValue() != null) {
    final Object object = getValue().getObject();
    final String classString = object.getClass().toString();
    final String objectString = object.toString();

    presentation.setPresentableText(objectString);

    if (getValue().getOwnModification() < myTree.myModificationToFilter) {
      presentation.setForcedTextForeground(JBColor.GRAY);
    }

    if (objectString != null) {
      final int dogIndex = objectString.lastIndexOf("@");
      if (dogIndex >= 0) {
        final String fqNameObject = objectString.substring(0, dogIndex);
        final String fqNameClass = classString.substring("class ".length());
        if (fqNameObject.equals(fqNameClass)) return;
      }
    }

    presentation.setLocationString(classString);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DisposerDebugger.java

示例2: update

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
public void update(PresentationData presentation) {
  presentation.setPresentableText(getValue().getName());
  final OrderEntry orderEntry = getValue().getOrderEntry();
  Icon closedIcon = orderEntry instanceof JdkOrderEntry ? getJdkIcon((JdkOrderEntry)orderEntry) : AllIcons.Nodes.PpLibFolder;
  presentation.setIcon(closedIcon);
  if (orderEntry instanceof JdkOrderEntry) {
    final JdkOrderEntry jdkOrderEntry = (JdkOrderEntry)orderEntry;
    final Sdk projectJdk = jdkOrderEntry.getJdk();
    if (projectJdk != null) { //jdk not specified
      final String path = projectJdk.getHomePath();
      if (path != null) {
        presentation.setLocationString(FileUtil.toSystemDependentName(path));
      }
    }
    presentation.setTooltip(null);
  }
  else {
    presentation.setTooltip(StringUtil.capitalize(IdeBundle.message("node.projectview.library", ((LibraryOrderEntry)orderEntry).getLibraryLevel())));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:NamedLibraryElementNode.java

示例3: decorate

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
public void decorate(@SuppressWarnings("rawtypes") ProjectViewNode node, PresentationData data) {
  CoverageDataManager manager = getCoverageDataManager();
  CoverageSuitesBundle currentSuite = manager.getCurrentSuitesBundle();

  Project project = node.getProject();
  BlazeCoverageAnnotator annotator = getAnnotator(project, currentSuite);
  if (annotator == null) {
    return;
  }
  PsiFile file = getPsiFileForJavaClass(getPsiElement(node));
  if (file == null) {
    return;
  }
  String string = annotator.getFileCoverageInformationString(file, currentSuite, manager);
  if (string != null) {
    data.setLocationString(string);
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:20,代码来源:BlazeCoverageProjectViewClassDecorator.java

示例4: decorate

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
public void decorate(ProjectViewNode node, PresentationData data) {
  final CoverageDataManager coverageDataManager = getCoverageDataManager();
  final CoverageSuitesBundle currentSuite = coverageDataManager.getCurrentSuitesBundle();

  final Project project = node.getProject();
  final JavaCoverageAnnotator javaCovAnnotator = getCovAnnotator(currentSuite, project);
  // This decorator is applicable only to JavaCoverageAnnotator
  if (javaCovAnnotator == null) {
    return;
  }

  final Object value = node.getValue();
  PsiElement element = null;
  if (value instanceof PsiElement) {
    element = (PsiElement)value;
  }
  else if (value instanceof SmartPsiElementPointer) {
    element = ((SmartPsiElementPointer)value).getElement();
  }
  else if (value instanceof PackageElement) {
    PackageElement packageElement = (PackageElement)value;
    final String coverageString = javaCovAnnotator.getPackageCoverageInformationString(packageElement.getPackage(),
                                                                                       packageElement.getModule(),
                                                                                       coverageDataManager);
    data.setLocationString(coverageString);
  }

  if (element instanceof PsiClass) {
    final GlobalSearchScope searchScope = currentSuite.getSearchScope(project);
    final VirtualFile vFile = PsiUtilCore.getVirtualFile(element);
    if (vFile != null && searchScope.contains(vFile)) {
      final String qName = ((PsiClass)element).getQualifiedName();
      if (qName != null) {
        data.setLocationString(javaCovAnnotator.getClassCoverageInformationString(qName, coverageDataManager));
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:CoverageProjectViewClassNodeDecorator.java

示例5: decorate

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
public void decorate(ProjectViewNode node, PresentationData data) {
  final CoverageDataManager manager = getCoverageDataManager();
  final CoverageSuitesBundle currentSuite = manager.getCurrentSuitesBundle();
  final CoverageAnnotator coverageAnnotator = currentSuite != null ? currentSuite.getAnnotator(node.getProject())
                                                                   : null;
  if (coverageAnnotator == null) {
    // N/A
    return;
  }

  final Object value = node.getValue();
  PsiElement element = null;
  if (value instanceof PsiElement) {
    element = (PsiElement)value;
  }
  else if (value instanceof SmartPsiElementPointer) {
    element = ((SmartPsiElementPointer)value).getElement();
  }

  String informationString = null;
  if (element instanceof PsiDirectory) {
    informationString = coverageAnnotator.getDirCoverageInformationString((PsiDirectory)element, currentSuite, manager);
  } else if (element instanceof PsiFile) {
    informationString = coverageAnnotator.getFileCoverageInformationString((PsiFile)element, currentSuite, manager);
  }

  if (informationString != null) {
    data.setLocationString(informationString);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:CoverageProjectViewDirectoryNodeDecorator.java

示例6: update

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void update(PresentationData presentation) {
  presentation.setIcon(AllIcons.Toolwindows.ToolWindowFavorites);
  presentation.setPresentableText(myName);
  presentation.setLocationString(myDescription);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:FavoritesListNode.java


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