Author: oriol
Date: 2012-04-03 08:26:47 -0700 (Tue, 03 Apr 2012)
New Revision: 28721

Modified:
   
core3/impl/trunk/table-import-impl/src/main/java/org/cytoscape/tableimport/internal/ImportNetworkTableReaderTask.java
   
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/JDialogTunableMutator.java
Log:
Fix bug #778. After validating the dialog data, if it's not correct, the dialog 
is redisplayed until it is correct or the user cancel

Modified: 
core3/impl/trunk/table-import-impl/src/main/java/org/cytoscape/tableimport/internal/ImportNetworkTableReaderTask.java
===================================================================
--- 
core3/impl/trunk/table-import-impl/src/main/java/org/cytoscape/tableimport/internal/ImportNetworkTableReaderTask.java
       2012-04-03 00:01:54 UTC (rev 28720)
+++ 
core3/impl/trunk/table-import-impl/src/main/java/org/cytoscape/tableimport/internal/ImportNetworkTableReaderTask.java
       2012-04-03 15:26:47 UTC (rev 28721)
@@ -150,7 +150,7 @@
                try{
                if (ntmp.getSourceIndex() == -1){
                        if (ntmp.getTargetIndex() == -1){
-                               errMsg.append("The network cannot be created 
without selecting the source and tatget columns!");
+                               errMsg.append("The network cannot be created 
without selecting the source and target columns!");
                                return ValidationState.INVALID;
                        }else{
                                errMsg.append("No edges will be created in the 
network; the target column is not selected.\nDo you want to continue?");

Modified: 
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/JDialogTunableMutator.java
===================================================================
--- 
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/JDialogTunableMutator.java
 2012-04-03 00:01:54 UTC (rev 28720)
+++ 
core3/impl/trunk/work-swing-impl/impl/src/main/java/org/cytoscape/work/internal/tunables/JDialogTunableMutator.java
 2012-04-03 15:26:47 UTC (rev 28721)
@@ -78,20 +78,34 @@
         * @param objectWithTunables    represents the objects annotated with 
tunables
         */
        private boolean displayGUI(final JPanel optionPanel, Object 
objectWithTunables) {
-               TunableDialog tunableDialog = new TunableDialog(parent);
-               tunableDialog.setLocationRelativeTo(parent);
+               TunableDialog tunableDialog;
+               boolean result = false;
+               String userInput;
                
-               tunableDialog.setTitle(getTitle(objectWithTunables));
-               tunableDialog.setModal(true);
-               tunableDialog.setAlwaysOnTop(true);
-
-               tunableDialog.addComponent(optionPanel);
-               tunableDialog.setVisible(true);
+               do 
+               {
+                       tunableDialog = new TunableDialog(parent);
+                       tunableDialog.setLocationRelativeTo(parent);
+                       
+                       tunableDialog.setTitle(getTitle(objectWithTunables));
+                       tunableDialog.setModal(true);
+                       tunableDialog.setAlwaysOnTop(true);
+       
+                       tunableDialog.addComponent(optionPanel);
+                       tunableDialog.setVisible(true);
                
-               String userInput = tunableDialog.getUserInput();
                
+                   userInput = tunableDialog.getUserInput();
+                   if (userInput.equalsIgnoreCase("OK"))
+                   {
+                       result = 
super.validateAndWriteBack(objectWithTunables);        
+                   }
+               }
+               while(userInput.equalsIgnoreCase("OK") == true && result == 
false);
+               
+               
                if (userInput.equalsIgnoreCase("OK")){
-                       return super.validateAndWriteBack(objectWithTunables);  
                
+                       return result;
                } else { 
                        return false;                   
                }

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