KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > actions > DropToFrameAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.ui.actions;
12
13
14 import java.util.Iterator JavaDoc;
15
16 import org.eclipse.debug.core.DebugException;
17 import org.eclipse.jdt.debug.core.IJavaStackFrame;
18 import org.eclipse.jdt.internal.debug.ui.ExceptionHandler;
19 import org.eclipse.jface.action.IAction;
20 import org.eclipse.jface.viewers.IStructuredSelection;
21
22 public class DropToFrameAction extends ObjectActionDelegate {
23
24     /**
25      * @see IActionDelegate#run(IAction)
26      */

27     public void run(IAction action) {
28         IStructuredSelection selection= getCurrentSelection();
29         if (selection == null) {
30             return;
31         }
32         Iterator JavaDoc itr= selection.iterator();
33         
34         while (itr.hasNext()) {
35             IJavaStackFrame frame= (IJavaStackFrame)itr.next();
36             try {
37                 frame.dropToFrame();
38             } catch (DebugException de) {
39                 String JavaDoc title= ActionMessages.getString("DropToFrameAction.Drop_to_Frame_1"); //$NON-NLS-1$
40
String JavaDoc message= ActionMessages.getString("DropToFrameAction.Exceptions_occurred_attempting_to_drop_to_frame._2"); //$NON-NLS-1$
41
ExceptionHandler.handle(de, title, message);
42             }
43         }
44     }
45 }
46
Popular Tags