Author: oriol
Date: 2012-07-06 02:05:31 -0700 (Fri, 06 Jul 2012)
New Revision: 29780

Modified:
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/session/NewSessionTask.java
   
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/session/NewSessionTaskFactoryImpl.java
   
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/session/NewSessionTaskTest.java
Log:
Revert to previous version since the fix has some wierd effects

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/session/NewSessionTask.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/session/NewSessionTask.java
       2012-07-06 00:29:19 UTC (rev 29779)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/session/NewSessionTask.java
       2012-07-06 09:05:31 UTC (rev 29780)
@@ -30,8 +30,6 @@
 package org.cytoscape.task.internal.session; 
 
 
-import javax.swing.JOptionPane;
-
 import org.cytoscape.session.CySessionManager;
 import org.cytoscape.work.AbstractTask;
 import org.cytoscape.work.ProvidesTitle;
@@ -41,44 +39,24 @@
 
 public class NewSessionTask extends AbstractTask {
 
-       /*@ProvidesTitle
+       @ProvidesTitle
        public String getTitle() {
                return "New Session";
        }
        
        @Tunable(description="<html>Current session (all networks/attributes) 
will be lost.<br />Do you want to continue?</html>")
-       //public boolean destroyCurrentSession = true;*/
+       public boolean destroyCurrentSession = true;
 
        private CySessionManager mgr;
-       private Boolean test;
        
        
-       public NewSessionTask(CySessionManager mgr,Boolean test) {
+       public NewSessionTask(CySessionManager mgr) {
                this.mgr = mgr;
-               this.test = test;
        }
 
        public void run(TaskMonitor taskMonitor) {
-               // Ask user whether to delete current session or not.
-               final String msg = "<html>Current session (all 
networks/attributes) will be lost.<br />Do you want to continue?</html>";
-               final String header ="New Session";
-               final Object[] options = { "Ok","Cancel" };
-               final int n ;
-               
-               if (test ) {
-                       mgr.setCurrentSession(null,null);
+               if (destroyCurrentSession) {
+                       mgr.setCurrentSession(null,null);                       
                }
-               else
-               {
-                       n = JOptionPane.showOptionDialog(null, msg, header,
-                                                                    
JOptionPane.OK_CANCEL_OPTION,
-                                                                    
JOptionPane.QUESTION_MESSAGE, 
-                                                                               
                         null, options, options[0]);
-                       if (n == JOptionPane.YES_OPTION  ) {
-                               mgr.setCurrentSession(null,null);
-                       }
-               }
-
-       
        }
 }

Modified: 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/session/NewSessionTaskFactoryImpl.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/session/NewSessionTaskFactoryImpl.java
    2012-07-06 00:29:19 UTC (rev 29779)
+++ 
core3/impl/trunk/core-task-impl/src/main/java/org/cytoscape/task/internal/session/NewSessionTaskFactoryImpl.java
    2012-07-06 09:05:31 UTC (rev 29780)
@@ -52,7 +52,7 @@
        }
 
        public TaskIterator createTaskIterator() {
-               return new TaskIterator(new NewSessionTask(mgr,false));
+               return new TaskIterator(new NewSessionTask(mgr));
        }
 
        @Override

Modified: 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/session/NewSessionTaskTest.java
===================================================================
--- 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/session/NewSessionTaskTest.java
   2012-07-06 00:29:19 UTC (rev 29779)
+++ 
core3/impl/trunk/core-task-impl/src/test/java/org/cytoscape/task/internal/session/NewSessionTaskTest.java
   2012-07-06 09:05:31 UTC (rev 29780)
@@ -22,7 +22,7 @@
 
        @Test
        public void testRun() throws Exception {
-               final NewSessionTask t = new NewSessionTask(mgr,true);
+               final NewSessionTask t = new NewSessionTask(mgr);
 
                t.run(tm);
                verify(mgr, times(1)).setCurrentSession(null, null);

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