diff --git a/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF index 31e74c889b6..b138257a87b 100644 --- a/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF +++ b/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.debug.core; singleton:=true -Bundle-Version: 7.2.0.qualifier +Bundle-Version: 7.3.0.qualifier Bundle-Activator: org.eclipse.cdt.debug.core.CDebugCorePlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/debug/org.eclipse.cdt.debug.core/pom.xml b/debug/org.eclipse.cdt.debug.core/pom.xml index 3bfb96892a0..c99b93cb60f 100644 --- a/debug/org.eclipse.cdt.debug.core/pom.xml +++ b/debug/org.eclipse.cdt.debug.core/pom.xml @@ -11,7 +11,7 @@ ../../pom.xml - 7.2.0-SNAPSHOT + 7.3.0-SNAPSHOT org.eclipse.cdt.debug.core eclipse-plugin diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IConnectHandler.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IConnectHandler.java new file mode 100644 index 00000000000..3e681e5d09d --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/IConnectHandler.java @@ -0,0 +1,21 @@ +/******************************************************************************* + * Copyright (c) 2012 Ericsson 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: + * Marc Khouzam (Ericsson) - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.debug.core.model; + +import org.eclipse.debug.core.commands.IDebugCommandHandler; + +/** + * Handler interface to for the connect command + * + * @since 7.3 + */ +public interface IConnectHandler extends IDebugCommandHandler { +} diff --git a/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF index e68437be26c..c3c06a0139b 100644 --- a/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF +++ b/debug/org.eclipse.cdt.debug.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.debug.ui; singleton:=true -Bundle-Version: 7.2.0.qualifier +Bundle-Version: 7.3.0.qualifier Bundle-Activator: org.eclipse.cdt.debug.ui.CDebugUIPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/obj16/connect.gif b/debug/org.eclipse.cdt.debug.ui/icons/obj16/connect.gif similarity index 100% rename from dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/icons/full/obj16/connect.gif rename to debug/org.eclipse.cdt.debug.ui/icons/obj16/connect.gif diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.properties b/debug/org.eclipse.cdt.debug.ui/plugin.properties index 76acb8514ee..a68c817bb15 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.properties +++ b/debug/org.eclipse.cdt.debug.ui/plugin.properties @@ -10,6 +10,7 @@ # IBM Corporation # Patrick Chuong (Texas Instruments) - Pin and Clone Supports (Bug 331781) # Dobrin Alexiev (Texas Instruments) - initial API and implementation (bug 336876) +# Marc Khouzam (Ericsson) - Added support for connect command (Bug 365601) ############################################################################### pluginName=C/C++ Development Tools Debugger UI @@ -200,6 +201,12 @@ Uncall.name = Uncall Uncall.description = Perform Uncall Uncall.label = Uncall +# Connect command +Connect.name = Connect +Connect.description = Connect to a process +Connect.label = Connect... +Connect.tooltip = Connect to a process + # Debug View layout DebugViewLayoutActionSet.label = Debug View Layout DebugViewLayoutCategory.name = Debug View Layout Commands diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml index dba67c653a7..d1ae7a9b7c4 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml @@ -1990,6 +1990,13 @@ id="org.eclipse.cdt.debug.ui.command.ungroupDebugContexts" name="%UngroupDebugContexts.name"> + + + @@ -2052,6 +2059,10 @@ class="org.eclipse.cdt.debug.internal.ui.commands.UngroupDebugContextsCommandHandler" commandId="org.eclipse.cdt.debug.ui.command.ungroupDebugContexts"> + + @@ -2494,6 +2505,27 @@ + + + + + + + + + diff --git a/debug/org.eclipse.cdt.debug.ui/pom.xml b/debug/org.eclipse.cdt.debug.ui/pom.xml index 64b82cebb62..f23e6501c7d 100644 --- a/debug/org.eclipse.cdt.debug.ui/pom.xml +++ b/debug/org.eclipse.cdt.debug.ui/pom.xml @@ -11,7 +11,7 @@ ../../pom.xml - 7.2.0-SNAPSHOT + 7.3.0-SNAPSHOT org.eclipse.cdt.debug.ui eclipse-plugin diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ConnectCommandHandler.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ConnectCommandHandler.java new file mode 100644 index 00000000000..7bfbd70b68e --- /dev/null +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/commands/ConnectCommandHandler.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2012 Ericsson 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: + * Marc Khouzam (Ericsson) - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.debug.internal.ui.commands; + +import org.eclipse.cdt.debug.core.model.IConnectHandler; +import org.eclipse.debug.ui.actions.DebugCommandHandler; + +/** + * Command handler to trigger a connect operation + * + * @since 7.3 + */ +public class ConnectCommandHandler extends DebugCommandHandler { + @Override + protected Class getCommandType() { + return IConnectHandler.class; + } +} diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.properties b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.properties index 4a343bfaf70..6248385f21a 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.properties +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.properties @@ -13,9 +13,6 @@ pluginName=GDB DSF Debugger Integration UI providerName=Eclipse CDT -action.connect.label = Connect... -action.connect.tooltip = Connect to a process - gdbPreferencePage.name = GDB launchTab.main.name=Main diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml index 62f27c7673e..b59f15537b5 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml @@ -210,54 +210,6 @@ plugin="org.eclipse.cdt.dsf.gdb.ui"> - - - - - - - - - - - - - - - - - - - - - - - - { +public class ProcessInfo implements IProcessExtendedInfo, Comparable { private final int pid; private final String name; private final String[] cores; diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java similarity index 83% rename from dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java rename to dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java index 04ca9d980ee..d90dc5752ac 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/actions/GdbConnectCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java @@ -9,16 +9,18 @@ * Ericsson - initial API and implementation * Marc Khouzam (Ericsson) - Add support for multi-attach (Bug 293679) *******************************************************************************/ -package org.eclipse.cdt.dsf.gdb.internal.ui.actions; +package org.eclipse.cdt.dsf.gdb.internal.ui.commands; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.RejectedExecutionException; +import org.eclipse.cdt.debug.core.model.IConnectHandler; import org.eclipse.cdt.dsf.concurrent.CountingRequestMonitor; import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; import org.eclipse.cdt.dsf.concurrent.DsfExecutor; @@ -35,8 +37,11 @@ import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService; import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; import org.eclipse.cdt.dsf.gdb.actions.IConnect; import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; +import org.eclipse.cdt.dsf.gdb.internal.ui.actions.ProcessInfo; import org.eclipse.cdt.dsf.gdb.internal.ui.launching.LaunchUIMessages; +import org.eclipse.cdt.dsf.gdb.internal.ui.launching.ProcessPrompter; import org.eclipse.cdt.dsf.gdb.internal.ui.launching.ProcessPrompter.PrompterInfo; +import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch; import org.eclipse.cdt.dsf.gdb.launching.IProcessExtendedInfo; import org.eclipse.cdt.dsf.gdb.launching.LaunchMessages; import org.eclipse.cdt.dsf.gdb.service.IGDBBackend; @@ -45,22 +50,24 @@ import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses.IGdbThreadDMData; import org.eclipse.cdt.dsf.gdb.service.SessionType; import org.eclipse.cdt.dsf.service.DsfServicesTracker; import org.eclipse.cdt.dsf.service.DsfSession; +import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IStatusHandler; +import org.eclipse.debug.core.IRequest; +import org.eclipse.debug.core.commands.AbstractDebugCommand; +import org.eclipse.debug.core.commands.IDebugCommandRequest; +import org.eclipse.debug.core.commands.IEnabledStateRequest; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.progress.UIJob; -public class GdbConnectCommand implements IConnect { +public class GdbConnectCommand extends AbstractDebugCommand implements IConnectHandler, IConnect { private final DsfExecutor fExecutor; private final DsfServicesTracker fTracker; @@ -85,7 +92,19 @@ public class GdbConnectCommand implements IConnect { } @Override - public boolean canConnect() { + protected boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest request) + throws CoreException + { + return canConnect(); + } + + /* + * This method should not be called from the UI thread. + * (non-Javadoc) + * @see org.eclipse.cdt.dsf.gdb.actions.IConnect#canConnect() + */ + @Override + public boolean canConnect() { Query canConnectQuery = new Query() { @Override public void execute(DataRequestMonitor rm) { @@ -115,10 +134,10 @@ public class GdbConnectCommand implements IConnect { /** * This job will prompt the user to select a set of processes * to attach too. - * We need a job because prompter.handleStatus will block and + * We need a job because the ProcessPrompter will block and * we don't want to block the executor. */ - protected class PromptForPidJob extends Job { + protected class PromptForPidJob extends UIJob { // The list of processes used in the case of an ATTACH session IProcessExtendedInfo[] fProcessList = null; @@ -133,25 +152,14 @@ public class GdbConnectCommand implements IConnect { } @Override - protected IStatus run(IProgressMonitor monitor) { - IStatus promptStatus = new Status(IStatus.INFO, "org.eclipse.debug.ui", 200/*STATUS_HANDLER_PROMPT*/, "", null); //$NON-NLS-1$//$NON-NLS-2$ - final IStatus processPromptStatus = new Status(IStatus.INFO, "org.eclipse.cdt.dsf.gdb.ui", 100, "", null); //$NON-NLS-1$//$NON-NLS-2$ - - final IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus); - + public IStatus runInUIThread(IProgressMonitor monitor) { final Status NO_PID_STATUS = new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, -1, LaunchMessages.getString("LocalAttachLaunchDelegate.No_Process_ID_selected"), //$NON-NLS-1$ null); - if (prompter == null) { - fRequestMonitor.setStatus(NO_PID_STATUS); - fRequestMonitor.done(); - return Status.OK_STATUS; - } - try { PrompterInfo info = new PrompterInfo(fNewProcessSupported, fProcessList); - Object result = prompter.handleStatus(processPromptStatus, info); + Object result = new ProcessPrompter().handleStatus(null, info); if (result == null) { fRequestMonitor.cancel(); } else if (result instanceof IProcessExtendedInfo[] || result instanceof String) { @@ -242,21 +250,34 @@ public class GdbConnectCommand implements IConnect { } @Override - public void connect(RequestMonitor requestMonitor) - { - // Create a fake rm to avoid null pointer exceptions - final RequestMonitor rm; - if (requestMonitor == null) { - rm = new RequestMonitor(fExecutor, null); - } else { - rm = requestMonitor; - } - - // Don't wait for the operation to finish because this - // method can be called from the UI thread, and it will - // block it, which is bad, because we need to use the UI - // thread to prompt the user for the process to choose. - // This is why we simply use a DsfRunnable. + protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException { + Query connectQuery = new Query() { + @Override + public void execute(DataRequestMonitor rm) { + connect(rm); + } + }; + try { + fExecutor.execute(connectQuery); + connectQuery.get(); + } catch (InterruptedException e) { + } catch (ExecutionException e) { + } catch (CancellationException e) { + // Nothing to do, just ignore the command since the user + // cancelled it. + } catch (RejectedExecutionException e) { + // Can be thrown if the session is shutdown + } + } + + /* + * This method should not be called from the UI thread. + * (non-Javadoc) + * @see org.eclipse.cdt.dsf.gdb.actions.IConnect#canConnect() + */ + @Override + public void connect(final RequestMonitor rm) + { fExecutor.execute(new DsfRunnable() { @Override public void run() { @@ -265,12 +286,15 @@ public class GdbConnectCommand implements IConnect { if (procService != null && commandControl != null) { final ICommandControlDMContext controlCtx = commandControl.getContext(); - procService.isDebugNewProcessSupported(controlCtx, new DataRequestMonitor(fExecutor, null) { + + // First check if the "New..." button should be enabled. + procService.isDebugNewProcessSupported(controlCtx, new DataRequestMonitor(fExecutor, rm) { @Override protected void handleCompleted() { final boolean newProcessSupported = isSuccess() && getData(); - procService.getRunningProcesses( + // Now get the list of all processes + procService.getRunningProcesses( controlCtx, new DataRequestMonitor(fExecutor, rm) { @Override @@ -282,8 +306,11 @@ public class GdbConnectCommand implements IConnect { new CountingRequestMonitor(fExecutor, rm) { @Override protected void handleSuccess() { + // Prompt the user to choose one or more processes, or to start a new one new PromptForPidJob( - LaunchUIMessages.getString("ProcessPrompter.PromptJob"), newProcessSupported, procInfoList.toArray(new IProcessExtendedInfo[0]), //$NON-NLS-1$ + LaunchUIMessages.getString("ProcessPrompter.PromptJob"), //$NON-NLS-1$ + newProcessSupported, + procInfoList.toArray(new IProcessExtendedInfo[procInfoList.size()]), new DataRequestMonitor(fExecutor, rm) { @Override protected void handleCancel() { @@ -299,8 +326,7 @@ public class GdbConnectCommand implements IConnect { } else if (data instanceof IProcessExtendedInfo[]) { attachToProcesses(controlCtx, (IProcessExtendedInfo[])data, rm); } else { - rm.setStatus(new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Invalid return type for process prompter", null)); //$NON-NLS-1$ - rm.done(); + rm.done(new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Invalid return type for process prompter", null)); //$NON-NLS-1$ } } }).schedule(); @@ -382,7 +408,7 @@ public class GdbConnectCommand implements IConnect { } private void startNewProcess(ICommandControlDMContext controlDmc, String binaryPath, RequestMonitor rm) { - final IGDBProcesses procService = fTracker.getService(IGDBProcesses.class); + IGDBProcesses procService = fTracker.getService(IGDBProcesses.class); procService.debugNewProcess( controlDmc, binaryPath, new HashMap(), new DataRequestMonitor(fExecutor, rm)); @@ -457,6 +483,8 @@ public class GdbConnectCommand implements IConnect { LaunchUIMessages.getString("ProcessPrompterDialog.TitlePrefix") + process.getName(), //$NON-NLS-1$ processShortName, new AttachToProcessRequestMonitor()).schedule(); } else { + // For a local attach, we can attach directly without looking for the binary + // since GDB will figure it out by itself IProcessDMContext procDmc = procService.createProcessContext(controlDmc, pidStr); procService.attachDebuggerToProcess(procDmc, null, new AttachToProcessRequestMonitor()); } @@ -477,11 +505,24 @@ public class GdbConnectCommand implements IConnect { new AttachToProcessRequestMonitor().done(); } else { - rm.setStatus(new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Cannot find service", null)); //$NON-NLS-1$ - rm.done(); + rm.done(new Status(IStatus.ERROR, GdbUIPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Cannot find service", null)); //$NON-NLS-1$ } } + + @Override + protected Object getTarget(Object element) { + if (element instanceof GdbLaunch || + element instanceof IDMVMContext) { + return element; + } + return null; + } + + @Override + protected boolean isRemainEnabled(IDebugCommandRequest request) { + return false; + } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java index 42b82306dd2..8e897d248f8 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java @@ -22,6 +22,7 @@ import java.util.Map; import org.eclipse.cdt.debug.core.CDebugUtils; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; +import org.eclipse.cdt.debug.core.model.IConnectHandler; import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector; import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; import org.eclipse.cdt.dsf.concurrent.ImmediateDataRequestMonitor; @@ -520,9 +521,9 @@ public class FinalLaunchSequence extends ReflectionSequence { fProcService.createProcessContext(fCommandControl.getContext(), Integer.toString(pid)), new DataRequestMonitor(getExecutor(), requestMonitor)); } else { - IConnect connectCommand = (IConnect)fSession.getModelAdapter(IConnect.class); - if (connectCommand != null) { - connectCommand.connect(requestMonitor); + IConnectHandler connectCommand = (IConnectHandler)fSession.getModelAdapter(IConnectHandler.class); + if (connectCommand instanceof IConnect) { + ((IConnect)connectCommand).connect(requestMonitor); } else { requestMonitor.done(); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java index 6fa04beb738..87c79a79e94 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/GdbLaunch.java @@ -18,6 +18,7 @@ import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.RejectedExecutionException; +import org.eclipse.cdt.debug.core.model.IConnectHandler; import org.eclipse.cdt.dsf.concurrent.ConfinedToDsfExecutor; import org.eclipse.cdt.dsf.concurrent.DefaultDsfExecutor; import org.eclipse.cdt.dsf.concurrent.DsfExecutor; @@ -289,7 +290,12 @@ public class GdbLaunch extends DsfLaunch // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=377447. if (adapter.equals(ITerminateHandler.class)) return getSession().getModelAdapter(adapter); - // Must force adapters to be loaded. + + // Allow to call the connect handler when the launch is selected + if (adapter.equals(IConnectHandler.class)) + return getSession().getModelAdapter(adapter); + + // Must force adapters to be loaded. Platform.getAdapterManager().loadAdapter(this, adapter.getName()); return super.getAdapter(adapter); }