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


Java PresentationData.setTooltip方法代码示例

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


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

示例1: update

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void update(PresentationData presentation) {
  final Collection<ArtifactProblemDescription> problems = ((ArtifactEditorImpl)myContext.getThisArtifactEditor()).getValidationManager().getProblems(this);
  if (problems == null || problems.isEmpty()) {
    super.update(presentation);
    return;
  }
  StringBuilder buffer = StringBuilderSpinAllocator.alloc();
  final String tooltip;
  boolean isError = false;
  try {
    for (ArtifactProblemDescription problem : problems) {
      isError |= problem.getSeverity() == ProjectStructureProblemType.Severity.ERROR;
      buffer.append(problem.getMessage(false)).append("<br>");
    }
    tooltip = XmlStringUtil.wrapInHtml(buffer);
  }
  finally {
    StringBuilderSpinAllocator.dispose(buffer);
  }

  getElementPresentation().render(presentation, addErrorHighlighting(isError, SimpleTextAttributes.REGULAR_ATTRIBUTES),
                                  addErrorHighlighting(isError, SimpleTextAttributes.GRAY_ATTRIBUTES));
  presentation.setTooltip(tooltip);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:PackagingElementNode.java

示例2: updateImpl

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void updateImpl(PresentationData data) {
  PsiFile value = getValue();
  data.setPresentableText(value.getName());
  data.setIcon(value.getIcon(Iconable.ICON_FLAG_READ_STATUS));

  VirtualFile file = getVirtualFile();
  if (file != null && file.is(VFileProperty.SYMLINK)) {
    String target = file.getCanonicalPath();
    if (target == null) {
      data.setAttributesKey(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES);
      data.setTooltip(CommonBundle.message("vfs.broken.link"));
    }
    else {
      data.setTooltip(FileUtil.toSystemDependentName(target));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:PsiFileNode.java

示例3: 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

示例4: update

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void update(PresentationData presentation) {
  RemoteServer<?> server = getServer();
  ServerConnection connection = getConnection();
  presentation.setPresentableText(server.getName());
  presentation.setIcon(getServerNodeIcon(server.getType().getIcon(), connection != null ? getStatusIcon(connection.getStatus()) : null));
  presentation.setTooltip(connection != null ? connection.getStatusText() : null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ServersTreeStructure.java

示例5: update

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void update(PresentationData presentation) {
  presentation.setIcon(myUsagePresentation.getIcon());
  presentation.setTooltip(myUsagePresentation.getTooltipText());
  final TextChunk[] text = myUsagePresentation.getText();
  updatePresentationWithTextChunks(presentation, text);
  presentation.setPresentableText(StringUtil.join(text, new Function<TextChunk, String>() {
    @Override
    public String fun(TextChunk chunk) {
      return chunk.getText();
    }
  }, ""));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:UsageProjectTreeNode.java

示例6: update

import com.intellij.ide.projectView.PresentationData; //导入方法依赖的package包/类
@Override
protected void update(PresentationData presentation) {
  myPresentation.render(presentation, SimpleTextAttributes.REGULAR_ATTRIBUTES, SimpleTextAttributes.GRAY_ATTRIBUTES);
  presentation.setTooltip(myPresentation.getTooltipText());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ArtifactsTreeNode.java

示例7: update

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


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