01: /*******************************************************************************
02: * Copyright (c) 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Chris Aniszczyk <zx@us.ibm.com> - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.runtime.spy.handlers;
11:
12: import org.eclipse.core.commands.AbstractHandler;
13: import org.eclipse.core.commands.ExecutionEvent;
14: import org.eclipse.core.commands.ExecutionException;
15: import org.eclipse.pde.internal.runtime.spy.dialogs.SpyDialog;
16: import org.eclipse.swt.widgets.Shell;
17: import org.eclipse.ui.handlers.HandlerUtil;
18:
19: public class SpyHandler extends AbstractHandler {
20:
21: public SpyHandler() {
22: }
23:
24: public Object execute(ExecutionEvent event)
25: throws ExecutionException {
26: if (event != null) {
27: Shell shell = HandlerUtil.getActiveShell(event);
28: SpyDialog dialog = new SpyDialog(shell, event, shell
29: .getDisplay().getCursorLocation());
30: dialog.create();
31: dialog.open();
32: }
33:
34: return null;
35: }
36: }
|