package zielu.gittoolbox.ui.config;

import com.intellij.ui.ColoredListCellRenderer;
import com.intellij.ui.SimpleTextAttributes;
import java.util.Date;
import javax.swing.JList;
import org.jetbrains.annotations.NotNull;
import zielu.gittoolbox.ResBundle;
import zielu.gittoolbox.config.AbsoluteDateTimeStyle;

public class AbsoluteDateTimeStyleRenderer extends ColoredListCellRenderer<AbsoluteDateTimeStyle> {
  private final Date now = new Date();

  @Override
  protected void customizeCellRenderer(@NotNull JList<? extends AbsoluteDateTimeStyle> list,
                                       AbsoluteDateTimeStyle value, int index, boolean selected, boolean hasFocus) {
    append(value.getLabel(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
    append("    " + ResBundle.example() + "  " + value.getFormat().format(now),
        SimpleTextAttributes.GRAY_ATTRIBUTES);
  }
}

@@ -218,43 +218,8 @@
 ll;%0A
-import zielu.gittoolbox.ResBundle;%0A
 impo
@@ -655,146 +655,112 @@
 .get
-Label(), SimpleTextAttributes.REGULAR_ATTRIBUTES);%0A    append(%22    %22 + ResBundle.example() + %22  %22 + value.getFormat().format(now),%0A       
+Format().format(now));%0A    if (value == AbsoluteDateTimeStyle.FROM_LOCALE) %7B%0A      append(%22    Default%22,
  Sim
@@ -782,16 +782,23 @@
 es.GRAY_
+ITALIC_
 ATTRIBUT
@@ -802,14 +802,20 @@
 BUTES);%0A
+    %7D%0A
   %7D%0A%7D%0A

Change absolute date-time presentation (#160)