1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 14:15:23 +02:00

Implement the launch config dialog run method. e.g. needed by JUnit.

Change-Id: I4a6204248e26efc93cac2ce33b1367fbe072b05e
This commit is contained in:
Doug Schaefer 2016-11-03 13:31:12 -04:00
parent 6c4c3c9363
commit f5264933cf

View file

@ -8,8 +8,11 @@ import org.eclipse.debug.core.ILaunchMode;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.debug.ui.ILaunchConfigurationTabGroup;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.operation.ModalContext;
import org.eclipse.jface.wizard.ProgressMonitorPart;
import org.eclipse.launchbar.core.ILaunchDescriptor;
import org.eclipse.launchbar.core.target.ILaunchTarget;
import org.eclipse.launchbar.ui.ILaunchBarLaunchConfigDialog;
@ -36,6 +39,7 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau
private ILaunchConfigurationTabGroup group;
private CTabFolder tabFolder;
private CTabItem lastSelection;
private ProgressMonitorPart pmPart;
private boolean initing;
public LaunchBarLaunchConfigDialog(Shell shell, ILaunchConfigurationWorkingCopy workingCopy,
@ -135,6 +139,10 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau
Activator.log(e.getStatus());
}
pmPart = new ProgressMonitorPart(composite, new GridLayout(), true);
pmPart.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
pmPart.setVisible(false);
initing = false;
return composite;
}
@ -148,8 +156,25 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau
@Override
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
throws InvocationTargetException, InterruptedException {
// TODO Auto-generated method stub
Control lastControl = getShell().getDisplay().getFocusControl();
if (lastControl != null && lastControl.getShell() != getShell()) {
lastControl = null;
}
getButton(IDialogConstants.OK_ID).setEnabled(false);
getButton(IDialogConstants.CANCEL_ID).setEnabled(false);
pmPart.attachToCancelComponent(null);
try {
ModalContext.run(runnable, fork, pmPart, getShell().getDisplay());
} finally {
pmPart.removeFromCancelComponent(null);
getButton(IDialogConstants.OK_ID).setEnabled(true);
getButton(IDialogConstants.CANCEL_ID).setEnabled(true);
if (lastControl != null) {
lastControl.setFocus();
}
updateButtons();
}
}
@Override