diff --git a/bundles/org.eclipse.remote.console/.classpath b/bundles/org.eclipse.remote.console/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/bundles/org.eclipse.remote.console/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/bundles/org.eclipse.remote.console/.gitignore b/bundles/org.eclipse.remote.console/.gitignore new file mode 100644 index 00000000000..ae3c1726048 --- /dev/null +++ b/bundles/org.eclipse.remote.console/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/bundles/org.eclipse.remote.console/.project b/bundles/org.eclipse.remote.console/.project new file mode 100644 index 00000000000..0d4f3afa834 --- /dev/null +++ b/bundles/org.eclipse.remote.console/.project @@ -0,0 +1,28 @@ + + + org.eclipse.remote.console + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/bundles/org.eclipse.remote.console/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.remote.console/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..0c68a61dca8 --- /dev/null +++ b/bundles/org.eclipse.remote.console/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/org.eclipse.remote.console/META-INF/MANIFEST.MF b/bundles/org.eclipse.remote.console/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..2ac47095fa3 --- /dev/null +++ b/bundles/org.eclipse.remote.console/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Console +Bundle-SymbolicName: org.eclipse.remote.console;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.eclipse.remote.internal.console.Activator +Bundle-Localization: plugin +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.remote.core;bundle-version="2.0.0", + org.eclipse.remote.ui;bundle-version="2.0.0", + org.eclipse.ui.console;bundle-version="3.6.0", + org.eclipse.tm.terminal.control;bundle-version="4.0.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-ActivationPolicy: lazy diff --git a/bundles/org.eclipse.remote.console/about.html b/bundles/org.eclipse.remote.console/about.html new file mode 100644 index 00000000000..3f810933b39 --- /dev/null +++ b/bundles/org.eclipse.remote.console/about.html @@ -0,0 +1,22 @@ + + + +About + + + +

About This Content

+ +

May 2, 2006

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.

+ + + \ No newline at end of file diff --git a/bundles/org.eclipse.remote.console/about.ini b/bundles/org.eclipse.remote.console/about.ini new file mode 100644 index 00000000000..5bd1defab8b --- /dev/null +++ b/bundles/org.eclipse.remote.console/about.ini @@ -0,0 +1,27 @@ +# about.ini +# contains information about a feature +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# "%key" are externalized strings defined in about.properties +# This file does not need to be translated. + +# Property "aboutText" contains blurb for "About" dialog (translated) +aboutText=%blurb + +# Property "windowImage" contains path to window icon (16x16) +# needed for primary features only + +# Property "featureImage" contains path to feature image (32x32) +featureImage=ptp_logo_icon32.png + +# Property "aboutImage" contains path to product image (500x330 or 115x164) +# needed for primary features only + +# Property "appName" contains name of the application (not translated) +# needed for primary features only + +# Property "welcomePage" contains path to welcome page (special XML-based format) +# optional + +# Property "welcomePerspective" contains the id of the perspective in which the +# welcome page is to be opened. +# optional diff --git a/bundles/org.eclipse.remote.console/about.mappings b/bundles/org.eclipse.remote.console/about.mappings new file mode 100644 index 00000000000..bddaab43109 --- /dev/null +++ b/bundles/org.eclipse.remote.console/about.mappings @@ -0,0 +1,6 @@ +# about.mappings +# contains fill-ins for about.properties +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# This file does not need to be translated. + +0=@build@ \ No newline at end of file diff --git a/bundles/org.eclipse.remote.console/about.properties b/bundles/org.eclipse.remote.console/about.properties new file mode 100644 index 00000000000..f68a85a36b4 --- /dev/null +++ b/bundles/org.eclipse.remote.console/about.properties @@ -0,0 +1,22 @@ +############################################################################### +# Copyright (c) 2005, 2007 IBM Corporation and others. +# 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 +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### + +# NLS_MESSAGEFORMAT_NONE +# NLS_ENCODING=UTF-8 + +blurb=Remote Services\n\ +\n\ +Version: {featureVersion}\n\ +Build id: {0}\n\ +\n\ +Copyright (c) 2008 IBM Corporation, and others. All rights reserved.\n\ +Visit http://www.eclipse.org/ptp\n + diff --git a/bundles/org.eclipse.remote.console/build.properties b/bundles/org.eclipse.remote.console/build.properties new file mode 100644 index 00000000000..7cce477fcd5 --- /dev/null +++ b/bundles/org.eclipse.remote.console/build.properties @@ -0,0 +1,12 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + plugin.properties,\ + icons/,\ + about.html,\ + about.ini,\ + about.mappings,\ + about.properties,\ + ptp_logo_icon32.png diff --git a/bundles/org.eclipse.remote.console/icons/clcl16/command_input_field.gif b/bundles/org.eclipse.remote.console/icons/clcl16/command_input_field.gif new file mode 100644 index 00000000000..9e3a547c145 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/clcl16/command_input_field.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/clcl16/connect_co.gif b/bundles/org.eclipse.remote.console/icons/clcl16/connect_co.gif new file mode 100644 index 00000000000..556b230da56 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/clcl16/connect_co.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/clcl16/disconnect_co.gif b/bundles/org.eclipse.remote.console/icons/clcl16/disconnect_co.gif new file mode 100644 index 00000000000..f1d5fb31e51 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/clcl16/disconnect_co.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/clcl16/lock_co.gif b/bundles/org.eclipse.remote.console/icons/clcl16/lock_co.gif new file mode 100644 index 00000000000..68fd6cf39ca Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/clcl16/lock_co.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/clcl16/newterminal.gif b/bundles/org.eclipse.remote.console/icons/clcl16/newterminal.gif new file mode 100644 index 00000000000..80201e0d469 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/clcl16/newterminal.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/clcl16/properties_tsk.gif b/bundles/org.eclipse.remote.console/icons/clcl16/properties_tsk.gif new file mode 100644 index 00000000000..41b5adbd543 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/clcl16/properties_tsk.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/cview16/terminal_view.gif b/bundles/org.eclipse.remote.console/icons/cview16/terminal_view.gif new file mode 100644 index 00000000000..bbb6a9e153e Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/cview16/terminal_view.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/dlcl16/command_input_field.gif b/bundles/org.eclipse.remote.console/icons/dlcl16/command_input_field.gif new file mode 100644 index 00000000000..f538ca707fc Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/dlcl16/command_input_field.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/dlcl16/connect_co.gif b/bundles/org.eclipse.remote.console/icons/dlcl16/connect_co.gif new file mode 100644 index 00000000000..ae5e64b9f6f Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/dlcl16/connect_co.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/dlcl16/disconnect_co.gif b/bundles/org.eclipse.remote.console/icons/dlcl16/disconnect_co.gif new file mode 100644 index 00000000000..24a628713dc Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/dlcl16/disconnect_co.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/dlcl16/lock_co.gif b/bundles/org.eclipse.remote.console/icons/dlcl16/lock_co.gif new file mode 100644 index 00000000000..b7764789356 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/dlcl16/lock_co.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/dlcl16/newterminal.gif b/bundles/org.eclipse.remote.console/icons/dlcl16/newterminal.gif new file mode 100644 index 00000000000..80201e0d469 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/dlcl16/newterminal.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/dlcl16/properties_tsk.gif b/bundles/org.eclipse.remote.console/icons/dlcl16/properties_tsk.gif new file mode 100644 index 00000000000..c307524a7a4 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/dlcl16/properties_tsk.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/dlcl16/rem_co.gif b/bundles/org.eclipse.remote.console/icons/dlcl16/rem_co.gif new file mode 100644 index 00000000000..559e462985f Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/dlcl16/rem_co.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/elcl16/command_input_field.gif b/bundles/org.eclipse.remote.console/icons/elcl16/command_input_field.gif new file mode 100644 index 00000000000..f538ca707fc Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/elcl16/command_input_field.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/elcl16/connect_co.gif b/bundles/org.eclipse.remote.console/icons/elcl16/connect_co.gif new file mode 100644 index 00000000000..c0de0d32dd6 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/elcl16/connect_co.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/elcl16/disconnect_co.gif b/bundles/org.eclipse.remote.console/icons/elcl16/disconnect_co.gif new file mode 100644 index 00000000000..ef5bfa8ad71 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/elcl16/disconnect_co.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/elcl16/lock_co.gif b/bundles/org.eclipse.remote.console/icons/elcl16/lock_co.gif new file mode 100644 index 00000000000..68fd6cf39ca Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/elcl16/lock_co.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/elcl16/newterminal.gif b/bundles/org.eclipse.remote.console/icons/elcl16/newterminal.gif new file mode 100644 index 00000000000..80201e0d469 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/elcl16/newterminal.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/elcl16/properties_tsk.gif b/bundles/org.eclipse.remote.console/icons/elcl16/properties_tsk.gif new file mode 100644 index 00000000000..41b5adbd543 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/elcl16/properties_tsk.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/elcl16/rem_co.gif b/bundles/org.eclipse.remote.console/icons/elcl16/rem_co.gif new file mode 100644 index 00000000000..2cd9c544436 Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/elcl16/rem_co.gif differ diff --git a/bundles/org.eclipse.remote.console/icons/eview16/terminal_view.gif b/bundles/org.eclipse.remote.console/icons/eview16/terminal_view.gif new file mode 100644 index 00000000000..bbb6a9e153e Binary files /dev/null and b/bundles/org.eclipse.remote.console/icons/eview16/terminal_view.gif differ diff --git a/bundles/org.eclipse.remote.console/plugin.properties b/bundles/org.eclipse.remote.console/plugin.properties new file mode 100644 index 00000000000..5e5faa0c2c8 --- /dev/null +++ b/bundles/org.eclipse.remote.console/plugin.properties @@ -0,0 +1,9 @@ +########################################################################## +# Copyright (c) 2015 QNX Software Systems, Inc. and others. +# 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 +########################################################################## +terminal.console.name=Command Shell Console +OpenTerminalCommand.name=Open Command Shell diff --git a/bundles/org.eclipse.remote.console/plugin.xml b/bundles/org.eclipse.remote.console/plugin.xml new file mode 100644 index 00000000000..592289c59f4 --- /dev/null +++ b/bundles/org.eclipse.remote.console/plugin.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bundles/org.eclipse.remote.console/pom.xml b/bundles/org.eclipse.remote.console/pom.xml new file mode 100644 index 00000000000..921424bb4b9 --- /dev/null +++ b/bundles/org.eclipse.remote.console/pom.xml @@ -0,0 +1,16 @@ + + + 4.0.0 + + + org.eclipse.remote + remote-parent + 1.1.1-SNAPSHOT + ../../releng/org.eclipse.remote.build/pom.xml + + + org.eclipse.remote.console + 1.0.0-SNAPSHOT + eclipse-plugin + diff --git a/bundles/org.eclipse.remote.console/ptp_logo_icon32.png b/bundles/org.eclipse.remote.console/ptp_logo_icon32.png new file mode 100644 index 00000000000..e8ec57270f3 Binary files /dev/null and b/bundles/org.eclipse.remote.console/ptp_logo_icon32.png differ diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/Activator.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/Activator.java new file mode 100644 index 00000000000..c6e10de8c36 --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/Activator.java @@ -0,0 +1,148 @@ +package org.eclipse.remote.internal.console; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.HashMap; +import java.util.Map.Entry; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.remote.console"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + public static Activator getDefault() { + return plugin; + } + + @Override + protected void initializeImageRegistry(ImageRegistry imageRegistry) { + HashMap map = new HashMap<>(); + + try { + // Local toolbars + map.put(ImageConsts.IMAGE_NEW_TERMINAL, "newterminal.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_CLCL_CONNECT, "connect_co.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_CLCL_DISCONNECT, "disconnect_co.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_CLCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_CLCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_CLCL_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$ + + loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_LOCALTOOL, map); + + map.clear(); + + // Enabled local toolbars + map.put(ImageConsts.IMAGE_NEW_TERMINAL, "newterminal.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_ELCL_CONNECT, "connect_co.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_ELCL_DISCONNECT, "disconnect_co.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_ELCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_ELCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_ELCL_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_ELCL_REMOVE, "rem_co.gif"); //$NON-NLS-1$ + + loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_ELCL, map); + + map.clear(); + + // Disabled local toolbars + map.put(ImageConsts.IMAGE_NEW_TERMINAL, "newterminal.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_DLCL_CONNECT, "connect_co.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_DLCL_DISCONNECT, "disconnect_co.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_DLCL_SETTINGS, "properties_tsk.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_DLCL_COMMAND_INPUT_FIELD, "command_input_field.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_DLCL_SCROLL_LOCK, "lock_co.gif"); //$NON-NLS-1$ + map.put(ImageConsts.IMAGE_DLCL_REMOVE, "rem_co.gif"); //$NON-NLS-1$ + + loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_DLCL, map); + + map.clear(); + + map.put(ImageConsts.IMAGE_TERMINAL_VIEW, "terminal_view.gif"); //$NON-NLS-1$ + + loadImageRegistry(imageRegistry, ImageConsts.IMAGE_DIR_EVIEW, map); + + map.clear(); + + } catch (MalformedURLException malformedURLException) { + malformedURLException.printStackTrace(); + } + } + + protected void loadImageRegistry(ImageRegistry imageRegistry, String strDir, HashMap map) + throws MalformedURLException { + ImageDescriptor imageDescriptor; + + for (Entry entry : map.entrySet()) { + URL url = plugin.getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + strDir + entry.getValue()); + imageDescriptor = ImageDescriptor.createFromURL(url); + imageRegistry.put(entry.getKey(), imageDescriptor); + } + } + + /** + * Create log entry from an IStatus + * + * @param status + * status to log + */ + public static void log(IStatus status) { + getDefault().getLog().log(status); + } + + /** + * Create log entry from a string + * + * @param msg + * message to log + */ + public static void log(String msg) { + log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, msg, null)); + } + + /** + * Create log entry from a Throwable + * + * @param e + * throwable to log + */ + public static void log(Throwable e) { + log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, e.getMessage(), e)); + } + + /** + * Return the OSGi service with the given service interface. + * + * @param service + * service interface + * @return the specified service or null if it's not registered + */ + public static T getService(Class service) { + final BundleContext context = plugin.getBundle().getBundleContext(); + final ServiceReference ref = context.getServiceReference(service); + return ref != null ? context.getService(ref) : null; + } +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/ConsoleMessages.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/ConsoleMessages.java new file mode 100644 index 00000000000..83fe6198c6d --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/ConsoleMessages.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.console; + +import org.eclipse.osgi.util.NLS; + +public class ConsoleMessages extends NLS { + static { + NLS.initializeMessages(ConsoleMessages.class.getName(), ConsoleMessages.class); + } + + public static String SELECT_CONNECTION; + public static String ENCODING_UNAVAILABLE_0; + public static String ENCODING_UNAVAILABLE_1; + public static String ENCODING; + public static String OPEN_CONSOLE_ERROR; + public static String STATUS; + public static String STATUS_CONNECTED; + public static String STATUS_CONNECTING; + public static String STATUS_CLOSED; + + public static String CONNECTING_TO_TERMINAL; + public static String OPENNING_TERMINAL; + public static String MAKING_CONNECTION; + public static String DISCONNECTING; +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/ConsoleMessages.properties b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/ConsoleMessages.properties new file mode 100644 index 00000000000..e07f47400e2 --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/ConsoleMessages.properties @@ -0,0 +1,24 @@ +################################################################################ +# Copyright (c) 2015 QNX Software Systems and others. +# 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 +# +# Contributors: +# QNX Software Systems - Initial API and implementation +################################################################################ +SELECT_CONNECTION = Select Remote Connection +ENCODING_UNAVAILABLE_0 = Unable to set Encoding +ENCODING_UNAVAILABLE_1 = Encoding {0} is unavailable! +ENCODING = Encoding: +OPEN_CONSOLE_ERROR = Error Opening Command Shell Console +STATUS = Status: +STATUS_CONNECTED = CONNECTED +STATUS_CONNECTING = CONNECTING... +STATUS_CLOSED = CLOSED + +CONNECTING_TO_TERMINAL = Connecting to Command Shell +OPENNING_TERMINAL = Openning Command Shell +MAKING_CONNECTION = Making Connection +DISCONNECTING = Disconnecting diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/ImageConsts.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/ImageConsts.java new file mode 100644 index 00000000000..a20dcabcb39 --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/ImageConsts.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2003, 2015 Wind River Systems, Inc. and others. + * 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 Wind River employees contributed to the Terminal component + * that contains this file: Chris Thew, Fran Litterio, Stephen Lamb, + * Helmut Haigermoser and Ted Williams. + * + * Contributors: + * Michael Scharf (Wind River) - extracted from TerminalConsts + * Martin Oberhuber (Wind River) - fixed copyright headers and beautified + * Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin + * Michael Scharf (Wind River) - [172483] added some more icons + * Michael Scharf (Wind River) - [240023] Get rid of the terminal's "Pin" button + *******************************************************************************/ +package org.eclipse.remote.internal.console; + +public interface ImageConsts +{ + public final static String IMAGE_DIR_ROOT = "icons/"; //$NON-NLS-1$ + public final static String IMAGE_DIR_LOCALTOOL = "clcl16/"; // basic colors - size 16x16 //$NON-NLS-1$ + public final static String IMAGE_DIR_DLCL = "dlcl16/"; // disabled - size 16x16 //$NON-NLS-1$ + public final static String IMAGE_DIR_ELCL = "elcl16/"; // enabled - size 16x16 //$NON-NLS-1$ + public final static String IMAGE_DIR_VIEW = "cview16/"; // views //$NON-NLS-1$ + public final static String IMAGE_DIR_EVIEW = "eview16/"; // views //$NON-NLS-1$ + + public static final String IMAGE_NEW_TERMINAL = "TerminalViewNewTerminal"; //$NON-NLS-1$ + public static final String IMAGE_TERMINAL_VIEW = "TerminalView"; //$NON-NLS-1$ + public static final String IMAGE_CLCL_CONNECT = "ImageClclConnect"; //$NON-NLS-1$ + public static final String IMAGE_CLCL_DISCONNECT = "ImageClclDisconnect"; //$NON-NLS-1$ + public static final String IMAGE_CLCL_SETTINGS = "ImageClclSettings"; //$NON-NLS-1$ + public static final String IMAGE_CLCL_SCROLL_LOCK = "ImageClclScrollLock"; //$NON-NLS-1$ + + public static final String IMAGE_DLCL_CONNECT = "ImageDlclConnect"; //$NON-NLS-1$ + public static final String IMAGE_DLCL_DISCONNECT = "ImageDlclDisconnect"; //$NON-NLS-1$ + public static final String IMAGE_DLCL_SETTINGS = "ImageDlclSettings"; //$NON-NLS-1$ + public static final String IMAGE_DLCL_SCROLL_LOCK = "ImageDlclScrollLock"; //$NON-NLS-1$ + public static final String IMAGE_DLCL_REMOVE = "ImageDlclRemove"; //$NON-NLS-1$ + + public static final String IMAGE_ELCL_CONNECT = "ImageElclConnect"; //$NON-NLS-1$ + public static final String IMAGE_ELCL_DISCONNECT = "ImageElclDisconnect"; //$NON-NLS-1$ + public static final String IMAGE_ELCL_SETTINGS = "ImageElclSettings"; //$NON-NLS-1$ + public static final String IMAGE_ELCL_SCROLL_LOCK = "ImageElclScrollLock"; //$NON-NLS-1$ + public static final String IMAGE_ELCL_REMOVE = "ImageElclRemove"; //$NON-NLS-1$ + public static final String IMAGE_CLCL_COMMAND_INPUT_FIELD = "ImageClclCommandInputField";//$NON-NLS-1$ + public static final String IMAGE_ELCL_COMMAND_INPUT_FIELD = "ImageDlclCommandInputField";//$NON-NLS-1$ + public static final String IMAGE_DLCL_COMMAND_INPUT_FIELD = "ImageDlclCommandInputField";//$NON-NLS-1$ + } diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsole.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsole.java new file mode 100644 index 00000000000..8fdfc7b3d7a --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsole.java @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.console; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; +import org.eclipse.ui.console.AbstractConsole; +import org.eclipse.ui.console.IConsoleView; +import org.eclipse.ui.part.IPageBookViewPage; +import org.eclipse.ui.progress.UIJob; + +@SuppressWarnings("restriction") +public class TerminalConsole extends AbstractConsole { + private final String encoding; + private final TerminalConsoleConnector terminalConnector; + private final int index; + + public TerminalConsole(IRemoteConnection connection, int index, String encoding) { + super(connection.getName(), Activator.getDefault().getImageRegistry().getDescriptor(ImageConsts.IMAGE_TERMINAL_VIEW)); + this.encoding = encoding; + this.terminalConnector = new TerminalConsoleConnector(connection); + this.index = index; + } + + public TerminalConsoleConnector getTerminalConnector() { + return terminalConnector; + } + + public IRemoteConnection getConnection() { + return terminalConnector.getConnection(); + } + + public int getIndex() { + return index; + } + + public synchronized void setState(TerminalState terminalState) { + StringBuffer nameBuff = new StringBuffer(getConnection().getName()); + if (index > 0) { + nameBuff.append(' '); + nameBuff.append(String.valueOf(index)); + } + nameBuff.append(" ("); //$NON-NLS-1$ + if (terminalState == TerminalState.CLOSED) { + nameBuff.append(ConsoleMessages.STATUS_CLOSED); + } else if (terminalState == TerminalState.CONNECTED) { + nameBuff.append(ConsoleMessages.STATUS_CONNECTED); + } else if (terminalState == TerminalState.CONNECTING) { + nameBuff.append(ConsoleMessages.STATUS_CONNECTING); + } + nameBuff.append(")"); //$NON-NLS-1$ + + final String name = nameBuff.toString(); + if (!name.equals(getName())) { + UIJob job = new UIJob("updating name") { //$NON-NLS-1$ + public IStatus runInUIThread(IProgressMonitor monitor) { + TerminalConsole.this.setName(name); + return Status.OK_STATUS; + } + }; + job.setSystem(true); + job.schedule(); + } + } + + public IPageBookViewPage createPage(IConsoleView view) { + view.setFocus(); + return new TerminalConsolePage(this, encoding); + } +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleConnector.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleConnector.java new file mode 100644 index 00000000000..ad8668c9f4e --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleConnector.java @@ -0,0 +1,285 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.console; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.PlatformObject; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.remote.core.IRemoteCommandShellService; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteProcess; +import org.eclipse.remote.core.IRemoteProcessBuilder; +import org.eclipse.remote.core.IRemoteProcessTerminalService; +import org.eclipse.remote.core.exception.RemoteConnectionException; +import org.eclipse.tm.internal.terminal.provisional.api.ISettingsStore; +import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; +import org.eclipse.tm.internal.terminal.provisional.api.ITerminalControl; +import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; + +@SuppressWarnings("restriction") +public class TerminalConsoleConnector { + + private final IRemoteConnection connection; + private IRemoteProcess remoteProcess; + private PageConnector[] pageConnectors = new PageConnector[0]; + private int width, height; + private TerminalState state = TerminalState.CLOSED; + + private class OutThread extends Thread { + public OutThread() { + super("Terminal Output"); //$NON-NLS-1$ + } + public void run() { + try { + byte[] buff = new byte[1024]; + InputStream in = remoteProcess.getInputStream(); + for (int n = in.read(buff); n >= 0; n = in.read(buff)) { + for (PageConnector connector : pageConnectors) { + ITerminalControl control = connector.control; + if (control != null) { + control.getRemoteToTerminalOutputStream().write(buff, 0, n); + } + } + } + setState(TerminalState.CLOSED); + synchronized (TerminalConsoleConnector.this) { + outThread = null; + } + } catch (IOException e) { + Activator.log(e); + } + } + } + private OutThread outThread; + + public TerminalConsoleConnector(IRemoteConnection connection) { + this.connection = connection; + } + + public IRemoteConnection getConnection() { + return connection; + } + + public ITerminalConnector newPageConnector() { + PageConnector connector = new PageConnector(); + List list = new ArrayList<>(Arrays.asList(pageConnectors)); + list.add(connector); + pageConnectors = list.toArray(new PageConnector[list.size()]); + return connector; + } + + private void disposePageConnector(PageConnector connector) { + List list = new ArrayList<>(Arrays.asList(pageConnectors)); + list.remove(connector); + pageConnectors = list.toArray(new PageConnector[list.size()]); + if (list.isEmpty()) { + // All gone, disconnect + disconnect(); + } + } + + private synchronized void setState(TerminalState state) { + this.state = state; + for (PageConnector connector : pageConnectors) { + ITerminalControl control = connector.control; + if (control != null) { + connector.control.setState(state); + } + } + } + + public synchronized void connect() { + if (state != TerminalState.CLOSED) { + return; + } + + new Job(ConsoleMessages.MAKING_CONNECTION) { + @Override + protected IStatus run(IProgressMonitor monitor) { + // make sure we're only doing this one at a time + // second and further controls will inherit much of this + synchronized (TerminalConsoleConnector.this) { + setState(TerminalState.CONNECTING); + + if (remoteProcess == null || remoteProcess.isCompleted()) { + try { + // We'll need a new one + if (!connection.isOpen()) { + try { + connection.open(monitor); + } catch (RemoteConnectionException e) { + return e.getStatus(); + } + } + remoteProcess = connection.getService(IRemoteCommandShellService.class) + .getCommandShell(IRemoteProcessBuilder.ALLOCATE_PTY); + } catch (IOException e) { + Activator.log(e); + return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getLocalizedMessage(), e); + } + } + + if (outThread == null) { + outThread = new OutThread(); + outThread.start(); + } + + if (width > 0 || height > 0) { + TerminalConsoleConnector.this.setTerminalSize(); + } + + setState(TerminalState.CONNECTED); + return Status.OK_STATUS; + } + } + }.schedule(); + } + + public void disconnect() { + if (!remoteProcess.isCompleted()) { + new Job(ConsoleMessages.DISCONNECTING) { + @Override + protected IStatus run(IProgressMonitor monitor) { + remoteProcess.destroy(); + return Status.OK_STATUS; + } + }.schedule(); + } + } + + private void setTerminalSize() { + int minWidth = Integer.MAX_VALUE; + int minHeight = Integer.MAX_VALUE; + + for (PageConnector connector : pageConnectors) { + if (connector.myWidth < minWidth) { + minWidth = connector.myWidth; + } + if (connector.myHeight < minHeight) { + minHeight = connector.myHeight; + } + } + + // Weird but the terminal has wrapping issues at this width, need to reduce it by 4. + minWidth -= 4; + + if (minWidth != width || minHeight != height) { + width = minWidth; + height = minHeight; + synchronized (this) { + if (remoteProcess != null) { + IRemoteProcessTerminalService termService = remoteProcess.getService(IRemoteProcessTerminalService.class); + if (termService != null) { + termService.setTerminalSize(width, height, 8 * width, 8 * height); + } + } + } + } + } + + private class PageConnector extends PlatformObject implements ITerminalConnector { + private int myWidth, myHeight; + private ITerminalControl control; + + @Override + public OutputStream getTerminalToRemoteStream() { + return remoteProcess.getOutputStream(); + } + + @Override + public void connect(final ITerminalControl control) { + this.control = control; + control.setVT100LineWrapping(true); + TerminalConsoleConnector.this.connect(); + if (!control.getState().equals(state)) { + control.setState(state); + } + } + + @Override + public synchronized void disconnect() { + disposePageConnector(this); + } + + @Override + public void setTerminalSize(int newWidth, int newHeight) { + if (newWidth != myWidth || newHeight != myHeight) { + myWidth = newWidth; + myHeight = newHeight; + TerminalConsoleConnector.this.setTerminalSize(); + } + } + + @Override + public String getId() { + // No id, we're magic + return null; + } + + @Override + public String getName() { + // No name + return null; + } + + @Override + public boolean isHidden() { + // in case we do leak into the TM world, we shouldn't be visible + return true; + } + + @Override + public boolean isInitialized() { + return true; + } + + @Override + public String getInitializationErrorMessage() { + return null; + } + + @Override + public boolean isLocalEcho() { + // TODO should the be a property of the connection? + return false; + } + + @Override + public void setDefaultSettings() { + // we don't do settings + } + + @Override + public String getSettingsSummary() { + // we don't do settings + return null; + } + + @Override + public void load(ISettingsStore arg0) { + // we don't do settings + } + + @Override + public void save(ISettingsStore arg0) { + // we don't do settings + } + } +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleFactory.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleFactory.java new file mode 100644 index 00000000000..411f1563dea --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleFactory.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.console; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.window.Window; +import org.eclipse.remote.core.IRemoteCommandShellService; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.exception.RemoteConnectionException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.console.ConsolePlugin; +import org.eclipse.ui.console.IConsole; +import org.eclipse.ui.console.IConsoleFactory; +import org.eclipse.ui.console.IConsoleManager; + +public class TerminalConsoleFactory implements IConsoleFactory { + + @Override + public void openConsole() { + final TerminalConsoleSettingsDialog settingsDialog = new TerminalConsoleSettingsDialog( + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); + if (settingsDialog.open() == Window.OK) { + openConsole(settingsDialog.getRemoteConnection(), settingsDialog.getEncoding()); + } + } + + public static void openConsole(final IRemoteConnection connection, final String encoding) { + new Job(ConsoleMessages.OPENNING_TERMINAL) { + @Override + public IStatus run(IProgressMonitor monitor) { + IRemoteCommandShellService commandShellService = connection.getService(IRemoteCommandShellService.class); + if (commandShellService == null) { + return Status.CANCEL_STATUS; + } + + try { + if (!connection.isOpen()) { + connection.open(monitor); + } + + // TODO, how to handle command shells that are singletons, like serial ports + + // Find the index; + IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager(); + IConsole[] consoles = consoleManager.getConsoles(); + boolean[] indices = new boolean[consoles.length]; + for (IConsole console : consoles) { + if (console instanceof TerminalConsole) { + TerminalConsole terminalConsole = (TerminalConsole) console; + if (terminalConsole.getConnection().equals(connection)) { + indices[terminalConsole.getIndex()] = true; + } + } + } + int index = 0; + while (index < indices.length && indices[index]) { + index++; + } + + TerminalConsole terminalConsole = new TerminalConsole(connection, index, encoding); + consoleManager.addConsoles(new IConsole[] { terminalConsole }); + consoleManager.showConsoleView(terminalConsole); + + return Status.OK_STATUS; + } catch (RemoteConnectionException e) { + return e.getStatus(); + } + } + }.schedule(); + } + +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsolePage.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsolePage.java new file mode 100644 index 00000000000..e5a0d1d0720 --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsolePage.java @@ -0,0 +1,178 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.console; + +import java.io.UnsupportedEncodingException; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.action.GroupMarker; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.dialogs.ErrorDialog; +import org.eclipse.osgi.util.NLS; +import org.eclipse.remote.internal.console.actions.ConsoleActionConnect; +import org.eclipse.remote.internal.console.actions.ConsoleActionDisconnect; +import org.eclipse.remote.internal.console.actions.ConsoleActionScrollLock; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.tm.internal.terminal.control.ITerminalListener; +import org.eclipse.tm.internal.terminal.control.ITerminalViewControl; +import org.eclipse.tm.internal.terminal.control.TerminalViewControlFactory; +import org.eclipse.tm.internal.terminal.provisional.api.ITerminalConnector; +import org.eclipse.tm.internal.terminal.provisional.api.TerminalState; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.console.IConsoleConstants; +import org.eclipse.ui.console.actions.CloseConsoleAction; +import org.eclipse.ui.part.IPageSite; +import org.eclipse.ui.part.Page; +import org.eclipse.ui.progress.UIJob; + +@SuppressWarnings("restriction") +public class TerminalConsolePage extends Page { + public static final String TOOLBAR_GROUP_ID = "org.eclipse.remote.internal.terminal.console.Toolbar"; //$NON-NLS-1$ + + private final ConsoleActionConnect connectAction; + private final ConsoleActionDisconnect disconnectAction; + + private final TerminalConsole terminalConsole; + private final String encoding; + private Composite mainComposite; + private ITerminalViewControl tViewCtrl; + + private Job connectTerminalJob = new ConnectTerminalJob(); + + private final ITerminalListener listener = new ITerminalListener() { + @Override + public void setState(TerminalState state) { + if (state == TerminalState.CONNECTING || state == TerminalState.CONNECTED) { + disconnectAction.setEnabled(true); + connectAction.setEnabled(false); + } else if (state == TerminalState.CLOSED) { + disconnectAction.setEnabled(false); + connectAction.setEnabled(true); + } + terminalConsole.setState(state); + } + + @Override + public void setTerminalTitle(final String title) { + // ignore titles coming from the widget + } + }; + + public TerminalConsolePage(TerminalConsole console, String encoding) { + terminalConsole = console; + this.encoding = encoding; + connectAction = new ConsoleActionConnect(console); + disconnectAction = new ConsoleActionDisconnect(console); + } + + public TerminalConsole getConsole() { + return terminalConsole; + } + + @Override + public void init(IPageSite pageSite) { + super.init(pageSite); + IToolBarManager toolBarManager = pageSite.getActionBars().getToolBarManager(); + toolBarManager.insertBefore(IConsoleConstants.OUTPUT_GROUP, new GroupMarker(TOOLBAR_GROUP_ID)); + toolBarManager.appendToGroup(TOOLBAR_GROUP_ID, connectAction); + toolBarManager.appendToGroup(TOOLBAR_GROUP_ID, disconnectAction); + toolBarManager.appendToGroup(TOOLBAR_GROUP_ID, new ConsoleActionScrollLock(this)); + toolBarManager.appendToGroup(TOOLBAR_GROUP_ID, new CloseConsoleAction(terminalConsole)); + } + + @Override + public void createControl(Composite parent) { + mainComposite = new Composite(parent, SWT.NONE); + mainComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); + mainComposite.setLayout(new FillLayout()); + + tViewCtrl = TerminalViewControlFactory.makeControl(listener, + mainComposite, + new ITerminalConnector[] {}); + tViewCtrl.setConnector(terminalConsole.getTerminalConnector().newPageConnector()); + + try { + tViewCtrl.setEncoding(encoding); + } catch (UnsupportedEncodingException e) { + IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, + NLS.bind(ConsoleMessages.ENCODING_UNAVAILABLE_1, encoding)); + Activator.log(status); + ErrorDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(), + ConsoleMessages.OPEN_CONSOLE_ERROR, + ConsoleMessages.ENCODING_UNAVAILABLE_0, + status); + } + connectTerminalJob.schedule(); + } + + @Override + public Control getControl() { + return mainComposite; + } + + @Override + public void setFocus() { + tViewCtrl.setFocus(); + } + + @Override + public void dispose() { + tViewCtrl.disposeTerminal(); + super.dispose(); + } + + public TerminalState getTerminalState() { + return tViewCtrl.getState(); + } + + public void connectTerminal() { + if (!tViewCtrl.isConnected()) { + connectTerminalJob.schedule(); + } + } + + public void disconnectTerminal() { + if (tViewCtrl.getState() != TerminalState.CLOSED) { + tViewCtrl.getTerminalConnector().disconnect(); + } + } + + public void setScrollLock(boolean enabled) { + tViewCtrl.setScrollLock(enabled); + } + + public boolean getScrollLock() { + return tViewCtrl.isScrollLock(); + } + + class ConnectTerminalJob extends UIJob { + public ConnectTerminalJob() { + super(ConsoleMessages.CONNECTING_TO_TERMINAL); + setSystem(true); + } + + @Override + public IStatus runInUIThread(IProgressMonitor monitor) { + if (tViewCtrl != null && !tViewCtrl.isDisposed()) { + tViewCtrl.clearTerminal(); + tViewCtrl.connectTerminal(); + } + return Status.OK_STATUS; + } + } +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleSettingsDialog.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleSettingsDialog.java new file mode 100644 index 00000000000..5e8fdc9dd7b --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/TerminalConsoleSettingsDialog.java @@ -0,0 +1,188 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.console; + +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.window.IShellProvider; +import org.eclipse.jface.window.Window; +import org.eclipse.remote.core.IRemoteCommandShellService; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteConnectionType; +import org.eclipse.remote.core.IRemoteProcessService; +import org.eclipse.remote.core.IRemoteServicesManager; +import org.eclipse.remote.ui.widgets.RemoteConnectionWidget; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Shell; + +public class TerminalConsoleSettingsDialog extends Dialog { + + private static final String CONNECTION_TYPE = "connectionType"; //$NON-NLS-1$ + private static final String CONNECTION_NAME = "connectionName"; //$NON-NLS-1$ + private static final String ENCODING = "encoding"; //$NON-NLS-1$ + + private RemoteConnectionWidget remoteConnWidget; + private Combo encodingCombo; + private String selectedEncoding; + + public TerminalConsoleSettingsDialog(IShellProvider parentShell) { + this(parentShell.getShell()); + } + + public TerminalConsoleSettingsDialog(Shell parentShell) { + super(parentShell); + } + + @Override + protected Control createDialogArea(Composite parent) { + Composite composite = (Composite) super.createDialogArea(parent); + composite.setLayout(new GridLayout(2, false)); + + IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); + // TODO remove the remote process service once we get command shell available with ssh and local + @SuppressWarnings("unchecked") List connTypes = manager.getConnectionTypesSupporting( + IRemoteCommandShellService.class, IRemoteProcessService.class); + + remoteConnWidget = new RemoteConnectionWidget(composite, SWT.NONE, null, 0, connTypes); + + IDialogSettings settings = getDialogSettings(); + String initialId = settings.get(CONNECTION_TYPE); + String initialName = settings.get(CONNECTION_NAME); + if (initialId != null && initialName != null) { + remoteConnWidget.setConnection(initialId, initialName); + } + GridData gd = new GridData(); + gd.horizontalSpan = 2; + remoteConnWidget.setLayoutData(gd); + remoteConnWidget.addSelectionListener(new ValidationSelectionListener()); + + Label encodingLabel = new Label(composite, SWT.NONE); + encodingLabel.setLayoutData(new GridData()); + encodingLabel.setText(ConsoleMessages.ENCODING); + + encodingCombo = new Combo(composite, SWT.READ_ONLY); + encodingCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + int i = 0; + String initialEncoding = settings.get(ENCODING); + if (initialEncoding == null) { + initialEncoding = Charset.defaultCharset().name(); + } + for (String encoding : getEncodings()) { + encodingCombo.add(encoding); + if (encoding.equals(initialEncoding)) { + selectedEncoding = encoding; + encodingCombo.select(i); + } + i++; + } + encodingCombo.addSelectionListener(new ValidationSelectionListener()); + + return composite; + } + + private List getEncodings(){ + List encodings = new ArrayList<>(2); + encodings.add("ISO-8859-1"); //$NON-NLS-1$ + encodings.add("UTF-8"); //$NON-NLS-1$ + + String hostEncoding = Charset.defaultCharset().name(); + if (!encodings.contains(hostEncoding)) { + encodings.add(hostEncoding); + } + return encodings; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + super.createButtonsForButtonBar(parent); + validateDialog(); + } + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText(ConsoleMessages.SELECT_CONNECTION); + } + + private void validateDialog() { + IRemoteConnection connection = remoteConnWidget.getConnection(); + selectedEncoding = encodingCombo.getItem(encodingCombo.getSelectionIndex()); + if (connection != null && selectedEncoding != null) { + getButton(OK).setEnabled(true); + } else { + getButton(OK).setEnabled(false); + } + } + + /** + * Get the remote connection selected in the dialog. + */ + public IRemoteConnection getRemoteConnection() { + return remoteConnWidget.getConnection(); + } + + /** + * Get the encoding selected in the dialog. + */ + public String getEncoding() { + return selectedEncoding; + } + + class ValidationSelectionListener implements SelectionListener { + @Override + public void widgetSelected(SelectionEvent e) { + validateDialog(); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + validateDialog(); + } + } + + private IDialogSettings getDialogSettings() { + IDialogSettings result = Activator.getDefault().getDialogSettings().getSection(TerminalConsoleSettingsDialog.class.getName()); + + if (result == null) { + result = Activator.getDefault().getDialogSettings().addNewSection(TerminalConsoleSettingsDialog.class.getName()); + } + + return result; + + } + + @Override + public int open() { + int rc = super.open(); + if (rc == Window.OK) { + // save the settings + IDialogSettings settings = getDialogSettings(); + IRemoteConnection connection = getRemoteConnection(); + settings.put(CONNECTION_TYPE, connection.getConnectionType().getId()); + settings.put(CONNECTION_NAME, connection.getName()); + settings.put(ENCODING, getEncoding()); + } + return rc; + } + +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ActionMessages.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ActionMessages.java new file mode 100644 index 00000000000..73d6553ec12 --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ActionMessages.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.console.actions; + +import org.eclipse.osgi.util.NLS; + +public class ActionMessages extends NLS { + + static { + NLS.initializeMessages(ActionMessages.class.getName(), ActionMessages.class); + } + + public static String CONNECT; + public static String DISCONNECT; + public static String SCROLL_LOCK; + +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ActionMessages.properties b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ActionMessages.properties new file mode 100644 index 00000000000..3d87929b24e --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ActionMessages.properties @@ -0,0 +1,13 @@ +################################################################################ +# Copyright (c) 2015 QNX Software Systems and others. +# 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 +# +# Contributors: +# QNX Software Systems - Initial API and implementation +################################################################################ +CONNECT = Connect +DISCONNECT = Disconnect +SCROLL_LOCK = Scroll Lock \ No newline at end of file diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleAction.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleAction.java new file mode 100644 index 00000000000..9df1416479b --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleAction.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.console.actions; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.remote.internal.console.Activator; + +public abstract class ConsoleAction extends Action { + public ConsoleAction(String id) { + this(id, 0); + } + + public ConsoleAction(String id, int style) { + super("", style); //$NON-NLS-1$ + setId(id); + } + + protected void setupAction(String text, String tooltip, + String image, String enabledImage, String disabledImage, + boolean enabled) { + ImageRegistry imageRegistry = Activator.getDefault().getImageRegistry(); + setupAction(text, tooltip, image, enabledImage, disabledImage, enabled, imageRegistry); + } + + protected void setupAction(String text, String tooltip, + String hoverImage, String enabledImage, String disabledImage, + boolean enabled, ImageRegistry imageRegistry) { + setupAction(text, + tooltip, + imageRegistry.getDescriptor(hoverImage), + imageRegistry.getDescriptor(enabledImage), + imageRegistry.getDescriptor(disabledImage), + enabled); + } + + protected void setupAction(String text, String tooltip, + ImageDescriptor hoverImage, ImageDescriptor enabledImage, ImageDescriptor disabledImage, + boolean enabled) { + setText(text); + setToolTipText(tooltip); + setEnabled(enabled); + if (enabledImage != null) { + setImageDescriptor(enabledImage); + } + if (disabledImage != null) { + setDisabledImageDescriptor(disabledImage); + } + if (hoverImage != null) { + setHoverImageDescriptor(hoverImage); + } + } +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleActionConnect.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleActionConnect.java new file mode 100644 index 00000000000..e3c97bf1f26 --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleActionConnect.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.console.actions; + +import org.eclipse.remote.internal.console.ImageConsts; +import org.eclipse.remote.internal.console.TerminalConsole; + +public class ConsoleActionConnect extends ConsoleAction { + private final TerminalConsole console; + + public ConsoleActionConnect(TerminalConsole console) { + super(ConsoleActionConnect.class.getName()); + + this.console = console; + + setupAction(ActionMessages.CONNECT, + ActionMessages.CONNECT, + ImageConsts.IMAGE_CLCL_CONNECT, + ImageConsts.IMAGE_ELCL_CONNECT, + ImageConsts.IMAGE_DLCL_CONNECT, + true); + } + + @Override + public void run() { + console.getTerminalConnector().connect(); + } +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleActionDisconnect.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleActionDisconnect.java new file mode 100644 index 00000000000..b567063320b --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleActionDisconnect.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.console.actions; + +import org.eclipse.remote.internal.console.ImageConsts; +import org.eclipse.remote.internal.console.TerminalConsole; + +public class ConsoleActionDisconnect extends ConsoleAction { + private final TerminalConsole console; + + public ConsoleActionDisconnect(TerminalConsole console) + { + super(ConsoleActionDisconnect.class.getName()); + + this.console = console; + + setupAction(ActionMessages.DISCONNECT, + ActionMessages.DISCONNECT, + ImageConsts.IMAGE_CLCL_DISCONNECT, + ImageConsts.IMAGE_ELCL_DISCONNECT, + ImageConsts.IMAGE_DLCL_DISCONNECT, + false); + } + + @Override + public void run() { + console.getTerminalConnector().disconnect(); + } +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleActionScrollLock.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleActionScrollLock.java new file mode 100644 index 00000000000..28c7e4a3fb2 --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/ConsoleActionScrollLock.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.console.actions; + +import org.eclipse.jface.action.IAction; +import org.eclipse.remote.internal.console.ImageConsts; +import org.eclipse.remote.internal.console.TerminalConsolePage; + +public class ConsoleActionScrollLock extends ConsoleAction { + private final TerminalConsolePage page; + + public ConsoleActionScrollLock(TerminalConsolePage page) + { + super(ConsoleActionScrollLock.class.getName(), IAction.AS_RADIO_BUTTON); + + this.page = page; + + setupAction(ActionMessages.SCROLL_LOCK, + ActionMessages.SCROLL_LOCK, + ImageConsts.IMAGE_CLCL_SCROLL_LOCK, + ImageConsts.IMAGE_ELCL_SCROLL_LOCK, + ImageConsts.IMAGE_DLCL_SCROLL_LOCK, + true); + } + + @Override + public void run() { + page.setScrollLock(!page.getScrollLock()); + setChecked(page.getScrollLock()); + } +} diff --git a/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/OpenCommandShellHandler.java b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/OpenCommandShellHandler.java new file mode 100644 index 00000000000..a382559d8e5 --- /dev/null +++ b/bundles/org.eclipse.remote.console/src/org/eclipse/remote/internal/console/actions/OpenCommandShellHandler.java @@ -0,0 +1,27 @@ +package org.eclipse.remote.internal.console.actions; + +import java.nio.charset.Charset; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.runtime.Status; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.internal.console.TerminalConsoleFactory; +import org.eclipse.ui.handlers.HandlerUtil; + +public class OpenCommandShellHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection(); + if (selection != null && selection instanceof IStructuredSelection) { + IRemoteConnection connection = (IRemoteConnection) ((IStructuredSelection) selection).iterator().next(); + TerminalConsoleFactory.openConsole(connection, Charset.defaultCharset().name()); + } + return Status.OK_STATUS; + } + +} diff --git a/bundles/org.eclipse.remote.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.remote.core/META-INF/MANIFEST.MF index 908862dc222..96f97d86378 100644 --- a/bundles/org.eclipse.remote.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.remote.core/META-INF/MANIFEST.MF @@ -9,7 +9,8 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.filesystem, org.eclipse.core.resources, org.eclipse.core.variables, - org.eclipse.debug.core + org.eclipse.debug.core, + org.eclipse.cdt.core.native;bundle-version="5.8.0" Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.remote.core, org.eclipse.remote.core.exception, diff --git a/bundles/org.eclipse.remote.core/plugin.xml b/bundles/org.eclipse.remote.core/plugin.xml index 51b916ebf9e..9753107b402 100644 --- a/bundles/org.eclipse.remote.core/plugin.xml +++ b/bundles/org.eclipse.remote.core/plugin.xml @@ -33,6 +33,11 @@ factory="org.eclipse.remote.internal.core.services.local.LocalProcessService$Factory" service="org.eclipse.remote.core.IRemoteProcessService"> + + + + diff --git a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/RemoteConnectionType.java b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/RemoteConnectionType.java index d62cc98cd86..d5db29d23ba 100644 --- a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/RemoteConnectionType.java +++ b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/RemoteConnectionType.java @@ -60,12 +60,14 @@ public class RemoteConnectionType implements IRemoteConnectionType { } // load up existing connections - try { - for (String connectionName : getPreferenceNode().childrenNames()) { - connections.put(connectionName, new RemoteConnection(this, connectionName)); + synchronized (connections) { + try { + for (String connectionName : getPreferenceNode().childrenNames()) { + connections.put(connectionName, new RemoteConnection(this, connectionName)); + } + } catch (BackingStoreException e) { + RemoteCorePlugin.log(e); } - } catch (BackingStoreException e) { - RemoteCorePlugin.log(e); } } @@ -284,23 +286,27 @@ public class RemoteConnectionType implements IRemoteConnectionType { */ @Override public IRemoteConnection getConnection(String name) { - return connections.get(name); + synchronized (connections) { + return connections.get(name); + } } @Override public IRemoteConnection getConnection(URI uri) { - IRemoteConnection connection = connections.get(uri.getAuthority()); - if (connection != null) { - return connection; + synchronized (connections) { + IRemoteConnection connection = connections.get(uri.getAuthority()); + if (connection != null) { + return connection; + } + + // If it's a file: scheme we must be the local connection type, just return our + // hopefully one connection, the Local connection. + if (uri.getScheme().equals("file") && !connections.isEmpty()) { //$NON-NLS-1$ + return connections.values().iterator().next(); + } + + return null; } - - // If it's a file: scheme we must be the local connection type, just return our - // hopefully one connection, the Local connection. - if (uri.getScheme().equals("file") && !connections.isEmpty()) { //$NON-NLS-1$ - return connections.values().iterator().next(); - } - - return null; } /* @@ -310,7 +316,9 @@ public class RemoteConnectionType implements IRemoteConnectionType { */ @Override public List getConnections() { - return new ArrayList(connections.values()); + synchronized (connections) { + return new ArrayList(connections.values()); + } } /* @@ -320,18 +328,24 @@ public class RemoteConnectionType implements IRemoteConnectionType { */ @Override public IRemoteConnectionWorkingCopy newConnection(String name) throws RemoteConnectionException { - if (connections.containsKey(name)) { - throw new ConnectionExistsException(name); + synchronized (connections) { + if (connections.containsKey(name)) { + throw new ConnectionExistsException(name); + } + return new RemoteConnectionWorkingCopy(this, name); } - return new RemoteConnectionWorkingCopy(this, name); } void addConnection(RemoteConnection remoteConnection) { - connections.put(remoteConnection.getName(), remoteConnection); + synchronized (connections) { + connections.put(remoteConnection.getName(), remoteConnection); + } } void removeConnection(String name) { - connections.remove(name); + synchronized (connections) { + connections.remove(name); + } } /* @@ -341,19 +355,21 @@ public class RemoteConnectionType implements IRemoteConnectionType { */ @Override public void removeConnection(IRemoteConnection connection) throws RemoteConnectionException { - if (connection instanceof RemoteConnection) { - connection.close(); - RemoteConnection conn = (RemoteConnection) connection; - try { - conn.getPreferences().removeNode(); - } catch (BackingStoreException e) { - throw new RemoteConnectionException(e); + synchronized (connections) { + if (connection instanceof RemoteConnection) { + connection.close(); + RemoteConnection conn = (RemoteConnection) connection; + try { + conn.getPreferences().removeNode(); + } catch (BackingStoreException e) { + throw new RemoteConnectionException(e); + } + conn.getSecurePreferences().removeNode(); + connections.remove(conn.getName()); + connection.fireConnectionChangeEvent(RemoteConnectionChangeEvent.CONNECTION_REMOVED); + } else { + RemoteCorePlugin.log("Wrong class for " + connection.getName() + ", was " + connection.getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$ } - conn.getSecurePreferences().removeNode(); - connections.remove(conn.getName()); - connection.fireConnectionChangeEvent(RemoteConnectionChangeEvent.CONNECTION_REMOVED); - } else { - RemoteCorePlugin.log("Wrong class for " + connection.getName() + ", was " + connection.getClass().getName()); //$NON-NLS-1$ //$NON-NLS-2$ } } diff --git a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalCommandShellService.java b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalCommandShellService.java new file mode 100644 index 00000000000..433d76e6541 --- /dev/null +++ b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalCommandShellService.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright (c) 2015 QNX Software Systems and others. + * 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 + * + * Contributors: + * QNX - initial API and implementation + *******************************************************************************/ +package org.eclipse.remote.internal.core.services.local; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.core.runtime.Platform; +import org.eclipse.remote.core.IRemoteCommandShellService; +import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteConnection.Service; +import org.eclipse.remote.core.IRemoteProcess; +import org.eclipse.remote.core.IRemoteProcessBuilder; +import org.eclipse.remote.core.IRemoteProcessService; + +public class LocalCommandShellService implements IRemoteCommandShellService { + + private final IRemoteConnection connection; + + public LocalCommandShellService(IRemoteConnection connection) { + this.connection = connection; + } + + public static class Factory implements IRemoteCommandShellService.Factory { + @SuppressWarnings("unchecked") + @Override + public T getService(IRemoteConnection remoteConnection, Class service) { + if (service.equals(IRemoteCommandShellService.class)) { + return (T) new LocalCommandShellService(remoteConnection); + } + return null; + } + } + + @Override + public IRemoteConnection getRemoteConnection() { + return connection; + } + + @SuppressWarnings("nls") + @Override + public IRemoteProcess getCommandShell(int flags) throws IOException { + IRemoteProcessService procService = connection.getService(IRemoteProcessService.class); + String[] command; + if (Platform.getOS().equals(Platform.OS_WIN32)) { + command = new String[] { "cmd" }; + } else { + List list = new ArrayList<>(Arrays.asList(System.getenv("SHELL").split("\\s+"))); + list.add("-l"); + command = list.toArray(new String[list.size()]); + } + IRemoteProcessBuilder builder = procService.getProcessBuilder(command); + return builder.start(IRemoteProcessBuilder.ALLOCATE_PTY); + } + +} diff --git a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcess.java b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcess.java index 806cdee790d..b2d40f7beaa 100644 --- a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcess.java +++ b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcess.java @@ -16,14 +16,18 @@ import java.io.OutputStream; import java.io.PipedInputStream; import java.io.PipedOutputStream; +import org.eclipse.cdt.utils.pty.PTY; import org.eclipse.remote.core.IRemoteProcess; import org.eclipse.remote.core.IRemoteProcessControlService; +import org.eclipse.remote.core.IRemoteProcessTerminalService; -public class LocalProcess implements IRemoteProcessControlService { +public class LocalProcess implements IRemoteProcessControlService, IRemoteProcessTerminalService { private static int refCount = 0; private final IRemoteProcess remoteProcess; private final Process localProcess; + private final PTY pty; + private int width, height; private InputStream procStdout; private InputStream procStderr; private Thread stdoutReader; @@ -52,6 +56,9 @@ public class LocalProcess implements IRemoteProcessControlService { if (IRemoteProcessControlService.class.equals(service)) { return (T) remoteProcess.getService(LocalProcess.class); } + if (IRemoteProcessTerminalService.class.equals(service)) { + return (T) remoteProcess.getService(LocalProcess.class); + } return null; } } @@ -113,7 +120,9 @@ public class LocalProcess implements IRemoteProcessControlService { public LocalProcess(IRemoteProcess process) { remoteProcess = process; - localProcess = ((LocalProcessBuilder) process.getProcessBuilder()).getProcess(); + LocalProcessBuilder builder = (LocalProcessBuilder) process.getProcessBuilder(); + localProcess = builder.getProcess(); + pty = builder.getPty(); try { if (process.getProcessBuilder().redirectErrorStream()) { @@ -226,4 +235,13 @@ public class LocalProcess implements IRemoteProcessControlService { public IRemoteProcess getRemoteProcess() { return remoteProcess; } + + @Override + public void setTerminalSize(int cols, int rows, int pwidth, int pheight) { + if (pty != null && (width != cols || height != rows)) { + width = cols; + height = rows; + pty.setTerminalSize(width, height); + } + } } diff --git a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcessBuilder.java b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcessBuilder.java index 022f453f94e..5f713ea5b85 100644 --- a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcessBuilder.java +++ b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcessBuilder.java @@ -18,6 +18,9 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import org.eclipse.cdt.utils.pty.PTY; +import org.eclipse.cdt.utils.pty.PTY.Mode; +import org.eclipse.cdt.utils.spawner.ProcessFactory; import org.eclipse.core.filesystem.EFS; import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.runtime.CoreException; @@ -32,6 +35,7 @@ import org.eclipse.remote.core.AbstractRemoteProcessBuilder; import org.eclipse.remote.core.IProcessFactory; import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteProcess; +import org.eclipse.remote.core.IRemoteProcessBuilder; import org.eclipse.remote.internal.core.RemoteCorePlugin; import org.eclipse.remote.internal.core.RemoteProcess; @@ -43,6 +47,7 @@ public class LocalProcessBuilder extends AbstractRemoteProcessBuilder { private final Map fRemoteEnv = new HashMap(); private Process localProcess; + private PTY pty; public LocalProcessBuilder(IRemoteConnection connection, List command) { super(connection, command); @@ -103,20 +108,31 @@ public class LocalProcessBuilder extends AbstractRemoteProcessBuilder { @Override public IRemoteProcess start(int flags) throws IOException { String commandArray[] = command().toArray(new String[0]); + + if ((flags & IRemoteProcessBuilder.ALLOCATE_PTY) != 0) { + environment().put("TERM", "vt100"); //$NON-NLS-1$ //$NON-NLS-2$ + } String environmentArray[] = new String[environment().size()]; int index = 0; for (Entry entry : environment().entrySet()) { environmentArray[index++] = entry.getKey() + "=" + entry.getValue(); //$NON-NLS-1$ } - if (directory() != null) { - try { - localProcess = fProcessFactory.exec(commandArray, environmentArray, - directory().toLocalFile(EFS.NONE, new NullProgressMonitor())); - } catch (CoreException e) { - throw new IOException(e.getMessage()); + + try { + if ((flags & IRemoteProcessBuilder.ALLOCATE_PTY) != 0) { + pty = new PTY(Mode.TERMINAL); + File dir = directory() != null ? directory().toLocalFile(EFS.NONE, new NullProgressMonitor()) : null; + localProcess = ProcessFactory.getFactory().exec(commandArray, environmentArray, dir, pty); + } else { + if (directory() != null) { + localProcess = fProcessFactory.exec(commandArray, environmentArray, + directory().toLocalFile(EFS.NONE, new NullProgressMonitor())); + } else { + localProcess = fProcessFactory.exec(commandArray, environmentArray); + } } - } else { - localProcess = fProcessFactory.exec(commandArray, environmentArray); + } catch (CoreException e) { + throw new IOException(e.getMessage()); } return new RemoteProcess(getRemoteConnection(), this); } @@ -125,6 +141,10 @@ public class LocalProcessBuilder extends AbstractRemoteProcessBuilder { return localProcess; } + public PTY getPty() { + return pty; + } + private IProcessFactory getProcessFactory() { IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint extensionPoint = registry.getExtensionPoint(RemoteCorePlugin.getUniqueIdentifier(), EXTENSION_POINT_ID); diff --git a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchProcessBuilder.java b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchProcessBuilder.java index 6c01b88c6f1..ceead2d9f1b 100644 --- a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchProcessBuilder.java +++ b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchProcessBuilder.java @@ -46,6 +46,7 @@ public class JSchProcessBuilder extends AbstractRemoteProcessBuilder { private Channel fChannel; private Map fNewRemoteEnv; private boolean fPreamble = true; + private boolean fShell = false; public JSchProcessBuilder(IRemoteConnection connection, List command) { super(connection, command); @@ -67,7 +68,8 @@ public class JSchProcessBuilder extends AbstractRemoteProcessBuilder { } public JSchProcessBuilder(IRemoteConnection connection) { - this(connection, "shell"); //$NON-NLS-1$ + this(connection, new ArrayList()); + fShell = true; } @Override @@ -102,7 +104,7 @@ public class JSchProcessBuilder extends AbstractRemoteProcessBuilder { } List cmdArgs = command(); - if (cmdArgs.size() < 1) { + if (cmdArgs.size() < 1 && !fShell) { throw new IndexOutOfBoundsException(); } @@ -161,10 +163,11 @@ public class JSchProcessBuilder extends AbstractRemoteProcessBuilder { } try { - if (cmdArgs.size() == 1 && cmdArgs.get(0).equals("shell")) { //$NON-NLS-1$ + if (fShell) { fChannel = fConnection.getShellChannel(); ((ChannelShell) fChannel).setPty((flags & ALLOCATE_PTY) == ALLOCATE_PTY); - RemoteDebugOptions.trace(RemoteDebugOptions.DEBUG_REMOTE_COMMANDS, "executing command: shell"); //$NON-NLS-1$ + ((ChannelShell) fChannel).setPtyType("vt100"); //$NON-NLS-1$ + RemoteDebugOptions.trace(RemoteDebugOptions.DEBUG_REMOTE_COMMANDS, "executing shell"); //$NON-NLS-1$ } else { fChannel = fConnection.getExecChannel(); String command = buildCommand(remoteCmd, env, clearEnv); diff --git a/bundles/org.eclipse.remote.ui/plugin.properties b/bundles/org.eclipse.remote.ui/plugin.properties index 06336c3c29e..6d387c5c375 100644 --- a/bundles/org.eclipse.remote.ui/plugin.properties +++ b/bundles/org.eclipse.remote.ui/plugin.properties @@ -16,5 +16,4 @@ ConnectionsView.name=Connections ConnectionsContent.name=Connections NewConnectionCommand.name=New Connection DeleteConnectionCommand.name=Delete Connection -OpenTerminalCommand.name=Open Terminal ConnectionProperties.name=Connection diff --git a/bundles/org.eclipse.remote.ui/plugin.xml b/bundles/org.eclipse.remote.ui/plugin.xml index b1de474ad95..59a38f886c1 100644 --- a/bundles/org.eclipse.remote.ui/plugin.xml +++ b/bundles/org.eclipse.remote.ui/plugin.xml @@ -121,11 +121,6 @@ id="org.eclipse.remote.ui.command.deleteConnection" name="%DeleteConnectionCommand.name"> - - @@ -168,23 +163,6 @@ - - - - - - - - - - + + org.eclipse.remote.console-feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/features/org.eclipse.remote.console-feature/build.properties b/features/org.eclipse.remote.console-feature/build.properties new file mode 100644 index 00000000000..db80add92e9 --- /dev/null +++ b/features/org.eclipse.remote.console-feature/build.properties @@ -0,0 +1,4 @@ +bin.includes = feature.xml,\ + feature.properties,\ + epl-v10.html,\ + eclipse_update_120.jpg diff --git a/features/org.eclipse.remote.console-feature/eclipse_update_120.jpg b/features/org.eclipse.remote.console-feature/eclipse_update_120.jpg new file mode 100644 index 00000000000..bfdf708ad61 Binary files /dev/null and b/features/org.eclipse.remote.console-feature/eclipse_update_120.jpg differ diff --git a/features/org.eclipse.remote.console-feature/epl-v10.html b/features/org.eclipse.remote.console-feature/epl-v10.html new file mode 100644 index 00000000000..ed4b196655e --- /dev/null +++ b/features/org.eclipse.remote.console-feature/epl-v10.html @@ -0,0 +1,328 @@ + + + + + + + + +Eclipse Public License - Version 1.0 + + + + + + +
+ +

Eclipse Public License - v 1.0 +

+ +

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER +THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, +REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE +OF THIS AGREEMENT.

+ +

1. DEFINITIONS

+ +

"Contribution" means:

+ +

a) +in the case of the initial Contributor, the initial code and documentation +distributed under this Agreement, and
+b) in the case of each subsequent Contributor:

+ +

i) +changes to the Program, and

+ +

ii) +additions to the Program;

+ +

where +such changes and/or additions to the Program originate from and are distributed +by that particular Contributor. A Contribution 'originates' from a Contributor +if it was added to the Program by such Contributor itself or anyone acting on +such Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in conjunction +with the Program under their own license agreement, and (ii) are not derivative +works of the Program.

+ +

"Contributor" means any person or +entity that distributes the Program.

+ +

"Licensed Patents " mean patent +claims licensable by a Contributor which are necessarily infringed by the use +or sale of its Contribution alone or when combined with the Program.

+ +

"Program" means the Contributions +distributed in accordance with this Agreement.

+ +

"Recipient" means anyone who +receives the Program under this Agreement, including all Contributors.

+ +

2. GRANT OF RIGHTS

+ +

a) +Subject to the terms of this Agreement, each Contributor hereby grants Recipient +a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly +display, publicly perform, distribute and sublicense the Contribution of such +Contributor, if any, and such derivative works, in source code and object code +form.

+ +

b) +Subject to the terms of this Agreement, each Contributor hereby grants +Recipient a non-exclusive, worldwide, royalty-free +patent license under Licensed Patents to make, use, sell, offer to sell, import +and otherwise transfer the Contribution of such Contributor, if any, in source +code and object code form. This patent license shall apply to the combination +of the Contribution and the Program if, at the time the Contribution is added +by the Contributor, such addition of the Contribution causes such combination +to be covered by the Licensed Patents. The patent license shall not apply to +any other combinations which include the Contribution. No hardware per se is +licensed hereunder.

+ +

c) +Recipient understands that although each Contributor grants the licenses to its +Contributions set forth herein, no assurances are provided by any Contributor +that the Program does not infringe the patent or other intellectual property +rights of any other entity. Each Contributor disclaims any liability to Recipient +for claims brought by any other entity based on infringement of intellectual +property rights or otherwise. As a condition to exercising the rights and +licenses granted hereunder, each Recipient hereby assumes sole responsibility +to secure any other intellectual property rights needed, if any. For example, +if a third party patent license is required to allow Recipient to distribute +the Program, it is Recipient's responsibility to acquire that license before +distributing the Program.

+ +

d) +Each Contributor represents that to its knowledge it has sufficient copyright +rights in its Contribution, if any, to grant the copyright license set forth in +this Agreement.

+ +

3. REQUIREMENTS

+ +

A Contributor may choose to distribute the +Program in object code form under its own license agreement, provided that: +

+ +

a) +it complies with the terms and conditions of this Agreement; and

+ +

b) +its license agreement:

+ +

i) +effectively disclaims on behalf of all Contributors all warranties and +conditions, express and implied, including warranties or conditions of title +and non-infringement, and implied warranties or conditions of merchantability +and fitness for a particular purpose;

+ +

ii) +effectively excludes on behalf of all Contributors all liability for damages, +including direct, indirect, special, incidental and consequential damages, such +as lost profits;

+ +

iii) +states that any provisions which differ from this Agreement are offered by that +Contributor alone and not by any other party; and

+ +

iv) +states that source code for the Program is available from such Contributor, and +informs licensees how to obtain it in a reasonable manner on or through a +medium customarily used for software exchange.

+ +

When the Program is made available in source +code form:

+ +

a) +it must be made available under this Agreement; and

+ +

b) a +copy of this Agreement must be included with each copy of the Program.

+ +

Contributors may not remove or alter any +copyright notices contained within the Program.

+ +

Each Contributor must identify itself as the +originator of its Contribution, if any, in a manner that reasonably allows +subsequent Recipients to identify the originator of the Contribution.

+ +

4. COMMERCIAL DISTRIBUTION

+ +

Commercial distributors of software may +accept certain responsibilities with respect to end users, business partners +and the like. While this license is intended to facilitate the commercial use +of the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create potential +liability for other Contributors. Therefore, if a Contributor includes the +Program in a commercial product offering, such Contributor ("Commercial +Contributor") hereby agrees to defend and indemnify every other +Contributor ("Indemnified Contributor") against any losses, damages and +costs (collectively "Losses") arising from claims, lawsuits and other +legal actions brought by a third party against the Indemnified Contributor to +the extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may participate +in any such claim at its own expense.

+ +

For example, a Contributor might include the +Program in a commercial product offering, Product X. That Contributor is then a +Commercial Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance claims and +warranties are such Commercial Contributor's responsibility alone. Under this +section, the Commercial Contributor would have to defend claims against the +other Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages.

+ +

5. NO WARRANTY

+ +

EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, +WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, +MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and distributing the +Program and assumes all risks associated with its exercise of rights under this +Agreement , including but not limited to the risks and costs of program errors, +compliance with applicable laws, damage to or loss of data, programs or +equipment, and unavailability or interruption of operations.

+ +

6. DISCLAIMER OF LIABILITY

+ +

EXCEPT AS EXPRESSLY SET FORTH IN THIS +AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF +THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGES.

+ +

7. GENERAL

+ +

If any provision of this Agreement is invalid +or unenforceable under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this Agreement, and without +further action by the parties hereto, such provision shall be reformed to the +minimum extent necessary to make such provision valid and enforceable.

+ +

If Recipient institutes patent litigation +against any entity (including a cross-claim or counterclaim in a lawsuit) +alleging that the Program itself (excluding combinations of the Program with +other software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the date +such litigation is filed.

+ +

All Recipient's rights under this Agreement +shall terminate if it fails to comply with any of the material terms or +conditions of this Agreement and does not cure such failure in a reasonable +period of time after becoming aware of such noncompliance. If all Recipient's +rights under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive.

+ +

Everyone is permitted to copy and distribute +copies of this Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The Agreement +Steward reserves the right to publish new versions (including revisions) of +this Agreement from time to time. No one other than the Agreement Steward has +the right to modify this Agreement. The Eclipse Foundation is the initial +Agreement Steward. The Eclipse Foundation may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved.

+ +

This Agreement is governed by the laws of the +State of New York and the intellectual property laws of the United States of +America. No party to this Agreement will bring a legal action under this +Agreement more than one year after the cause of action arose. Each party waives +its rights to a jury trial in any resulting litigation.

+ +

 

+ +
+ + + + \ No newline at end of file diff --git a/features/org.eclipse.remote.console-feature/feature.properties b/features/org.eclipse.remote.console-feature/feature.properties new file mode 100644 index 00000000000..c25ce255306 --- /dev/null +++ b/features/org.eclipse.remote.console-feature/feature.properties @@ -0,0 +1,24 @@ +################################################################################# +# Copyright (c) 2015 QNX Software Systems 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 +################################################################################# + +# "featureName" property - name of the feature +featureName=Remote Command Shell Console + +# "providerName" property - name of the company that provides the feature +providerName=Eclipse PTP + +# "description" property - description of the feature +description=Provides serial port services for the remote framework + +# copyright +copyright=\ +Copyright (c) 2015 QNX Software Corporation.\n\ +All rights reserved. This program and the accompanying materials\n\ +are made available under the terms of the Eclipse Public License v1.0\n\ +which accompanies this distribution, and is available at\n\ +http://www.eclipse.org/legal/epl-v10.html\n diff --git a/features/org.eclipse.remote.console-feature/feature.xml b/features/org.eclipse.remote.console-feature/feature.xml new file mode 100644 index 00000000000..4a9180dd711 --- /dev/null +++ b/features/org.eclipse.remote.console-feature/feature.xml @@ -0,0 +1,29 @@ + + + + + %description + + + + %copyright + + + + %license + + + + + diff --git a/features/org.eclipse.remote.console-feature/pom.xml b/features/org.eclipse.remote.console-feature/pom.xml new file mode 100644 index 00000000000..bc181190727 --- /dev/null +++ b/features/org.eclipse.remote.console-feature/pom.xml @@ -0,0 +1,49 @@ + + + 4.0.0 + + + org.eclipse.remote + remote-parent + 1.1.1-SNAPSHOT + ../../releng/org.eclipse.remote.build/pom.xml + + + org.eclipse.remote.features + org.eclipse.remote.console + 1.0.0-SNAPSHOT + eclipse-feature + + + + + org.eclipse.tycho.extras + tycho-source-feature-plugin + + + source-feature + package + + source-feature + + + + + + org.eclipse.tycho + tycho-p2-plugin + ${tycho-version} + + + attached-p2-metadata + package + + p2-metadata + + + + + + + diff --git a/releng/org.eclipse.remote.build/mars.target b/releng/org.eclipse.remote.build/mars.target index c8f48efd777..b047b1de5c3 100644 --- a/releng/org.eclipse.remote.build/mars.target +++ b/releng/org.eclipse.remote.build/mars.target @@ -15,6 +15,9 @@ + + + diff --git a/releng/org.eclipse.remote.build/pom.xml b/releng/org.eclipse.remote.build/pom.xml index 84cd5fcd51e..af114b94f71 100644 --- a/releng/org.eclipse.remote.build/pom.xml +++ b/releng/org.eclipse.remote.build/pom.xml @@ -23,7 +23,7 @@ 4.5milestones http://download.eclipse.org/eclipse/updates/${platform-version}/ http://download.eclipse.org/cbi/updates/license/ - http://download.eclipse.org/tm/updates/4.0milestones/ + http://download.eclipse.org/tm/terminal/builds/development/nightly/ http://download.eclipse.org/tools/cdt/builds/master/nightly/ /home/data/httpd/download.eclipse.org/tools/ptp/builds/remote/${remote-release} @@ -50,9 +50,12 @@ ../../bundles/org.eclipse.remote.ui ../../features/org.eclipse.remote-feature ../../releng/org.eclipse.remote.repo - + + + ../../bundles/org.eclipse.remote.console + ../../features/org.eclipse.remote.console-feature ../../bundles/org.eclipse.remote.serial.core ../../bundles/org.eclipse.remote.serial.ui diff --git a/releng/org.eclipse.remote.repo/category.xml b/releng/org.eclipse.remote.repo/category.xml index e1873f917f1..5bda418eda8 100644 --- a/releng/org.eclipse.remote.repo/category.xml +++ b/releng/org.eclipse.remote.repo/category.xml @@ -6,10 +6,22 @@ - + + + + + + + + + + + +