private static boolean containsUnresolvedConflicts(@NotNull CheckinProjectPanel panel) {
   for (Change change : panel.getSelectedChanges()) {
     FileStatus status = change.getFileStatus();
     if (status.equals(FileStatus.MERGE)
         || status.equals(FileStatus.MERGED_WITH_BOTH_CONFLICTS)
         || status.equals(FileStatus.MERGED_WITH_CONFLICTS)
         || status.equals(FileStatus.MERGED_WITH_PROPERTY_CONFLICTS)) {
       return true;
     }
   }
   return false;
 }
 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 void initFileStatusDescriptors(
      @NotNull List<EditorSchemeAttributeDescriptor> descriptions, MyColorScheme scheme) {

    FileStatus[] statuses = FileStatusFactory.getInstance().getAllFileStatuses();

    for (FileStatus fileStatus : statuses) {
      addEditorSettingDescription(
          descriptions,
          fileStatus.getText(),
          FILE_STATUS_GROUP,
          null,
          fileStatus.getColorKey(),
          scheme);
    }
  }
Example #4
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);
 }
    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;
    }
  @Override
  public boolean equals(final Object o) {
    if (this == o) return true;
    if (!(o instanceof ShelvedChange)) return false;

    final ShelvedChange that = (ShelvedChange) o;

    if (myAfterPath != null ? !myAfterPath.equals(that.myAfterPath) : that.myAfterPath != null)
      return false;
    if (myBeforePath != null ? !myBeforePath.equals(that.myBeforePath) : that.myBeforePath != null)
      return false;
    if (myFileStatus != null ? !myFileStatus.equals(that.myFileStatus) : that.myFileStatus != null)
      return false;
    if (myPatchPath != null ? !myPatchPath.equals(that.myPatchPath) : that.myPatchPath != null)
      return false;

    return true;
  }
 void dumpFileStatus(FileStatus fs) {
   if (LOG.isDebugEnabled()) {
     LOG.debug(
         "FileStatus:" + fs.getText() + " " + fs.getColor() + " " + " " + fs.getClass().getName());
   }
 }