Ejemplo n.º 1
0
  @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));
      }
    }
  }
    private void renderFile(
        final VirtualFile file,
        final SimpleTextAttributes textAttributes,
        @Nullable final String toolTip) {
      final PresentationData presentation = getPresentation();
      presentation.setTooltip(toolTip);
      presentation.addText(myFilePointer.getFileName(), textAttributes);

      if (file != null) {
        presentation.setLocationString(file.getPath());
      }
    }
    FileSetNode(final OfbizFileSet fileSet) {
      mySet = fileSet;

      final PresentationData presentationData = getPresentation();
      final String name = mySet.getName();

      if (fileSet.getFiles().isEmpty()) {
        presentationData.addText(name, getErrorAttributes());
        presentationData.setTooltip("No files attached");
      } else {
        presentationData.addText(name, getPlainAttributes());
        presentationData.setLocationString("" + fileSet.getFiles().size());
      }
    }