[kune-commits] r1486 - trunk/src/main/java/cc/kune/gspace/client/viewers

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Mon Aug 8 02:02:51 CEST 2011


Author: vjrj_
Date: 2011-08-08 02:02:51 +0200 (Mon, 08 Aug 2011)
New Revision: 1486

Modified:
   trunk/src/main/java/cc/kune/gspace/client/viewers/PathToolbarUtils.java
Log:
CLOSED - # 90: Truncate long names in folder path 
http://kune.ourproject.org/issues/ticket/90

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/PathToolbarUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/PathToolbarUtils.java	2011-08-07 23:07:04 UTC (rev 1485)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/PathToolbarUtils.java	2011-08-08 00:02:51 UTC (rev 1486)
@@ -2,6 +2,7 @@
 
 import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.common.client.utils.TextUtils;
 import cc.kune.core.client.dnd.FolderViewerDropController;
 import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
 import cc.kune.core.client.registry.IconsRegistry;
@@ -71,9 +72,13 @@
   private ButtonDescriptor createPathButton(final ContainerSimpleDTO container, final int length,
       final int pos) {
     final String style = calculateStyle(pos, length);
+    final String title = container.getName();
     final ButtonDescriptor btn = new ButtonDescriptor(new GotoTokenAction(
-        iconsRegistry.getContentTypeIcon(container.getTypeId()), container.getName(),
+        iconsRegistry.getContentTypeIcon(container.getTypeId()), TextUtils.ellipsis(title, 15),
         container.getStateToken(), style, stateManager, eventBus));
+    if (title.length() > 15) {
+      btn.withToolTip(title);
+    }
     return btn;
   }
 }




More information about the kune-commits mailing list