Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2011-10-18 14:15:05 +0000
committerUwe Stieber2011-10-18 14:15:05 +0000
commit5cbf4e73284d06f3ecbc75bcce722aaac5e783ff (patch)
treea3316b380b9c04841a8e22c5f2d46d6073788fd4 /target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src
parent6b3b514c5e76e31c28774e7b88420eef7bccc280 (diff)
downloadorg.eclipse.tcf-5cbf4e73284d06f3ecbc75bcce722aaac5e783ff.tar.gz
org.eclipse.tcf-5cbf4e73284d06f3ecbc75bcce722aaac5e783ff.tar.xz
org.eclipse.tcf-5cbf4e73284d06f3ecbc75bcce722aaac5e783ff.zip
Target Explorer: Added "Launch Terminal" infra-structure
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src')
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/help/IContextHelpIds.java29
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/interfaces/ILauncherDelegate.java40
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java274
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/internal/handler/LaunchTerminalCommandHandler.java58
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/AbstractLauncherDelegate.java20
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/LauncherDelegateManager.java102
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/nls/Messages.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/nls/Messages.properties4
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/types/ConnectorManager.java2
9 files changed, 532 insertions, 1 deletions
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/help/IContextHelpIds.java b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/help/IContextHelpIds.java
new file mode 100644
index 000000000..c5aa435ad
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/help/IContextHelpIds.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.te.ui.terminals.help;
+
+import org.eclipse.tm.te.ui.terminals.activator.UIPlugin;
+
+
+/**
+ * UI Context help id definitions.
+ */
+public interface IContextHelpIds {
+
+ /**
+ * UI plug-in common context help id prefix.
+ */
+ public final static String PREFIX = UIPlugin.getUniqueIdentifier() + "."; //$NON-NLS-1$
+
+ /**
+ * Launch terminal settings dialog.
+ */
+ public final static String LAUNCH_TERMINAL_SETTINGS_DIALOG = PREFIX + "LaunchTerminalSettingsDialog"; //$NON-NLS-1$
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/interfaces/ILauncherDelegate.java b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/interfaces/ILauncherDelegate.java
new file mode 100644
index 000000000..8d6d17360
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/interfaces/ILauncherDelegate.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.te.ui.terminals.interfaces;
+
+import org.eclipse.tm.te.runtime.interfaces.callback.ICallback;
+import org.eclipse.tm.te.runtime.interfaces.extensions.IExecutableExtension;
+import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tm.te.ui.controls.BaseDialogPageControl;
+import org.eclipse.tm.te.ui.controls.interfaces.IWizardConfigurationPanel;
+
+/**
+ * Terminal launcher delegate.
+ */
+public interface ILauncherDelegate extends IExecutableExtension {
+
+ /**
+ * Returns the configuration panel instance to present to the
+ * user. The instance must be always the same on subsequent calls
+ * until disposed.
+ *
+ * @param parentControl The parent control. Must not be <code>null</code>.
+ * @return The configuration panel instance.
+ */
+ public IWizardConfigurationPanel getPanel(BaseDialogPageControl parentControl);
+
+ /**
+ * Execute the terminal launch.
+ *
+ * @param properties The properties. Must not be <code>null</code>.
+ * @param callback The callback or <code>null</code>.
+ */
+ public void execute(IPropertiesContainer properties, ICallback callback);
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java
new file mode 100644
index 000000000..451881f41
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.te.ui.terminals.internal.dialogs;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.dialogs.IDialogPage;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+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;
+import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tm.te.runtime.properties.PropertiesContainer;
+import org.eclipse.tm.te.ui.controls.BaseWizardConfigurationPanelControl;
+import org.eclipse.tm.te.ui.controls.interfaces.IWizardConfigurationPanel;
+import org.eclipse.tm.te.ui.jface.dialogs.CustomTrayDialog;
+import org.eclipse.tm.te.ui.swt.SWTControlUtil;
+import org.eclipse.tm.te.ui.terminals.help.IContextHelpIds;
+import org.eclipse.tm.te.ui.terminals.interfaces.ILauncherDelegate;
+import org.eclipse.tm.te.ui.terminals.launcher.LauncherDelegateManager;
+import org.eclipse.tm.te.ui.terminals.nls.Messages;
+import org.eclipse.tm.te.ui.wizards.interfaces.ISharedDataWizardPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * Launch terminal settings dialog implementation.
+ */
+public class LaunchTerminalSettingsDialog extends CustomTrayDialog {
+ // The parent selection
+ private ISelection selection = null;
+
+ // The subcontrols
+ /* default */ Combo terminals;
+ /* default */ SettingsPanelControl settings;
+
+ // Map the label added to the combobox to the corresponding launcher delegate.
+ private final Map<String, ILauncherDelegate> label2delegate = new HashMap<String, ILauncherDelegate>();
+
+ // The data object containing the currently selected settings
+ private IPropertiesContainer data = null;
+
+ /**
+ * The control managing the terminal setting panels.
+ */
+ protected class SettingsPanelControl extends BaseWizardConfigurationPanelControl {
+
+ /**
+ * Constructor.
+ *
+ * @param parentPage The parent dialog page this control is embedded in.
+ * Might be <code>null</code> if the control is not associated with a page.
+ */
+ public SettingsPanelControl(IDialogPage parentPage) {
+ super(parentPage);
+ setPanelIsGroup(true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.ui.controls.BaseWizardConfigurationPanelControl#getGroupLabel()
+ */
+ @Override
+ public String getGroupLabel() {
+ return Messages.LaunchTerminalSettingsDialog_group_label;
+ }
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param shell The parent shell or <code>null</code>.
+ */
+ public LaunchTerminalSettingsDialog(Shell shell) {
+ super(shell, IContextHelpIds.LAUNCH_TERMINAL_SETTINGS_DIALOG);
+ }
+
+ /**
+ * Sets the parent selection.
+ *
+ * @param selection The parent selection or <code>null</code>.
+ */
+ public void setSelection(ISelection selection) {
+ this.selection = selection;
+ }
+
+ /**
+ * Returns the parent selection.
+ *
+ * @return The parent selection or <code>null</code>.
+ */
+ public ISelection getSelection() {
+ return selection;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.ui.jface.dialogs.CustomTrayDialog#dispose()
+ */
+ @Override
+ protected void dispose() {
+ if (settings != null) { settings.dispose(); settings = null; }
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.ui.jface.dialogs.CustomTrayDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ setDialogTitle(Messages.LaunchTerminalSettingsDialog_title);
+
+ Composite composite = (Composite)super.createDialogArea(parent);
+
+ Composite panel = new Composite(composite, SWT.NONE);
+ GridLayout layout = new GridLayout(2, false);
+ layout.marginHeight = 0; layout.marginWidth = 0;
+ panel.setLayout(layout);
+ panel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+ Label label = new Label(panel, SWT.HORIZONTAL);
+ label.setText(Messages.LaunchTerminalSettingsDialog_combo_label);
+
+ terminals = new Combo(panel, SWT.READ_ONLY);
+ terminals.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ terminals.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ settings.showConfigurationPanel(terminals.getText());
+ }
+ });
+
+ // fill the combo with content
+ fillCombo(terminals);
+
+ // Create the settings panel control
+ settings = new SettingsPanelControl(null);
+
+ // Create and add the panels
+ for (String terminalLabel : terminals.getItems()) {
+ // Get the corresponding delegate
+ ILauncherDelegate delegate = label2delegate.get(terminalLabel);
+ Assert.isNotNull(delegate);
+ // Get the wizard configuration panel instance
+ IWizardConfigurationPanel configPanel = delegate.getPanel(settings);
+ Assert.isNotNull(configPanel);
+
+ settings.addConfigurationPanel(terminalLabel, configPanel);
+ }
+
+ // Setup the panel control
+ settings.setupPanel(panel, terminals.getItems(), new FormToolkit(panel.getDisplay()));
+ GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ layoutData.horizontalSpan = 2;
+ layoutData.widthHint = convertWidthInCharsToPixels(30);
+ layoutData.heightHint = convertHeightInCharsToPixels(5);
+ settings.getPanel().setLayoutData(layoutData);
+
+ // Preselect the first terminal launcher
+ terminals.select(0);
+ settings.showConfigurationPanel(terminals.getText());
+
+ SWTControlUtil.setEnabled(terminals, terminals.getItemCount() > 1);
+
+ restoreWidgetValues();
+
+ applyDialogFont(composite);
+ return composite;
+ }
+
+ /**
+ * Fill the given combo with content. The content are the terminal
+ * launcher delegate labels.
+ *
+ * @param combo The combo. Must not be <code>null</code>.
+ */
+ protected void fillCombo(Combo combo) {
+ Assert.isNotNull(combo);
+
+ List<String> items = new ArrayList<String>();
+
+ ILauncherDelegate[] delegates = LauncherDelegateManager.getInstance().getLauncherDelegates(false);
+ for (ILauncherDelegate delegate : delegates) {
+ String label = delegate.getLabel();
+ if (label == null || "".equals(label.trim())) label = delegate.getId(); //$NON-NLS-1$
+ label2delegate.put(label, delegate);
+ items.add(label);
+ }
+
+ Collections.sort(items);
+ combo.setItems(items.toArray(new String[items.size()]));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.ui.jface.dialogs.CustomTrayDialog#saveWidgetValues()
+ */
+ @Override
+ protected void saveWidgetValues() {
+ IDialogSettings settings = getDialogSettings();
+ if (settings != null) {
+ settings.put("terminalLabel", SWTControlUtil.getText(terminals)); //$NON-NLS-1$
+ this.settings.saveWidgetValues(settings, null);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.ui.jface.dialogs.CustomTrayDialog#restoreWidgetValues()
+ */
+ @Override
+ protected void restoreWidgetValues() {
+ IDialogSettings settings = getDialogSettings();
+ if (settings != null) {
+ String terminalLabel = settings.get("terminalLabel"); //$NON-NLS-1$
+ int index = terminalLabel != null ? Arrays.asList(terminals.getItems()).indexOf(terminalLabel) : -1;
+ if (index != -1) {
+ terminals.select(index);
+ this.settings.showConfigurationPanel(terminals.getText());
+ }
+
+ this.settings.restoreWidgetValues(settings, null);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.ui.jface.dialogs.CustomTrayDialog#okPressed()
+ */
+ @Override
+ protected void okPressed() {
+ data = new PropertiesContainer();
+
+ // Store the id of the selected delegate
+ data.setProperty("delegateId", label2delegate.get(terminals.getText()).getId()); //$NON-NLS-1$
+ // Store the selection
+ data.setProperty("selection", selection); //$NON-NLS-1$
+
+ // Store the delegate specific settings
+ IWizardConfigurationPanel panel = this.settings.getConfigurationPanel(terminals.getText());
+ if (panel instanceof ISharedDataWizardPage) {
+ ((ISharedDataWizardPage)panel).extractData(data);
+ }
+
+ super.okPressed();
+ }
+
+ /**
+ * Returns the currently selected settings.
+ * <p>
+ * The settings are extracted from the UI widgets once
+ * OK got pressed.
+ *
+ * @return The currently selected settings or <code>null</code>.
+ */
+ public IPropertiesContainer getSettings() {
+ return data;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/internal/handler/LaunchTerminalCommandHandler.java b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/internal/handler/LaunchTerminalCommandHandler.java
new file mode 100644
index 000000000..8ffbc2459
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/internal/handler/LaunchTerminalCommandHandler.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.te.ui.terminals.internal.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.tm.te.runtime.interfaces.properties.IPropertiesContainer;
+import org.eclipse.tm.te.ui.terminals.interfaces.ILauncherDelegate;
+import org.eclipse.tm.te.ui.terminals.internal.dialogs.LaunchTerminalSettingsDialog;
+import org.eclipse.tm.te.ui.terminals.launcher.LauncherDelegateManager;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Launch terminal command handler implementation.
+ */
+public class LaunchTerminalCommandHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ // Get the active shell
+ Shell shell = HandlerUtil.getActiveShell(event);
+ // Get the current selection
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+
+ // Create the launch terminal settings dialog
+ LaunchTerminalSettingsDialog dialog = new LaunchTerminalSettingsDialog(shell);
+ dialog.setSelection(selection);
+ if (dialog.open() == Window.OK) {
+ // Get the terminal settings from the dialog
+ IPropertiesContainer settings = dialog.getSettings();
+ if (settings != null) {
+ String delegateId = settings.getStringProperty("delegateId"); //$NON-NLS-1$
+ Assert.isNotNull(delegateId);
+ ILauncherDelegate delegate = LauncherDelegateManager.getInstance().getLauncherDelegate(delegateId, false);
+ Assert.isNotNull(delegateId);
+ delegate.execute(settings, null);
+ }
+ }
+
+ return null;
+ }
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/AbstractLauncherDelegate.java b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/AbstractLauncherDelegate.java
new file mode 100644
index 000000000..c339eb404
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/AbstractLauncherDelegate.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.te.ui.terminals.launcher;
+
+import org.eclipse.tm.te.runtime.extensions.ExecutableExtension;
+import org.eclipse.tm.te.ui.terminals.interfaces.ILauncherDelegate;
+
+/**
+ * Abstract launcher delegate implementation.
+ */
+public abstract class AbstractLauncherDelegate extends ExecutableExtension implements ILauncherDelegate {
+
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/LauncherDelegateManager.java b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/LauncherDelegateManager.java
new file mode 100644
index 000000000..50bbf06a0
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/launcher/LauncherDelegateManager.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.te.ui.terminals.launcher;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager;
+import org.eclipse.tm.te.runtime.extensions.ExecutableExtensionProxy;
+import org.eclipse.tm.te.ui.terminals.interfaces.ILauncherDelegate;
+
+/**
+ * Terminal launcher delegate manager implementation.
+ */
+public class LauncherDelegateManager extends AbstractExtensionPointManager<ILauncherDelegate> {
+
+ /*
+ * Thread save singleton instance creation.
+ */
+ private static class LazyInstanceHolder {
+ public static LauncherDelegateManager instance = new LauncherDelegateManager();
+ }
+
+ /**
+ * Returns the singleton instance.
+ */
+ public static LauncherDelegateManager getInstance() {
+ return LazyInstanceHolder.instance;
+ }
+
+ /**
+ * Constructor.
+ */
+ LauncherDelegateManager() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager#getExtensionPointId()
+ */
+ @Override
+ protected String getExtensionPointId() {
+ return "org.eclipse.tm.te.ui.terminals.launcherDelegates"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tm.te.runtime.extensions.AbstractExtensionPointManager#getConfigurationElementName()
+ */
+ @Override
+ protected String getConfigurationElementName() {
+ return "delegate"; //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the list of all contributed terminal launcher delegates.
+ *
+ * @param unique If <code>true</code>, the method returns new instances for each
+ * contributed terminal launcher delegate.
+ *
+ * @return The list of contributed terminal launcher delegates, or an empty array.
+ */
+ public ILauncherDelegate[] getLauncherDelegates(boolean unique) {
+ List<ILauncherDelegate> contributions = new ArrayList<ILauncherDelegate>();
+ Collection<ExecutableExtensionProxy<ILauncherDelegate>> launcherDelegates = getExtensions().values();
+ for (ExecutableExtensionProxy<ILauncherDelegate> launcherDelegate : launcherDelegates) {
+ ILauncherDelegate instance = unique ? launcherDelegate.newInstance() : launcherDelegate.getInstance();
+ if (instance != null && !contributions.contains(instance)) {
+ contributions.add(instance);
+ }
+ }
+
+ return contributions.toArray(new ILauncherDelegate[contributions.size()]);
+ }
+
+ /**
+ * Returns the terminal launcher delegate identified by its unique id. If no terminal
+ * launcher delegate with the specified id is registered, <code>null</code> is returned.
+ *
+ * @param id The unique id of the terminal launcher delegate or <code>null</code>
+ * @param unique If <code>true</code>, the method returns new instances of the terminal launcher delegate contribution.
+ *
+ * @return The terminal launcher delegate instance or <code>null</code>.
+ */
+ public ILauncherDelegate getLauncherDelegate(String id, boolean unique) {
+ ILauncherDelegate contribution = null;
+ if (getExtensions().containsKey(id)) {
+ ExecutableExtensionProxy<ILauncherDelegate> proxy = getExtensions().get(id);
+ // Get the extension instance
+ contribution = unique ? proxy.newInstance() : proxy.getInstance();
+ }
+
+ return contribution;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/nls/Messages.java b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/nls/Messages.java
index 97533a523..af8552000 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/nls/Messages.java
@@ -45,4 +45,8 @@ public class Messages extends NLS {
public static String TerminalService_error_cannotCreateConnector;
public static String TerminalService_defaultTitle;
+
+ public static String LaunchTerminalSettingsDialog_title;
+ public static String LaunchTerminalSettingsDialog_combo_label;
+ public static String LaunchTerminalSettingsDialog_group_label;
}
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/nls/Messages.properties
index 8ae7fd1d8..6e86cfb30 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/nls/Messages.properties
@@ -19,3 +19,7 @@ InputStreamMonitor_error_writingToStream=Exception when writing to stream. Possi
TerminalService_error_cannotCreateConnector=Cannot create a valid terminal connector instance from the provided terminal properties.
TerminalService_defaultTitle=Console
+
+LaunchTerminalSettingsDialog_title=Launch Terminal
+LaunchTerminalSettingsDialog_combo_label=Choose terminal:
+LaunchTerminalSettingsDialog_group_label=Settings
diff --git a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/types/ConnectorManager.java b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/types/ConnectorManager.java
index dc9014c6a..9b4cebe35 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/types/ConnectorManager.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.ui.terminals/src/org/eclipse/tm/te/ui/terminals/types/ConnectorManager.java
@@ -87,7 +87,7 @@ public class ConnectorManager extends AbstractExtensionPointManager<IConnectorTy
* @param id The unique id of the terminal connector type or <code>null</code>
* @param unique If <code>true</code>, the method returns new instances of the terminal connector type contribution.
*
- * @return The status handler instance or <code>null</code>.
+ * @return The terminal connector type instance or <code>null</code>.
*/
public IConnectorType getConnectorType(String id, boolean unique) {
IConnectorType contribution = null;

Back to the top