diff options
author | Anithra P Janakiraman | 2010-01-29 11:38:57 +0000 |
---|---|---|
committer | Anithra P Janakiraman | 2010-01-29 11:38:57 +0000 |
commit | b6d4bb1569a5f6045206af2dc6e7650c99c7888e (patch) | |
tree | 86cb6173ca88dd4fd70d131f9520a8d1cb8dc073 /systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension | |
parent | 0d32419fa59de317451a1663af30e308ff1a2f94 (diff) | |
download | org.eclipse.linuxtools-b6d4bb1569a5f6045206af2dc6e7650c99c7888e.tar.gz org.eclipse.linuxtools-b6d4bb1569a5f6045206af2dc6e7650c99c7888e.tar.xz org.eclipse.linuxtools-b6d4bb1569a5f6045206af2dc6e7650c99c7888e.zip |
Deleting dashboard directories
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension')
33 files changed, 0 insertions, 1602 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/META-INF/MANIFEST.MF deleted file mode 100644 index 3e46ca596a..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: DashboardExtension Plug-in -Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.dashboardextension;singleton:=true -Bundle-Version: 1.0.0 -Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.dashboardextension.internal.DashboardExtensionPlugin -Bundle-Vendor: IBM -Bundle-Localization: plugin -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.linuxtools.systemtap.ui.ide, - org.eclipse.linuxtools.systemtap.ui.editor, - org.eclipse.linuxtools.systemtap.ui.graphing, - org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui, - org.eclipse.linuxtools.systemtap.ui.logging, - org.eclipse.linuxtools.systemtap.ui.systemtapgui, - org.eclipse.linuxtools.systemtap.ui.structures, - org.eclipse.linuxtools.systemtap.ui.dashboard, - org.eclipse.linuxtools.systemtap.ui.graphingapi.ui -Eclipse-AutoStart: true diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/AddScriptAction.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/AddScriptAction.class Binary files differdeleted file mode 100644 index 5fb864f005..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/AddScriptAction.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/CreateModuleAction.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/CreateModuleAction.class Binary files differdeleted file mode 100644 index 1c3b18f6c5..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/CreateModuleAction.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/DeleteScriptAction.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/DeleteScriptAction.class Binary files differdeleted file mode 100644 index 61e0f6a666..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/DeleteScriptAction.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ExportScriptAction.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ExportScriptAction.class Binary files differdeleted file mode 100644 index 8d71f4f825..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ExportScriptAction.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ViewScriptAction.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ViewScriptAction.class Binary files differdeleted file mode 100644 index aa28984ffa..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ViewScriptAction.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$1.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$1.class Binary files differdeleted file mode 100644 index 42d3353dc2..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$1.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$2.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$2.class Binary files differdeleted file mode 100644 index ef12adf885..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$2.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$3.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$3.class Binary files differdeleted file mode 100644 index 57de668c8b..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$3.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$4.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$4.class Binary files differdeleted file mode 100644 index 04cb7ced0f..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog$4.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog.class Binary files differdeleted file mode 100644 index 3de7806067..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails$1.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails$1.class Binary files differdeleted file mode 100644 index 8e961bfc73..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails$1.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails$2.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails$2.class Binary files differdeleted file mode 100644 index 5ece2347e5..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails$2.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails.class Binary files differdeleted file mode 100644 index d8970122b6..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/DashboardExtensionPlugin.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/DashboardExtensionPlugin.class Binary files differdeleted file mode 100644 index 4bcaa8b5ca..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/DashboardExtensionPlugin.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/Localization.class b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/Localization.class Binary files differdeleted file mode 100644 index a60057fe7c..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/Localization.class +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/localization.properties deleted file mode 100644 index 51fcc6b046..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/bin/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/localization.properties +++ /dev/null @@ -1,12 +0,0 @@ -ExportScriptAction.NoFileToExport=No file open to export\! - -ExportScriptDialog.ExportScript=Export Script -ExportScriptDialog.Description=Description: -ExportScriptDialog.FillFields=You must fill in all the fields\! -ExportScriptAction.Error=Error -ExportScriptDialog.Display=Display: -ExportScriptDialog.Category=Category: -ExportScriptDialog.Graphs=Graphs: -ExportScriptDialog.Add=Add -ExportScriptDialog.AddFilter=Add Filter -ExportScriptDialog.Remove=Remove diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/build.properties deleted file mode 100644 index c88359b87e..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - icons/,\ - plugin.properties diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/icons/actions/export_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/icons/actions/export_wiz.gif Binary files differdeleted file mode 100644 index 5a0837d1e4..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/icons/actions/export_wiz.gif +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/icons/actions/file_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/icons/actions/file_obj.gif Binary files differdeleted file mode 100755 index 7ccc6a7031..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/icons/actions/file_obj.gif +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/icons/actions/mod_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/icons/actions/mod_obj.gif Binary files differdeleted file mode 100644 index 8bbfd04204..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/icons/actions/mod_obj.gif +++ /dev/null diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/plugin.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/plugin.properties deleted file mode 100644 index bdc6f14513..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/plugin.properties +++ /dev/null @@ -1,18 +0,0 @@ -command.exportScript.name=&Export Script... -command.exportScript.desc=Export Script to the Dashboard - -actionset.export.name=Export Action Set -action.exportScript.name=&Export Script... -action.exportScript.desc=Export Script to the Dashboard - -command.createModule.name=&Create Module... -command.createModule.desc=Create new Dashboard Module - -actionset.createModule.name=Create Module Action Set -action.createModule.name=&Create Module... -action.createModule.desc=Create new Dashboard Module - - -action.viewScript.name=View Script -action.addScript.name=Add Script -action.deleteScript.name=Delete Script
\ No newline at end of file diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/plugin.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/plugin.xml deleted file mode 100644 index 0418506f93..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/plugin.xml +++ /dev/null @@ -1,118 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.0"?> -<plugin> - <extension - point="org.eclipse.ui.startup"> - <!--startup class=""--> - </extension> - - <extension - point="org.eclipse.ui.commands"> - <command - name="%command.exportScript.name" - description="%command.exportScript.desc" - categoryId="org.eclipse.linuxtools.systemtap.ui.ide.category.file" - id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.commands.ExportScript"/> - <command - name="%command.createModule.name" - description="%command.createModule.desc" - categoryId="org.eclipse.linuxtools.systemtap.ui.dashboard.category.file" - id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.commands.CreateModuleAction"/> - </extension> - <extension - point="org.eclipse.ui.bindings"> - <key - commandId="org.eclipse.linuxtools.systemtap.ui.dashboardextension.commands.ExportScript" - contextId="org.eclipse.ui.contexts.window" - schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="M1+X"/> - <key - commandId="org.eclipse.linuxtools.systemtap.ui.dashboardextension.commands.CreateModuleAction" - contextId="org.eclipse.ui.contexts.window" - schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="M1+Y"/> - </extension> - <extension - point="org.eclipse.ui.actionSets"> - <actionSet - label="%actionset.export.name" - visible="true" - id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.ExportScriptActionSet"> - <action - label="%action.exportScript.name" - tooltip="%action.exportScript.desc" - id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.actions.ExportScript" - icon="icons/actions/export_wiz.gif" - toolbarPath="org.eclipse.ui.workbench.file/export.ext" - menubarPath="file2/export.ext" - class="org.eclipse.linuxtools.systemtap.ui.dashboardextension.ExportScriptAction" - definitionId="org.eclipse.linuxtools.systemtap.ui.dashboardextension.commands.ExportScript" - style="push" - state="false"/> - </actionSet> - </extension> - <extension - point="org.eclipse.ui.actionSets"> - <actionSet - label="%actionset.createModule.name" - visible="true" - id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.CreateModuleActionSet"> - <action - label="%action.createModule.name" - tooltip="%action.createModule.desc" - id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.actions.CreateModuleAction" - icon="icons/actions/mod_obj.gif" - toolbarPath="org.eclipse.ui.workbench.file/export.ext" - menubarPath="file2/export.ext" - class="org.eclipse.linuxtools.systemtap.ui.dashboardextension.CreateModuleAction" - definitionId="org.eclipse.linuxtools.systemtap.ui.dashboardextension.commands.CreateModuleAction" - style="push" - state="true"/> - </actionSet> - </extension> - - - <extension - point="org.eclipse.ui.popupMenus"> - <objectContribution - adaptable="false" - id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.ViewScriptMenu" - objectClass="org.eclipse.linuxtools.systemtap.ui.dashboard.structures.ModuleTreeNode"> - <action - label="%action.viewScript.name" - class="org.eclipse.linuxtools.systemtap.ui.dashboardextension.ViewScriptAction" - icon="icons/actions/file_obj.gif" - menubarPath="file.ext" - id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.ViewScriptAction" - style="push"/> - <!--<action - class="org.eclipse.linuxtools.systemtap.ui.dashboardextension.actions.AddScriptAction" - icon="icons/actions/file_obj.gif" - id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.AddScriptAction" - label="%action.addScript.name" - menubarPath="file.ext" - style="push"> - </action>--> - ,<!--<action - class="org.eclipse.linuxtools.systemtap.ui.dashboardextension.actions.DeleteScriptAction" - icon="icons/actions/file_obj.gif" - id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.DeleteScriptAction" - label="%action.deleteScript.name" - menubarPath="file.ext" - style="push"> - </action>--> - </objectContribution> - </extension> - - <extension - point="org.eclipse.ui.perspectiveExtensions"> - <perspectiveExtension - targetID="org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective"> - <actionSet id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.ExportScriptActionSet"/> - </perspectiveExtension> - <perspectiveExtension - targetID="org.eclipse.linuxtools.systemtap.ui.dashboard.DashboardPerspective"> - <actionSet id="org.eclipse.linuxtools.systemtap.ui.dashboardextension.CreateModuleActionSet"/> - </perspectiveExtension> - </extension> -</plugin> diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/AddScriptAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/AddScriptAction.java deleted file mode 100644 index 22c7d87b3f..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/AddScriptAction.java +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM 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: - * IBM Corporation - Jeff Briggs, Henry Hughes, Ryan Morse, Anithra P J - *******************************************************************************/ - -package org.eclipse.linuxtools.systemtap.ui.dashboardextension.actions; - -import java.io.FileInputStream; -import java.io.IOException; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.DashboardModule; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.ModuleTreeNode; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.WorkbenchException; - -import org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor; -import org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective; -import org.eclipse.linuxtools.systemtap.ui.ide.actions.TempFileAction; - -/** - * A class that handles extracting the original script from the dashboard module. - * It will then create a new active editor in the IDE perspective and display the - * module in a temp file. Users can then modify this script and use the modified - * version as well as the original. - * @author Ryan Morse - */ -public class AddScriptAction extends Action implements IViewActionDelegate { - /** - * This method sets what item the user has selected to view. - */ - public void init(IViewPart view) { - selectedItem = null; - } - - /** - * This method will retreive the script from the selected module for the user - * to see. It will then create a new active editor in the IDE perspective and - * display the module in a temp file. Users can then modify this script and - * use the modified version as well as the original. - * @param act An action representing the click event used to start this method. - */ - public void run(IAction act) { - DashboardModule data = (DashboardModule)selectedItem.getData(); - - try { - IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(IDEPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); - - TempFileAction tfa = new TempFileAction(); - tfa.run(); - - IEditorPart edit = p.getActiveEditor(); - - if(null != edit) { - if(edit instanceof SimpleEditor) { - SimpleEditor editor = (SimpleEditor)edit; - - //Copy the file just to ensure the user has to save their own copy if they want it - FileInputStream fin; - try { - fin = new FileInputStream(data.script); - StringBuilder sb = new StringBuilder(); - - int c; - while((c = fin.read()) != -1) - sb.append((char)c); - - fin.close(); - editor.insertText(sb.toString()); - } catch (IOException e) {} - } - } - } catch(WorkbenchException we) {} - } - - /** - * This method will update the selected item when a new item is selected. - * @param action The action that fired this method. - * @param selection The newly selected item. - */ - public void selectionChanged(IAction action, ISelection selection) { - if(selection instanceof IStructuredSelection) { - IStructuredSelection selected = (IStructuredSelection)selection; - Object o = selected.getFirstElement(); - if(o instanceof ModuleTreeNode) { - selectedItem = (ModuleTreeNode)o; - o = selectedItem.getData(); - if(null != o) { - setEnabled(true); - return; - } - } - } - setEnabled(false); - } - - private ModuleTreeNode selectedItem; -} diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/CreateModuleAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/CreateModuleAction.java deleted file mode 100644 index 564c259cbc..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/CreateModuleAction.java +++ /dev/null @@ -1,273 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM 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: - * IBM Corporation - Jeff Briggs, Henry Hughes, Ryan Morse, Anithra P J - *******************************************************************************/ - -package org.eclipse.linuxtools.systemtap.ui.dashboardextension.actions; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileWriter; - - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.linuxtools.systemtap.ui.dashboard.DashboardPerspective; -import org.eclipse.linuxtools.systemtap.ui.dashboard.internal.DashboardPlugin; -import org.eclipse.linuxtools.systemtap.ui.dashboard.preferences.DashboardPreferenceConstants; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.DashboardMetaData; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.DashboardModule; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.DashboardModuleFileFilter; -import org.eclipse.linuxtools.systemtap.ui.dashboard.views.DashboardModuleBrowserView; -import org.eclipse.linuxtools.systemtap.ui.dashboardextension.dialogs.ExportScriptDialog; -import org.eclipse.linuxtools.systemtap.ui.dashboardextension.dialogs.ScriptDetails; -import org.eclipse.ui.IMemento; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.WorkbenchException; -import org.eclipse.ui.XMLMemento; - -import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSetParser; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.IDataSetFilter; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.GraphData; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset.DataSetWizard; -import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode; -import org.eclipse.linuxtools.systemtap.ui.structures.ZipArchive; -import org.eclipse.linuxtools.systemtap.ui.graphing.GraphingConstants; -import org.eclipse.linuxtools.systemtap.ui.systemtapgui.SystemTapGUISettings; - -/** - * This class brings up a dialog box for the user to select what they want the - * new module to contain. If a new module is build, it will be exported to the - * dashboard for use at any time. - * @author Ryan Morse - */ -public class CreateModuleAction extends Action implements IWorkbenchWindowActionDelegate { - /** - * This method will bring up the export script dialog window for the user - * to select what they want to new module to contain. If the user enters - * module information and clicks ok the module will be built and added to - * the dashboard. - */ - - //private static String scriptFileName = "/script.stp"; - public String script = null; - - public void init(IWorkbenchWindow window) { - fWindow= window; - } - - protected IWorkbenchWindow fWindow = null; - - public void run(IAction action) { - // if(null == script || script.length() <= 0) { - // String msg = MessageFormat.format(Localization.getString("ExportScriptAction.NoFileToExport"), null); - // MessageDialog.openWarning(fWindow.getShell(), Localization.getString("ExportScriptAction.Error"), msg); - // } else { - ScriptDetails sd = new ScriptDetails(fWindow.getShell()); - sd.open(); - if (sd.isCanceled()) return; - - script = DashboardPlugin.getDefault().getPreferenceStore().getString(DashboardPreferenceConstants.P_DASHBOARD_SCRIPT); - DataSetWizard wizard = new DataSetWizard(GraphingConstants.DataSetMetaData, script); - IWorkbench workbench = PlatformUI.getWorkbench(); - wizard.init(workbench, null); - WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard); - dialog.create(); - dialog.open(); - - IDataSetParser parser = wizard.getParser(); - IDataSet dataSet = wizard.getDataSet(); - - wizard.dispose(); - - if(null == parser || null == dataSet) - return; - - ExportScriptDialog exportDialog = new ExportScriptDialog(fWindow.getShell(), dataSet); - exportDialog.open(); - - exportDialog.dispose(); - if(!exportDialog.isCanceled()) { - String category = exportDialog.getCategory(); - String display = exportDialog.getDisplay(); - String description = exportDialog.getDescription(); - GraphData[] gd = exportDialog.getGraphs(); - TreeNode filters = exportDialog.getGraphFilters(); - - validateDirectory(); - File meta = saveMetaData(display, category, description, dataSet, parser, gd, filters,DashboardPlugin.getDefault().getPreferenceStore().getString(DashboardPreferenceConstants.P_DASHBOARD_EXAMPLES_DIR)); - String archiveName = getSaveDirectory() + "/" + category.replace(' ', '_') + "." + display.replace(' ', '_'); - buildArchive(archiveName, new File(script), meta); - cleanupFiles(new String[] {archiveName, meta.getAbsolutePath()}); - updateDashboard(); - // } - } - } - - /** - * This method will check to make sure the exported module directory is valid. - * If it isn't then the foleders will be created in order to make the directory - * valid. - */ - private void validateDirectory() { - File folder = new File(getSaveDirectory()); - - if(!folder.exists()) - folder.mkdir(); - } - - /** - * This method will create a new XML Memento used to store all of the meta data - * for the module. This data is all based on what the user selected from the - * dialog box. - * @param disp The string to display that represents this module. - * @param cat The category string representing where this module will be placed - * @param desc The description string for this module - * @param dataSet The IDataSet that holds the data for this module - * @param parser The parer that can obtain the information from the raw output - * @param gd GraphData Array specifying all of the information needed to create the selected graphs - * @param filters TreeNode containing all of the selected filters for each graph. - */ - private File saveMetaData(String disp, String cat, String desc, IDataSet dataSet, IDataSetParser parser, GraphData[] gd, TreeNode filters, String location) { - File meta = null; - XMLMemento data = XMLMemento.createWriteRoot(DashboardMetaData.XMLDashboardItem); - - try { - IMemento child, child2, child3; - - data.putString(DashboardMetaData.XMLdDisplay, disp); - data.putString(DashboardMetaData.XMLdCategory, cat); - data.putString(DashboardMetaData.XMLdDescription, desc); - data.putString(DashboardMetaData.XMLdDataset, dataSet.getID()); - data.putString(DashboardMetaData.XMLdScript, script); - data.putString(DashboardMetaData.XMLdLocation, location); - data.putString(DashboardMetaData.XMLdScriptFileName, script); - - - child = data.createChild(DashboardMetaData.XMLParsingExpressions); - String[] cols = dataSet.getTitles(); - for(int i=0; i<cols.length; i++) { - child2 = child.createChild(DashboardMetaData.XMLpColumn); - child2.putString(DashboardMetaData.XMLpName, cols[i]); - } - parser.saveXML(child.createChild(DashboardMetaData.XMLpParser)); - - child = data.createChild(DashboardMetaData.XMLGraphDisplays); - for(int j,i=0; i<gd.length; i++) { - child2 = child.createChild(DashboardMetaData.XMLgGraph); - child2.putString(DashboardMetaData.XMLgId, gd[i].graphID); - child2.putString(DashboardMetaData.XMLgTitle, gd[i].title); - - TreeNode treeChild = filters.getChildAt(i); - for(j=0; j<treeChild.getChildCount(); j++) { - ((IDataSetFilter)(treeChild.getChildAt(j).getData())).writeXML(child2); - } - - child3 = child2.createChild(DashboardMetaData.XMLgSeries); - child3.putString(DashboardMetaData.XMLgAxis, DashboardMetaData.XMLgAxisX); - child3.putInteger(DashboardMetaData.XMLgColumn, gd[i].xSeries); - for(j=0; j<gd[i].ySeries.length; j++) { - child3 = child2.createChild(DashboardMetaData.XMLgSeries); - child3.putString(DashboardMetaData.XMLgAxis, DashboardMetaData.XMLgAxisY); - child3.putInteger(DashboardMetaData.XMLgColumn, gd[i].ySeries[j]); - } - } - - meta = new File(getSaveDirectory() + DashboardModule.metaFileName); - FileWriter writer = new FileWriter(meta); - data.save(writer); - writer.close(); - } catch(FileNotFoundException fnfe) { - return meta; - } catch(Exception e) { - return meta; - } - return meta; - } - - /** - * This method will create the module archive by first zipping the .stp file and the meta data - * together. Then it will compress the .zip file into a .gz file. The .gz file's extension is - * set to .dash to discurage users from trying to modify it and to make it sepecific to the - * SystemTapGUI dashboard. - * @param archiveName The name to use for the file containing the new module data. - * @param script The file representing the .stp script file to use for the module - * @param meta The XML Memento file representing the module details. - */ - private void buildArchive(String archiveName, File script, File meta) { - String[] files = new String[] {meta.getAbsolutePath()}; - String[] names = new String[] {DashboardModule.metaFileName}; - - ZipArchive.zipFiles(archiveName, files, names); - ZipArchive.compressFile(archiveName + DashboardModuleFileFilter.DashboardModuleExtension, archiveName); - } - - /** - * This method will delete any extra files that were generated as a result of building - * the Dashboard module. - * @param files A list of all of the file paths that should be removed - */ - private void cleanupFiles(String[] files) { - if(null == files) - return; - - File f; - for(int i=0; i<files.length; i++) { - f = new File(files[i]); - if(f.exists()) - f.delete(); - } - } - - /** - * This method will get the directory name that should be used for saving the dashboard modules. - */ - private String getSaveDirectory() { - return SystemTapGUISettings.settingsFolder + "/dashboard"; - } - - /** - * This method forces the Dashboard's DashboardModuleBrowserView to refresh itself to ensure - * that is contains the most up-to-date module list. - */ - private void updateDashboard() { - try { - IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(DashboardPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); - IViewPart ivp = p.findView(DashboardModuleBrowserView.ID); - ((DashboardModuleBrowserView)ivp).refresh(); - - //p = PlatformUI.getWorkbench().showPerspective(IDEPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); - } catch(WorkbenchException we) {} - } - - /** - * Removes all internal references to objects. No other method should be called after this. - */ - /*public void dispose() { - super.dispose(); - }*/ - - public void selectionChanged(IAction action, ISelection selection) { - // TODO Auto-generated method stub - - } - - public void dispose() { - // TODO Auto-generated method stub - - } -} diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/DeleteScriptAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/DeleteScriptAction.java deleted file mode 100644 index 58314da986..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/DeleteScriptAction.java +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM 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: - * IBM Corporation - Jeff Briggs, Henry Hughes, Ryan Morse, Anithra P J - *******************************************************************************/ - -package org.eclipse.linuxtools.systemtap.ui.dashboardextension.actions; - -import java.io.FileInputStream; -import java.io.IOException; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.DashboardModule; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.ModuleTreeNode; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.WorkbenchException; - -import org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor; -import org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective; -import org.eclipse.linuxtools.systemtap.ui.ide.actions.TempFileAction; - -/** - * A class that handles extracting the original script from the dashboard module. - * It will then create a new active editor in the IDE perspective and display the - * module in a temp file. Users can then modify this script and use the modified - * version as well as the original. - * @author Ryan Morse - */ -public class DeleteScriptAction extends Action implements IViewActionDelegate { - /** - * This method sets what item the user has selected to view. - */ - public void init(IViewPart view) { - selectedItem = null; - } - - /** - * This method will retreive the script from the selected module for the user - * to see. It will then create a new active editor in the IDE perspective and - * display the module in a temp file. Users can then modify this script and - * use the modified version as well as the original. - * @param act An action representing the click event used to start this method. - */ - public void run(IAction act) { - DashboardModule data = (DashboardModule)selectedItem.getData(); - - try { - IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(IDEPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); - - TempFileAction tfa = new TempFileAction(); - tfa.run(); - - IEditorPart edit = p.getActiveEditor(); - - if(null != edit) { - if(edit instanceof SimpleEditor) { - SimpleEditor editor = (SimpleEditor)edit; - - //Copy the file just to ensure the user has to save their own copy if they want it - FileInputStream fin; - try { - fin = new FileInputStream(data.script); - StringBuilder sb = new StringBuilder(); - - int c; - while((c = fin.read()) != -1) - sb.append((char)c); - - fin.close(); - editor.insertText(sb.toString()); - } catch (IOException e) {} - } - } - } catch(WorkbenchException we) {} - } - - /** - * This method will update the selected item when a new item is selected. - * @param action The action that fired this method. - * @param selection The newly selected item. - */ - public void selectionChanged(IAction action, ISelection selection) { - if(selection instanceof IStructuredSelection) { - IStructuredSelection selected = (IStructuredSelection)selection; - Object o = selected.getFirstElement(); - if(o instanceof ModuleTreeNode) { - selectedItem = (ModuleTreeNode)o; - o = selectedItem.getData(); - if(null != o) { - setEnabled(true); - return; - } - } - } - setEnabled(false); - } - - private ModuleTreeNode selectedItem; -} diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ExportScriptAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ExportScriptAction.java deleted file mode 100644 index f6a960c590..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ExportScriptAction.java +++ /dev/null @@ -1,250 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM 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: - * IBM Corporation - Jeff Briggs, Henry Hughes, Ryan Morse, Anithra P J - *******************************************************************************/ - -package org.eclipse.linuxtools.systemtap.ui.dashboardextension.actions; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileWriter; -import java.text.MessageFormat; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.linuxtools.systemtap.ui.dashboard.DashboardPerspective; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.DashboardMetaData; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.DashboardModule; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.DashboardModuleFileFilter; -import org.eclipse.linuxtools.systemtap.ui.dashboard.views.DashboardModuleBrowserView; -import org.eclipse.linuxtools.systemtap.ui.dashboardextension.dialogs.ExportScriptDialog; -import org.eclipse.linuxtools.systemtap.ui.dashboardextension.internal.Localization; -import org.eclipse.ui.IMemento; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.WorkbenchException; -import org.eclipse.ui.XMLMemento; - -import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSetParser; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.IDataSetFilter; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.GraphData; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset.DataSetWizard; -import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode; -import org.eclipse.linuxtools.systemtap.ui.structures.ZipArchive; -import org.eclipse.linuxtools.systemtap.ui.graphing.GraphingConstants; -import org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective; -import org.eclipse.linuxtools.systemtap.ui.ide.actions.RunScriptAction; -import org.eclipse.linuxtools.systemtap.ui.systemtapgui.SystemTapGUISettings; - -/** - * This class brings up a dialog box for the user to select what they want the - * new module to contain. If a new module is build, it will be exported to the - * dashboard for use at any time. - * @author Ryan Morse - */ -public class ExportScriptAction extends RunScriptAction implements IWorkbenchWindowActionDelegate { - /** - * This method will bring up the export script dialog window for the user - * to select what they want to new module to contain. If the user enters - * module information and clicks ok the module will be built and added to - * the dashboard. - */ - - private static String scriptFileName = "/script.stp"; - - public void run(IAction action) { - String script = getFilePath(); - if(null == script || script.length() <= 0) { - String msg = MessageFormat.format(Localization.getString("ExportScriptAction.NoFileToExport"), null); - MessageDialog.openWarning(fWindow.getShell(), Localization.getString("ExportScriptAction.Error"), msg); - } else { - DataSetWizard wizard = new DataSetWizard(GraphingConstants.DataSetMetaData, script); - IWorkbench workbench = PlatformUI.getWorkbench(); - wizard.init(workbench, null); - WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard); - dialog.create(); - dialog.open(); - - IDataSetParser parser = wizard.getParser(); - IDataSet dataSet = wizard.getDataSet(); - - wizard.dispose(); - - if(null == parser || null == dataSet) - return; - - ExportScriptDialog exportDialog = new ExportScriptDialog(fWindow.getShell(), dataSet); - exportDialog.open(); - - exportDialog.dispose(); - if(!exportDialog.isCanceled()) { - String category = exportDialog.getCategory(); - String display = exportDialog.getDisplay(); - String description = exportDialog.getDescription(); - GraphData[] gd = exportDialog.getGraphs(); - TreeNode filters = exportDialog.getGraphFilters(); - - validateDirectory(); - File meta = saveMetaData(display, category, description, dataSet, parser, gd, filters,"local"); - String archiveName = getSaveDirectory() + "/" + category.replace(' ', '_') + "." + display.replace(' ', '_'); - buildArchive(archiveName, new File(script), meta); - cleanupFiles(new String[] {archiveName, meta.getAbsolutePath()}); - updateDashboard(); - } - } - } - - /** - * This method will check to make sure the exported module directory is valid. - * If it isn't then the foleders will be created in order to make the directory - * valid. - */ - private void validateDirectory() { - File folder = new File(getSaveDirectory()); - - if(!folder.exists()) - folder.mkdir(); - } - - /** - * This method will create a new XML Memento used to store all of the meta data - * for the module. This data is all based on what the user selected from the - * dialog box. - * @param disp The string to display that represents this module. - * @param cat The category string representing where this module will be placed - * @param desc The description string for this module - * @param dataSet The IDataSet that holds the data for this module - * @param parser The parer that can obtain the information from the raw output - * @param gd GraphData Array specifying all of the information needed to create the selected graphs - * @param filters TreeNode containing all of the selected filters for each graph. - */ - private File saveMetaData(String disp, String cat, String desc, IDataSet dataSet, IDataSetParser parser, GraphData[] gd, TreeNode filters, String location) { - File meta = null; - XMLMemento data = XMLMemento.createWriteRoot(DashboardMetaData.XMLDashboardItem); - - try { - IMemento child, child2, child3; - - data.putString(DashboardMetaData.XMLdDisplay, disp); - data.putString(DashboardMetaData.XMLdCategory, cat); - data.putString(DashboardMetaData.XMLdDescription, desc); - data.putString(DashboardMetaData.XMLdDataset, dataSet.getID()); - data.putString(DashboardMetaData.XMLdScript, scriptFileName); - data.putString(DashboardMetaData.XMLdLocation, location); - data.putString(DashboardMetaData.XMLdScriptFileName, scriptFileName); - - - child = data.createChild(DashboardMetaData.XMLParsingExpressions); - String[] cols = dataSet.getTitles(); - for(int i=0; i<cols.length; i++) { - child2 = child.createChild(DashboardMetaData.XMLpColumn); - child2.putString(DashboardMetaData.XMLpName, cols[i]); - } - parser.saveXML(child.createChild(DashboardMetaData.XMLpParser)); - - child = data.createChild(DashboardMetaData.XMLGraphDisplays); - for(int j,i=0; i<gd.length; i++) { - child2 = child.createChild(DashboardMetaData.XMLgGraph); - child2.putString(DashboardMetaData.XMLgId, gd[i].graphID); - child2.putString(DashboardMetaData.XMLgTitle, gd[i].title); - - TreeNode treeChild = filters.getChildAt(i); - for(j=0; j<treeChild.getChildCount(); j++) { - ((IDataSetFilter)(treeChild.getChildAt(j).getData())).writeXML(child2); - } - - child3 = child2.createChild(DashboardMetaData.XMLgSeries); - child3.putString(DashboardMetaData.XMLgAxis, DashboardMetaData.XMLgAxisX); - child3.putInteger(DashboardMetaData.XMLgColumn, gd[i].xSeries); - for(j=0; j<gd[i].ySeries.length; j++) { - child3 = child2.createChild(DashboardMetaData.XMLgSeries); - child3.putString(DashboardMetaData.XMLgAxis, DashboardMetaData.XMLgAxisY); - child3.putInteger(DashboardMetaData.XMLgColumn, gd[i].ySeries[j]); - } - } - - meta = new File(getSaveDirectory() + DashboardModule.metaFileName); - FileWriter writer = new FileWriter(meta); - data.save(writer); - writer.close(); - } catch(FileNotFoundException fnfe) { - return meta; - } catch(Exception e) { - return meta; - } - return meta; - } - - /** - * This method will create the module archive by first zipping the .stp file and the meta data - * together. Then it will compress the .zip file into a .gz file. The .gz file's extension is - * set to .dash to discurage users from trying to modify it and to make it sepecific to the - * SystemTapGUI dashboard. - * @param archiveName The name to use for the file containing the new module data. - * @param script The file representing the .stp script file to use for the module - * @param meta The XML Memento file representing the module details. - */ - private void buildArchive(String archiveName, File script, File meta) { - String[] files = new String[] {script.getAbsolutePath(), meta.getAbsolutePath()}; - String[] names = new String[] {scriptFileName, DashboardModule.metaFileName}; - - ZipArchive.zipFiles(archiveName, files, names); - ZipArchive.compressFile(archiveName + DashboardModuleFileFilter.DashboardModuleExtension, archiveName); - } - - /** - * This method will delete any extra files that were generated as a result of building - * the Dashboard module. - * @param files A list of all of the file paths that should be removed - */ - private void cleanupFiles(String[] files) { - if(null == files) - return; - - File f; - for(int i=0; i<files.length; i++) { - f = new File(files[i]); - if(f.exists()) - f.delete(); - } - } - - /** - * This method will get the directory name that should be used for saving the dashboard modules. - */ - private String getSaveDirectory() { - return SystemTapGUISettings.settingsFolder + "/dashboard"; - } - - /** - * This method forces the Dashboard's DashboardModuleBrowserView to refresh itself to ensure - * that is contains the most up-to-date module list. - */ - private void updateDashboard() { - try { - IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(DashboardPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); - IViewPart ivp = p.findView(DashboardModuleBrowserView.ID); - ((DashboardModuleBrowserView)ivp).refresh(); - - p = PlatformUI.getWorkbench().showPerspective(IDEPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); - } catch(WorkbenchException we) {} - } - - /** - * Removes all internal references to objects. No other method should be called after this. - */ - public void dispose() { - super.dispose(); - } -} diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ViewScriptAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ViewScriptAction.java deleted file mode 100644 index 5079cdcb46..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/actions/ViewScriptAction.java +++ /dev/null @@ -1,111 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM 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: - * IBM Corporation - Jeff Briggs, Henry Hughes, Ryan Morse, Anithra P J - *******************************************************************************/ - -package org.eclipse.linuxtools.systemtap.ui.dashboardextension.actions; - -import java.io.FileInputStream; -import java.io.IOException; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.DashboardModule; -import org.eclipse.linuxtools.systemtap.ui.dashboard.structures.ModuleTreeNode; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.WorkbenchException; - -import org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor; -import org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective; -import org.eclipse.linuxtools.systemtap.ui.ide.actions.TempFileAction; - -/** - * A class that handles extracting the original script from the dashboard module. - * It will then create a new active editor in the IDE perspective and display the - * module in a temp file. Users can then modify this script and use the modified - * version as well as the original. - * @author Ryan Morse - */ -public class ViewScriptAction extends Action implements IViewActionDelegate { - /** - * This method sets what item the user has selected to view. - */ - public void init(IViewPart view) { - selectedItem = null; - } - - /** - * This method will retreive the script from the selected module for the user - * to see. It will then create a new active editor in the IDE perspective and - * display the module in a temp file. Users can then modify this script and - * use the modified version as well as the original. - * @param act An action representing the click event used to start this method. - */ - public void run(IAction act) { - DashboardModule data = (DashboardModule)selectedItem.getData(); - - try { - IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(IDEPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); - - TempFileAction tfa = new TempFileAction(); - tfa.run(); - - IEditorPart edit = p.getActiveEditor(); - - if(null != edit) { - if(edit instanceof SimpleEditor) { - SimpleEditor editor = (SimpleEditor)edit; - - //Copy the file just to ensure the user has to save their own copy if they want it - FileInputStream fin; - try { - fin = new FileInputStream(data.script); - StringBuilder sb = new StringBuilder(); - - int c; - while((c = fin.read()) != -1) - sb.append((char)c); - - fin.close(); - editor.insertText(sb.toString()); - } catch (IOException e) {} - } - } - } catch(WorkbenchException we) {} - } - - /** - * This method will update the selected item when a new item is selected. - * @param action The action that fired this method. - * @param selection The newly selected item. - */ - public void selectionChanged(IAction action, ISelection selection) { - if(selection instanceof IStructuredSelection) { - IStructuredSelection selected = (IStructuredSelection)selection; - Object o = selected.getFirstElement(); - if(o instanceof ModuleTreeNode) { - selectedItem = (ModuleTreeNode)o; - o = selectedItem.getData(); - if(null != o) { - setEnabled(true); - return; - } - } - } - setEnabled(false); - } - - private ModuleTreeNode selectedItem; -} diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog.java deleted file mode 100644 index 073d666cbd..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ExportScriptDialog.java +++ /dev/null @@ -1,339 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM 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: - * IBM Corporation - Jeff Briggs, Henry Hughes, Ryan Morse, Anithra P J - *******************************************************************************/ - -package org.eclipse.linuxtools.systemtap.ui.dashboardextension.dialogs; - -import java.text.MessageFormat; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.linuxtools.systemtap.ui.dashboardextension.internal.Localization; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.swt.widgets.TreeItem; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.PlatformUI; - -import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.IDataSetFilter; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.GraphData; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter.AvailableFilterTypes; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter.SelectFilterWizard; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.graph.GraphFactory; -import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.graph.SelectGraphWizard; -import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode; - -/** - * This class handles creating a dialog that the user is able to select - * features that they want to be part of their new dashboard module. - * Once the user is done configuring the module, it will create the new - * module for the dashboard from the active script in the editor. - * @author Ryan Morse - */ -public class ExportScriptDialog extends Dialog { - public ExportScriptDialog(Shell parentShell, IDataSet data) { - super(parentShell); - this.data = data; - canceled = false; - } - - /** - * This method will setup the size of the dialog window and set its title. - * @param shell The shell that will contain this dialog box - */ - protected void configureShell(Shell shell) { - super.configureShell(shell); - shell.setText(Localization.getString("ExportScriptDialog.ExportScript")); - shell.setSize(330, 375); - } - - /** - * This method adds all of the components to the dialog and positions them. - * Actions are added to all of the buttons to deal with user interaction. - * @param parent The Composite that will contain all components created in this method - * @return The main Control created by this method. - */ - protected Control createDialogArea(Composite parent) { - Composite comp = new Composite(parent, SWT.NONE); - - //Dialog reference labels - Label lblDisplay = new Label(comp, SWT.NONE); - lblDisplay.setText(Localization.getString("ExportScriptDialog.Display")); - lblDisplay.setBounds(10, 12, 100, 25); - Label lblCategory = new Label(comp, SWT.NONE); - lblCategory.setText(Localization.getString("ExportScriptDialog.Category")); - lblCategory.setBounds(10, 42, 100, 25); - Label lblDescription = new Label(comp, SWT.NONE); - lblDescription.setText(Localization.getString("ExportScriptDialog.Description")); - lblDescription.setBounds(10, 72, 100, 25); - Label lblGraphs = new Label(comp, SWT.NONE); - lblGraphs.setText(Localization.getString("ExportScriptDialog.Graphs")); - lblGraphs.setBounds(10, 150, 100, 25); - - //Text boxes for how to display the new module in the dashboard - txtDisplay = new Text(comp, SWT.BORDER); - txtDisplay.setBounds(120, 10, 200, 25); - txtCategory = new Text(comp, SWT.BORDER); - txtCategory.setBounds(120, 40, 200, 25); - txtDescription = new Text(comp, SWT.MULTI | SWT.WRAP | SWT.BORDER); - txtDescription.setBounds(120, 70, 200, 75); - - treeGraphs = new Tree(comp, SWT.SINGLE | SWT.BORDER); - treeGraphs.setBounds(10, 175, 200, 125); - - //Button to add another graph - btnAdd = new Button(comp, SWT.PUSH); - btnAdd.setText(Localization.getString("ExportScriptDialog.Add")); - btnAdd.setBounds(220, 175, 100, 26); - - //Button to filter the script output data - btnAddFilter = new Button(comp, SWT.PUSH); - btnAddFilter.setText(Localization.getString("ExportScriptDialog.AddFilter")); - btnAddFilter.setBounds(220, 205, 100, 26); - btnAddFilter.setEnabled(false); - - //Button to remove the selected graph/filter - btnRemove = new Button(comp, SWT.PUSH); - btnRemove.setText(Localization.getString("ExportScriptDialog.Remove")); - btnRemove.setBounds(220, 265, 100, 26); - btnRemove.setEnabled(false); - - //Action to notify the buttons when to enable/disable themselves based on list selection - treeGraphs.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - selectedTreeItem = (TreeItem)e.item; - if(null == selectedTreeItem.getParentItem()) - btnAddFilter.setEnabled(true); - else - btnAddFilter.setEnabled(false); - btnRemove.setEnabled(true); - } - - public void widgetDefaultSelected(SelectionEvent e) {} - }); - - //Brings up a new dialog box when user clicks the add button. Allows selecting a new graph to display. - btnAdd.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - SelectGraphWizard wizard = new SelectGraphWizard(data); - IWorkbench workbench = PlatformUI.getWorkbench(); - wizard.init(workbench, null); - WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard); - dialog.create(); - dialog.open(); - - GraphData gd = wizard.getGraphData(); - if(null != gd) { - TreeItem item = new TreeItem(treeGraphs, SWT.NONE); - item.setText(GraphFactory.getGraphName(gd.graphID) + ":" + gd.title); - item.setData(gd); - } - } - - public void widgetDefaultSelected(SelectionEvent e) {} - }); - - //Brings up a new dialog for selecting filter options when the user clicks the filter button. - btnAddFilter.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - SelectFilterWizard wizard = new SelectFilterWizard(data.getTitles()); - IWorkbench workbench = PlatformUI.getWorkbench(); - wizard.init(workbench, null); - WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard); - dialog.create(); - dialog.open(); - - IDataSetFilter f = wizard.getFilter(); - if(null != f) { - TreeItem item = new TreeItem(treeGraphs.getSelection()[0], SWT.NONE); - item.setText(AvailableFilterTypes.getFilterName(f.getID())); - item.setData(f); - } - } - - public void widgetDefaultSelected(SelectionEvent e) {} - }); - - //Removes the selected graph/filter from the tree - btnRemove.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - selectedTreeItem.dispose(); - btnRemove.setEnabled(false); - } - - public void widgetDefaultSelected(SelectionEvent e) {} - }); - - return comp; - } - - /** - * This method haddles what to do when the user clicks the ok or cancel button. - * If canceled it will just close without doing anything. If the user clicked ok - * and the data entered is valid it will set up variables that can be accessed - * later to build the actual module. This method should not be called explicitly. - * @param buttonID A reference to the button that was pressed. 0 - ID, 1- for others - */ - protected void buttonPressed(int buttonID) { - if(0 == buttonID) { //OK - if(txtDisplay.getText().length() <= 0 || - txtCategory.getText().length() <= 0 || - txtDescription.getText().length() <= 0 || - treeGraphs.getItemCount() <= 0) { - String msg = MessageFormat.format(Localization.getString("ExportScriptDialog.FillFields"), null); - MessageDialog.openWarning(this.getShell(), Localization.getString("ExportScriptDialog.Error"), msg); - return; - } - - display = txtDisplay.getText(); - category = txtCategory.getText(); - description = txtDescription.getText(); - buildGraphData(); - buildFilterData(); - } else { - canceled = true; - } - - super.buttonPressed(buttonID); - } - - /** - * This allows outside classes to determine if the user clicked ok or cancel. - * @return boolean representing whether the cancel button was pressed or not - */ - public boolean isCanceled() { - return canceled; - } - - /** - * This allows an outside class to determin what was chosen to be the Category. - * @return String representing the selected Category name. - */ - public String getCategory() { - return category; - } - - /** - * This allows an outside class to determin what was chosen to be the Description. - * @return String representing the selected Description. - */ - public String getDescription() { - return description; - } - - /** - * This allows an outside class to determin what was chosen to be the Display name. - * @return String representing the selected Display name. - */ - public String getDisplay() { - return display; - } - - /** - * This allows an outside class to determin what graph types were selected. - * @return GraphData[] for each selected graph. - */ - public GraphData[] getGraphs() { - return graphData; - } - - /** - * This allows an outside class to determin what filter types were chosen. - * @return TreeNode organized as follows: Root->Graphs->Filters. - */ - public TreeNode getGraphFilters() { - return filters; - } - - /** - * This cleans up all internal references to objects. No other method should - * be called after the dispose method. - */ - public void dispose() { - if(null != txtDisplay) - txtDisplay.dispose(); - if(null != txtCategory) - txtCategory.dispose(); - if(null != txtDescription) - txtDescription.dispose(); - if(null != treeGraphs) - treeGraphs.dispose(); - if(null != btnAdd) - btnAdd.dispose(); - if(null != btnRemove) - btnRemove.dispose(); - if(null != btnAddFilter) - btnAddFilter.dispose(); - if(null != selectedTreeItem) - selectedTreeItem.dispose(); - txtDisplay = null; - txtCategory = null; - txtDescription = null; - treeGraphs = null; - btnAdd = null; - btnRemove = null; - btnAddFilter = null; - selectedTreeItem = null; - data = null; - } - - /** - * This method converts what was selected in the tree into a simple array - * of all of the selected graphs and their data. - */ - private void buildGraphData() { - TreeItem[] children = treeGraphs.getItems(); - graphData = new GraphData[children.length]; - for(int i=0; i<graphData.length; i++) - graphData[i] = (GraphData)children[i].getData(); - } - - /** - * This mothod takes the data from the tree and builds another tree that - * has all the information about the graph and Filters in an easily - * accessable structure. - */ - private void buildFilterData() { - TreeItem[] items = treeGraphs.getItems(); - TreeItem[] filterItems; - - filters = new TreeNode("", false); //$NON-NLS-1$ - TreeNode graphLevel; - for(int i=0; i<items.length; i++) { - filterItems = items[i].getItems(); - - graphLevel = new TreeNode("graph", false); //$NON-NLS-1$ - filters.add(graphLevel); - - for(int j=0; j<filterItems.length; j++) - graphLevel.add(new TreeNode(filterItems[j].getData(), false)); - } - } - - private IDataSet data; - private Tree treeGraphs; - private Text txtDisplay, txtCategory, txtDescription; - private Button btnAdd, btnRemove, btnAddFilter; - private String display, category, description; - private GraphData[] graphData; - private TreeNode filters; - private boolean canceled; - private TreeItem selectedTreeItem; -} diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails.java deleted file mode 100644 index 7c097faefb..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/dialogs/ScriptDetails.java +++ /dev/null @@ -1,130 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 IBM 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: - * IBM Corporation - Anithra P J - *******************************************************************************/ - -package org.eclipse.linuxtools.systemtap.ui.dashboardextension.dialogs; - - - -import org.eclipse.linuxtools.systemtap.ui.dashboard.internal.DashboardPlugin; -import org.eclipse.linuxtools.systemtap.ui.dashboard.preferences.DashboardPreferenceConstants; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Dialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.events.SelectionEvent; - - -public class ScriptDetails extends Dialog { - private Text dirText; - private Text scriptText; - private Button OKButton; - private Button cancelButton; - private boolean canceled = false; - - public ScriptDetails(Shell parent) { - super(parent); - } - - /** - * This allows outside classes to determine if the user clicked ok or cancel. - * @return boolean representing whether the cancel button was pressed or not - */ - public boolean isCanceled() { - return canceled; - } - - public void open() { - - Shell parent = getParent(); - final Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); - shell.setText("Enter Script details"); - shell.setSize(350, 160); - - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.makeColumnsEqualWidth = false; - shell.setLayout(layout); - - GridData data = new GridData(); - data.grabExcessHorizontalSpace = false; - data.horizontalAlignment = SWT.LEFT; - Label dirLabel = new Label(shell, SWT.NONE); - dirLabel.setText("Examples Dir: "); - dirLabel.setLayoutData(data); - - data = new GridData(); - data.grabExcessHorizontalSpace = true; - data.horizontalAlignment = SWT.FILL; - dirText = new Text(shell, SWT.SINGLE | SWT.BORDER); - dirText.setLayoutData(data); - dirText.setText(DashboardPlugin.getDefault().getPluginPreferences().getString(DashboardPreferenceConstants.P_DASHBOARD_EXAMPLES_DIR)); - - data = new GridData(); - data.grabExcessHorizontalSpace = false; - data.horizontalAlignment = SWT.LEFT; - Label scriptLabel = new Label(shell, SWT.NONE); - scriptLabel.setText("Script: "); - scriptLabel.setLayoutData(data); - - data = new GridData(); - data.grabExcessHorizontalSpace = true; - data.horizontalAlignment = SWT.FILL; - scriptText = new Text(shell, SWT.SINGLE | SWT.BORDER); - scriptText.setLayoutData(data); - //scriptText.setText(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_PASSWORD)); - - - data = new GridData(); - data.horizontalAlignment = SWT.RIGHT; - cancelButton = new Button(shell, SWT.PUSH); - cancelButton.setLayoutData(data); - cancelButton.setSize(50, 100); - cancelButton.setText("Cancel"); - cancelButton.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - shell.dispose(); - canceled = true; - } - public void widgetDefaultSelected(SelectionEvent e) {} - }); - - data = new GridData(); - data.horizontalAlignment = SWT.RIGHT; - OKButton = new Button(shell, SWT.PUSH); - OKButton.setLayoutData(data); - OKButton.setSize(50, 100); - OKButton.setText("OK"); - OKButton.addSelectionListener(new SelectionListener() { - public void widgetSelected(SelectionEvent e) { - // FIXME: no error handling is done, should probably be - // pushed down to the connection level - // Set the preferences to this new info. - DashboardPlugin.getDefault().getPreferenceStore().setValue(DashboardPreferenceConstants.P_DASHBOARD_EXAMPLES_DIR, dirText.getText()); - DashboardPlugin.getDefault().getPreferenceStore().setValue(DashboardPreferenceConstants.P_DASHBOARD_SCRIPT, scriptText.getText()); - - shell.close(); - } - public void widgetDefaultSelected(SelectionEvent e) {} - }); - - shell.open(); - Display display = parent.getDisplay(); - while (!shell.isDisposed()) { - if (!display.readAndDispatch()) display.sleep(); - } - } -} diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/DashboardExtensionPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/DashboardExtensionPlugin.java deleted file mode 100644 index e2910d8b85..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/DashboardExtensionPlugin.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM 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: - * IBM Corporation - Jeff Briggs, Henry Hughes, Ryan Morse, Anithra P J - *******************************************************************************/ - -package org.eclipse.linuxtools.systemtap.ui.dashboardextension.internal; - -import org.eclipse.ui.IStartup; -import org.eclipse.ui.plugin.*; -import org.eclipse.jface.resource.ImageDescriptor; -import org.osgi.framework.BundleContext; - -/** - * The main plugin class to be used in the desktop. - */ -public class DashboardExtensionPlugin extends AbstractUIPlugin implements IStartup { - - //The shared instance. - private static DashboardExtensionPlugin plugin; - - /** - * The constructor. - */ - public DashboardExtensionPlugin() { - plugin = this; - } - - /** - * This method is called upon plug-in activation - */ - public void start(BundleContext context) throws Exception { - super.start(context); - } - - /** - * This method is called when the plug-in is stopped - */ - public void stop(BundleContext context) throws Exception { - super.stop(context); - plugin = null; - } - - /** - * Returns the shared instance. - */ - public static DashboardExtensionPlugin getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given - * plug-in relative path. - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.linuxtools.systemtap.ui.dashboardextension", path); - } - - public void earlyStartup() {} -} diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/Localization.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/Localization.java deleted file mode 100644 index a105d5821a..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/Localization.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.linuxtools.systemtap.ui.dashboardextension.internal; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class Localization { - private static final String BUNDLE_NAME = "org.eclipse.linuxtools.systemtap.ui.dashboardextension.internal.localization"; - - private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle - .getBundle(BUNDLE_NAME); - - private Localization() { - } - - public static String getString(String key) { - try { - return RESOURCE_BUNDLE.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } -} diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/localization.properties deleted file mode 100644 index 51fcc6b046..0000000000 --- a/systemtap/org.eclipse.linuxtools.systemtap.ui.dashboardextension/src/org/eclipse/linuxtools/systemtap/ui/dashboardextension/internal/localization.properties +++ /dev/null @@ -1,12 +0,0 @@ -ExportScriptAction.NoFileToExport=No file open to export\! - -ExportScriptDialog.ExportScript=Export Script -ExportScriptDialog.Description=Description: -ExportScriptDialog.FillFields=You must fill in all the fields\! -ExportScriptAction.Error=Error -ExportScriptDialog.Display=Display: -ExportScriptDialog.Category=Category: -ExportScriptDialog.Graphs=Graphs: -ExportScriptDialog.Add=Add -ExportScriptDialog.AddFilter=Add Filter -ExportScriptDialog.Remove=Remove |