Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java25
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java22
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java35
3 files changed, 30 insertions, 52 deletions
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java
index 248c15c7fce..e90b1be21cb 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java
@@ -261,20 +261,17 @@ public class LaunchUtils {
*/
public static void enableActivity(final String activityID, final boolean enableit) {
if (PlatformUI.isWorkbenchRunning()) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
- IActivityManager activityManager = workbenchActivitySupport.getActivityManager();
- Set<String> enabledActivityIds = new HashSet<>(activityManager.getEnabledActivityIds());
- boolean changed = false;
- if (enableit)
- changed = enabledActivityIds.add(activityID);
- else
- changed = enabledActivityIds.remove(activityID);
- if (changed)
- workbenchActivitySupport.setEnabledActivityIds(enabledActivityIds);
- }
+ PlatformUI.getWorkbench().getDisplay().asyncExec(() -> {
+ IWorkbenchActivitySupport workbenchActivitySupport = PlatformUI.getWorkbench().getActivitySupport();
+ IActivityManager activityManager = workbenchActivitySupport.getActivityManager();
+ Set<String> enabledActivityIds = new HashSet<>(activityManager.getEnabledActivityIds());
+ boolean changed = false;
+ if (enableit)
+ changed = enabledActivityIds.add(activityID);
+ else
+ changed = enabledActivityIds.remove(activityID);
+ if (changed)
+ workbenchActivitySupport.setEnabledActivityIds(enabledActivityIds);
});
}
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java
index 689eb1ca293..851ac30e364 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java
@@ -377,15 +377,12 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
localMode = mode;
}
if (!conf.supportsMode(localMode)) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ PlatformUI.getWorkbench().getDisplay()
+ .asyncExec(() -> MessageDialog.openError(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
LaunchMessages.LaunchUIPlugin_Error,
NLS.bind(LaunchMessages.MultiLaunchConfigurationDelegate_Cannot, conf.toString(),
- localMode));
- }
- });
+ localMode)));
continue;
}
@@ -411,14 +408,11 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
postLaunchAction(subLaunch, le.action, le.actionParam, monitor);
} catch (StackOverflowError e) {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ PlatformUI.getWorkbench().getDisplay()
+ .asyncExec(() -> MessageDialog.openError(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
LaunchMessages.LaunchUIPlugin_Error,
- NLS.bind(LaunchMessages.MultiLaunchConfigurationDelegate_Loop, conf.toString()));
- }
- });
+ NLS.bind(LaunchMessages.MultiLaunchConfigurationDelegate_Loop, conf.toString())));
}
}
if (!launch.hasChildren()) {
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java
index 3ac57ff2654..98ae3a3c20b 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java
@@ -46,8 +46,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -146,14 +144,11 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
fProjText = new Text(projComp, SWT.SINGLE | SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
fProjText.setLayoutData(gd);
- fProjText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent evt) {
- // if project changes, invalidate program name cache
- fPreviouslyCheckedProgram = null;
- updateBuildConfigCombo(EMPTY_STRING);
- updateLaunchConfigurationDialog();
- }
+ fProjText.addModifyListener(evt -> {
+ // if project changes, invalidate program name cache
+ fPreviouslyCheckedProgram = null;
+ updateBuildConfigCombo(EMPTY_STRING);
+ updateLaunchConfigurationDialog();
});
fProjButton = createPushButton(projComp, LaunchMessages.Launch_common_Browse_1, null);
fProjButton.addSelectionListener(new SelectionAdapter() {
@@ -457,12 +452,7 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
fCoreText = new Text(coreComp, SWT.SINGLE | SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
fCoreText.setLayoutData(gd);
- fCoreText.addModifyListener(new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent evt) {
- updateLaunchConfigurationDialog();
- }
- });
+ fCoreText.addModifyListener(evt -> updateLaunchConfigurationDialog());
Button browseForCoreButton;
browseForCoreButton = createPushButton(coreComp, LaunchMessages.Launch_common_Browse_3, null);
browseForCoreButton.addSelectionListener(new SelectionAdapter() {
@@ -515,14 +505,11 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
display = getShell().getDisplay();
}
final IBinary[][] ret = new IBinary[1][];
- BusyIndicator.showWhile(display, new Runnable() {
- @Override
- public void run() {
- try {
- ret[0] = cproject.getBinaryContainer().getBinaries();
- } catch (CModelException e) {
- LaunchUIPlugin.errorDialog("Launch UI internal error", e); //$NON-NLS-1$
- }
+ BusyIndicator.showWhile(display, () -> {
+ try {
+ ret[0] = cproject.getBinaryContainer().getBinaries();
+ } catch (CModelException e) {
+ LaunchUIPlugin.errorDialog("Launch UI internal error", e); //$NON-NLS-1$
}
});
return ret[0];

Back to the top