properties) {
- //Try to see if the user set a title explicitly via the properties map.
+ // Try to see if the user set a title explicitly via the properties map.
String title = getDefaultTerminalTitle(properties);
- if(title!=null){
- return title;
- }
+ if (title != null) return title;
//No title,try to calculate the title
String host = (String)properties.get(ITerminalsConnectorConstants.PROP_IP_HOST);
@@ -111,6 +109,7 @@ public class SshLauncherDelegate extends AbstractLauncherDelegate {
}
return NLS.bind(Messages.SshLauncherDelegate_terminalTitle, new String[]{user, host, date});
}
+
return Messages.SshLauncherDelegate_terminalTitle_default;
}
diff --git a/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/launcher/TelnetLauncherDelegate.java b/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/launcher/TelnetLauncherDelegate.java
index 5063882c475..370dea26589 100644
--- a/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/launcher/TelnetLauncherDelegate.java
+++ b/plugins/org.eclipse.tm.terminal.connector.telnet/src/org/eclipse/tm/terminal/connector/telnet/launcher/TelnetLauncherDelegate.java
@@ -85,16 +85,14 @@ public class TelnetLauncherDelegate extends AbstractLauncherDelegate {
/**
* Returns the terminal title string.
*
- * The default implementation constructs a title like "SSH @ host (Start time) ".
+ * The default implementation constructs a title like "Telnet @ host (Start time) ".
*
* @return The terminal title string or null
.
*/
private String getTerminalTitle(Map properties) {
- //Try to see if the user set a title explicitly via the properties map.
+ // Try to see if the user set a title explicitly via the properties map.
String title = getDefaultTerminalTitle(properties);
- if(title!=null){
- return title;
- }
+ if (title != null) return title;
//No title,try to calculate the title
String host = (String)properties.get(ITerminalsConnectorConstants.PROP_IP_HOST);
@@ -104,6 +102,7 @@ public class TelnetLauncherDelegate extends AbstractLauncherDelegate {
String date = format.format(new Date(System.currentTimeMillis()));
return NLS.bind(Messages.TelnetLauncherDelegate_terminalTitle, new String[]{host, date});
}
+
return Messages.TelnetLauncherDelegate_terminalTitle_default;
}
diff --git a/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/launcher/AbstractLauncherDelegate.java b/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/launcher/AbstractLauncherDelegate.java
index 0059bdef1dd..6cca5ad5dac 100644
--- a/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/launcher/AbstractLauncherDelegate.java
+++ b/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/launcher/AbstractLauncherDelegate.java
@@ -146,15 +146,12 @@ public abstract class AbstractLauncherDelegate extends PlatformObject implements
/**
* Get the title from the settings, and use it as the default title.
+ *
* @param properties the setting properties map.
* @return the value retrieved via the @see {@link ITerminalsConnectorConstants#PROP_TITLE}, or null if the key hasn't been set.
*/
protected String getDefaultTerminalTitle(Map properties) {
String title = (String)properties.get(ITerminalsConnectorConstants.PROP_TITLE);
-
- if (title != null) {
- return title;
- }
- return null;
+ return title != null ? title : null;
}
}