airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hes...@apache.org
Subject svn commit: r1462390 - /airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java
Date Fri, 29 Mar 2013 03:17:51 GMT
Author: heshan
Date: Fri Mar 29 03:17:51 2013
New Revision: 1462390

URL: http://svn.apache.org/r1462390
Log:
AIRAVATA-803 Handling the AWS secret key and access key from input form.

Modified:
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java?rev=1462390&r1=1462389&r2=1462390&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java
Fri Mar 29 03:17:51 2013
@@ -21,13 +21,6 @@
 
 package org.apache.airavata.xbaya.ui.dialogs.amazon;
 
-import java.awt.event.ActionEvent;
-
-import javax.swing.AbstractAction;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JPanel;
-
 import org.apache.airavata.xbaya.XBayaEngine;
 import org.apache.airavata.xbaya.core.amazon.AmazonCredential;
 import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
@@ -35,6 +28,9 @@ import org.apache.airavata.xbaya.ui.widg
 import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
 import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
 
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+
 public class ChangeCredentialWindow {
     private XBayaEngine engine;
     private XBayaDialog dialog;
@@ -90,14 +86,18 @@ public class ChangeCredentialWindow {
             @Override
             public void actionPerformed(ActionEvent e) {
                 String accessID = ChangeCredentialWindow.this.accessKeyIDTextField.getText();
-                if (accessID != "") {
-                    AmazonCredential.getInstance().setAwsAccessKeyId(accessID);
-                }
-                String secretID = ChangeCredentialWindow.this.secretAccessKeyTextField.getText();
-                if (secretID != "") {
-                    AmazonCredential.getInstance().setAwsSecretAccessKey(secretID);
+                if (!"".equals(accessID)) {
+                    String secretID = ChangeCredentialWindow.this.secretAccessKeyTextField.getText();
+
+                    if (!"".equals(secretID)) {
+                        AmazonCredential.getInstance().setAwsAccessKeyId(accessID);
+                        AmazonCredential.getInstance().setAwsSecretAccessKey(secretID);
+                        hide();
+                        return;
+                    }
                 }
-                hide();
+
+                JOptionPane.showMessageDialog(dialog.getDialog(),"SecretKey and AccessKey
can not be empty!");
             }
 
         });



Mime
View raw message