| package org.eclipse.jdt.internal.debug.ui.actions; |
| |
| /********************************************************************** |
| Copyright (c) 2000, 2002 IBM Corp. All rights reserved. |
| This file is made available under the terms of the Common Public License v1.0 |
| which accompanies this distribution, and is available at |
| http://www.eclipse.org/legal/cpl-v10.html |
| **********************************************************************/ |
| |
| import java.util.Iterator; |
| |
| import org.eclipse.debug.core.DebugException; |
| import org.eclipse.jdt.debug.core.IJavaStackFrame; |
| import org.eclipse.jdt.internal.debug.ui.ExceptionHandler; |
| import org.eclipse.jface.action.IAction; |
| import org.eclipse.jface.viewers.IStructuredSelection; |
| |
| public class DropToFrameAction extends ObjectActionDelegate { |
| |
| /** |
| * @see IActionDelegate#run(IAction) |
| */ |
| public void run(IAction action) { |
| IStructuredSelection selection= getCurrentSelection(); |
| if (selection == null) { |
| return; |
| } |
| Iterator enum= selection.iterator(); |
| |
| while (enum.hasNext()) { |
| IJavaStackFrame frame= (IJavaStackFrame)enum.next(); |
| try { |
| frame.dropToFrame(); |
| } catch (DebugException de) { |
| String title= ActionMessages.getString("DropToFrameAction.Drop_to_Frame_1"); //$NON-NLS-1$ |
| String message= ActionMessages.getString("DropToFrameAction.Exceptions_occurred_attempting_to_drop_to_frame._2"); //$NON-NLS-1$ |
| ExceptionHandler.handle(de, title, message); |
| } |
| } |
| } |
| } |