Java Code Examples for com.intellij.ide.projectView.PresentationData#setAttributesKey()

The following examples show how to use com.intellij.ide.projectView.PresentationData#setAttributesKey() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PsiFileNode.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
protected void updateImpl(PresentationData data) {
  PsiFile value = getValue();
  data.setPresentableText(value.getName());
  data.setIcon(IconDescriptorUpdaters.getIcon(value, 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));
    }
  }
}
 
Example 2
Source File: AbstractTreeNode.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected void postprocess(@Nonnull PresentationData presentation) {
  if (hasProblemFileBeneath()) {
    presentation.setAttributesKey(FILESTATUS_ERRORS);
  }

  setForcedForeground(presentation);
}