James Moger
2011-10-31 17820f3a1153250a325fed23dfc2da59ce6ba777
src/com/gitblit/client/NameRenderer.java
@@ -18,11 +18,8 @@
import java.awt.Color;
import java.awt.Component;
import javax.swing.ImageIcon;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import com.gitblit.models.RepositoryModel;
/**
 * Repository name cell renderer. This renderer shows the group name in a gray
@@ -35,26 +32,13 @@
   private static final long serialVersionUID = 1L;
   final String groupSpan;
   private final boolean displayIcon;
   private final ImageIcon blankIcon;
   private final ImageIcon subscribedIcon;
   private final String groupSpan;
   public NameRenderer() {
      this(false);
      this(Color.gray, new Color(0x00, 0x69, 0xD6));
   }
   public NameRenderer(boolean showIcon) {
      this(Color.gray, new Color(0x00, 0x69, 0xD6), showIcon);
   }
   private NameRenderer(Color group, Color repo, boolean showIcon) {
      blankIcon = new ImageIcon(getClass().getResource("/blank.png"));
      subscribedIcon = new ImageIcon(getClass().getResource("/bullet_feed.png"));
      displayIcon = showIcon;
   private NameRenderer(Color group, Color repo) {
      groupSpan = "<span style='color:" + getHexColor(group) + "'>";
      setForeground(repo);
   }
@@ -71,8 +55,6 @@
   public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
         boolean hasFocus, int row, int column) {
      super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
      if (value instanceof RepositoryModel) {
         RepositoryModel model = (RepositoryModel) value;
         String name = value.toString();
         int lastSlash = name.lastIndexOf('/');
         if (!isSelected && lastSlash > -1) {
@@ -81,16 +63,6 @@
            setText("<html><body>" + groupSpan + group + "</span>" + repo);
         } else {
            this.setText(name);
         }
         if (displayIcon) {
            if (model.subscribed) {
               setIcon(subscribedIcon);
            } else {
               setIcon(blankIcon);
            }
         }
      } else {
         this.setText(value.toString());
      }
      return this;
   }