Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/controls/LocalWizardConfigurationPanel.java28
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherDelegate.java15
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/panels/AbstractConfigurationPanel.java6
4 files changed, 45 insertions, 7 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/controls/LocalWizardConfigurationPanel.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/controls/LocalWizardConfigurationPanel.java
index 5fba9b025..0ad8d2ba8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/controls/LocalWizardConfigurationPanel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/controls/LocalWizardConfigurationPanel.java
@@ -11,6 +11,7 @@ package org.eclipse.tcf.te.ui.terminals.local.controls;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -28,6 +29,7 @@ import org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode;
import org.eclipse.tcf.te.ui.terminals.panels.AbstractConfigurationPanel;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchEncoding;
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
@@ -55,13 +57,28 @@ public class LocalWizardConfigurationPanel extends AbstractConfigurationPanel im
panel.setLayout(new GridLayout());
panel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ // Create the encoding selection combo
+ createEncodingUI(panel, false);
+
+ // Set the default encoding:
+ // Default UTF-8 on Mac for Local, Preferences:Platform encoding otherwise
+ if (Platform.OS_MACOSX.equals(Platform.getOS())) {
+ setEncoding("UTF-8"); //$NON-NLS-1$
+ } else {
+ String encoding = WorkbenchEncoding.getWorkbenchDefaultEncoding();
+ if (encoding != null && !"".equals(encoding)) setEncoding(encoding); //$NON-NLS-1$
+ }
+
+ // Fill the rest of the panel with a label to be able to
+ // set a height and width hint for the dialog
Label label = new Label(panel, SWT.HORIZONTAL);
GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
layoutData.widthHint = 300;
- layoutData.heightHint = 100;
+ layoutData.heightHint = 80;
label.setLayoutData(layoutData);
resource = getSelectionResource();
+
setControl(panel);
}
@@ -79,6 +96,10 @@ public class LocalWizardConfigurationPanel extends AbstractConfigurationPanel im
*/
@Override
public void setupData(IPropertiesContainer data) {
+ if (data == null) return;
+
+ String value = data.getStringProperty(ITerminalsConnectorConstants.PROP_ENCODING);
+ if (value != null) setEncoding(value);
}
@@ -93,7 +114,10 @@ public class LocalWizardConfigurationPanel extends AbstractConfigurationPanel im
// set the connector type for serial
data.setProperty(ITerminalsConnectorConstants.PROP_CONNECTOR_TYPE_ID, "org.eclipse.tcf.te.ui.terminals.type.local"); //$NON-NLS-1$
- // if we have a IResource selection use the location for working dir
+ // Store the encoding
+ data.setProperty(ITerminalsConnectorConstants.PROP_ENCODING, getEncoding());
+
+ // if we have a IResource selection use the location for working directory
if (resource != null){
String dir = resource.getProject().getLocation().toString();
data.setProperty(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR, dir);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherDelegate.java
index d2bc1976f..d1b7774cc 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/launcher/LocalLauncherDelegate.java
@@ -10,6 +10,7 @@
package org.eclipse.tcf.te.ui.terminals.local.launcher;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
@@ -21,6 +22,7 @@ import org.eclipse.tcf.te.ui.terminals.interfaces.IConfigurationPanel;
import org.eclipse.tcf.te.ui.terminals.interfaces.IMementoHandler;
import org.eclipse.tcf.te.ui.terminals.launcher.AbstractLauncherDelegate;
import org.eclipse.tcf.te.ui.terminals.local.controls.LocalWizardConfigurationPanel;
+import org.eclipse.ui.WorkbenchEncoding;
/**
* Serial launcher delegate implementation.
@@ -58,6 +60,19 @@ public class LocalLauncherDelegate extends AbstractLauncherDelegate {
properties.setProperty(ITerminalsConnectorConstants.PROP_TITLE, terminalTitle);
}
+ // If not configured, set the default encodings for the local terminal
+ if (!properties.containsKey(ITerminalsConnectorConstants.PROP_ENCODING)) {
+ String encoding = null;
+ // Set the default encoding:
+ // Default UTF-8 on Mac for Local, Preferences:Platform encoding otherwise
+ if (Platform.OS_MACOSX.equals(Platform.getOS())) {
+ encoding = "UTF-8"; //$NON-NLS-1$
+ } else {
+ encoding = WorkbenchEncoding.getWorkbenchDefaultEncoding();
+ }
+ if (encoding != null && !"".equals(encoding)) properties.setProperty(ITerminalsConnectorConstants.PROP_ENCODING, encoding); //$NON-NLS-1$
+ }
+
// Get the terminal service
ITerminalService terminal = ServiceManager.getInstance().getService(ITerminalService.class);
// If not available, we cannot fulfill this request
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF
index 013a11fcf..72ccd7cf6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/META-INF/MANIFEST.MF
@@ -16,8 +16,7 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400",
org.eclipse.tcf.te.ui.swt;bundle-version="1.3.0",
org.eclipse.tm.terminal;bundle-version="3.2.300",
org.eclipse.ui;bundle-version="3.8.0",
- org.eclipse.ui.forms;bundle-version="3.5.200",
- org.eclipse.ui.ide;bundle-version="3.8.1"
+ org.eclipse.ui.forms;bundle-version="3.5.200"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/panels/AbstractConfigurationPanel.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/panels/AbstractConfigurationPanel.java
index cafff4653..2e6a8eb6d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/panels/AbstractConfigurationPanel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/panels/AbstractConfigurationPanel.java
@@ -47,7 +47,7 @@ import org.eclipse.tcf.te.ui.terminals.activator.UIPlugin;
import org.eclipse.tcf.te.ui.terminals.interfaces.IConfigurationPanel;
import org.eclipse.tcf.te.ui.terminals.nls.Messages;
import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.ide.IDEEncoding;
+import org.eclipse.ui.WorkbenchEncoding;
/**
* Abstract terminal configuration panel implementation.
@@ -487,8 +487,8 @@ public abstract class AbstractConfigurationPanel extends AbstractWizardConfigura
encodings.add("Default (ISO-8859-1)"); //$NON-NLS-1$
encodings.add("UTF-8"); //$NON-NLS-1$
- // The default Eclipse encoding (configured in the preferences)
- String eclipseEncoding = IDEEncoding.getResourceEncoding();
+ // The default Eclipse Workbench encoding (configured in the preferences)
+ String eclipseEncoding = WorkbenchEncoding.getWorkbenchDefaultEncoding();
if (eclipseEncoding != null && !encodings.contains(eclipseEncoding)) encodings.add(eclipseEncoding);
// The default host (Java VM) encoding

Back to the top