Author: paperwing
Date: 2012-08-10 16:01:45 -0700 (Fri, 10 Aug 2012)
New Revision: 30166

Modified:
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/CyActivator.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/App.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppParser.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/SimpleApp.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/Update.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/UpdateManager.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/WebQuerier.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/AppManagerDialog.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CheckForUpdatesPanel.java
   
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/InstallFromStorePanel.java
Log:
App store apps now have version number next to name, check for updates tab can 
check for updates and display last time updates were checked for. Updates not 
installable yet.

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/CyActivator.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/CyActivator.java
 2012-08-10 20:23:39 UTC (rev 30165)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/CyActivator.java
 2012-08-10 23:01:45 UTC (rev 30166)
@@ -384,6 +384,9 @@
                serverThread.setDaemon(true);
                Executors.newSingleThreadExecutor().execute(serverThread);
                
+//             cyPropertyRef.getProperties().put("testkey1", "testval1");
+//             cyPropertyRef.getProperties().setProperty("testkey2", 
"testval2");
+               
                // Fire event "start up mostly finished". This seems to close 
the Cytoscape splash screen and show the actual UI.
                cyEventHelperRef.fireEvent(new CyStartEvent(this));
        }

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/App.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/App.java
 2012-08-10 20:23:39 UTC (rev 30165)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/App.java
 2012-08-10 23:01:45 UTC (rev 30166)
@@ -88,6 +88,7 @@
                TO_BE_DISABLED("Disable-on-restart"),
                DISABLED("Disabled"),
                UNINSTALLED("Uninstalled"),
+               TO_BE_INSTALLED("Install-on-restart"),
                FILE_MOVED("File Moved (Uninstalled)"),
                FILE_MOVED_UNINSTALLED("File Moved (Uninstalled)"),
                // Currently, simple apps require a restart for uninstall, so 
we require a restart even if file is moved

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
  2012-08-10 20:23:39 UTC (rev 30165)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppManager.java
  2012-08-10 23:01:45 UTC (rev 30166)
@@ -901,64 +901,4 @@
        public void removeAppListener(AppsChangedListener appListener) {
                appListeners.remove(appListener);
        }
-       
-       public class ChecksumException extends Exception {
-               private static final long serialVersionUID = 
7022699404764909882L;
-               
-               public ChecksumException(String text) {
-                       super(text);
-               }
-       }
-       
-       /**
-        * Obtain the SHA-512 checksum of a file, in the following format: 
sha512:3c1c..
-        * @param file The file to find the checksum
-        * @return The SHA-512 checksum, in format: sha512:e1..
-        * @throws ChecksumException If unable to obtain SHA-512 algorithm 
implementation,
-        * file does not exist, or IO error while reading
-        */
-       public String getChecksum(File file) throws ChecksumException {
-               MessageDigest messageDigest;
-                
-               try {
-                       messageDigest = MessageDigest.getInstance("SHA-512");
-               } catch (NoSuchAlgorithmException e) {
-                       throw new ChecksumException("Unable to obtain SHA-512 
algorithm implementation");
-               }
-
-               InputStream inputStream;
-               try {
-                       inputStream = new FileInputStream(file);
-               } catch (FileNotFoundException e) {
-                       throw new ChecksumException("File " + 
file.getAbsolutePath() + " does not exist.");
-               }
-                
-               try {
-                       inputStream = new DigestInputStream(inputStream, 
messageDigest);
-                       
-                       byte[] byteBuffer = new byte[128];
-                       
-                       while (inputStream.available() != 0) {
-                               inputStream.read(byteBuffer);
-                       }
-               } catch (IOException e) {
-                       throw new ChecksumException("Error reading from file " 
+ file + ", " + e.getMessage());
-               } finally {
-                       try {
-                               inputStream.close();
-                       } catch (IOException e) {
-                               logger.warn("Failed to close input stream on 
file " + file.getAbsolutePath() + ", " + e.getMessage());
-                       }
-               }
-               
-               byte[] digest = messageDigest.digest();
-               
-               String result = "";
-               for (int i = 0; i < digest.length; i++) {
-                       // Convert each byte to a 2-digit hex number, adding 
0x100 to obtain the 0 if the byte is 0E
-                       result += Integer.toString((digest[i] & 0xff) + 0x100, 
16).substring(1);
-               }
-               
-               return "sha512:" + result;
-       }
 }

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppParser.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppParser.java
   2012-08-10 20:23:39 UTC (rev 30165)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/AppParser.java
   2012-08-10 23:01:45 UTC (rev 30166)
@@ -1,8 +1,13 @@
 package org.cytoscape.app.internal.manager;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
+import java.security.DigestInputStream;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.LinkedList;
@@ -14,17 +19,8 @@
 
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParserFactory;
-import javax.xml.stream.FactoryConfigurationError;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
 import org.cytoscape.app.internal.exception.AppParsingException;
 import org.cytoscape.app.internal.util.DebugHelper;
-import org.json.XML;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.Attributes;
@@ -199,6 +195,14 @@
                                        + " major[.minor] (eg. 1 or 1.0) with 
variable whitespace around versions");
                }
                
+               String fileHash;
+               try {
+                       fileHash = getChecksum(file);
+                       parsedApp.setSha512Checksum(fileHash);
+               } catch (ChecksumException e) {
+                       parsedApp.setSha512Checksum(null);
+               }
+               
                parsedApp.setAppFile(file);
                parsedApp.setEntryClassName(entryClassName);
                parsedApp.setAppName(readableName);
@@ -303,4 +307,64 @@
 
         return featuresList;
     }
+    
+    public class ChecksumException extends Exception {
+               private static final long serialVersionUID = 
7022699404764909882L;
+               
+               public ChecksumException(String text) {
+                       super(text);
+               }
+       }
+       
+       /**
+        * Obtain the SHA-512 checksum of a file, in the following format: 
sha512:3c1c..
+        * @param file The file to find the checksum
+        * @return The SHA-512 checksum, in format: sha512:e1..
+        * @throws ChecksumException If unable to obtain SHA-512 algorithm 
implementation,
+        * file does not exist, or IO error while reading
+        */
+       public String getChecksum(File file) throws ChecksumException {
+               MessageDigest messageDigest;
+                
+               try {
+                       messageDigest = MessageDigest.getInstance("SHA-512");
+               } catch (NoSuchAlgorithmException e) {
+                       throw new ChecksumException("Unable to obtain SHA-512 
algorithm implementation");
+               }
+
+               InputStream inputStream;
+               try {
+                       inputStream = new FileInputStream(file);
+               } catch (FileNotFoundException e) {
+                       throw new ChecksumException("File " + 
file.getAbsolutePath() + " does not exist.");
+               }
+                
+               try {
+                       inputStream = new DigestInputStream(inputStream, 
messageDigest);
+                       
+                       byte[] byteBuffer = new byte[128];
+                       
+                       while (inputStream.available() != 0) {
+                               inputStream.read(byteBuffer);
+                       }
+               } catch (IOException e) {
+                       throw new ChecksumException("Error reading from file " 
+ file + ", " + e.getMessage());
+               } finally {
+                       try {
+                               inputStream.close();
+                       } catch (IOException e) {
+                               // logger.warn("Failed to close input stream on 
file " + file.getAbsolutePath() + ", " + e.getMessage());
+                       }
+               }
+               
+               byte[] digest = messageDigest.digest();
+               
+               String result = "";
+               for (int i = 0; i < digest.length; i++) {
+                       // Convert each byte to a 2-digit hex number, adding 
0x100 to obtain the 0 if the byte is 0E
+                       result += Integer.toString((digest[i] & 0xff) + 0x100, 
16).substring(1);
+               }
+               
+               return "sha512:" + result;
+       }
 }

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/SimpleApp.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/SimpleApp.java
   2012-08-10 20:23:39 UTC (rev 30165)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/manager/SimpleApp.java
   2012-08-10 23:01:45 UTC (rev 30166)
@@ -25,9 +25,17 @@
                switch (this.getStatus()) {
                
                case DISABLED:
-                       return "Disable on Restart";
+                       if (this.getAppInstance() != null) {
+                               return "Disable on Restart";
+                       } else {
+                               return "Disabled";
+                       }
                case UNINSTALLED:
-                       return "Uninstall on Restart";
+                       if (this.getAppInstance() != null) {
+                               return "Uninstall on Restart";
+                       } else {
+                               return "Uninstalled";
+                       }
                case FILE_MOVED:
                        return "File Moved (Needs restart to uninstall)";
                default:

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/Update.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/Update.java
  2012-08-10 20:23:39 UTC (rev 30165)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/Update.java
  2012-08-10 23:01:45 UTC (rev 30166)
@@ -16,6 +16,8 @@
        /** The version of the new updated app */
        private String updateVersion;
 
+       private String updateUrl;
+       
        /** Obtain the {@link App}pp object that the update is associated with. 
*/
        public App getApp() {
                return app;
@@ -31,6 +33,10 @@
                return updateVersion;
        }
 
+       public String getUpdateUrl() {
+               return updateUrl;
+       }
+       
        public void setApp(App app) {
                this.app = app;
        }
@@ -43,5 +49,12 @@
                this.updateVersion = updateVersion;
        }
        
+       public void setUpdateUrl(String updateUrl) {
+               this.updateUrl = updateUrl;
+       }
        
+       @Override
+       public String toString() {
+               return this.app.getAppName();
+       }
 }

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/UpdateManager.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/UpdateManager.java
   2012-08-10 20:23:39 UTC (rev 30165)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/UpdateManager.java
   2012-08-10 23:01:45 UTC (rev 30166)
@@ -1,8 +1,11 @@
 package org.cytoscape.app.internal.net;
 
 import java.sql.Time;
+import java.util.Calendar;
 import java.util.HashSet;
+import java.util.Locale;
 import java.util.Set;
+import java.util.TimeZone;
 
 import org.cytoscape.app.internal.event.UpdatesChangedEvent;
 import org.cytoscape.app.internal.event.UpdatesChangedListener;
@@ -14,7 +17,7 @@
        private Set<UpdatesChangedListener> updatesChangedListeners;
        private Set<Update> updates;
        
-       private Time lastUpdateCheckTime;
+       private Calendar lastUpdateCheckTime;
        
        public UpdateManager() {
                this.updatesChangedListeners = new 
HashSet<UpdatesChangedListener>();
@@ -26,15 +29,22 @@
         * @param webQuerier The {@link WebQuerier} used to access app store 
data
         * @param apps The set of apps to check for updates for
         */
-       public void checkForUpdates(WebQuerier webQuerier, Set<App> apps) {
+       public void checkForUpdates(WebQuerier webQuerier, Set<App> apps, 
AppManager appManager) {
                
+               Set<Update> potentialUpdates = webQuerier.checkForUpdates(apps, 
appManager);
                
+               this.updates = potentialUpdates;
+               
                fireUpdatesChangedEvent();
                
                // Update last update check time
-               lastUpdateCheckTime = new Time(System.currentTimeMillis());
+               lastUpdateCheckTime = 
Calendar.getInstance(TimeZone.getDefault(), Locale.getDefault());
        }
        
+       public Set<Update> getUpdates() {
+               return this.updates;
+       }
+       
        /**
         * Installs the given {@link Update} via the given {@link AppManager}
         * @param update The update to install
@@ -57,7 +67,7 @@
                }
        }
        
-       public Time getLastUpdateCheckTime() {
+       public Calendar getLastUpdateCheckTime() {
                return lastUpdateCheckTime;
        }
 }

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/WebQuerier.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/WebQuerier.java
      2012-08-10 20:23:39 UTC (rev 30165)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/net/WebQuerier.java
      2012-08-10 23:01:45 UTC (rev 30166)
@@ -23,7 +23,8 @@
 import org.cytoscape.app.internal.exception.AppDownloadException;
 import org.cytoscape.app.internal.manager.App;
 import org.cytoscape.app.internal.manager.AppManager;
-import org.cytoscape.app.internal.manager.AppManager.ChecksumException;
+import org.cytoscape.app.internal.manager.AppParser;
+import org.cytoscape.app.internal.manager.AppParser.ChecksumException;
 import org.cytoscape.app.internal.net.WebQuerier.AppTag;
 import org.cytoscape.app.internal.util.DebugHelper;
 import org.cytoscape.io.util.StreamUtil;
@@ -576,10 +577,12 @@
                                        if (highestVersionRelease != null
                                                        && 
compareVersions(highestVersionRelease.getReleaseVersion(), app.getVersion()) < 
0) {
                                                
+                                               // 
System.out.println(highestVersionRelease.getReleaseVersion() + " won vs " + 
app.getVersion());
+                                               
                                                if (app.getSha512Checksum() == 
null) {
                                                        try {
-                                                               
app.setSha512Checksum(appManager.getChecksum(app.getAppFile()));
-                                                       } catch 
(ChecksumException e) {
+                                                               
app.setSha512Checksum(appManager.getAppParser().getChecksum(app.getAppFile()));
+                                                       } catch 
(AppParser.ChecksumException e) {
                                                                
app.setSha512Checksum(null);
                                                        }
                                                }
@@ -591,9 +594,12 @@
                                                        for (WebApp.Release 
release : webApp.getReleases()) {
                                                                if 
(release.getSha512Checksum().toLowerCase().indexOf(checksum.toLowerCase()) != 
-1) {
                                                                        
+                                                                       // 
System.out.println("Matching hash found");
+                                                                       
                                                                        Update 
update = new Update();
-                                                                       
update.setUpdateVersion(release.getReleaseVersion());
+                                                                       
update.setUpdateVersion(highestVersionRelease.getReleaseVersion());
                                                                        
update.setApp(app);
+                                                                       
update.setUpdateUrl(url + highestVersionRelease.getRelativeUrl()); 
                                                                        
                                                                        return 
update;
                                                                }

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/AppManagerDialog.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/AppManagerDialog.java
 2012-08-10 20:23:39 UTC (rev 30165)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/AppManagerDialog.java
 2012-08-10 23:01:45 UTC (rev 30166)
@@ -34,7 +34,7 @@
        mainTabbedPane = new javax.swing.JTabbedPane();
         installNewAppsPanel1 = new InstallFromStorePanel(appManager, fileUtil, 
taskManager, this);
         currentlyInstalledAppsPanel1 = new 
CurrentlyInstalledAppsPanel(appManager);
-        checkForUpdatesPanel1 = new CheckForUpdatesPanel();
+        checkForUpdatesPanel1 = new CheckForUpdatesPanel(appManager);
 
         setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
         setTitle("App Manager");

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CheckForUpdatesPanel.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CheckForUpdatesPanel.java
     2012-08-10 20:23:39 UTC (rev 30165)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/CheckForUpdatesPanel.java
     2012-08-10 23:01:45 UTC (rev 30166)
@@ -2,7 +2,21 @@
 
 import java.awt.event.ComponentAdapter;
 import java.awt.event.ComponentEvent;
+import java.util.Calendar;
+import java.util.HashSet;
+import java.util.Set;
 
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.table.DefaultTableModel;
+
+import org.cytoscape.app.internal.manager.App;
+import org.cytoscape.app.internal.manager.AppManager;
+import org.cytoscape.app.internal.net.Update;
+import org.cytoscape.app.internal.net.UpdateManager;
+
 /**
  * This class represents the panel in the App Manager dialog's tab used for 
checking for app updates.
  * Its UI setup code is generated by the Netbeans 7 GUI builder.
@@ -23,8 +37,14 @@
     private javax.swing.JScrollPane updatesScrollPane;
     private javax.swing.JTable updatesTable;
        
-    public CheckForUpdatesPanel() {
+    private UpdateManager updateManager;
+    private AppManager appManager;
+    
+    public CheckForUpdatesPanel(AppManager appManager) {
         initComponents();
+        
+        this.updateManager = new UpdateManager();
+        this.appManager = appManager;
     }
 
     private void initComponents() {
@@ -137,11 +157,26 @@
                 .addContainerGap())
         );
         
-        //
         this.addComponentListener(new ComponentAdapter() {
                
                @Override
                public void componentShown(ComponentEvent e) {
+                       
+                       
updateManager.checkForUpdates(appManager.getWebQuerier(), 
+                                       appManager.getApps(), 
+                                       appManager);
+                       
+                       int updateCount = updateManager.getUpdates().size();
+                       updatesAvailableLabel.setText(updateCount + " " 
+                                       + (updateCount == 1 ? "update" : 
"updates") + " available.");
+                       
+                       Calendar lastUpdateCheckTime = 
updateManager.getLastUpdateCheckTime();
+                       updateCheckTimeLabel.setText("Today, at " 
+                               + lastUpdateCheckTime.get(Calendar.HOUR) + ":"
+                               + lastUpdateCheckTime.get(Calendar.MINUTE) + " "
+                               + (lastUpdateCheckTime.get(Calendar.AM_PM) == 
Calendar.AM ? "am" : "pm"));
+                       
+                       populateUpdatesTable();
                }
         });
     }
@@ -153,4 +188,85 @@
     private void installAllTableActionPerformed(java.awt.event.ActionEvent 
evt) {
         // TODO add your handling code here:
     }
+    
+    private void populateUpdatesTable() {
+   
+       SwingUtilities.invokeLater(new Runnable() {
+               
+                       @Override
+                       public void run() {
+                               
+                               updatesTable.setModel(new 
javax.swing.table.DefaultTableModel(
+                                   new Object [][] {
+
+                                   },
+                                   new String [] {
+                                       "App Name", "Current Version", "New 
Version", "Update URL"
+                                   }
+                               ) {
+                                               private static final long 
serialVersionUID = 5428723339522445073L;
+                                               
+                                               boolean[] canEdit = new boolean 
[] {
+                                       false, false
+                                   };
+
+                                   public boolean isCellEditable(int rowIndex, 
int columnIndex) {
+                                       return canEdit [columnIndex];
+                                   }
+                               });
+                               
+                               
+                               DefaultTableModel tableModel = 
(DefaultTableModel) updatesTable.getModel();
+                               
+                               for (Update update : 
updateManager.getUpdates()) {      
+                                       tableModel.addRow(new Object[]{
+                                               update,
+                                               update.getApp().getVersion(),
+                                               update.getUpdateVersion(),
+                                               update.getUpdateUrl()
+                                       });
+                       }
+                       }
+               
+       });     
+    }
+    
+    /**
+     * Obtain the set of {@link Update} objects corresponding to currently 
selected entries in the table of apps
+     * @return A set of {@link Update} objects corresponding to selected apps 
in the table
+     */
+    private Set<Update> getSelectedUpdates() {
+        Set<Update> selectedUpdates = new HashSet<Update>();
+        int[] selectedRows = updatesTable.getSelectedRows();
+       
+        for (int index = 0; index < selectedRows.length; index++) {
+               
+               Update update = (Update) updatesTable.getModel().getValueAt(
+                               
updatesTable.convertRowIndexToModel(selectedRows[index]), 0);
+               
+               selectedUpdates.add(update);
+        }
+       
+       return selectedUpdates;
+    }
+    
+    /**
+     * Setup and register a listener to the table to listen for selection 
changed events in order to update the
+     * description box
+     */
+    private void setupDescriptionListener() {
+       updatesTable.getSelectionModel().addListSelectionListener(new 
ListSelectionListener() {
+                       
+                       @Override
+                       public void valueChanged(ListSelectionEvent e) {
+                               updateDescriptionBox();
+                       }
+               });
+    }
+    
+    private void updateDescriptionBox() {
+//     Set<Update> selectedUpdates = 
+
+//     descriptionTextArea.setText("Update from ")
+    }
 }

Modified: 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/InstallFromStorePanel.java
===================================================================
--- 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/InstallFromStorePanel.java
    2012-08-10 20:23:39 UTC (rev 30165)
+++ 
core3/impl/trunk/app-impl/src/main/java/org/cytoscape/app/internal/ui/InstallFromStorePanel.java
    2012-08-10 23:01:45 UTC (rev 30166)
@@ -14,6 +14,7 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
@@ -38,6 +39,7 @@
 import org.cytoscape.app.internal.manager.AppManager;
 import org.cytoscape.app.internal.manager.AppParser;
 import org.cytoscape.app.internal.net.ResultsFilterer;
+import org.cytoscape.app.internal.net.Update;
 import org.cytoscape.app.internal.net.WebApp;
 import org.cytoscape.app.internal.net.WebQuerier;
 import org.cytoscape.app.internal.net.WebQuerier.AppTag;
@@ -123,9 +125,9 @@
                        public void run(TaskMonitor taskMonitor) throws 
Exception {
                                WebQuerier webQuerier = 
appManager.getWebQuerier();
                        
-                               taskMonitor.setTitle("Obtaining apps from: " + 
webQuerier.getCurrentAppStoreUrl());
+                               taskMonitor.setTitle("Getting available apps");
+                               taskMonitor.setStatusMessage("Obtaining apps 
from: " + webQuerier.getCurrentAppStoreUrl());
                                
-                               taskMonitor.setStatusMessage("Getting available 
apps");
                                Set<WebApp> availableApps = 
webQuerier.getAllApps();
                        
                                // Once the information is obtained, update the 
tree
@@ -208,7 +210,8 @@
 
         descriptionTextPane.setContentType("text/html");
         descriptionTextPane.setEditable(false);
-        descriptionTextPane.setText("<html>\n  <head>\n\n  </head>\n  <body>\n 
   <p style=\"margin-top: 0\">\n      App description is displayed here.\n    
</p>\n  </body>\n</html>\n");
+        //descriptionTextPane.setText("<html>\n  <head>\n\n  </head>\n  
<body>\n    <p style=\"margin-top: 0\">\n      App description is displayed 
here.\n    </p>\n  </body>\n</html>\n");
+        descriptionTextPane.setText("");
         descriptionScrollPane.setViewportView(descriptionTextPane);
 
         javax.swing.GroupLayout descriptionPanelLayout = new 
javax.swing.GroupLayout(descriptionPanel);
@@ -649,9 +652,13 @@
                text += "src=\"" + 
appManager.getWebQuerier().getDefaultAppStoreUrl() 
                        + selectedApp.getIconUrl() + "\" alt=\"" + 
selectedApp.getFullName() + "\"/>";
                
-               // App name
-               text += "<p> <b>" + selectedApp.getFullName() + "</b> </p>";
+               // App name, version
+               text += "<p>";
+               text += "<b>" + selectedApp.getFullName() + "</b>";
+               text += " " + 
selectedApp.getReleases().get(selectedApp.getReleases().size() - 
1).getReleaseVersion();
+               text += "</p>";
                
+               
                // App description
                text += "<p>" + 
(String.valueOf(selectedApp.getDescription()).equalsIgnoreCase("null") ? "App 
description not found." : selectedApp.getDescription()) + "</p>";
                text += "</body> </html>";
@@ -745,8 +752,6 @@
                        queryForApps();
                }
        }
-       
-       
    
     }
     

-- 
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