From 41ac47d732eed8392d60d0f6773e5a279d49b999 Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 12 Dec 2013 13:36:50 +0100 Subject: initial commit of Enea Linux 3.1 Migrated from the internal git server on the dora-enea branch Signed-off-by: Adrian Dudau --- .../sdk/remotetools/actions/SystemtapHandler.java | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SystemtapHandler.java (limited to 'plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SystemtapHandler.java') 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 @@ +/******************************************************************************* + * Copyright (c) 2011 Intel Corporation. + * 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: + * Intel - initial API and implementation + *******************************************************************************/ +package org.yocto.sdk.remotetools.actions; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.handlers.HandlerUtil; +import org.eclipse.ui.progress.IProgressService; + +public class SystemtapHandler extends AbstractHandler { + protected SystemtapSettingDialog setting; + protected String changeTerm="export TERM=vt100;"; + protected IWorkbenchWindow window; + protected Shell shell; + + public Object execute(ExecutionEvent event) throws ExecutionException { + + this.window = HandlerUtil.getActiveWorkbenchWindowChecked(event); + shell = window.getShell(); + setting=new SystemtapSettingDialog( + shell, "Systemtap" + ); + + + if(setting.open() == BaseSettingDialog.OK) { + + String metadata_location = ((SystemtapSettingDialog)setting).getMetadataLocation(); + String builddir_location = ((SystemtapSettingDialog)setting).getBuilddirLocation(); + String remote_host = ((SystemtapSettingDialog)setting).getRemoteHost(); + String user_id = ((SystemtapSettingDialog)setting).getUserID(); + String systemtap_script = ((SystemtapSettingDialog)setting).getSystemtapScript(); + String systemtap_args = ((SystemtapSettingDialog)setting).getSystemtapArgs(); + IProgressService progressService = PlatformUI.getWorkbench().getProgressService(); + SystemtapModel op = new SystemtapModel(metadata_location, builddir_location, remote_host, user_id, systemtap_script, + systemtap_args,window.getShell().getDisplay()); + try { + progressService.busyCursorWhile(op); + }catch (InterruptedException e) { + //user cancelled + }catch (Exception e) { + e.printStackTrace(); + MessageDialog.openError(window.getShell(), + "Systemtap", + e.getMessage()); + } + } + return false; + } + + protected void initialize(ExecutionEvent event) throws ExecutionException { + this.window = HandlerUtil.getActiveWorkbenchWindowChecked(event); + shell = window.getShell(); + setting=new SystemtapSettingDialog( + shell, "Systemtap" + ); + } + +} -- cgit v1.2.3-54-g00ecf