summaryrefslogtreecommitdiffstats
path: root/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SystemtapHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SystemtapHandler.java')
-rw-r--r--plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SystemtapHandler.java70
1 files changed, 70 insertions, 0 deletions
diff --git a/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SystemtapHandler.java b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SystemtapHandler.java
new file mode 100644
index 0000000..f5d34d8
--- /dev/null
+++ b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SystemtapHandler.java
@@ -0,0 +1,70 @@
1/*******************************************************************************
2 * Copyright (c) 2011 Intel Corporation.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Intel - initial API and implementation
10 *******************************************************************************/
11package org.yocto.sdk.remotetools.actions;
12import org.eclipse.core.commands.AbstractHandler;
13import org.eclipse.core.commands.ExecutionEvent;
14import org.eclipse.core.commands.ExecutionException;
15import org.eclipse.jface.dialogs.MessageDialog;
16import org.eclipse.swt.widgets.Shell;
17import org.eclipse.ui.IWorkbenchWindow;
18import org.eclipse.ui.PlatformUI;
19import org.eclipse.ui.handlers.HandlerUtil;
20import org.eclipse.ui.progress.IProgressService;
21
22public class SystemtapHandler extends AbstractHandler {
23 protected SystemtapSettingDialog setting;
24 protected String changeTerm="export TERM=vt100;";
25 protected IWorkbenchWindow window;
26 protected Shell shell;
27
28 public Object execute(ExecutionEvent event) throws ExecutionException {
29
30 this.window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
31 shell = window.getShell();
32 setting=new SystemtapSettingDialog(
33 shell, "Systemtap"
34 );
35
36
37 if(setting.open() == BaseSettingDialog.OK) {
38
39 String metadata_location = ((SystemtapSettingDialog)setting).getMetadataLocation();
40 String builddir_location = ((SystemtapSettingDialog)setting).getBuilddirLocation();
41 String remote_host = ((SystemtapSettingDialog)setting).getRemoteHost();
42 String user_id = ((SystemtapSettingDialog)setting).getUserID();
43 String systemtap_script = ((SystemtapSettingDialog)setting).getSystemtapScript();
44 String systemtap_args = ((SystemtapSettingDialog)setting).getSystemtapArgs();
45 IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
46 SystemtapModel op = new SystemtapModel(metadata_location, builddir_location, remote_host, user_id, systemtap_script,
47 systemtap_args,window.getShell().getDisplay());
48 try {
49 progressService.busyCursorWhile(op);
50 }catch (InterruptedException e) {
51 //user cancelled
52 }catch (Exception e) {
53 e.printStackTrace();
54 MessageDialog.openError(window.getShell(),
55 "Systemtap",
56 e.getMessage());
57 }
58 }
59 return false;
60 }
61
62 protected void initialize(ExecutionEvent event) throws ExecutionException {
63 this.window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
64 shell = window.getShell();
65 setting=new SystemtapSettingDialog(
66 shell, "Systemtap"
67 );
68 }
69
70}