Author: ruschein
Date: 2010-02-17 16:14:39 -0800 (Wed, 17 Feb 2010)
New Revision: 19358

Modified:
   coreplugins/trunk/browser/src/browser/MultiDataEditAction.java
Log:
Fixed Mantis bug #2178.

Modified: coreplugins/trunk/browser/src/browser/MultiDataEditAction.java
===================================================================
--- coreplugins/trunk/browser/src/browser/MultiDataEditAction.java      
2010-02-18 00:10:14 UTC (rev 19357)
+++ coreplugins/trunk/browser/src/browser/MultiDataEditAction.java      
2010-02-18 00:14:39 UTC (rev 19358)
@@ -273,6 +273,12 @@
         * attributeTo the values that were copied will be saved to "new_values"
         */
        private void copyAtt() {
+               // Sanity check:
+               if (attributeFrom == null || attributeTo == null || 
attributeTo.equals("")) {
+                       showErrorWindow("\"From\" attribute or \"To\" attribute 
has not been specified!");
+                       return;
+               }
+
                byte fromType = attrData.getType(attributeFrom);
                byte toType= attrData.getType(attributeTo);
                if (toType != CyAttributes.TYPE_UNDEFINED && fromType != 
toType) {
@@ -323,7 +329,7 @@
 
        // Pop-up window for error message
        private void showErrorWindow(String errMessage) {
-               JOptionPane.showMessageDialog(Cytoscape.getDesktop(), 
errMessage, "Error!",
+               JOptionPane.showMessageDialog(null/*Cytoscape.getDesktop()*/, 
errMessage, "Error!",
                                              JOptionPane.ERROR_MESSAGE);
 
                return;
@@ -336,8 +342,7 @@
        private void doubleAction(double input) {
                // Sanity check:
                if (action == DIV && input == 0.0) {
-                       JOptionPane.showMessageDialog(null, "Division by zero 
is invalid!",
-                                                     "Arithmetic Error", 
JOptionPane.ERROR_MESSAGE);
+                       showErrorWindow("Division by zero is invalid!");
                        return;
                }
 
@@ -376,8 +381,7 @@
        private void integerAction(int input) {
                // Sanity check:
                if (action == DIV && input == 0.0) {
-                       JOptionPane.showMessageDialog(null, "Division by zero 
is invalid!",
-                                                     "Arithmetic Error", 
JOptionPane.ERROR_MESSAGE);
+                       showErrorWindow("Division by zero is invalid!");
                        return;
                }
 

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