Author: adietish
Date: 2010-10-25 06:03:11 -0400 (Mon, 25 Oct 2010)
New Revision: 26023
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java
Log:
[JBIDE-7402] cleanup: extracted getPassword() method
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java 2010-10-25
10:02:48 UTC (rev 26022)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java 2010-10-25
10:03:11 UTC (rev 26023)
@@ -27,18 +27,26 @@
private static final String MAINPAGE_NAME = "EditCloudConnection.name";
//$NON-NLS-1$
private CloudConnectionPage mainPage;
private DeltaCloud cloud;
-
+
public EditCloudConnection(DeltaCloud cloud) {
super();
this.cloud = cloud;
}
-
+
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
}
@Override
public void addPages() {
+ String password = getPassword();
+ mainPage = new CloudConnectionPage(WizardMessages.getString(MAINPAGE_NAME),
+ cloud.getName(), cloud.getURL(), cloud.getUsername(), password,
+ cloud.getType(), this);
+ addPage(mainPage);
+ }
+
+ private String getPassword() {
String password = "";
String key = DeltaCloud.getPreferencesKey(cloud.getURL(), cloud.getUsername());
ISecurePreferences root = SecurePreferencesFactory.getDefault();
@@ -48,10 +56,7 @@
} catch (Exception e) {
Activator.log(e);
}
- mainPage = new CloudConnectionPage(WizardMessages.getString(MAINPAGE_NAME),
- cloud.getName(), cloud.getURL(), cloud.getUsername(), password,
- cloud.getType(), this);
- addPage(mainPage);
+ return password;
}
@Override
@@ -72,7 +77,7 @@
return false;
}
}
-
+
@Override
public boolean performFinish() {
String name = mainPage.getModel().getName();