Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/resources/text_en.properties
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/resources/text_en.properties	(revision 42096)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/resources/text_en.properties	(revision 42097)
@@ -59,6 +59,8 @@
 Information=Information
 known_values=Contents
 ladoVentana=Window side
+largeIcon= Large icons
+list=List
 msg_cancel_incrementable=Cancel the computation?
 no=No
 No=No
@@ -100,6 +102,7 @@
 si=yes
 sideLong=Window side
 siguiente=Next
+smallIcon=Small icons
 subir=Up
 teclas=Keys
 text_preview_text=Preview
@@ -113,6 +116,7 @@
 validate_filter_expression_explanation=Choose whether to validate filter expression
 Valores=Values
 verdetalles=Show details
+view=View
 Warning=Warning
 write_here_a_filter_expression=Enter an SQL WHERE style expression manually or use the buttons to compose one.
 yellow=Yellow
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/resources/text.properties
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/resources/text.properties	(revision 42096)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/resources/text.properties	(revision 42097)
@@ -140,6 +140,7 @@
 known_values=Valores conocidos
 ladoVentana=Lado ventana
 languageRulesConfigurationLabel=Reglas de idioma
+largeIcon= Iconos grandes
 layer_abstract=Resumen de la capa
 layer_name=Nombre de la capa
 layer_title=T\u00edtulo de la capa
@@ -149,6 +150,7 @@
 like_JTextField=Como JTextField
 limpiar=Limpiar
 line=L\u00ednea
+list=Lista
 log=Log
 maintain_position=Mantener posici\u00f3n
 max_features=M\u00e1x. features
@@ -195,7 +197,7 @@
 options=Opciones
 origen=Origen
 outputType=Tipo de dato
-panel_adding_exception=Error agregando capa\: 
+panel_adding_exception=Error agregando capa\:
 panel_base_exception=Error cargando %(PANEL_LABEL)%(CAUSE_MESSAGE).
 panel_loading_exception=Error cargando capa\:
 panel_without_preferred_size_defined_exception=Panel de etiqueta %(PANEL_LABEL) sin tama\u00f1o inicial definido.
@@ -248,11 +250,12 @@
 si=s\u00ed
 sideLong=Lado ventana
 siguiente=Siguiente
+smallIcon=Iconos peque\u00f1os
 srs=Srs
 subir=Subir
 teclas=Teclas
 test=Test
-test_TableFilterQueryJPanel_title=Test TableFilterQueryJPanel 
+test_TableFilterQueryJPanel_title=Test TableFilterQueryJPanel
 testJComboBoxConfigurableLookUpErrorMessage=Error de ejecuci\u00f3n en el componente JComboBoxConfigurableLookUp
 text_preview_text=Vista previa
 the_panel=el panel
@@ -269,6 +272,7 @@
 validate_expression=Validar expresi\u00f3n
 validate_filter_expression_explanation=Validar o no la expresi\u00f3n de filtro.
 verdetalles=Ver detalles
+view=Vista
 vista=Vista
 warning=Aviso
 Warning=Aviso
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/painters/SmallIcon.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/painters/SmallIcon.java	(revision 42096)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/painters/SmallIcon.java	(revision 42097)
@@ -23,15 +23,13 @@
  */
 package org.gvsig.gui.beans.listview.painters;
 
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.Shape;
+import java.awt.*;
 import java.util.ArrayList;
 
 import org.gvsig.gui.beans.listview.IListViewPainter;
 import org.gvsig.gui.beans.listview.ListViewItem;
+import org.gvsig.i18n.Messages;
+
 /**
  * Iconos de 82x28
  *
@@ -39,87 +37,100 @@
  * @author BorSanZa - Borja Sánchez Zamorano (borja.sanchez@iver.es)
  */
 public class SmallIcon implements IListViewPainter {
-	ArrayList items = null;
-	int iconsWidth = 40;
-	int minIconsWidth = 40;
-	int iconsHeight = 28;
-	Dimension lastDimension = new Dimension(0, 0);
-	int cols = 0;
 
-	public SmallIcon(ArrayList items) {
-		this.items = items;
-	}
+  ArrayList items = null;
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#getName()
-	 */
-	public String getName() {
-		return "SmallIcon";
-	}
+  int iconsWidth = 40;
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#getPreferredSize()
-	 */
-	public Dimension getPreferredSize() {
-		return lastDimension;
-	}
+  int minIconsWidth = 40;
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#paint(java.awt.Graphics2D, int, int)
-	 */
-	public void paint(Graphics2D g, Rectangle visibleRect) {
-		int aux = (int) Math.floor(visibleRect.getWidth() / (minIconsWidth + 2));
-		if (aux > items.size())
-			aux = items.size();
-		iconsWidth = (int) (Math.floor(visibleRect.getWidth() / aux) - 2);
+  int iconsHeight = 28;
 
-		int height2 = 0;
+  Dimension lastDimension = new Dimension(0, 0);
 
-		int posX = 0;
-		int posY = 0;
-		cols = 0;
-		for (int i = 0; i < items.size(); i++) {
-			// Evito que se pueda editar el nombre
-			((ListViewItem) items.get(i)).setNameRectangle(null);
+  int cols = 0;
 
-			((ListViewItem) items.get(i)).setShowTooltip(true);
-			if (posX != 0) {
-				if (((posX + 1) * (iconsWidth + 2)) > visibleRect.getWidth()) {
-					posX = 0;
-					posY++;
-				}
-			}
+  public SmallIcon(ArrayList items) {
+    this.items = items;
+  }
 
-			((ListViewItem) items.get(i)).getItemRectangle().setBounds(posX * (iconsWidth + 2), (posY * (iconsHeight + 2)), iconsWidth + 2, iconsHeight + 2);
-			if (((ListViewItem) items.get(i)).getItemRectangle().intersects(visibleRect)) {
-				if (((ListViewItem) items.get(i)).isSelected()) {
-					g.setColor(new Color(49, 106, 197));
-					g.fillRect(posX * (iconsWidth + 2), posY * (iconsHeight + 2), iconsWidth + 2, iconsHeight + 2);
-				}
+  /*
+   * (non-Javadoc)
+   * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#getName()
+   */
+  public String getName() {
+    return Messages.getText("smallIcon");
+  }
 
-				Shape clip = g.getClip();
-				g.translate(posX * (iconsWidth + 2) + 1, (posY * (iconsHeight + 2)) + 1);
-				g.setClip(0, 0, iconsWidth, iconsHeight);
+  /*
+   * (non-Javadoc)
+   * @see
+   * org.gvsig.gui.beans.graphic.listview.IListViewPainter#getPreferredSize()
+   */
+  public Dimension getPreferredSize() {
+    return lastDimension;
+  }
 
-				if (((ListViewItem) items.get(i)).getIcon() != null)
-					((ListViewItem) items.get(i)).getIcon().paint(g, ((ListViewItem) items.get(i)).isSelected());
+  /*
+   * (non-Javadoc)
+   * @see
+   * org.gvsig.gui.beans.graphic.listview.IListViewPainter#paint(java.awt.Graphics2D
+   * , int, int)
+   */
+  public void paint(Graphics2D g, Rectangle visibleRect) {
+    int aux = (int) Math.floor(visibleRect.getWidth() / (minIconsWidth + 2));
+    if (aux > items.size()) aux = items.size();
+    iconsWidth = (int) (Math.floor(visibleRect.getWidth() / aux) - 2);
 
-				g.setClip(clip);
-				g.translate(- (posX * (iconsWidth + 2) + 1), - ((posY * (iconsHeight + 2)) + 1));
-			}
+    int height2 = 0;
 
-			if (height2 < ((posY + 1) * (iconsHeight + 2)))
-				height2 = (posY + 1) * (iconsHeight + 2);
+    int posX = 0;
+    int posY = 0;
+    cols = 0;
+    for (int i = 0; i < items.size(); i++) {
+      // Evito que se pueda editar el nombre
+      ((ListViewItem) items.get(i)).setNameRectangle(null);
 
-			if (cols < posX)
-				cols = posX;
+      ((ListViewItem) items.get(i)).setShowTooltip(true);
+      if (posX != 0) {
+        if (((posX + 1) * (iconsWidth + 2)) > visibleRect.getWidth()) {
+          posX = 0;
+          posY++;
+        }
+      }
 
-			posX++;
-		}
+      ((ListViewItem) items.get(i)).getItemRectangle().setBounds(
+          posX * (iconsWidth + 2), (posY * (iconsHeight + 2)), iconsWidth + 2,
+          iconsHeight + 2);
+      if (((ListViewItem) items.get(i)).getItemRectangle().intersects(
+          visibleRect)) {
+        if (((ListViewItem) items.get(i)).isSelected()) {
+          g.setColor(new Color(49, 106, 197));
+          g.fillRect(posX * (iconsWidth + 2), posY * (iconsHeight + 2),
+              iconsWidth + 2, iconsHeight + 2);
+        }
 
-		lastDimension = new Dimension(minIconsWidth + 2, height2);
-	}
+        Shape clip = g.getClip();
+        g.translate(posX * (iconsWidth + 2) + 1, (posY * (iconsHeight + 2)) + 1);
+        g.setClip(0, 0, iconsWidth, iconsHeight);
+
+        if (((ListViewItem) items.get(i)).getIcon() != null)
+          ((ListViewItem) items.get(i)).getIcon().paint(g,
+              ((ListViewItem) items.get(i)).isSelected());
+
+        g.setClip(clip);
+        g.translate(-(posX * (iconsWidth + 2) + 1),
+            -((posY * (iconsHeight + 2)) + 1));
+      }
+
+      if (height2 < ((posY + 1) * (iconsHeight + 2)))
+        height2 = (posY + 1) * (iconsHeight + 2);
+
+      if (cols < posX) cols = posX;
+
+      posX++;
+    }
+
+    lastDimension = new Dimension(minIconsWidth + 2, height2);
+  }
 }
\ No newline at end of file
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/painters/LargeIcon.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/painters/LargeIcon.java	(revision 42096)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/painters/LargeIcon.java	(revision 42097)
@@ -23,15 +23,13 @@
  */
 package org.gvsig.gui.beans.listview.painters;
 
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.Shape;
+import java.awt.*;
 import java.util.ArrayList;
 
 import org.gvsig.gui.beans.listview.IListViewPainter;
 import org.gvsig.gui.beans.listview.ListViewItem;
+import org.gvsig.i18n.Messages;
+
 /**
  * Iconos de 82x28
  *
@@ -39,87 +37,100 @@
  * @author BorSanZa - Borja Sánchez Zamorano (borja.sanchez@iver.es)
  */
 public class LargeIcon implements IListViewPainter {
-	ArrayList items = null;
-	int iconsWidth = 82;
-	int minIconsWidth = 82;
-	int iconsHeight = 28;
-	Dimension lastDimension = new Dimension(0, 0);
-	int cols = 0;
 
-	public LargeIcon(ArrayList items) {
-		this.items = items;
-	}
+  ArrayList items = null;
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#getName()
-	 */
-	public String getName() {
-		return "LargeIcon";
-	}
+  int iconsWidth = 82;
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#getPreferredSize()
-	 */
-	public Dimension getPreferredSize() {
-		return lastDimension;
-	}
+  int minIconsWidth = 82;
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#paint(java.awt.Graphics2D, int, int)
-	 */
-	public void paint(Graphics2D g, Rectangle visibleRect) {
-		int aux = (int) Math.floor(visibleRect.getWidth() / (minIconsWidth + 2));
-		if (aux > items.size())
-			aux = items.size();
-		iconsWidth = (int) (Math.floor(visibleRect.getWidth() / aux) - 2);
+  int iconsHeight = 28;
 
-		int height2 = 0;
+  Dimension lastDimension = new Dimension(0, 0);
 
-		int posX = 0;
-		int posY = 0;
-		cols = 0;
-		for (int i = 0; i < items.size(); i++) {
-			// Evito que se pueda editar el nombre
-			((ListViewItem) items.get(i)).setNameRectangle(null);
+  int cols = 0;
 
-			((ListViewItem) items.get(i)).setShowTooltip(true);
-			if (posX != 0) {
-				if (((posX + 1) * (iconsWidth + 2)) > visibleRect.getWidth()) {
-					posX = 0;
-					posY++;
-				}
-			}
+  public LargeIcon(ArrayList items) {
+    this.items = items;
+  }
 
-			((ListViewItem) items.get(i)).getItemRectangle().setBounds(posX * (iconsWidth + 2), (posY * (iconsHeight + 2)), iconsWidth + 2, iconsHeight + 2);
-			if (((ListViewItem) items.get(i)).getItemRectangle().intersects(visibleRect)) {
-				if (((ListViewItem) items.get(i)).isSelected()) {
-					g.setColor(new Color(49, 106, 197));
-					g.fillRect(posX * (iconsWidth + 2), posY * (iconsHeight + 2), iconsWidth + 2, iconsHeight + 2);
-				}
+  /*
+   * (non-Javadoc)
+   * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#getName()
+   */
+  public String getName() {
+    return Messages.getText("largeIcon");
+  }
 
-				Shape clip = g.getClip();
-				g.translate(posX * (iconsWidth + 2) + 1, (posY * (iconsHeight + 2)) + 1);
-				g.setClip(0, 0, iconsWidth, iconsHeight);
+  /*
+   * (non-Javadoc)
+   * @see
+   * org.gvsig.gui.beans.graphic.listview.IListViewPainter#getPreferredSize()
+   */
+  public Dimension getPreferredSize() {
+    return lastDimension;
+  }
 
-				if (((ListViewItem) items.get(i)).getIcon() != null)
-					((ListViewItem) items.get(i)).getIcon().paint(g, ((ListViewItem) items.get(i)).isSelected());
+  /*
+   * (non-Javadoc)
+   * @see
+   * org.gvsig.gui.beans.graphic.listview.IListViewPainter#paint(java.awt.Graphics2D
+   * , int, int)
+   */
+  public void paint(Graphics2D g, Rectangle visibleRect) {
+    int aux = (int) Math.floor(visibleRect.getWidth() / (minIconsWidth + 2));
+    if (aux > items.size()) aux = items.size();
+    iconsWidth = (int) (Math.floor(visibleRect.getWidth() / aux) - 2);
 
-				g.setClip(clip);
-				g.translate(-(posX * (iconsWidth + 2) + 1), -((posY * (iconsHeight + 2)) + 1));
-			}
+    int height2 = 0;
 
-			if (height2 < ((posY + 1) * (iconsHeight + 2)))
-				height2 = (posY + 1) * (iconsHeight + 2);
+    int posX = 0;
+    int posY = 0;
+    cols = 0;
+    for (int i = 0; i < items.size(); i++) {
+      // Evito que se pueda editar el nombre
+      ((ListViewItem) items.get(i)).setNameRectangle(null);
 
-			if (cols < posX)
-				cols = posX;
+      ((ListViewItem) items.get(i)).setShowTooltip(true);
+      if (posX != 0) {
+        if (((posX + 1) * (iconsWidth + 2)) > visibleRect.getWidth()) {
+          posX = 0;
+          posY++;
+        }
+      }
 
-			posX++;
-		}
+      ((ListViewItem) items.get(i)).getItemRectangle().setBounds(
+          posX * (iconsWidth + 2), (posY * (iconsHeight + 2)), iconsWidth + 2,
+          iconsHeight + 2);
+      if (((ListViewItem) items.get(i)).getItemRectangle().intersects(
+          visibleRect)) {
+        if (((ListViewItem) items.get(i)).isSelected()) {
+          g.setColor(new Color(49, 106, 197));
+          g.fillRect(posX * (iconsWidth + 2), posY * (iconsHeight + 2),
+              iconsWidth + 2, iconsHeight + 2);
+        }
 
-		lastDimension = new Dimension(minIconsWidth + 2, height2);
-	}
+        Shape clip = g.getClip();
+        g.translate(posX * (iconsWidth + 2) + 1, (posY * (iconsHeight + 2)) + 1);
+        g.setClip(0, 0, iconsWidth, iconsHeight);
+
+        if (((ListViewItem) items.get(i)).getIcon() != null)
+          ((ListViewItem) items.get(i)).getIcon().paint(g,
+              ((ListViewItem) items.get(i)).isSelected());
+
+        g.setClip(clip);
+        g.translate(-(posX * (iconsWidth + 2) + 1),
+            -((posY * (iconsHeight + 2)) + 1));
+      }
+
+      if (height2 < ((posY + 1) * (iconsHeight + 2)))
+        height2 = (posY + 1) * (iconsHeight + 2);
+
+      if (cols < posX) cols = posX;
+
+      posX++;
+    }
+
+    lastDimension = new Dimension(minIconsWidth + 2, height2);
+  }
 }
\ No newline at end of file
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/painters/PaintList.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/painters/PaintList.java	(revision 42096)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/painters/PaintList.java	(revision 42097)
@@ -23,114 +23,126 @@
  */
 package org.gvsig.gui.beans.listview.painters;
 
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.FontMetrics;
-import java.awt.GradientPaint;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.Shape;
+import java.awt.*;
 import java.util.ArrayList;
 
 import org.gvsig.gui.beans.listview.IListViewPainter;
 import org.gvsig.gui.beans.listview.ListViewItem;
+import org.gvsig.i18n.Messages;
+
 /**
  * @version 28/06/2007
  * @author BorSanZa - Borja Sánchez Zamorano (borja.sanchez@iver.es)
  */
 public class PaintList implements IListViewPainter {
-	ArrayList items = null;
-	int iconsWidth = 35;
-	int minIconsWidth = 35;
-	Dimension lastDimension = new Dimension(0, 0);
 
-	public PaintList(ArrayList items) {
-		this.items = items;
-	}
+  ArrayList items = null;
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#getName()
-	 */
-	public String getName() {
-		return "List";
-	}
+  int iconsWidth = 35;
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#getPreferredSize()
-	 */
-	public Dimension getPreferredSize() {
-		return lastDimension;
-	}
+  int minIconsWidth = 35;
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#paint(java.awt.Graphics2D, int, int)
-	 */
-	public void paint(Graphics2D g, Rectangle visibleRect) {
-		FontMetrics fm = g.getFontMetrics();
+  Dimension lastDimension = new Dimension(0, 0);
 
-		int minAux = 0;
-		for (int i = 0; i < items.size(); i++) {
-			int auxWidth = g.getFontMetrics().stringWidth(((ListViewItem) items.get(i)).getName()) + 8;
-			if (minAux < auxWidth)
-				minAux = auxWidth;
-		}
-		minAux = visibleRect.width - minAux;
-		if (minAux < minIconsWidth)
-			minAux = minIconsWidth;
-		iconsWidth = minAux;
+  public PaintList(ArrayList items) {
+    this.items = items;
+  }
 
-		int height2 = 0;
-		int width2 = 0;
-		for (int i = 0; i < items.size(); i++) {
-			((ListViewItem) items.get(i)).setNameRectangle(null);
+  /*
+   * (non-Javadoc)
+   * @see org.gvsig.gui.beans.graphic.listview.IListViewPainter#getName()
+   */
+  public String getName() {
+    return Messages.getText("list");
+  }
 
-			int auxWidth = g.getFontMetrics().stringWidth(((ListViewItem) items.get(i)).getName());
-			if ((minIconsWidth + 3 + auxWidth - visibleRect.x) > visibleRect.width) {
-				((ListViewItem) items.get(i)).setShowTooltip(true);
-			} else {
-				((ListViewItem) items.get(i)).setShowTooltip(false);
-			}
-			if (width2 < auxWidth)
-				width2 = auxWidth;
+  /*
+   * (non-Javadoc)
+   * @see
+   * org.gvsig.gui.beans.graphic.listview.IListViewPainter#getPreferredSize()
+   */
+  public Dimension getPreferredSize() {
+    return lastDimension;
+  }
 
-			((ListViewItem) items.get(i)).getItemRectangle().setBounds(visibleRect.x, i * 17, visibleRect.width, 17);
+  /*
+   * (non-Javadoc)
+   * @see
+   * org.gvsig.gui.beans.graphic.listview.IListViewPainter#paint(java.awt.Graphics2D
+   * , int, int)
+   */
+  public void paint(Graphics2D g, Rectangle visibleRect) {
+    FontMetrics fm = g.getFontMetrics();
 
-			if (!((ListViewItem) items.get(i)).getItemRectangle().intersects(visibleRect))
-				continue;
+    int minAux = 0;
+    for (int i = 0; i < items.size(); i++) {
+      int auxWidth = g.getFontMetrics().stringWidth(
+          ((ListViewItem) items.get(i)).getName()) + 8;
+      if (minAux < auxWidth) minAux = auxWidth;
+    }
+    minAux = visibleRect.width - minAux;
+    if (minAux < minIconsWidth) minAux = minIconsWidth;
+    iconsWidth = minAux;
 
-			int upper = fm.getLeading() + fm.getAscent() + ((17 - fm.getHeight()) / 2);
+    int height2 = 0;
+    int width2 = 0;
+    for (int i = 0; i < items.size(); i++) {
+      ((ListViewItem) items.get(i)).setNameRectangle(null);
 
-			if (((ListViewItem) items.get(i)).isSelected()) {
-				Color color1 = new Color(89, 153, 229);
-				Color color2 = new Color(31, 92, 207);
-				g.setPaint(new GradientPaint(0, i * 17 + 1, color1, 0, i * 17 + 16, color2, false));
-				g.fillRect(visibleRect.x, i * 17 + 1, visibleRect.width, 16);
-				g.setColor(new Color(61, 123, 218));
-				g.drawLine(visibleRect.x, i * 17, visibleRect.x + visibleRect.width, i * 17);
-				g.setColor(Color.white);
-			} else {
-				g.setColor(Color.black);
-			}
-			g.drawString(((ListViewItem) items.get(i)).getName(), iconsWidth + 3, (i * 17) + upper);
-			// Guardar el estado de donde se visualiza el nombre y cuanto ocupa
-			((ListViewItem) items.get(i)).setNameRectangle(new Rectangle(iconsWidth + 2, i * 17 - 1, visibleRect.width - (iconsWidth + 2), 20));
+      int auxWidth = g.getFontMetrics().stringWidth(
+          ((ListViewItem) items.get(i)).getName());
+      if ((minIconsWidth + 3 + auxWidth - visibleRect.x) > visibleRect.width) {
+        ((ListViewItem) items.get(i)).setShowTooltip(true);
+      }
+      else {
+        ((ListViewItem) items.get(i)).setShowTooltip(false);
+      }
+      if (width2 < auxWidth) width2 = auxWidth;
 
-			Shape clip = g.getClip();
-			g.translate(1, i * 17 + 1);
-			g.setClip(0, 0, iconsWidth, 15);
+      ((ListViewItem) items.get(i)).getItemRectangle().setBounds(visibleRect.x,
+          i * 17, visibleRect.width, 17);
 
-			if (((ListViewItem) items.get(i)).getIcon() != null)
-				((ListViewItem) items.get(i)).getIcon().paint(g, ((ListViewItem) items.get(i)).isSelected());
+      if (!((ListViewItem) items.get(i)).getItemRectangle().intersects(
+          visibleRect)) continue;
 
-			g.setClip(clip);
-			g.translate(-1, -(i * 17 + 1));
-		}
-		height2 = items.size() * 17;
+      int upper = fm.getLeading() + fm.getAscent()
+          + ((17 - fm.getHeight()) / 2);
 
-		lastDimension = new Dimension(minIconsWidth + 3 + width2, height2);
-	//lastDimension = new Dimension(0, height2);
-	}
+      if (((ListViewItem) items.get(i)).isSelected()) {
+        Color color1 = new Color(89, 153, 229);
+        Color color2 = new Color(31, 92, 207);
+        g.setPaint(new GradientPaint(0, i * 17 + 1, color1, 0, i * 17 + 16,
+            color2, false));
+        g.fillRect(visibleRect.x, i * 17 + 1, visibleRect.width, 16);
+        g.setColor(new Color(61, 123, 218));
+        g.drawLine(visibleRect.x, i * 17, visibleRect.x + visibleRect.width,
+            i * 17);
+        g.setColor(Color.white);
+      }
+      else {
+        g.setColor(Color.black);
+      }
+      g.drawString(((ListViewItem) items.get(i)).getName(), iconsWidth + 3,
+          (i * 17) + upper);
+      // Guardar el estado de donde se visualiza el nombre y cuanto ocupa
+      ((ListViewItem) items.get(i))
+          .setNameRectangle(new Rectangle(iconsWidth + 2, i * 17 - 1,
+              visibleRect.width - (iconsWidth + 2), 20));
+
+      Shape clip = g.getClip();
+      g.translate(1, i * 17 + 1);
+      g.setClip(0, 0, iconsWidth, 15);
+
+      if (((ListViewItem) items.get(i)).getIcon() != null)
+        ((ListViewItem) items.get(i)).getIcon().paint(g,
+            ((ListViewItem) items.get(i)).isSelected());
+
+      g.setClip(clip);
+      g.translate(-1, -(i * 17 + 1));
+    }
+    height2 = items.size() * 17;
+
+    lastDimension = new Dimension(minIconsWidth + 3 + width2, height2);
+    // lastDimension = new Dimension(0, height2);
+  }
 }
\ No newline at end of file
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/ListViewComponent.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/ListViewComponent.java	(revision 42096)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.ui/src/main/java/org/gvsig/gui/beans/listview/ListViewComponent.java	(revision 42097)
@@ -23,976 +23,984 @@
  */
 package org.gvsig.gui.beans.listview;
 
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.Image;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.RenderingHints;
+import java.awt.*;
 import java.awt.color.ColorSpace;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
+import java.awt.event.*;
 import java.awt.image.BufferedImage;
 import java.awt.image.ColorConvertOp;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.EventObject;
-import java.util.Iterator;
+import java.util.*;
 
-import javax.swing.ButtonGroup;
-import javax.swing.JComponent;
-import javax.swing.JMenu;
-import javax.swing.JPopupMenu;
-import javax.swing.JRadioButtonMenuItem;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JViewport;
+import javax.swing.*;
 import javax.swing.event.AncestorEvent;
 import javax.swing.event.AncestorListener;
 
-import org.gvsig.gui.beans.listview.painters.LargeIcon;
-import org.gvsig.gui.beans.listview.painters.PaintList;
-import org.gvsig.gui.beans.listview.painters.SmallIcon;
+import org.gvsig.gui.beans.listview.painters.*;
+import org.gvsig.i18n.Messages;
+
 /**
  * Componente grafico para representar una lista de valores
  *
  * @version 28/06/2007
  * @author BorSanZa - Borja Sánchez Zamorano (borja.sanchez@iver.es)
  */
-public class ListViewComponent extends JComponent implements MouseListener, MouseMotionListener, ActionListener, KeyListener, FocusListener, AncestorListener {
-	private static final long serialVersionUID = 6177600314634665863L;
+public class ListViewComponent extends JComponent implements MouseListener,
+    MouseMotionListener, ActionListener, KeyListener, FocusListener,
+    AncestorListener {
 
-	/**
-	 * Lista de los tipos de vista existentes
-	 */
-	private ArrayList<IListViewPainter> painters = new ArrayList<IListViewPainter>();
-	private ArrayList<JRadioButtonMenuItem> paintersMenu = new ArrayList<JRadioButtonMenuItem>();
+  private static final long serialVersionUID = 6177600314634665863L;
 
-	/**
-	 * Lista de items
-	 */
-	private ArrayList<ListViewItem> items = new ArrayList<ListViewItem>();
+  /**
+   * Lista de los tipos de vista existentes
+   */
+  private ArrayList<IListViewPainter> painters = new ArrayList<IListViewPainter>();
 
-	/**
-	 * Selecciona el tipo de vista
-	 */
-	private int         view           = 0;
+  private ArrayList<JRadioButtonMenuItem> paintersMenu = new ArrayList<JRadioButtonMenuItem>();
 
-	/**
-	 * Booleano para saber si se permite la multiselección
-	 */
-	private boolean     multiSelect    = false;
+  /**
+   * Lista de items
+   */
+  private ArrayList<ListViewItem> items = new ArrayList<ListViewItem>();
 
-	private Image       image          = null;
-	private int         width          = 0;
-	private int         height         = 0;
-	private Graphics2D  widgetGraphics = null;
-	private JMenu       jMenu          = null;
-	private ButtonGroup buttonGroup    = null;
-	private JPopupMenu  jPopupMenu     = null;
+  /**
+   * Selecciona el tipo de vista
+   */
+  private int view = 0;
 
-	private JTextField  jRenameEdit    = null;
+  /**
+   * Booleano para saber si se permite la multiselección
+   */
+  private boolean multiSelect = false;
 
+  private Image image = null;
 
-	private int         itemEdited     = -1;
-	private int         lastSelected   = -1;
-	private int         cursorPos      = -1;
+  private int width = 0;
 
+  private int height = 0;
 
-	private boolean     editable       = false;
+  private Graphics2D widgetGraphics = null;
 
-	private ArrayList<ListViewListener> actionCommandListeners = new ArrayList<ListViewListener>();
+  private JMenu jMenu = null;
 
-	private ListViewItem  lastSelectedItem = null;
+  private ButtonGroup buttonGroup = null;
 
-	/**
-	 * Construye un <code>ListViewComponent</code>
-	 *
-	 */
-	public ListViewComponent() {
-		setFocusable(true);
+  private JPopupMenu jPopupMenu = null;
 
-		initialize();
-	}
+  private JTextField jRenameEdit = null;
 
-	/**
-	 * Inicializa el <code>ListViewComponent</code>
-	 */
-	private void initialize() {
-		addListViewPainter(new PaintList(items));
-		addListViewPainter(new SmallIcon(items));
-		addListViewPainter(new LargeIcon(items));
+  private int itemEdited = -1;
 
-		addAncestorListener(this);
+  private int lastSelected = -1;
 
-		addKeyListener(this);
-		addMouseListener(this);
-		addMouseMotionListener(this);
-	}
+  private int cursorPos = -1;
 
-	/**
-	 * Obtiene que vista se esta usando en el componente
-	 * @return
-	 */
-	public int getView() {
-		return view;
-	}
+  private boolean editable = false;
 
-	/**
-	 * Define que vista es la que se va a usar
-	 * @param view
-	 */
-	public void setView(int view) {
-		this.view = view;
-	}
+  private ArrayList<ListViewListener> actionCommandListeners = new ArrayList<ListViewListener>();
 
-	/**
-	 * Agrega una vista al componente
-	 * @param item
-	 */
-	public void addListViewPainter(IListViewPainter item) {
-		painters.add(item);
+  private ListViewItem lastSelectedItem = null;
 
-		JRadioButtonMenuItem jRadioButtonMenuItem = new JRadioButtonMenuItem();
-		getButtonGroup().add(jRadioButtonMenuItem);
+  /**
+   * Construye un <code>ListViewComponent</code>
+   */
+  public ListViewComponent() {
+    setFocusable(true);
 
-		jRadioButtonMenuItem.setText(item.getName());
-		if (paintersMenu.size() == 0)
-			jRadioButtonMenuItem.setSelected(true);
-		getJMenu().add(jRadioButtonMenuItem);
+    initialize();
+  }
 
-		jRadioButtonMenuItem.addActionListener(this);
+  /**
+   * Inicializa el <code>ListViewComponent</code>
+   */
+  private void initialize() {
+    addListViewPainter(new PaintList(items));
+    addListViewPainter(new SmallIcon(items));
+    addListViewPainter(new LargeIcon(items));
 
-		paintersMenu.add(jRadioButtonMenuItem);
-	}
-	
-	/**
-	 * Sorts the specified array of objects into ascending order
-	 */
-	public void sort() {
-		Object[] list = items.toArray();
-		Arrays.sort(list);
-		items.clear();
-		for (int i = 0; i < list.length; i++) 
-			items.add((ListViewItem)list[i]);
-	}
+    addAncestorListener(this);
 
-	/**
-	 * Agrega un item al componente
-	 * @param item
-	 */
-	public void addItem(ListViewItem item) {
-		addItem(item, false);
-	}
+    addKeyListener(this);
+    addMouseListener(this);
+    addMouseMotionListener(this);
+  }
 
-	/**
-	 * Agrega un item al componente, si acceptRepeatNames es false no se aceptaran
-	 * nombres repetidos
-	 * @param item
-	 * @param acceptRepeatNames
-	 */
-	public void addItem(ListViewItem item, boolean acceptRepeatNames) {
-		items.add(item);
-		if (!acceptRepeatNames)
-			changeName(item.getName(), items.size() - 1);
+  /**
+   * Obtiene que vista se esta usando en el componente
+   *
+   * @return
+   */
+  public int getView() {
+    return view;
+  }
 
-		viewItem(items.size() - 1);
-	}
+  /**
+   * Define que vista es la que se va a usar
+   *
+   * @param view
+   */
+  public void setView(int view) {
+    this.view = view;
+  }
 
-	/**
-	 * Agrega el item en la posicion especificada de la lista.
-	 * @param pos
-	 * @param item
-	 */
-	public void addItem(int pos, ListViewItem item) {
-		items.add(pos, item);
-		changeName(item.getName(), pos);
+  /**
+   * Agrega una vista al componente
+   *
+   * @param item
+   */
+  public void addListViewPainter(IListViewPainter item) {
+    painters.add(item);
 
-		viewItem(pos);
-	}
+    JRadioButtonMenuItem jRadioButtonMenuItem = new JRadioButtonMenuItem();
+    getButtonGroup().add(jRadioButtonMenuItem);
 
-	/**
-	 * Agrega un item al componente
-	 * @param item
-	 */
-	public void removeItem(int index) {
-		items.remove(index);
-		repaint();
-	}
+    jRadioButtonMenuItem.setText(item.getName());
+    if (paintersMenu.size() == 0) jRadioButtonMenuItem.setSelected(true);
+    getJMenu().add(jRadioButtonMenuItem);
 
-	/**
-	 * Borra todos los items seleccionados
-	 */
-	public void removeSelecteds() {
-		for (int i = (items.size()-1); i>=0; i--)
-			if (((ListViewItem) items.get(i)).isSelected())
-				items.remove(i);
+    jRadioButtonMenuItem.addActionListener(this);
 
-		repaint();
-	}
+    paintersMenu.add(jRadioButtonMenuItem);
+  }
 
-	/**
-	 * Devuelve un ArrayList con todos los items
-	 * @return
-	 */
-	@SuppressWarnings("unchecked")
-	public ArrayList getItems() {
-		return items;
-	}
+  /**
+   * Sorts the specified array of objects into ascending order
+   */
+  public void sort() {
+    Object[] list = items.toArray();
+    Arrays.sort(list);
+    items.clear();
+    for (int i = 0; i < list.length; i++)
+      items.add((ListViewItem) list[i]);
+  }
 
-	private Graphics2D getWidgetGraphics() {
-		getWidgetImage();
-		return widgetGraphics;
-	}
+  /**
+   * Agrega un item al componente
+   *
+   * @param item
+   */
+  public void addItem(ListViewItem item) {
+    addItem(item, false);
+  }
 
-	private Image getWidgetImage() {
-		int width2 = getVisibleRect().width;
-		int height2 = getVisibleRect().height;
-		if (width2 <= 0)
-			width2 = 1;
-		if (height2 <= 0)
-			height2=1;
+  /**
+   * Agrega un item al componente, si acceptRepeatNames es false no se aceptaran
+   * nombres repetidos
+   *
+   * @param item
+   * @param acceptRepeatNames
+   */
+  public void addItem(ListViewItem item, boolean acceptRepeatNames) {
+    items.add(item);
+    if (!acceptRepeatNames) changeName(item.getName(), items.size() - 1);
 
-		if ((width != width2) || (height != height2)) {
-			image = createImage(width2, height2);
-			if (image == null)
-				return null;
-			widgetGraphics = (Graphics2D) image.getGraphics();
-		}
+    viewItem(items.size() - 1);
+  }
 
-		width = width2;
-		height = height2;
-		return image;
-	}
+  /**
+   * Agrega el item en la posicion especificada de la lista.
+   *
+   * @param pos
+   * @param item
+   */
+  public void addItem(int pos, ListViewItem item) {
+    items.add(pos, item);
+    changeName(item.getName(), pos);
 
-	/**
-	 * Redibujar el componente en el graphics temporal
-	 */
-	private void redrawBuffer() {
-		if (getWidgetGraphics() == null)
-			return;
+    viewItem(pos);
+  }
 
-		/** desactivación del anti-aliasing */
-		getWidgetGraphics().setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
-		getWidgetGraphics().setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
+  /**
+   * Agrega un item al componente
+   *
+   * @param item
+   */
+  public void removeItem(int index) {
+    items.remove(index);
+    repaint();
+  }
 
-		/** demanda de rendimiento rápido */
-		getWidgetGraphics().setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED);
-		getWidgetGraphics().setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_SPEED);
-		getWidgetGraphics().setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
-		getWidgetGraphics().setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE);
+  /**
+   * Borra todos los items seleccionados
+   */
+  public void removeSelecteds() {
+    for (int i = (items.size() - 1); i >= 0; i--)
+      if (((ListViewItem) items.get(i)).isSelected()) items.remove(i);
 
-		getWidgetGraphics().translate(-getVisibleRect().x, -getVisibleRect().y);
-		getWidgetGraphics().setColor(Color.white);
-		getWidgetGraphics().fillRect(getVisibleRect().x, getVisibleRect().y, getVisibleRect().width, getVisibleRect().height);
+    repaint();
+  }
 
-		((IListViewPainter) painters.get(view)).paint((Graphics2D) getWidgetGraphics(), getVisibleRect());
-		getWidgetGraphics().translate(getVisibleRect().x, getVisibleRect().y);
-	}
+  /**
+   * Devuelve un ArrayList con todos los items
+   *
+   * @return
+   */
+  @SuppressWarnings("unchecked")
+  public ArrayList getItems() {
+    return items;
+  }
 
-	public void paint(Graphics g) {
-		redrawBuffer();
+  private Graphics2D getWidgetGraphics() {
+    getWidgetImage();
+    return widgetGraphics;
+  }
 
-		if (image != null) {
-			if (isEnabled()) {
-				g.drawImage(image, getVisibleRect().x, getVisibleRect().y, this);
-			} else {
-				// Dibujar en escala de grises y aclarado para cuando esta inactivo
-				BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+  private Image getWidgetImage() {
+    int width2 = getVisibleRect().width;
+    int height2 = getVisibleRect().height;
+    if (width2 <= 0) width2 = 1;
+    if (height2 <= 0) height2 = 1;
 
-				Graphics big = bi.createGraphics();
-				big.drawImage(image, 0, 0, this);
+    if ((width != width2) || (height != height2)) {
+      image = createImage(width2, height2);
+      if (image == null) return null;
+      widgetGraphics = (Graphics2D) image.getGraphics();
+    }
 
-				ColorConvertOp colorConvert = new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY), null);
-				colorConvert.filter(bi, bi);
+    width = width2;
+    height = height2;
+    return image;
+  }
 
-				big.setColor(new Color(255, 255, 255, 164));
-				big.fillRect(0, 0, width, height);
+  /**
+   * Redibujar el componente en el graphics temporal
+   */
+  private void redrawBuffer() {
+    if (getWidgetGraphics() == null) return;
 
-				g.drawImage(bi, getVisibleRect().x, getVisibleRect().y, this);
-			}
-		}
+    /** desactivación del anti-aliasing */
+    getWidgetGraphics().setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+        RenderingHints.VALUE_ANTIALIAS_OFF);
+    getWidgetGraphics().setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+        RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
 
+    /** demanda de rendimiento rápido */
+    getWidgetGraphics().setRenderingHint(RenderingHints.KEY_RENDERING,
+        RenderingHints.VALUE_RENDER_SPEED);
+    getWidgetGraphics().setRenderingHint(RenderingHints.KEY_COLOR_RENDERING,
+        RenderingHints.VALUE_COLOR_RENDER_SPEED);
+    getWidgetGraphics().setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
+        RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
+    getWidgetGraphics().setRenderingHint(RenderingHints.KEY_DITHERING,
+        RenderingHints.VALUE_DITHER_DISABLE);
 
-		Dimension size = getPreferredSize();
-		Dimension aux = ((IListViewPainter) painters.get(view)).getPreferredSize();
-		if (!size.equals(aux)) {
-			setPreferredSize(aux);
-			setSize(aux);
-		}
+    getWidgetGraphics().translate(-getVisibleRect().x, -getVisibleRect().y);
+    getWidgetGraphics().setColor(Color.white);
+    getWidgetGraphics().fillRect(getVisibleRect().x, getVisibleRect().y,
+        getVisibleRect().width, getVisibleRect().height);
 
-		if (getParent() instanceof JViewport) {
-			JViewport jViewport = (JViewport) getParent();
-			if (jViewport.getParent() instanceof JScrollPane) {
-				if (items.size() > 0)
-					((JScrollPane) jViewport.getParent()).getVerticalScrollBar().setUnitIncrement(((ListViewItem) items.get(0)).getItemRectangle().height);
-			}
-		}
-	}
+    ((IListViewPainter) painters.get(view)).paint(
+        (Graphics2D) getWidgetGraphics(), getVisibleRect());
+    getWidgetGraphics().translate(getVisibleRect().x, getVisibleRect().y);
+  }
 
-	public boolean isMultiSelect() {
-		return multiSelect;
-	}
+  public void paint(Graphics g) {
+    redrawBuffer();
 
-	public void setMultiSelect(boolean multiSelect) {
-		if (multiSelect == false) {
-			for (int i = 0; i<items.size(); i++)
-				((ListViewItem) items.get(i)).setSelected(false);
-			if ((lastSelected != -1) && (lastSelected < items.size()))
-				((ListViewItem) items.get(lastSelected)).setSelected(true);
-		}
+    if (image != null) {
+      if (isEnabled()) {
+        g.drawImage(image, getVisibleRect().x, getVisibleRect().y, this);
+      }
+      else {
+        // Dibujar en escala de grises y aclarado para cuando esta inactivo
+        BufferedImage bi = new BufferedImage(width, height,
+            BufferedImage.TYPE_INT_RGB);
 
-		this.multiSelect = multiSelect;
-		repaint();
-	}
+        Graphics big = bi.createGraphics();
+        big.drawImage(image, 0, 0, this);
 
-	private int getItem(int x, int y) {
-		Point point = new Point(x, y);
-		Rectangle rectangle = null;
-		for (int i = 0; i < items.size(); i++) {
-			rectangle = ((ListViewItem) items.get(i)).getItemRectangle();
-			if ((rectangle != null) && (rectangle.getBounds().contains(point)))
-				return i;
-		}
+        ColorConvertOp colorConvert = new ColorConvertOp(
+            ColorSpace.getInstance(ColorSpace.CS_GRAY), null);
+        colorConvert.filter(bi, bi);
 
-		return -1;
-	}
+        big.setColor(new Color(255, 255, 255, 164));
+        big.fillRect(0, 0, width, height);
 
-	/*
-	 * (non-Javadoc)
-	 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
-	 */
-	public void mousePressed(MouseEvent e) {
-		if (!isEnabled())
-			return;
-		requestFocus();
+        g.drawImage(bi, getVisibleRect().x, getVisibleRect().y, this);
+      }
+    }
 
-		try {
-			if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != InputEvent.BUTTON1_MASK)
-				return;
+    Dimension size = getPreferredSize();
+    Dimension aux = ((IListViewPainter) painters.get(view)).getPreferredSize();
+    if (!size.equals(aux)) {
+      setPreferredSize(aux);
+      setSize(aux);
+    }
 
-			cursorPos = getItem(e.getX(), e.getY());
-			viewItem(cursorPos);
-			if (cursorPos == -1)
-				return;
+    if (getParent() instanceof JViewport) {
+      JViewport jViewport = (JViewport) getParent();
+      if (jViewport.getParent() instanceof JScrollPane) {
+        if (items.size() > 0)
+          ((JScrollPane) jViewport.getParent()).getVerticalScrollBar()
+              .setUnitIncrement(
+                  ((ListViewItem) items.get(0)).getItemRectangle().height);
+      }
+    }
+  }
 
-			if (isMultiSelect()) {
-				if ((e.getModifiers() & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK) {
-					int pos1 = cursorPos;
-					int pos2 = lastSelected;
-					if (pos2 < pos1) {
-						pos1 = lastSelected;
-						pos2 = cursorPos;
-					}
+  public boolean isMultiSelect() {
+    return multiSelect;
+  }
 
-					if ((e.getModifiers() & InputEvent.CTRL_MASK) != InputEvent.CTRL_MASK)
-						for (int i = 0; i < items.size(); i++)
-							((ListViewItem) items.get(i)).setSelected(false);
+  public void setMultiSelect(boolean multiSelect) {
+    if (multiSelect == false) {
+      for (int i = 0; i < items.size(); i++)
+        ((ListViewItem) items.get(i)).setSelected(false);
+      if ((lastSelected != -1) && (lastSelected < items.size()))
+        ((ListViewItem) items.get(lastSelected)).setSelected(true);
+    }
 
-					for (int i = pos1; i <= pos2; i++)
-						((ListViewItem) items.get(i)).setSelected(true);
-					return;
-				}
+    this.multiSelect = multiSelect;
+    repaint();
+  }
 
-				lastSelected = cursorPos;
+  private int getItem(int x, int y) {
+    Point point = new Point(x, y);
+    Rectangle rectangle = null;
+    for (int i = 0; i < items.size(); i++) {
+      rectangle = ((ListViewItem) items.get(i)).getItemRectangle();
+      if ((rectangle != null) && (rectangle.getBounds().contains(point)))
+        return i;
+    }
 
-				if ((e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK) {
-					((ListViewItem) items.get(cursorPos)).setSelected(!((ListViewItem) items.get(cursorPos)).isSelected());
-					return;
-				}
+    return -1;
+  }
 
-				for (int i = 0; i < items.size(); i++)
-					((ListViewItem) items.get(i)).setSelected(false);
+  /*
+   * (non-Javadoc)
+   * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
+   */
+  public void mousePressed(MouseEvent e) {
+    if (!isEnabled()) return;
+    requestFocus();
 
-				((ListViewItem) items.get(cursorPos)).setSelected(true);
-			} else {
-				boolean selected = true;
+    try {
+      if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != InputEvent.BUTTON1_MASK)
+        return;
 
-				lastSelected = cursorPos;
+      cursorPos = getItem(e.getX(), e.getY());
+      viewItem(cursorPos);
+      if (cursorPos == -1) return;
 
-				if ((e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK)
-					selected = !((ListViewItem) items.get(cursorPos)).isSelected();
+      if (isMultiSelect()) {
+        if ((e.getModifiers() & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK) {
+          int pos1 = cursorPos;
+          int pos2 = lastSelected;
+          if (pos2 < pos1) {
+            pos1 = lastSelected;
+            pos2 = cursorPos;
+          }
 
-				for (int i = 0; i < items.size(); i++)
-					((ListViewItem) items.get(i)).setSelected(false);
+          if ((e.getModifiers() & InputEvent.CTRL_MASK) != InputEvent.CTRL_MASK)
+            for (int i = 0; i < items.size(); i++)
+              ((ListViewItem) items.get(i)).setSelected(false);
 
-				((ListViewItem) items.get(cursorPos)).setSelected(selected);
-			}
-		} finally {
-			repaint();
-		}
-	}
+          for (int i = pos1; i <= pos2; i++)
+            ((ListViewItem) items.get(i)).setSelected(true);
+          return;
+        }
 
-	/**
-	 * Establece que un item debe estar visible en la vista
-	 * @param pos
-	 */
-	private void viewItem(int pos) {
-		if ((pos == -1) || (items.size()==0))
-			return;
-		redrawBuffer();
-		Dimension aux = ((IListViewPainter) painters.get(view)).getPreferredSize();
-		setPreferredSize(aux);
-		setSize(aux);
+        lastSelected = cursorPos;
 
-		if (pos < 0)
-			pos = 0;
+        if ((e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK) {
+          ((ListViewItem) items.get(cursorPos))
+              .setSelected(!((ListViewItem) items.get(cursorPos)).isSelected());
+          return;
+        }
 
-		if (pos >= items.size())
-			pos = items.size() - 1;
+        for (int i = 0; i < items.size(); i++)
+          ((ListViewItem) items.get(i)).setSelected(false);
 
-		if (getParent() instanceof JViewport) {
-			JViewport jViewport = (JViewport) getParent();
+        ((ListViewItem) items.get(cursorPos)).setSelected(true);
+      }
+      else {
+        boolean selected = true;
 
-			if (jViewport.getParent() instanceof JScrollPane) {
-				ListViewItem lvi = ((ListViewItem) items.get(pos));
-				Rectangle rectangle = (Rectangle) lvi.getItemRectangle().clone();
-				if (rectangle == null)
-					return;
-				rectangle.setLocation((int) rectangle.getX() - getVisibleRect().x, (int) rectangle.getY() - getVisibleRect().y);
-				jViewport.scrollRectToVisible(rectangle);
-				((JScrollPane)jViewport.getParent()).getVerticalScrollBar().paintImmediately(((JScrollPane)jViewport.getParent()).getVerticalScrollBar().getVisibleRect());
-			}
-		}
-	}
+        lastSelected = cursorPos;
 
-	public void mouseDragged(MouseEvent e) {
-		if (!isEnabled())
-			return;
-		if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != InputEvent.BUTTON1_MASK)
-			return;
+        if ((e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK)
+          selected = !((ListViewItem) items.get(cursorPos)).isSelected();
 
-		if (isMultiSelect()) {
-			if ((e.getModifiers() & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK)
-				return;
-			if ((e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK)
-				return;
-		}
+        for (int i = 0; i < items.size(); i++)
+          ((ListViewItem) items.get(i)).setSelected(false);
 
-		int itemSelected = getItem(e.getX(), e.getY());
+        ((ListViewItem) items.get(cursorPos)).setSelected(selected);
+      }
+    }
+    finally {
+      repaint();
+    }
+  }
 
-		if (itemSelected == -1)
-			return;
+  /**
+   * Establece que un item debe estar visible en la vista
+   *
+   * @param pos
+   */
+  private void viewItem(int pos) {
+    if ((pos == -1) || (items.size() == 0)) return;
+    redrawBuffer();
+    Dimension aux = ((IListViewPainter) painters.get(view)).getPreferredSize();
+    setPreferredSize(aux);
+    setSize(aux);
 
-		lastSelected = itemSelected;
-		cursorPos = itemSelected;
+    if (pos < 0) pos = 0;
 
-		for (int i = 0; i<items.size(); i++)
-			((ListViewItem) items.get(i)).setSelected(false);
+    if (pos >= items.size()) pos = items.size() - 1;
 
-		((ListViewItem) items.get(itemSelected)).setSelected(true);
+    if (getParent() instanceof JViewport) {
+      JViewport jViewport = (JViewport) getParent();
 
-		repaint();
+      if (jViewport.getParent() instanceof JScrollPane) {
+        ListViewItem lvi = ((ListViewItem) items.get(pos));
+        Rectangle rectangle = (Rectangle) lvi.getItemRectangle().clone();
+        if (rectangle == null) return;
+        rectangle.setLocation((int) rectangle.getX() - getVisibleRect().x,
+            (int) rectangle.getY() - getVisibleRect().y);
+        jViewport.scrollRectToVisible(rectangle);
+        ((JScrollPane) jViewport.getParent()).getVerticalScrollBar()
+            .paintImmediately(
+                ((JScrollPane) jViewport.getParent()).getVerticalScrollBar()
+                    .getVisibleRect());
+      }
+    }
+  }
 
-		viewItem(itemSelected);
-	}
+  public void mouseDragged(MouseEvent e) {
+    if (!isEnabled()) return;
+    if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != InputEvent.BUTTON1_MASK)
+      return;
 
-	private JPopupMenu getPopupMenu() {
-		if (jPopupMenu == null) {
-			jPopupMenu = new JPopupMenu();
-			getJMenu().setText("View");
+    if (isMultiSelect()) {
+      if ((e.getModifiers() & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK)
+        return;
+      if ((e.getModifiers() & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK)
+        return;
+    }
 
-			jPopupMenu.add(getJMenu());
-		}
-		return jPopupMenu;
-	}
+    int itemSelected = getItem(e.getX(), e.getY());
 
-	public void mouseReleased(MouseEvent e) {
-		if (!isEnabled())
-			return;
-		if ((e.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
-			getPopupMenu().show(this, e.getX (), e.getY () );
+    if (itemSelected == -1) return;
 
-		if ((e.getModifiers() & InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK) {
-			fireSelectionValueChanged();
-		}
-	}
+    lastSelected = itemSelected;
+    cursorPos = itemSelected;
 
-	public void mouseMoved(MouseEvent e) {
-		if (!isEnabled())
-			return;
-		int itemSelected = getItem(e.getX(), e.getY());
+    for (int i = 0; i < items.size(); i++)
+      ((ListViewItem) items.get(i)).setSelected(false);
 
-		if (itemSelected == -1) {
-			setToolTipText(null);
-			return;
-		}
-		if (((ListViewItem) items.get(itemSelected)).isShowTooltip())
-			setToolTipText(((ListViewItem) items.get(itemSelected)).getName());
-		else
-			setToolTipText(null);
-	}
+    ((ListViewItem) items.get(itemSelected)).setSelected(true);
 
-	private ButtonGroup getButtonGroup() {
-		if (buttonGroup == null)
-			buttonGroup = new ButtonGroup();
-		return buttonGroup;
-	}
+    repaint();
 
-	private JMenu getJMenu() {
-		if (jMenu == null)
-			jMenu = new JMenu();
-		return jMenu;
-	}
+    viewItem(itemSelected);
+  }
 
-	/*
-	 * (non-Javadoc)
-	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
-	 */
-	public void actionPerformed(ActionEvent e) {
-		int pos = paintersMenu.indexOf(e.getSource());
-		view = pos;
-		viewItem(cursorPos);
-	}
+  private JPopupMenu getPopupMenu() {
+    if (jPopupMenu == null) {
+      jPopupMenu = new JPopupMenu();
+      getJMenu().setText(Messages.getText("view"));
 
-	/**
-	 * Returns an array of the values for the selected cells. The returned values
-	 * are sorted in increasing index order.
-	 *
-	 * @return the selected values or an empty list if nothing is selected
-	 */
-	public ListViewItem[] getSelectedValues() {
-		int cont = 0;
-		for (int i = 0; i < items.size(); i++) {
-			if (((ListViewItem) items.get(i)).isSelected())
-				cont++;
-		}
-		ListViewItem[] values = new ListViewItem[cont];
-		cont = 0;
-		for (int i = 0; i < items.size(); i++) {
-			if (((ListViewItem) items.get(i)).isSelected()) {
-				values[cont] = (ListViewItem) items.get(i);
-				cont++;
-			}
-		}
+      jPopupMenu.add(getJMenu());
+    }
+    return jPopupMenu;
+  }
 
-		return values;
-	}
+  public void mouseReleased(MouseEvent e) {
+    if (!isEnabled()) return;
+    if ((e.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
+      getPopupMenu().show(this, e.getX(), e.getY());
 
-	/**
-	 * Returns the first selected index; returns -1 if there is no selected item.
-	 *
-	 * @return the value of <code>getMinSelectionIndex</code>
-	 */
-	public int getSelectedIndex() {
-		for (int i = 0; i < items.size(); i++) {
-			if (((ListViewItem) items.get(i)).isSelected())
-				return i;
-		}
-		return -1;
-	}
+    if ((e.getModifiers() & InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK) {
+      fireSelectionValueChanged();
+    }
+  }
 
+  public void mouseMoved(MouseEvent e) {
+    if (!isEnabled()) return;
+    int itemSelected = getItem(e.getX(), e.getY());
 
-	/**
-	 * Select the index value
-	 *
-	 * @return the value of <code>getMinSelectionIndex</code>
-	 */
-	public void setSelectedIndex(int value) {
-		if (value < 0)
-			value = 0;
-		if (value >= items.size())
-			value = items.size() - 1;
-		for (int i = 0; i < items.size(); i++) {
-			((ListViewItem) items.get(i)).setSelected(i == value);
-		}
-		lastSelectedItem = getSelectedValue();
-		viewItem(value);
-		update(getGraphics());
-	}
+    if (itemSelected == -1) {
+      setToolTipText(null);
+      return;
+    }
+    if (((ListViewItem) items.get(itemSelected)).isShowTooltip())
+      setToolTipText(((ListViewItem) items.get(itemSelected)).getName());
+    else
+      setToolTipText(null);
+  }
 
-	/**
-	 * Returns the first selected value, or <code>null</code> if the selection
-	 * is empty.
-	 *
-	 * @return the first selected value
-	 */
-	public ListViewItem getSelectedValue() {
-		for (int i = 0; i < items.size(); i++) {
-			if (((ListViewItem) items.get(i)).isSelected())
-				return (ListViewItem) items.get(i);
-		}
-		return null;
-	}
+  private ButtonGroup getButtonGroup() {
+    if (buttonGroup == null) buttonGroup = new ButtonGroup();
+    return buttonGroup;
+  }
 
-	/**
-	 * Returns an array of all of the selected indices in increasing order.
-	 *
-	 * @return all of the selected indices, in increasing order
-	 */
-	public int[] getSelectedIndices() {
-		int cont = 0;
-		for (int i = 0; i < items.size(); i++) {
-			if (((ListViewItem) items.get(i)).isSelected())
-				cont++;
-		}
-		int[] values = new int[cont];
-		cont = 0;
-		for (int i = 0; i < items.size(); i++) {
-			if (((ListViewItem) items.get(i)).isSelected()) {
-				values[cont] = i;
-				cont++;
-			}
-		}
+  private JMenu getJMenu() {
+    if (jMenu == null) jMenu = new JMenu();
+    return jMenu;
+  }
 
-		return values;
-	}
+  /*
+   * (non-Javadoc)
+   * @see
+   * java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+   */
+  public void actionPerformed(ActionEvent e) {
+    int pos = paintersMenu.indexOf(e.getSource());
+    view = pos;
+    viewItem(cursorPos);
+  }
 
-	/**
-	 * Añadir un listener a la lista de eventos
-	 * @param listener
-	 */
-	public void addListSelectionListener(ListViewListener listener) {
-		if (!actionCommandListeners.contains(listener))
-			actionCommandListeners.add(listener);
-	}
+  /**
+   * Returns an array of the values for the selected cells. The returned values
+   * are sorted in increasing index order.
+   *
+   * @return the selected values or an empty list if nothing is selected
+   */
+  public ListViewItem[] getSelectedValues() {
+    int cont = 0;
+    for (int i = 0; i < items.size(); i++) {
+      if (((ListViewItem) items.get(i)).isSelected()) cont++;
+    }
+    ListViewItem[] values = new ListViewItem[cont];
+    cont = 0;
+    for (int i = 0; i < items.size(); i++) {
+      if (((ListViewItem) items.get(i)).isSelected()) {
+        values[cont] = (ListViewItem) items.get(i);
+        cont++;
+      }
+    }
 
-	/**
-	 * Borrar un listener de la lista de eventos
-	 * @param listener
-	 */
-	public void removeListSelectionListener(ListViewListener listener) {
-		actionCommandListeners.remove(listener);
-	}
+    return values;
+  }
 
-	/**
-	 * Invocar a los eventos asociados al componente
-	 */
-	private void fireSelectionValueChanged() {
-		lastSelectedItem = getSelectedValue();
-		Iterator<ListViewListener> acIterator = actionCommandListeners.iterator();
-		EventObject e = null;
-		while (acIterator.hasNext()) {
-			ListViewListener listener = acIterator.next();
-			if (e == null)
-				e = new EventObject(this);
-			listener.actionValueChanged(e);
-		}
-	}
+  /**
+   * Returns the first selected index; returns -1 if there is no selected item.
+   *
+   * @return the value of <code>getMinSelectionIndex</code>
+   */
+  public int getSelectedIndex() {
+    for (int i = 0; i < items.size(); i++) {
+      if (((ListViewItem) items.get(i)).isSelected()) return i;
+    }
+    return -1;
+  }
 
-	/**
-	 * Invocar a los eventos asociados al componente
-	 */
-	private void fireItemNameChanged(String oldName, ListViewItem item) {
-		Iterator<ListViewListener> acIterator = actionCommandListeners.iterator();
-		EventObject e = null;
-		while (acIterator.hasNext()) {
-			ListViewListener listener = acIterator.next();
-			if (e == null)
-				e = new EventObject(this);
-			listener.actionItemNameChanged(e, oldName, item);
-		}
-	}
-	public void renameItem(int item) {
-		if (!isEditable())
-			return;
+  /**
+   * Select the index value
+   *
+   * @return the value of <code>getMinSelectionIndex</code>
+   */
+  public void setSelectedIndex(int value) {
+    if (value < 0) value = 0;
+    if (value >= items.size()) value = items.size() - 1;
+    for (int i = 0; i < items.size(); i++) {
+      ((ListViewItem) items.get(i)).setSelected(i == value);
+    }
+    lastSelectedItem = getSelectedValue();
+    viewItem(value);
+    update(getGraphics());
+  }
 
-		if ((item >= 0) && (item < items.size())) {
-			if (((ListViewItem) items.get(item)).isSelected()) {
-				Rectangle rectangle = ((ListViewItem) items.get(item)).getNameRectangle();
+  /**
+   * Returns the first selected value, or <code>null</code> if the selection is
+   * empty.
+   *
+   * @return the first selected value
+   */
+  public ListViewItem getSelectedValue() {
+    for (int i = 0; i < items.size(); i++) {
+      if (((ListViewItem) items.get(i)).isSelected())
+        return (ListViewItem) items.get(i);
+    }
+    return null;
+  }
 
-				if (rectangle != null) {
-					itemEdited = item;
-					((ListViewItem) items.get(itemEdited)).setSelected(false);
-					repaint();
-					this.setLayout(null);
-					getJRenameEdit().setText(((ListViewItem) items.get(item)).getName());
-					this.add(getJRenameEdit());
-					getJRenameEdit().setBounds(rectangle);
-					getJRenameEdit().addFocusListener(this);
-					getJRenameEdit().addKeyListener(this);
-					getJRenameEdit().requestFocus();
-					getJRenameEdit().setSelectionStart(0);
-					getJRenameEdit().setSelectionEnd(getJRenameEdit().getText().length());
-				}
-			}
-		}
-	}
+  /**
+   * Returns an array of all of the selected indices in increasing order.
+   *
+   * @return all of the selected indices, in increasing order
+   */
+  public int[] getSelectedIndices() {
+    int cont = 0;
+    for (int i = 0; i < items.size(); i++) {
+      if (((ListViewItem) items.get(i)).isSelected()) cont++;
+    }
+    int[] values = new int[cont];
+    cont = 0;
+    for (int i = 0; i < items.size(); i++) {
+      if (((ListViewItem) items.get(i)).isSelected()) {
+        values[cont] = i;
+        cont++;
+      }
+    }
 
-	public JTextField getJRenameEdit() {
-		if (jRenameEdit == null) {
-			jRenameEdit = new JTextField();
-		}
-		return jRenameEdit;
- 	}
+    return values;
+  }
 
-	public void changeName(String newName, int pos) {
-		newName = newName.trim();
-		if (newName.length() == 0)
-			return;
-		String newNameAux = newName;
-		boolean isItem;
-		int newNumber = 0;
-		do {
-			isItem = false;
-			for (int i = 0; i < items.size(); i++) {
-				if ((i != pos) && (((ListViewItem) items.get(i)).getName().equals(newNameAux))) {
-					isItem = true;
-					newNumber++;
-					newNameAux = newName + "_" + newNumber;
-					break;
-				}
-			}
-		} while (isItem);
-		((ListViewItem) items.get(pos)).setName(newNameAux);
-	}
+  /**
+   * Añadir un listener a la lista de eventos
+   *
+   * @param listener
+   */
+  public void addListSelectionListener(ListViewListener listener) {
+    if (!actionCommandListeners.contains(listener))
+      actionCommandListeners.add(listener);
+  }
 
-	public void closeRenameEdit() {
-		if (jRenameEdit == null)
-			return;
+  /**
+   * Borrar un listener de la lista de eventos
+   *
+   * @param listener
+   */
+  public void removeListSelectionListener(ListViewListener listener) {
+    actionCommandListeners.remove(listener);
+  }
 
-		if (itemEdited != -1) {
-			String oldName = ((ListViewItem) items.get(itemEdited)).getName();
+  /**
+   * Invocar a los eventos asociados al componente
+   */
+  private void fireSelectionValueChanged() {
+    lastSelectedItem = getSelectedValue();
+    Iterator<ListViewListener> acIterator = actionCommandListeners.iterator();
+    EventObject e = null;
+    while (acIterator.hasNext()) {
+      ListViewListener listener = acIterator.next();
+      if (e == null) e = new EventObject(this);
+      listener.actionValueChanged(e);
+    }
+  }
 
-			changeName(getJRenameEdit().getText(), itemEdited);
+  /**
+   * Invocar a los eventos asociados al componente
+   */
+  private void fireItemNameChanged(String oldName, ListViewItem item) {
+    Iterator<ListViewListener> acIterator = actionCommandListeners.iterator();
+    EventObject e = null;
+    while (acIterator.hasNext()) {
+      ListViewListener listener = acIterator.next();
+      if (e == null) e = new EventObject(this);
+      listener.actionItemNameChanged(e, oldName, item);
+    }
+  }
 
-			fireItemNameChanged(oldName, (ListViewItem) items.get(itemEdited));
+  public void renameItem(int item) {
+    if (!isEditable()) return;
 
-			((ListViewItem) items.get(cursorPos)).setSelected(true);
-			itemEdited = -1;
-			repaint();
-		}
-		this.remove(getJRenameEdit());
-		jRenameEdit = null;
-		this.requestFocus();
-	}
+    if ((item >= 0) && (item < items.size())) {
+      if (((ListViewItem) items.get(item)).isSelected()) {
+        Rectangle rectangle = ((ListViewItem) items.get(item))
+            .getNameRectangle();
 
-	/**
-	 * Mueve el cursor hacia abajo
-	 */
-	private void moveDown() {
-		int selItem = -1;
+        if (rectangle != null) {
+          itemEdited = item;
+          ((ListViewItem) items.get(itemEdited)).setSelected(false);
+          repaint();
+          this.setLayout(null);
+          getJRenameEdit().setText(((ListViewItem) items.get(item)).getName());
+          this.add(getJRenameEdit());
+          getJRenameEdit().setBounds(rectangle);
+          getJRenameEdit().addFocusListener(this);
+          getJRenameEdit().addKeyListener(this);
+          getJRenameEdit().requestFocus();
+          getJRenameEdit().setSelectionStart(0);
+          getJRenameEdit().setSelectionEnd(getJRenameEdit().getText().length());
+        }
+      }
+    }
+  }
 
-		for (int i = 0; i < items.size(); i++) {
-			if (cursorPos == i)
-				continue;
-			if (((ListViewItem) items.get(i)).getItemRectangle().y >= (((ListViewItem) items.get(cursorPos)).getItemRectangle().y + ((ListViewItem) items.get(cursorPos)).getItemRectangle().height)) {
-				if (((ListViewItem) items.get(i)).getItemRectangle().x == ((ListViewItem) items.get(cursorPos)).getItemRectangle().x) {
-					selItem = i;
-					break;
-				}
-			}
-		}
+  public JTextField getJRenameEdit() {
+    if (jRenameEdit == null) {
+      jRenameEdit = new JTextField();
+    }
+    return jRenameEdit;
+  }
 
-		if (selItem != -1) {
-			cursorPos = selItem;
-			setSelectedIndex(selItem);
-		}
-	}
+  public void changeName(String newName, int pos) {
+    newName = newName.trim();
+    if (newName.length() == 0) return;
+    String newNameAux = newName;
+    boolean isItem;
+    int newNumber = 0;
+    do {
+      isItem = false;
+      for (int i = 0; i < items.size(); i++) {
+        if ((i != pos)
+            && (((ListViewItem) items.get(i)).getName().equals(newNameAux))) {
+          isItem = true;
+          newNumber++;
+          newNameAux = newName + "_" + newNumber;
+          break;
+        }
+      }
+    }
+    while (isItem);
+    ((ListViewItem) items.get(pos)).setName(newNameAux);
+  }
 
-	/**
-	 * Mueve el cursor hacia la izquierda
-	 */
-	private void moveLeft() {
-		int selItem = -1;
-		for (int i = items.size() - 1; i >= 0; i--) {
-			if (cursorPos == i)
-				continue;
-			if ((((ListViewItem) items.get(i)).getItemRectangle().x + ((ListViewItem) items.get(i)).getItemRectangle().width) <= ((ListViewItem) items.get(cursorPos)).getItemRectangle().x) {
-				if (((ListViewItem) items.get(i)).getItemRectangle().y == ((ListViewItem) items.get(cursorPos)).getItemRectangle().y) {
-					selItem = i;
-					break;
-				}
-			}
-		}
+  public void closeRenameEdit() {
+    if (jRenameEdit == null) return;
 
-		if (selItem != -1) {
-			cursorPos = selItem;
-			setSelectedIndex(selItem);
-		}
-	}
+    if (itemEdited != -1) {
+      String oldName = ((ListViewItem) items.get(itemEdited)).getName();
 
-	/**
-	 * Mueve el cursor hacia la derecha
-	 */
-	private void moveRight() {
-		int selItem = -1;
-		for (int i = 0; i < items.size(); i++) {
-			if (cursorPos == i)
-				continue;
-			if (((ListViewItem) items.get(i)).getItemRectangle().x >= (((ListViewItem) items.get(cursorPos)).getItemRectangle().x + ((ListViewItem) items.get(cursorPos)).getItemRectangle().width)) {
-				if (((ListViewItem) items.get(i)).getItemRectangle().y == ((ListViewItem) items.get(cursorPos)).getItemRectangle().y) {
-					selItem = i;
-					break;
-				}
-			}
-		}
+      changeName(getJRenameEdit().getText(), itemEdited);
 
-		if (selItem != -1) {
-			cursorPos = selItem;
-			setSelectedIndex(selItem);
-		}
-	}
+      fireItemNameChanged(oldName, (ListViewItem) items.get(itemEdited));
 
-	/**
-	 * Mueve el cursor hacia arriba
-	 */
-	private void moveUp() {
-		int selItem = -1;
-		for (int i = items.size() - 1; i >= 0; i--) {
-			if (cursorPos == i)
-				continue;
-			if ((((ListViewItem) items.get(i)).getItemRectangle().y + ((ListViewItem) items.get(i)).getItemRectangle().height) <= ((ListViewItem) items.get(cursorPos)).getItemRectangle().y) {
-				if (((ListViewItem) items.get(i)).getItemRectangle().x == ((ListViewItem) items.get(cursorPos)).getItemRectangle().x) {
-					selItem = i;
-					break;
-				}
-			}
-		}
+      ((ListViewItem) items.get(cursorPos)).setSelected(true);
+      itemEdited = -1;
+      repaint();
+    }
+    this.remove(getJRenameEdit());
+    jRenameEdit = null;
+    this.requestFocus();
+  }
 
-		if (selItem != -1) {
-			cursorPos = selItem;
-			setSelectedIndex(selItem);
-		}
-	}
+  /**
+   * Mueve el cursor hacia abajo
+   */
+  private void moveDown() {
+    int selItem = -1;
 
-	public void keyPressed(KeyEvent e) {
-		if (e.getSource() == this) {
-			switch (e.getKeyCode()) {
-				case KeyEvent.VK_F2:
-					renameItem(cursorPos);
-					break;
-				case KeyEvent.VK_DOWN:
-					moveDown();
-					break;
-				case KeyEvent.VK_LEFT:
-					moveLeft();
-					break;
-				case KeyEvent.VK_RIGHT:
-					moveRight();
-					break;
-				case KeyEvent.VK_UP:
-					moveUp();
-					break;
-				case KeyEvent.VK_HOME:
-					cursorPos = 0;
-					setSelectedIndex(cursorPos);
-					break;
-				case KeyEvent.VK_END:
-					cursorPos = items.size() - 1;
-					setSelectedIndex(cursorPos);
-					break;
-				case KeyEvent.VK_PAGE_UP:
-					if (items.size() > 0) {
-						int cont = (int) Math.floor(this.getVisibleRect().getHeight() / ((ListViewItem) items.get(0)).getItemRectangle().height);
-						for (int i = 0; i < cont; i++)
-							moveUp();
-					}
-					break;
-				case KeyEvent.VK_PAGE_DOWN:
-					if (items.size() > 0) {
-						int cont = (int) Math.floor(this.getVisibleRect().getHeight() / ((ListViewItem) items.get(0)).getItemRectangle().height);
-						for (int i = 0; i < cont; i++)
-							moveDown();
-					}
-					break;
-			}
-			return;
-		}
-		if (e.getSource() == getJRenameEdit()) {
-			switch (e.getKeyCode()) {
-				case KeyEvent.VK_ESCAPE:
-					getJRenameEdit().setText(((ListViewItem) items.get(itemEdited)).getName());
-					closeRenameEdit();
-					break;
-				case KeyEvent.VK_ENTER:
-					closeRenameEdit();
-					break;
-			}
-		}
-	}
+    for (int i = 0; i < items.size(); i++) {
+      if (cursorPos == i) continue;
+      if (((ListViewItem) items.get(i)).getItemRectangle().y >= (((ListViewItem) items
+          .get(cursorPos)).getItemRectangle().y + ((ListViewItem) items
+          .get(cursorPos)).getItemRectangle().height)) {
+        if (((ListViewItem) items.get(i)).getItemRectangle().x == ((ListViewItem) items
+            .get(cursorPos)).getItemRectangle().x) {
+          selItem = i;
+          break;
+        }
+      }
+    }
 
-	public void keyReleased(KeyEvent e) {
-		if (e.getSource() == this) {
-			switch (e.getKeyCode()) {
-				case KeyEvent.VK_DOWN:
-				case KeyEvent.VK_UP:
-				case KeyEvent.VK_LEFT:
-				case KeyEvent.VK_RIGHT:
-				case KeyEvent.VK_HOME:
-				case KeyEvent.VK_END:
-				case KeyEvent.VK_PAGE_UP:
-				case KeyEvent.VK_PAGE_DOWN:
-					fireSelectionValueChanged();
-					break;
-			}
-		}
-	}
+    if (selItem != -1) {
+      cursorPos = selItem;
+      setSelectedIndex(selItem);
+    }
+  }
 
-	public void focusLost(FocusEvent e) {
-		closeRenameEdit();
-	}
+  /**
+   * Mueve el cursor hacia la izquierda
+   */
+  private void moveLeft() {
+    int selItem = -1;
+    for (int i = items.size() - 1; i >= 0; i--) {
+      if (cursorPos == i) continue;
+      if ((((ListViewItem) items.get(i)).getItemRectangle().x + ((ListViewItem) items
+          .get(i)).getItemRectangle().width) <= ((ListViewItem) items
+          .get(cursorPos)).getItemRectangle().x) {
+        if (((ListViewItem) items.get(i)).getItemRectangle().y == ((ListViewItem) items
+            .get(cursorPos)).getItemRectangle().y) {
+          selItem = i;
+          break;
+        }
+      }
+    }
 
-	public void mouseClicked(MouseEvent e) {
-		if (!isEnabled())
-			return;
-		if (e.getSource() == this)
-			// Si es doble click y hay algún elemento seleccionado en la lista lo eliminamos
-			if (e.getClickCount() == 2) {
-				renameItem(cursorPos);
-			}
-	}
+    if (selItem != -1) {
+      cursorPos = selItem;
+      setSelectedIndex(selItem);
+    }
+  }
 
-	/**
-	 * Devuelve si se puede cambiar el nombre de los items
-	 * @return
-	 */
-	public boolean isEditable() {
-		return editable;
-	}
+  /**
+   * Mueve el cursor hacia la derecha
+   */
+  private void moveRight() {
+    int selItem = -1;
+    for (int i = 0; i < items.size(); i++) {
+      if (cursorPos == i) continue;
+      if (((ListViewItem) items.get(i)).getItemRectangle().x >= (((ListViewItem) items
+          .get(cursorPos)).getItemRectangle().x + ((ListViewItem) items
+          .get(cursorPos)).getItemRectangle().width)) {
+        if (((ListViewItem) items.get(i)).getItemRectangle().y == ((ListViewItem) items
+            .get(cursorPos)).getItemRectangle().y) {
+          selItem = i;
+          break;
+        }
+      }
+    }
 
-	/**
-	 * Define si se puede cambiar el nombre de los items
-	 * @param editable
-	 */
-	public void setEditable(boolean editable) {
-		this.editable = editable;
-	}
+    if (selItem != -1) {
+      cursorPos = selItem;
+      setSelectedIndex(selItem);
+    }
+  }
 
-	/**
-	 * Quito los eventos del JScrollPane para gestionarlos yo
-	 */
-	public void ancestorAdded(AncestorEvent event) {
-		if (getParent() instanceof JViewport) {
-			JViewport jViewport = (JViewport) getParent();
-			if (jViewport.getParent() instanceof JScrollPane) {
-				((JScrollPane) jViewport.getParent()).setActionMap(null);
-			}
-		}
-	}
+  /**
+   * Mueve el cursor hacia arriba
+   */
+  private void moveUp() {
+    int selItem = -1;
+    for (int i = items.size() - 1; i >= 0; i--) {
+      if (cursorPos == i) continue;
+      if ((((ListViewItem) items.get(i)).getItemRectangle().y + ((ListViewItem) items
+          .get(i)).getItemRectangle().height) <= ((ListViewItem) items
+          .get(cursorPos)).getItemRectangle().y) {
+        if (((ListViewItem) items.get(i)).getItemRectangle().x == ((ListViewItem) items
+            .get(cursorPos)).getItemRectangle().x) {
+          selItem = i;
+          break;
+        }
+      }
+    }
 
-	/**
-	 * Devuelve el último item seleccionado. Solo el que provoco el evento.
-	 * @return
-	 */
-	public ListViewItem getLastSelectedItem() {
-		return lastSelectedItem;
-	}
+    if (selItem != -1) {
+      cursorPos = selItem;
+      setSelectedIndex(selItem);
+    }
+  }
 
-	/* (non-Javadoc)
-	 * @see javax.swing.JComponent#setEnabled(boolean)
-	 */
-	public void setEnabled(boolean enabled) {
-		super.setEnabled(enabled);
-		update(getGraphics());
-	}
+  public void keyPressed(KeyEvent e) {
+    if (e.getSource() == this) {
+      switch (e.getKeyCode()) {
+        case KeyEvent.VK_F2:
+          renameItem(cursorPos);
+          break;
+        case KeyEvent.VK_DOWN:
+          moveDown();
+          break;
+        case KeyEvent.VK_LEFT:
+          moveLeft();
+          break;
+        case KeyEvent.VK_RIGHT:
+          moveRight();
+          break;
+        case KeyEvent.VK_UP:
+          moveUp();
+          break;
+        case KeyEvent.VK_HOME:
+          cursorPos = 0;
+          setSelectedIndex(cursorPos);
+          break;
+        case KeyEvent.VK_END:
+          cursorPos = items.size() - 1;
+          setSelectedIndex(cursorPos);
+          break;
+        case KeyEvent.VK_PAGE_UP:
+          if (items.size() > 0) {
+            int cont = (int) Math.floor(this.getVisibleRect().getHeight()
+                / ((ListViewItem) items.get(0)).getItemRectangle().height);
+            for (int i = 0; i < cont; i++)
+              moveUp();
+          }
+          break;
+        case KeyEvent.VK_PAGE_DOWN:
+          if (items.size() > 0) {
+            int cont = (int) Math.floor(this.getVisibleRect().getHeight()
+                / ((ListViewItem) items.get(0)).getItemRectangle().height);
+            for (int i = 0; i < cont; i++)
+              moveDown();
+          }
+          break;
+      }
+      return;
+    }
+    if (e.getSource() == getJRenameEdit()) {
+      switch (e.getKeyCode()) {
+        case KeyEvent.VK_ESCAPE:
+          getJRenameEdit().setText(
+              ((ListViewItem) items.get(itemEdited)).getName());
+          closeRenameEdit();
+          break;
+        case KeyEvent.VK_ENTER:
+          closeRenameEdit();
+          break;
+      }
+    }
+  }
 
-	//[start] Codigo no usado
-	public void mouseEntered(MouseEvent e) {}
-	public void mouseExited(MouseEvent e) {}
-	public void keyTyped(KeyEvent e) {}
-	public void focusGained(FocusEvent e) {}
-	public void ancestorMoved(AncestorEvent event) {}
-	public void ancestorRemoved(AncestorEvent event) {}
-	//[end]
+  public void keyReleased(KeyEvent e) {
+    if (e.getSource() == this) {
+      switch (e.getKeyCode()) {
+        case KeyEvent.VK_DOWN:
+        case KeyEvent.VK_UP:
+        case KeyEvent.VK_LEFT:
+        case KeyEvent.VK_RIGHT:
+        case KeyEvent.VK_HOME:
+        case KeyEvent.VK_END:
+        case KeyEvent.VK_PAGE_UP:
+        case KeyEvent.VK_PAGE_DOWN:
+          fireSelectionValueChanged();
+          break;
+      }
+    }
+  }
+
+  public void focusLost(FocusEvent e) {
+    closeRenameEdit();
+  }
+
+  public void mouseClicked(MouseEvent e) {
+    if (!isEnabled()) return;
+    if (e.getSource() == this)
+    // Si es doble click y hay algún elemento seleccionado en la lista lo
+    // eliminamos
+      if (e.getClickCount() == 2) {
+        renameItem(cursorPos);
+      }
+  }
+
+  /**
+   * Devuelve si se puede cambiar el nombre de los items
+   *
+   * @return
+   */
+  public boolean isEditable() {
+    return editable;
+  }
+
+  /**
+   * Define si se puede cambiar el nombre de los items
+   *
+   * @param editable
+   */
+  public void setEditable(boolean editable) {
+    this.editable = editable;
+  }
+
+  /**
+   * Quito los eventos del JScrollPane para gestionarlos yo
+   */
+  public void ancestorAdded(AncestorEvent event) {
+    if (getParent() instanceof JViewport) {
+      JViewport jViewport = (JViewport) getParent();
+      if (jViewport.getParent() instanceof JScrollPane) {
+        ((JScrollPane) jViewport.getParent()).setActionMap(null);
+      }
+    }
+  }
+
+  /**
+   * Devuelve el último item seleccionado. Solo el que provoco el evento.
+   *
+   * @return
+   */
+  public ListViewItem getLastSelectedItem() {
+    return lastSelectedItem;
+  }
+
+  /*
+   * (non-Javadoc)
+   * @see javax.swing.JComponent#setEnabled(boolean)
+   */
+  public void setEnabled(boolean enabled) {
+    super.setEnabled(enabled);
+    update(getGraphics());
+  }
+
+  // [start] Codigo no usado
+  public void mouseEntered(MouseEvent e) {}
+
+  public void mouseExited(MouseEvent e) {}
+
+  public void keyTyped(KeyEvent e) {}
+
+  public void focusGained(FocusEvent e) {}
+
+  public void ancestorMoved(AncestorEvent event) {}
+
+  public void ancestorRemoved(AncestorEvent event) {}
+  // [end]
 }
\ No newline at end of file
