Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2017-08-16 20:24:52 +0000
committerAlexander Kurtakov2017-09-06 10:43:46 +0000
commitd8621eaf55a1e95ff894dda0a241af08cc6111fe (patch)
treec25456438000b8f21bfd4173f6910cba71bf138a /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands
parent1ac7a50083b25934db5e4902343c7a186435763b (diff)
downloadeclipse.platform.debug-d8621eaf55a1e95ff894dda0a241af08cc6111fe.tar.gz
eclipse.platform.debug-d8621eaf55a1e95ff894dda0a241af08cc6111fe.tar.xz
eclipse.platform.debug-d8621eaf55a1e95ff894dda0a241af08cc6111fe.zip
Bug 521038 - Replaced anonymous Runnable classes by lambda expressionI20170906-2000I20170906-0815
Change-Id: Ia0d3478be72f514cce6e57cb679fa60668bdb23f Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java49
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java31
2 files changed, 31 insertions, 49 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java
index 851b2d4a7..fefe8cbfd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java
@@ -30,44 +30,29 @@ public class ExecuteActionRequest extends DebugCommandRequest {
super(elements);
}
- @Override
+ @Override
public void done() {
- if (fParticipant != null) {
+ if (fParticipant != null) {
fParticipant.requestDone(this);
fParticipant = null;
}
- final IStatus status = getStatus();
- if (status != null) {
- switch (status.getSeverity()) {
- case IStatus.ERROR:
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- MessageDialog.openError(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
- }
- });
- break;
- case IStatus.WARNING:
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- MessageDialog.openWarning(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
- }
- });
- break;
- case IStatus.INFO:
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- MessageDialog.openInformation(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
- }
- });
- break;
+ final IStatus status = getStatus();
+ if (status != null) {
+ switch (status.getSeverity()) {
+ case IStatus.ERROR:
+ DebugUIPlugin.getStandardDisplay().asyncExec(() -> MessageDialog.openError(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage()));
+ break;
+ case IStatus.WARNING:
+ DebugUIPlugin.getStandardDisplay().asyncExec(() -> MessageDialog.openWarning(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage()));
+ break;
+ case IStatus.INFO:
+ DebugUIPlugin.getStandardDisplay().asyncExec(() -> MessageDialog.openInformation(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage()));
+ break;
default:
break;
- }
- }
- }
+ }
+ }
+ }
public void setCommandParticipant(ICommandParticipant participant) {
fParticipant = participant;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
index b0d0713bf..3495f7a09 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
@@ -36,24 +36,21 @@ import org.eclipse.jface.viewers.StructuredSelection;
*/
public class TerminateAndRelaunchAction extends DebugCommandAction {
- @Override
+ @Override
public void postExecute(IRequest request, final Object[] targets) {
- if (request.getStatus() == null || request.getStatus().isOK()) {
- DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- @Override
- public void run() {
- // Must be run in the UI thread since the launch can require
- // prompting to proceed
- for (int i = 0; i < targets.length; i++) {
- ILaunch launch = DebugUIPlugin.getLaunch(targets[i]);
- if (launch != null) {
- RelaunchActionDelegate.relaunch(launch.getLaunchConfiguration(), launch.getLaunchMode());
- }
- }
- }
- });
- }
- }
+ if (request.getStatus() == null || request.getStatus().isOK()) {
+ DebugUIPlugin.getStandardDisplay().asyncExec(() -> {
+ // Must be run in the UI thread since the launch can require
+ // prompting to proceed
+ for (int i = 0; i < targets.length; i++) {
+ ILaunch launch = DebugUIPlugin.getLaunch(targets[i]);
+ if (launch != null) {
+ RelaunchActionDelegate.relaunch(launch.getLaunchConfiguration(), launch.getLaunchMode());
+ }
+ }
+ });
+ }
+ }
@Override
protected ISelection getContext() {

Back to the top