trim too long names in 'Author' field in 'Commit Changes' dialog
authornik <Nikolay.Chashnikov@jetbrains.com>
Thu, 3 Sep 2015 12:04:53 +0000 (15:04 +0300)
committernik <Nikolay.Chashnikov@jetbrains.com>
Thu, 3 Sep 2015 12:50:36 +0000 (15:50 +0300)
plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java

index f88df6797c1ecab8d3c3797d49390b7bfdf5c818..de469950760f016cd00a3688756c7113148200ad 100644 (file)
@@ -38,9 +38,7 @@ import com.intellij.openapi.vcs.checkin.CheckinChangeListSpecificComponent;
 import com.intellij.openapi.vcs.checkin.CheckinEnvironment;
 import com.intellij.openapi.vcs.ui.RefreshableOnComponent;
 import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.ui.EditorCustomization;
-import com.intellij.ui.GuiUtils;
-import com.intellij.ui.StringComboboxEditor;
+import com.intellij.ui.*;
 import com.intellij.util.*;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.UIUtil;
@@ -623,6 +621,14 @@ public class GitCheckinEnvironment implements CheckinEnvironment {
           }
         }
       };
+      myAuthorField.setRenderer(new ListCellRendererWrapper<String>() {
+        @Override
+        public void customize(JList list, String value, int index, boolean selected, boolean hasFocus) {
+          if (value != null) {
+            setText(StringUtil.trimLog(value, 100));
+          }
+        }
+      });
       myAuthorField.setMinimumAndPreferredWidth(100);
       myAuthorField.setEditable(true);
       authorLabel.setLabelFor(myAuthorField);