Example #1
0
 @NotNull
 private TreeMessage getMessage(@NotNull FileStatus fileStatus) {
   if (!(MapSequence.fromMap(myTreeMessages).containsKey(fileStatus))) {
     MapSequence.fromMap(myTreeMessages)
         .put(fileStatus, new TreeMessage(fileStatus.getColor(), null, this));
   }
   return MapSequence.fromMap(myTreeMessages).get(fileStatus);
 }
 protected void customizeCellRenderer(
     JList list, Object value, int index, boolean selected, boolean hasFocus) {
   if (value instanceof VirtualFile) {
     VirtualFile virtualfile = (VirtualFile) value;
     String fileName = virtualfile.getName();
     setIcon(IconUtilEx.getIcon(virtualfile, 2, project));
     FileStatus filestatus = FileStatusManager.getInstance(project).getStatus(virtualfile);
     TextAttributes textattributes =
         new TextAttributes(filestatus.getColor(), null, null, EffectType.LINE_UNDERSCORE, 0);
     append(fileName, SimpleTextAttributes.fromTextAttributes(textattributes));
   }
 }
    private static SimpleTextAttributes getMainForegroundAttributes(InspectionTreeNode node) {
      SimpleTextAttributes foreground = SimpleTextAttributes.REGULAR_ATTRIBUTES;
      if (node instanceof RefElementNode) {
        RefEntity refElement = ((RefElementNode) node).getElement();

        if (refElement instanceof RefElement) {
          refElement = ((RefElement) refElement).getContainingEntry();
          if (((RefElement) refElement).isEntry() && ((RefElement) refElement).isPermanentEntry()) {
            foreground = new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, JBColor.blue);
          }
        }
      }
      final FileStatus nodeStatus = node.getNodeStatus();
      if (nodeStatus != FileStatus.NOT_CHANGED) {
        foreground =
            new SimpleTextAttributes(
                foreground.getBgColor(),
                nodeStatus.getColor(),
                foreground.getWaveColor(),
                foreground.getStyle());
      }
      return foreground;
    }
 void dumpFileStatus(FileStatus fs) {
   if (LOG.isDebugEnabled()) {
     LOG.debug(
         "FileStatus:" + fs.getText() + " " + fs.getColor() + " " + " " + fs.getClass().getName());
   }
 }