Author: pwang
Date: 2009-03-30 12:27:57 -0700 (Mon, 30 Mar 2009)
New Revision: 16360

Modified:
   
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/RepoCellRenderer.java
Log:
Fixed the display issue for IU names

Modified: 
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/RepoCellRenderer.java
===================================================================
--- 
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/RepoCellRenderer.java
 2009-03-30 18:26:49 UTC (rev 16359)
+++ 
csplugins/trunk/ucsd/pwang/cyprovision/org.eclipse.equinox.p2.ui2/src/org/eclipse/equinox/internal/provisional/p2/ui2/dialogs/RepoCellRenderer.java
 2009-03-30 19:27:57 UTC (rev 16360)
@@ -11,9 +11,11 @@
 import org.eclipse.equinox.internal.p2.ui2.model.AvailableIUElement;
 import org.eclipse.equinox.internal.p2.ui2.model.CategoryElement;
 import org.eclipse.equinox.internal.p2.ui2.model.ProvElement;
+import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.internal.provisional.p2.ui2.IUPropertyUtils;
 
 public class RepoCellRenderer extends DefaultTreeCellRenderer {
-       DefaultMutableTreeNode theNode;
+       //DefaultMutableTreeNode theNode;
 
        public RepoCellRenderer(){      
        }
@@ -35,7 +37,6 @@
                        
setBackground(UIManager.getColor("Tree.textBackground"));
                }
 
-       
        if (treeNode.getUserObject() instanceof ProvElement){
                ProvElement provElement = (ProvElement) 
treeNode.getUserObject();
                
@@ -44,13 +45,15 @@
                
                if (provElement instanceof CategoryElement){
                        CategoryElement cat_element = 
(CategoryElement)provElement;
-                       
+                       // TODO -- we should have a name for each category
                        this.setText(cat_element.getLabel(null));
                }
                else if (provElement instanceof AvailableIUElement){
                        AvailableIUElement avail_element = 
(AvailableIUElement)provElement;
-                       String version = 
avail_element.getIU().getVersion().toString();
-                       this.setText(avail_element.getLabel(null) + " -- " + 
version);
+                       IInstallableUnit installUnit =avail_element.getIU();
+                       String version = installUnit.getVersion().toString();
+                       String name = 
IUPropertyUtils.getIUProperty(installUnit, IInstallableUnit.PROP_NAME);
+                       this.setText(name + " -- " + version);
                }
                else {
                        this.setText("Unknown");                        


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to