Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-08-14 05:48:26 -0400
committerUwe Stieber2012-08-14 05:49:23 -0400
commit9a80781d4c0211572076f3d8e1c0053f4071bc3f (patch)
tree6800889d16f5dce01794a62a26932718ef4ff9a1 /target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.ssh
parent92bf484c46ac1a8a2f08f07e9d080d8e99d3b767 (diff)
downloadorg.eclipse.tcf-9a80781d4c0211572076f3d8e1c0053f4071bc3f.tar.gz
org.eclipse.tcf-9a80781d4c0211572076f3d8e1c0053f4071bc3f.tar.xz
org.eclipse.tcf-9a80781d4c0211572076f3d8e1c0053f4071bc3f.zip
Target Explorer: Bug 379394 - [Terminal] Add a UI Control for setting the Terminal's encoding
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.ssh')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.ssh/src/org/eclipse/tcf/te/ui/terminals/ssh/controls/SshWizardConfigurationPanel.java41
1 files changed, 26 insertions, 15 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.ssh/src/org/eclipse/tcf/te/ui/terminals/ssh/controls/SshWizardConfigurationPanel.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.ssh/src/org/eclipse/tcf/te/ui/terminals/ssh/controls/SshWizardConfigurationPanel.java
index e55d6df61..0ceef4086 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.ssh/src/org/eclipse/tcf/te/ui/terminals/ssh/controls/SshWizardConfigurationPanel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.ssh/src/org/eclipse/tcf/te/ui/terminals/ssh/controls/SshWizardConfigurationPanel.java
@@ -61,9 +61,8 @@ public class SshWizardConfigurationPanel extends AbstractConfigurationPanel impl
GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
panel.setLayoutData(data);
- if(isWithoutSelection()){
- createHostsUI(panel);
- }
+ // Create the host selection combo
+ if (isWithoutSelection()) createHostsUI(panel, true);
SshConnector conn = new SshConnector();
sshSettings = (SshSettings) conn.getSshSettings();
@@ -72,6 +71,9 @@ public class SshWizardConfigurationPanel extends AbstractConfigurationPanel impl
sshSettingsPage = conn.makeSettingsPage();
sshSettingsPage.createControl(panel);
+ // Create the encoding selection combo
+ createEncodingUI(panel, true);
+
setControl(panel);
}
@@ -117,6 +119,7 @@ public class SshWizardConfigurationPanel extends AbstractConfigurationPanel impl
data.setProperty(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE, sshSettings.getKeepalive());
data.setProperty(ITerminalsConnectorConstants.PROP_SSH_PASSWORD, sshSettings.getPassword());
data.setProperty(ITerminalsConnectorConstants.PROP_SSH_USER, sshSettings.getUser());
+ data.setProperty(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
}
/* (non-Javadoc)
@@ -124,9 +127,9 @@ public class SshWizardConfigurationPanel extends AbstractConfigurationPanel impl
*/
@Override
protected void fillSettingsForHost(String host){
- if(host!=null && host.length()!=0){
- if(hostSettingsMap.containsKey(host)){
- Map<String, String> hostSettings=hostSettingsMap.get(host);
+ if (host != null && host.length() != 0){
+ if (hostSettingsMap.containsKey(host)){
+ Map<String, String> hostSettings = hostSettingsMap.get(host);
if (hostSettings.get(ITerminalsConnectorConstants.PROP_IP_HOST) != null) {
sshSettings.setHost(hostSettings.get(ITerminalsConnectorConstants.PROP_IP_HOST));
}
@@ -146,6 +149,9 @@ public class SshWizardConfigurationPanel extends AbstractConfigurationPanel impl
if (password != null) {
sshSettings.setPassword(password);
}
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_ENCODING) != null) {
+ setEncoding(hostSettings.get(ITerminalsConnectorConstants.PROP_ENCODING));
+ }
} else {
sshSettings.setHost(getSelectionHost());
sshSettings.setUser(getDefaultUser());
@@ -164,31 +170,36 @@ public class SshWizardConfigurationPanel extends AbstractConfigurationPanel impl
super.doSaveWidgetValues(settings, idPrefix);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.terminals.panels.AbstractConfigurationPanel#saveSettingsForHost(boolean)
+ */
@Override
protected void saveSettingsForHost(boolean add){
- String host=getHostFromSettings();
- if(host!=null && host.length()!=0){
- if(hostSettingsMap.containsKey(host)){
- Map<String, String> hostSettings=hostSettingsMap.get(host);
+ String host = getHostFromSettings();
+ if (host != null && host.length() != 0) {
+ if (hostSettingsMap.containsKey(host)){
+ Map<String, String> hostSettings = hostSettingsMap.get(host);
hostSettings.put(ITerminalsConnectorConstants.PROP_IP_HOST, sshSettings.getHost());
hostSettings.put(ITerminalsConnectorConstants.PROP_IP_PORT, Integer.toString(sshSettings.getPort()));
hostSettings.put(ITerminalsConnectorConstants.PROP_TIMEOUT, Integer.toString(sshSettings.getTimeout()));
hostSettings.put(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE, Integer.toString(sshSettings.getKeepalive()));
hostSettings.put(ITerminalsConnectorConstants.PROP_SSH_USER, sshSettings.getUser());
+ hostSettings.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
- if(sshSettings.getPassword()!=null && sshSettings.getPassword().length()!=0){
+ if (sshSettings.getPassword() != null && sshSettings.getPassword().length() != 0){
saveSecurePassword(host, sshSettings.getPassword());
}
- } else if(add){
- Map<String, String> hostSettings=new HashMap<String, String>();
+ } else if (add) {
+ Map<String, String> hostSettings = new HashMap<String, String>();
hostSettings.put(ITerminalsConnectorConstants.PROP_IP_HOST, sshSettings.getHost());
hostSettings.put(ITerminalsConnectorConstants.PROP_IP_PORT, Integer.toString(sshSettings.getPort()));
hostSettings.put(ITerminalsConnectorConstants.PROP_TIMEOUT, Integer.toString(sshSettings.getTimeout()));
hostSettings.put(ITerminalsConnectorConstants.PROP_SSH_KEEP_ALIVE, Integer.toString(sshSettings.getKeepalive()));
hostSettings.put(ITerminalsConnectorConstants.PROP_SSH_USER, sshSettings.getUser());
+ hostSettings.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
hostSettingsMap.put(host, hostSettings);
- if(sshSettings.getPassword()!=null && sshSettings.getPassword().length()!=0){
+ if (sshSettings.getPassword() != null && sshSettings.getPassword().length() != 0){
saveSecurePassword(host, sshSettings.getPassword());
}
}
@@ -272,7 +283,7 @@ public class SshWizardConfigurationPanel extends AbstractConfigurationPanel impl
*/
@Override
public boolean isValid(){
- return sshSettingsPage.validateSettings();
+ return isEncodingValid() && sshSettingsPage.validateSettings();
}
/* (non-Javadoc)

Back to the top