diff --git a/rse/plugins/org.eclipse.rse.shells.ui/plugin.properties b/rse/plugins/org.eclipse.rse.shells.ui/plugin.properties index 0478c6f9aeb..7ba7a81931f 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/plugin.properties +++ b/rse/plugins/org.eclipse.rse.shells.ui/plugin.properties @@ -22,8 +22,6 @@ providerName = Eclipse.org View.RemoteCommands = Remote Shell -PropertyPage.ShellSettings = Shell Settings - PropertyPage.ServerLauncherSettings = Server Launcher Settings PropertyPage.Service = Service PropertyPage.EnvVariables = Environment Variables diff --git a/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml b/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml index 0b96e747ec0..91b4df014a5 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml +++ b/rse/plugins/org.eclipse.rse.shells.ui/plugin.xml @@ -112,15 +112,6 @@ Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter fro - - - - - - 0) - { - String[] list = attribute.split(","); //$NON-NLS-1$ - for (int i = 0; i < list.length; i++) - { - result.add(list[i]); - } - } - else - { - result.add("UTF-8"); //$NON-NLS-1$ - result.add("UTF-16"); //$NON-NLS-1$ - result.add("US-ASCII"); //$NON-NLS-1$ - result.add("ISO-8859-1"); //$NON-NLS-1$ - result.add("Cp1252"); //$NON-NLS-1$ - result.add("Cp1256"); //$NON-NLS-1$ - } - return result; - } - - - /* (non-Javadoc) - * @see org.eclipse.rse.ui.propertypages.SystemBasePropertyPage#createContentArea(org.eclipse.swt.widgets.Composite) - */ - protected Control createContentArea(Composite parent) - { - Font font = parent.getFont(); - Group group = new Group(parent, SWT.NONE); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - group.setLayoutData(data); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - group.setLayout(layout); - group.setText(ShellResources.RESID_SHELL_PROPERTYPAGE_ENCODING); - group.setFont(font); - - _form = new EncodingForm(getShell(), getMessageLine()); - _form.createContents(group); - - RemoteCmdSubSystem cmdSS = getCmdSubSystem(); - _form.initialize(getShellEncodingDefaults(), cmdSS.getShellEncoding()); - return _form.getDefaultControl(); - } - - public RemoteCmdSubSystem getCmdSubSystem() - { - return (RemoteCmdSubSystem)getElement(); - } - - /* (non-Javadoc) - * @see org.eclipse.rse.ui.propertypages.SystemBasePropertyPage#verifyPageContents() - */ - protected boolean verifyPageContents() - { - return true; - } - - /** - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() - { - String encoding = _form.getEncoding(); - getCmdSubSystem().setShellEncoding(encoding); - - List defaults = getShellEncodingDefaults(); - if (!defaults.contains(encoding)) - { - defaults.add(encoding); - setShellEncodingDefaults(defaults); - } - - return true; - } -} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/EncodingForm.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/EncodingForm.java deleted file mode 100644 index 16910121382..00000000000 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/internal/shells/ui/view/EncodingForm.java +++ /dev/null @@ -1,174 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2005, 2006 IBM Corporation. All rights reserved. - * This program and the accompanying materials are made available under the terms - * of the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following IBM employees contributed to the Remote System Explorer - * component that contains this file: David McKnight, Kushal Munir, - * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, - * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. - * - * Contributors: - * {Name} (company) - description of contribution. - ********************************************************************************/ - -package org.eclipse.rse.internal.shells.ui.view; - -import java.io.UnsupportedEncodingException; -import java.util.Collections; -import java.util.List; - -import org.eclipse.rse.internal.shells.ui.ShellResources; -import org.eclipse.rse.ui.SystemBaseForm; -import org.eclipse.rse.ui.messages.ISystemMessageLine; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - - - -public class EncodingForm extends SystemBaseForm -{ - // State for encoding group - private String _encoding; - private String _defaultEncoding; - - private Button _defaultEncodingButton; - private Button _otherEncodingButton; - private Combo _encodingCombo; - - - public EncodingForm(Shell shell, ISystemMessageLine line) - { - super(shell, line); - _defaultEncoding = ShellResources.RESID_SHELL_PROPERTYPAGE_DEFAULT_ENCODING; - } - - /* (non-Javadoc) - * @see org.eclipse.rse.core.ui.SystemBaseForm#createContents(org.eclipse.swt.widgets.Composite) - */ - public Control createContents(Composite group) - { - - SelectionAdapter buttonListener = new SelectionAdapter() - { - public void widgetSelected(SelectionEvent e) { - updateEncodingState(_defaultEncodingButton.getSelection()); - updateValidState(); - } - }; - - _defaultEncodingButton = new Button(group, SWT.RADIO); - _defaultEncodingButton.setText(ShellResources.RESID_SHELL_PROPERTYPAGE_HOST_ENCODING); - GridData data = new GridData(); - Font font = group.getFont(); - - data.horizontalSpan = 2; - _defaultEncodingButton.setLayoutData(data); - _defaultEncodingButton.addSelectionListener(buttonListener); - _defaultEncodingButton.setFont(font); - - _otherEncodingButton = new Button(group, SWT.RADIO); - _otherEncodingButton.setText(ShellResources.RESID_SHELL_PROPERTYPAGE_OTHER_ENCODING); - _otherEncodingButton.addSelectionListener(buttonListener); - _otherEncodingButton.setFont(font); - - _encodingCombo = new Combo(group, SWT.NONE); - data = new GridData(); - _encodingCombo.setFont(font); - _encodingCombo.setLayoutData(data); - _encodingCombo.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateValidState(); - } - }); - - return _encodingCombo; - } - - public void initialize(List defaults, String encoding) - { - _encoding = encoding; - - boolean isDefault = _encoding == null || _encoding.length() == 0 || encoding.equals(_defaultEncoding); - - if (!isDefault && !defaults.contains(_encoding)) - { - defaults.add(_encoding); - } - Collections.sort(defaults); - for (int i = 0; i < defaults.size(); ++i) { - _encodingCombo.add((String) defaults.get(i)); - } - - _encodingCombo.setText(isDefault ? _defaultEncoding : _encoding); - updateEncodingState(isDefault); - } - - public Control getDefaultControl() - { - return _encodingCombo; - } - - public boolean usingDefault() - { - return _defaultEncodingButton.getSelection(); - } - - public String getEncoding() - { - if (usingDefault()) - { - return ""; //$NON-NLS-1$ - } - return _encodingCombo.getText(); - } - - protected void updateValidState() - { - if (!isEncodingValid()) - { - getMessageLine().setErrorMessage(ShellResources.RESID_UNSUPPORTED_ENCODING); - } - else - { - getMessageLine().clearErrorMessage(); - } - } - - private boolean isEncodingValid() - { - return _defaultEncodingButton.getSelection() - || isValidEncoding(_encodingCombo.getText()); - } - - private boolean isValidEncoding(String enc) - { - try { - new String(new byte[0], enc); - return true; - } catch (UnsupportedEncodingException e) { - return false; - } - } - - private void updateEncodingState(boolean useDefault) - { - _defaultEncodingButton.setSelection(useDefault); - _otherEncodingButton.setSelection(!useDefault); - _encodingCombo.setEnabled(!useDefault); - updateValidState(); - } - -} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java index 24e4bf962c2..d903124b7b3 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java @@ -19,7 +19,6 @@ package org.eclipse.rse.subsystems.shells.core.subsystems; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IRemoteSystemEnvVar; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.swt.widgets.Shell; @@ -139,16 +138,7 @@ public interface IRemoteCmdSubSystem extends ISubSystem{ * Provide list of executed commands on subsystem.This is only applicable if the subsystem factory reports * true for supportsCommands(). */ - public String[] getExecutedCommands(); - - - /** - * Returns the shell encoding to assume when reading IO from a remote shell. - * - * @deprecated use {@link IHost#getDefaultEncoding(boolean)} instead - */ - public String getShellEncoding(); - + public String[] getExecutedCommands(); /** * Provide a list of possible commands for the specified context. This method is primarily used diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java index 014a33b557f..d4f13165c22 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/RemoteCmdSubSystem.java @@ -83,31 +83,6 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd return (IRemoteCmdSubSystemConfiguration) super.getSubSystemConfiguration(); } - public String getShellEncoding() - { - IPropertySet set = getPropertySet("Remote"); //$NON-NLS-1$ - if (set != null) - { - return set.getPropertyValue("shell.encoding"); //$NON-NLS-1$ - } - return null; - } - - /** - * @deprecated use {@link IHost#setDefaultEncoding(String, boolean)} instead - */ - public void setShellEncoding(String encoding) - { - IPropertySet set = getPropertySet("Remote"); //$NON-NLS-1$ - if (set == null) - { - set = createPropertySet("Remote", getDescription()); //$NON-NLS-1$ - } - set.addProperty("shell.encoding", encoding); //$NON-NLS-1$ - setDirty(true); - commit(); - } - /** * Long running list processing calls this method to check for a user-cancel * event. If user did cancel, an exception is thrown.