summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMax Weninger2011-11-15 02:50:34 (EST)
committer Uwe Stieber2011-11-15 02:50:34 (EST)
commit9aed07ada74e508d7705cd249fa75a06bce10143 (patch)
treea5c8439f4a9b92f9b363e915efab64c9b213b112
parent7648a108647fefb71f48aff164076c60205eedf1 (diff)
downloadorg.eclipse.tcf-9aed07ada74e508d7705cd249fa75a06bce10143.zip
org.eclipse.tcf-9aed07ada74e508d7705cd249fa75a06bce10143.tar.gz
org.eclipse.tcf-9aed07ada74e508d7705cd249fa75a06bce10143.tar.bz2
Target Explorer: Fix NPE on saving password and improve terminal tab title
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/controls/SshWizardConfigurationPanel.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/launcher/SshLauncherDelegate.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/nls/Messages.properties2
3 files changed, 8 insertions, 4 deletions
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/controls/SshWizardConfigurationPanel.java b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/controls/SshWizardConfigurationPanel.java
index d55595c..13cf943 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/controls/SshWizardConfigurationPanel.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/controls/SshWizardConfigurationPanel.java
@@ -206,7 +206,9 @@ public class SshWizardConfigurationPanel extends AbstractConfigurationPanel impl
settings.put(getSettingsKeyWithPrefix(host, ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE), sshSettings.getKeepalive());
settings.put(getSettingsKeyWithPrefix(host, ITerminalsConnectorConstants.PROP_SSH_USER), sshSettings.getUser());
- saveSecurePassword(sshSettings.getHost(), sshSettings.getPassword());
+ if(sshSettings.getPassword()!=null && sshSettings.getPassword().length()!=0){
+ saveSecurePassword(host, sshSettings.getPassword());
+ }
}
/**
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/launcher/SshLauncherDelegate.java b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/launcher/SshLauncherDelegate.java
index 0be9929..91a533a 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/launcher/SshLauncherDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/launcher/SshLauncherDelegate.java
@@ -74,10 +74,12 @@ public class SshLauncherDelegate extends AbstractLauncherDelegate {
*/
private String getTerminalTitle(IPropertiesContainer properties) {
String host = properties.getStringProperty(ITerminalsConnectorConstants.PROP_IP_HOST);
- if (host != null) {
+ String user = properties.getStringProperty(ITerminalsConnectorConstants.PROP_SSH_USER);
+
+ if (host != null && user!= null) {
DateFormat format = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
String date = format.format(new Date(System.currentTimeMillis()));
- return NLS.bind(Messages.SshLauncherDelegate_terminalTitle, host, date);
+ return NLS.bind(Messages.SshLauncherDelegate_terminalTitle, new String[]{user, host, date});
}
return Messages.SshLauncherDelegate_terminalTitle_default;
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/nls/Messages.properties
index 8b0211a..32bb3ae 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals.ssh/src/org/eclipse/tm/te/ui/terminals/ssh/nls/Messages.properties
@@ -3,5 +3,5 @@
# Externalized Strings.
#
-SshLauncherDelegate_terminalTitle=SSH @ {0} ({1})
+SshLauncherDelegate_terminalTitle=SSH {0}@{1} ({2})
SshLauncherDelegate_terminalTitle_default=SSH Terminal