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.telnet
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.telnet')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.telnet/src/org/eclipse/tcf/te/ui/terminals/telnet/controls/TelnetWizardConfigurationPanel.java32
1 files changed, 20 insertions, 12 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.telnet/src/org/eclipse/tcf/te/ui/terminals/telnet/controls/TelnetWizardConfigurationPanel.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.telnet/src/org/eclipse/tcf/te/ui/terminals/telnet/controls/TelnetWizardConfigurationPanel.java
index 424a515e5..c93dee6f4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.telnet/src/org/eclipse/tcf/te/ui/terminals/telnet/controls/TelnetWizardConfigurationPanel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.telnet/src/org/eclipse/tcf/te/ui/terminals/telnet/controls/TelnetWizardConfigurationPanel.java
@@ -58,9 +58,8 @@ public class TelnetWizardConfigurationPanel extends AbstractConfigurationPanel i
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);
TelnetConnector conn = new TelnetConnector();
telnetSettings = (TelnetSettings) conn.getTelnetSettings();
@@ -70,6 +69,9 @@ public class TelnetWizardConfigurationPanel extends AbstractConfigurationPanel i
// MWE otherwise we don't get a valid default selection of the combo
telnetSettings.setNetworkPort(NetworkPortMap.PROP_VALUETELNET);
+ // Create the encoding selection combo
+ createEncodingUI(panel, true);
+
setControl(panel);
}
@@ -103,6 +105,7 @@ public class TelnetWizardConfigurationPanel extends AbstractConfigurationPanel i
data.setProperty(ITerminalsConnectorConstants.PROP_IP_HOST,telnetSettings.getHost());
data.setProperty(ITerminalsConnectorConstants.PROP_IP_PORT, telnetSettings.getNetworkPort());
data.setProperty(ITerminalsConnectorConstants.PROP_TIMEOUT, telnetSettings.getTimeout());
+ data.setProperty(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
}
/* (non-Javadoc)
@@ -110,9 +113,9 @@ public class TelnetWizardConfigurationPanel extends AbstractConfigurationPanel i
*/
@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) {
telnetSettings.setHost(hostSettings.get(ITerminalsConnectorConstants.PROP_IP_HOST));
}
@@ -122,7 +125,10 @@ public class TelnetWizardConfigurationPanel extends AbstractConfigurationPanel i
if (hostSettings.get(ITerminalsConnectorConstants.PROP_TIMEOUT) != null) {
telnetSettings.setTimeout(hostSettings.get(ITerminalsConnectorConstants.PROP_TIMEOUT));
}
- } else{
+ if (hostSettings.get(ITerminalsConnectorConstants.PROP_ENCODING) != null) {
+ setEncoding(hostSettings.get(ITerminalsConnectorConstants.PROP_ENCODING));
+ }
+ } else {
telnetSettings.setHost(getSelectionHost());
// MWE otherwise we don't get a valid default selection of the combo
telnetSettings.setNetworkPort(NetworkPortMap.PROP_VALUETELNET);
@@ -137,18 +143,20 @@ public class TelnetWizardConfigurationPanel extends AbstractConfigurationPanel i
*/
@Override
protected void saveSettingsForHost(boolean add){
- String host=getHostFromSettings();
- if(host!=null && host.length()!=0){
- if(hostSettingsMap.containsKey(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, telnetSettings.getHost());
hostSettings.put(ITerminalsConnectorConstants.PROP_IP_PORT, Integer.toString(telnetSettings.getNetworkPort()));
hostSettings.put(ITerminalsConnectorConstants.PROP_TIMEOUT, Integer.toString(telnetSettings.getTimeout()));
- } else if(add){
+ hostSettings.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
+ } else if (add) {
Map<String, String> hostSettings=new HashMap<String, String>();
hostSettings.put(ITerminalsConnectorConstants.PROP_IP_HOST, telnetSettings.getHost());
hostSettings.put(ITerminalsConnectorConstants.PROP_IP_PORT, Integer.toString(telnetSettings.getNetworkPort()));
hostSettings.put(ITerminalsConnectorConstants.PROP_TIMEOUT, Integer.toString(telnetSettings.getTimeout()));
+ hostSettings.put(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
hostSettingsMap.put(host, hostSettings);
}
}
@@ -159,7 +167,7 @@ public class TelnetWizardConfigurationPanel extends AbstractConfigurationPanel i
*/
@Override
public boolean isValid(){
- return telnetSettingsPage.validateSettings();
+ return isEncodingValid() && telnetSettingsPage.validateSettings();
}
/* (non-Javadoc)

Back to the top