| /******************************************************************************* |
| * Copyright (c) Jan 2, 2013 IBM Corporation 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: |
| * IBM Corporation - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.jdt.internal.debug.ui.actions; |
| |
| import org.eclipse.core.commands.ExecutionEvent; |
| import org.eclipse.core.commands.ExecutionException; |
| import org.eclipse.jdt.debug.eval.IEvaluationResult; |
| import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; |
| import org.eclipse.jdt.internal.debug.ui.display.IDataDisplay; |
| import org.eclipse.swt.widgets.Display; |
| import org.eclipse.ui.IWorkbenchPart; |
| |
| /** |
| * Default handler for the 'Execute' command |
| * |
| * @since 3.6.200 |
| */ |
| public class ExecuteSnippetHandler extends AbstractEvaluateHandler { |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
| */ |
| public Object execute(ExecutionEvent event) throws ExecutionException { |
| return null; |
| } |
| |
| @Override |
| protected IWorkbenchPart getTargetPart() { |
| return null; |
| } |
| |
| @Override |
| protected void displayResult(final IEvaluationResult result) { |
| if (result.hasErrors()) { |
| final Display display = JDIDebugUIPlugin.getStandardDisplay(); |
| display.asyncExec(new Runnable() { |
| public void run() { |
| if (display.isDisposed()) { |
| return; |
| } |
| reportErrors(result); |
| } |
| }); |
| } |
| } |
| |
| @Override |
| protected IDataDisplay getDataDisplay() { |
| return super.getDirectDataDisplay(); |
| } |
| } |