Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap-feature/.project17
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap-feature/ChangeLog25
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap-feature/build.properties4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap-feature/epl-v10.html256
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap-feature/feature.properties115
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap-feature/feature.xml87
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.backup-feature/.project17
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.backup-feature/ChangeLog38
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.backup-feature/build.properties3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.backup-feature/epl-v10.html256
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.backup-feature/feature.properties112
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.backup-feature/feature.xml38
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/ChangeLog20
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/META-INF/MANIFEST.MF15
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/build.properties4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/AllTests.java38
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ConsoleStreamDaemonTest.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ErrorStreamDaemonTest.java66
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ErrorTableDisplayTest.java28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ScriptConsoleTest.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/views/ErrorViewTest.java31
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/ChangeLog11
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/META-INF/MANIFEST.MF24
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/build.properties9
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/actions/save_log.gifbin0 -> 583 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/views/error_obj.gifbin0 -> 351 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/views/error_st_obj.gifbin0 -> 339 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/plugin.properties6
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/plugin.xml46
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ClientSession.java326
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScpClient.java232
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/Subscription.java420
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/ConsoleAction.java116
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/SaveLogAction.java59
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/StopScriptAction.java88
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/ErrorMessage.java31
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/SCPDetails.java110
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/SelectServerDialog.java165
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/ConsoleLogPlugin.java66
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/Localization.java22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/localization.properties13
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/ConsoleLogPreferenceConstants.java25
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/ConsoleLogPreferencePage.java68
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/PreferenceInitializer.java38
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ConsoleStreamDaemon.java71
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMError.java62
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMPacket.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMRequest.java197
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMResponse.java136
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ErrorStreamDaemon.java76
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ErrorTableDisplay.java184
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/IErrorParser.java16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ScriptConsole.java288
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/views/ErrorView.java95
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/ChangeLog18
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/META-INF/MANIFEST.MF17
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/build.properties7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/copy_edit.gifbin0 -> 594 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/cut_edit.gifbin0 -> 212 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/delete_edit.gifbin0 -> 351 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/paste_edit.gifbin0 -> 605 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/redo_edit.gifbin0 -> 356 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/undo_edit.gifbin0 -> 355 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/close_edit.gifbin0 -> 163 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/closeall_edit.gifbin0 -> 204 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/new_wiz.gifbin0 -> 612 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/open_wiz.gifbin0 -> 216 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/print_edit.gifbin0 -> 612 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/save_edit.gifbin0 -> 639 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/saveall_edit.gifbin0 -> 604 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/saveas_edit.gifbin0 -> 583 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/plugin.properties18
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/plugin.xml72
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/ColorManager.java41
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/DoubleClickStrategy.java134
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/NonRuleBasedDamagerRepairer.java138
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/PathEditorInput.java113
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/RecentFileMenuManager.java42
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/SimpleDocumentProvider.java242
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/SimpleEditor.java190
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/WhitespaceDetector.java28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/WordDetector.java27
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/ActiveEditorAction.java22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/EditorAction.java70
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/NewFileAction.java45
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/OpenFileAction.java104
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/OpenRecentFileAction.java44
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/EditorPlugin.java68
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/Localization.java22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/RecentFileLog.java118
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/localization.properties5
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/ChangeLog18
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/META-INF/MANIFEST.MF11
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/build.properties4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/src/org/eclipse/linuxtools/systemtap/ui/graphing/AllTests.java28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/src/org/eclipse/linuxtools/systemtap/ui/graphing/structures/GraphDisplaySetTest.java29
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.settings/org.eclipse.pde.prefs22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/ChangeLog11
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/META-INF/MANIFEST.MF26
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/build.properties9
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/concepts.html24
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/dataTable.html38
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/filters.html57
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphInteraction.html22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes.html19
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/barGraph.html12
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/bar.pngbin0 -> 57086 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/line.pngbin0 -> 56270 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multibar.pngbin0 -> 53670 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multiline.pngbin0 -> 55538 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multiscatter.pngbin0 -> 56240 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/scatter.pngbin0 -> 54530 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/lineGraph.html12
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiBarGraph.html12
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiLineGraph.html13
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiScatterGraph.html14
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/scatterGraph.html12
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphWizard.pngbin0 -> 61025 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphWizard2.pngbin0 -> 56674 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphingPerspective.pngbin0 -> 46821 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphingPerspective2.pngbin0 -> 48425 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/filters.pngbin0 -> 21461 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/graphExpanded.pngbin0 -> 13937 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/match.pngbin0 -> 55032 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/match2.pngbin0 -> 47165 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/range.pngbin0 -> 60042 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/range2.pngbin0 -> 48867 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/scale2.pngbin0 -> 4675 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/sort.pngbin0 -> 56352 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/sort2.pngbin0 -> 50899 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/unique.pngbin0 -> 67983 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/zoom.pngbin0 -> 1319 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/gettingStarted.html13
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/graphingTutorial.html78
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/GraphWizard.pngbin0 -> 61025 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/chartbox1.pngbin0 -> 19247 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/graph.pngbin0 -> 55043 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/graphics.pngbin0 -> 57714 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/multi.pngbin0 -> 53849 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/introduction.html26
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/exampleGraphingScripts.html32
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/frequentlyAskedQuestions.html37
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/export.pngbin0 -> 87449 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/import.pngbin0 -> 88542 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/openbox1.pngbin0 -> 49976 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/preferencesbox1.pngbin0 -> 40679 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/saveoutput.pngbin0 -> 91761 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/viewbox1.pngbin0 -> 17660 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/dash.pngbin0 -> 1765 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/export_wiz.gifbin0 -> 329 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/graphing.pngbin0 -> 1668 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/ide.pngbin0 -> 866 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/import_wiz.gifbin0 -> 327 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/open_wiz.gifbin0 -> 216 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/save_wiz.gifbin0 -> 639 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/stop_obj.gifbin0 -> 215 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/menus.html49
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/preferences.html129
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/reference.html19
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/regex.html144
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/toolbars.html29
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/importDataSet.html30
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/makingGraphs.html16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/openScriptOutput.html12
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/savingGraphImage.html11
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/tasks.html16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/toc.html61
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocconcepts.xml17
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocgettingstarted.xml7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocreference.xml11
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/toctasks.xml9
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/export_wiz.gifbin0 -> 329 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/import_wiz.gifbin0 -> 327 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/new_wiz.gifbin0 -> 612 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/open_wiz.gifbin0 -> 216 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/regEx.gifbin0 -> 294 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/save_wiz.gifbin0 -> 639 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiBar.gifbin0 -> 284 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiLine.gifbin0 -> 190 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiScatter.gifbin0 -> 191 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleBar.gifbin0 -> 248 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleLine.gifbin0 -> 144 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleScatter.gifbin0 -> 144 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/perspective_obj.gifbin0 -> 983 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/views/selector_obj.gifbin0 -> 983 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.properties31
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.xml174
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/GraphingConstants.java23
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/GraphingPerspective.java48
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ExportDataSetAction.java148
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ImportDataSetAction.java160
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ModifyParsingAction.java105
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/OpenScriptOutputAction.java200
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/SaveGraphImageAction.java234
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/GraphingPlugin.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/Localization.java22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/localization.properties20
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/DataTablePreferencePage.java71
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphPreferencePage.java84
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphingPreferenceConstants.java20
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphingPreferencePage.java57
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/PreferenceInitializer.java43
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/structures/GraphDisplaySet.java272
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/views/GraphSelectorView.java184
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/toc.xml17
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/.classpath8
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/ChangeLog7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/META-INF/MANIFEST.MF15
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/build.properties4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/AllTests.java88
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/MockDataSet.java67
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/adapters/BlockAdapterTest.java20
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/adapters/ScrollAdapterTest.java20
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/AverageAggregateTest.java66
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/CountAggregateTest.java66
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/MaxAggregateTest.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/MinAggregateTest.java66
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/SumAggregateTest.java66
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/FilteredRowDataSetTest.java271
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowDataSetTest.java157
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowEntryTest.java109
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowParserTest.java66
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/FilteredTableDataSetTest.java267
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableDataSetTest.java164
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableEntryTest.java125
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableParserTest.java69
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/MatchFilterTest.java79
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/RangeFilterTest.java139
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/SortFilterTest.java109
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/UniqueFilterTest.java93
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/ChartStreamDaemonTest.java55
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/ChartStreamDaemonTest2.java60
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/DataPointTest.java19
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/GraphDataTest.java30
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/NumberTypeTest.java76
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/UpdateManagerTest.java57
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/ChangeLog11
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/META-INF/MANIFEST.MF21
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/build.properties5
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/IGraphColorConstants.java245
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/BlockAdapter.java172
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/IAdapter.java38
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/ScrollAdapter.java177
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/AverageAggregate.java43
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/CountAggregate.java40
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/IDataAggregate.java17
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/MaxAggregate.java44
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/MinAggregate.java44
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/SumAggregate.java42
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IBlockDataSet.java16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataEntry.java25
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataSet.java35
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataSetParser.java30
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IFilteredDataSet.java21
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IHistoricalDataSet.java22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/FilteredRowDataSet.java157
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowDataSet.java183
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowEntry.java79
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowParser.java88
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/FilteredTableDataSet.java169
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableDataSet.java204
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableEntry.java112
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableParser.java104
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/IDataSetFilter.java23
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/MatchFilter.java76
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/RangeFilter.java114
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/SortFilter.java89
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/UniqueFilter.java110
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/GraphingAPINonUIPlugin.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/Localization.java22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/localization.properties5
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/ChartStreamDaemon.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/ChartStreamDaemon2.java55
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/DataPoint.java26
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/GraphData.java20
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/NumberType.java105
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/ChangeLog11
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/META-INF/MANIFEST.MF23
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/build.properties7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/BarGraph.gifbin0 -> 284 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/LineGraph.gifbin0 -> 190 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/PieChart.gifbin0 -> 1274 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/ScatterGraph.gifbin0 -> 191 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/plugin.properties3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/plugin.xml26
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/datadisplay/DataGrid.java344
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/AChart.java130
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/AGraph.java241
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/BarGraph.java140
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IBlockGraph.java16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IGraph.java27
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IScrollGraph.java16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/LineGraph.java120
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/PieChart.java108
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/ScatterGraph.java121
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/GraphingAPIUIPlugin.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/Localization.java21
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/localization.properties142
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/DataTablePreferencePage.java56
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphPreferencePage.java69
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphingAPIPreferenceConstants.java25
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphingAPIPreferencePage.java37
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/PreferenceInitializer.java32
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphAxis.java203
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphAxis2.java114
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphCanvas.java256
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphComposite.java210
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphLabel.java104
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphLegend.java108
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/IGraphPrimitive.java54
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/DataSetFactory.java146
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/DataSetWizard.java191
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/ParsingWizardPage.java216
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectDataSetWizardPage.java119
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectRowParsingWizardPage.java126
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectTableParsingWizardPage.java145
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/AggregateFactory.java87
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/AvailableFilterTypes.java121
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/FilterWizardPage.java59
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/MatchFilterWizardPage.java127
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/RangeFilterWizardPage.java175
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SelectFilterWizard.java85
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SelectFilterWizardPage.java119
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SortFilterWizardPage.java108
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/UniqueFilterWizardPage.java149
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/GraphFactory.java157
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/GraphModel.java89
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectGraphWizard.java71
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectGraphWizardPage.java118
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectSeriesWizardPage.java328
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/.classpath9
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/ChangeLog21
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/META-INF/MANIFEST.MF15
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/build.properties4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/AllTests.java33
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/IDESessionSettingsTest.java18
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/StapErrorParserTest.java69
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/TreeSettingsTest.java131
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/ChangeLog67
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/META-INF/MANIFEST.MF35
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/build.properties9
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/completion/stp_completion.properties569
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/concepts.html16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/functionBrowser.html17
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/Editor.pngbin0 -> 58169 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/Function.pngbin0 -> 71937 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/KernelSource.pngbin0 -> 63684 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/ProbeAlias.pngbin0 -> 66851 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_long.gifbin0 -> 367 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_str.gifbin0 -> 576 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_unk.gifbin0 -> 368 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_void.gifbin0 -> 183 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/kernelBrowser.html9
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/probeAliasBrowser.html17
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/stpEditor.html13
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/systemtapPerspectives.html23
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial.html15
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/chartbox1.pngbin0 -> 19247 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/editor.pngbin0 -> 54078 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/graph.pngbin0 -> 55043 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/graphics.pngbin0 -> 57714 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/newfile.pngbin0 -> 32385 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/output.pngbin0 -> 58821 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson1.html30
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson2.html70
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson3.html59
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/gettingStarted.html22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/exampleScripts.html174
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/frequentlyAskedQuestions.html29
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/Console.pngbin0 -> 66102 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/ErrorLog.pngbin0 -> 58821 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/chartbox1.pngbin0 -> 19247 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/consolebox1.pngbin0 -> 19084 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/findbox1.pngbin0 -> 23878 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/gotobox1.pngbin0 -> 7047 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/importbox1.pngbin0 -> 35211 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/newbox1.pngbin0 -> 52828 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/openbox1.pngbin0 -> 49976 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/optionsbox1.pngbin0 -> 28529 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/passbox1.pngbin0 -> 7450 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/preferencesbox1.pngbin0 -> 40679 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/viewbox1.pngbin0 -> 17817 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/dash.pngbin0 -> 1765 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/graphing.pngbin0 -> 1668 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/ide.pngbin0 -> 866 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/import_wiz.gifbin0 -> 327 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/new_wiz.gifbin0 -> 612 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/open_wiz.gifbin0 -> 216 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_chart.gifbin0 -> 612 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_exc.gifbin0 -> 379 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_tool.gifbin0 -> 588 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/stop_obj.gifbin0 -> 215 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/menus.html105
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/preferences.html129
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/reference.html19
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/regex.html144
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/toolbars.html29
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/viewsAndEditors.html34
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/creatingSystemtapScripts.html17
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/addedModule.pngbin0 -> 8131 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/exportScript.pngbin0 -> 61215 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/options.pngbin0 -> 28529 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/tasks.html14
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/usingTheSTPEditor.html30
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/viewingDataCharts.html14
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/toc.html54
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocconcepts.xml10
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocgettingstarted.xml10
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocreference.xml14
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/toctasks.xml8
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/import_wiz.gifbin0 -> 327 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_chart.gifbin0 -> 612 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_exc.gifbin0 -> 379 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_tool.gifbin0 -> 588 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/terminate_co.gifbin0 -> 215 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_c.gifbin0 -> 351 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_h.gifbin0 -> 353 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_stp.gifbin0 -> 360 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/file_obj.gifbin0 -> 354 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/fldr_obj.gifbin0 -> 216 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/probe_obj.gifbin0 -> 374 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/perspective_obj.gifbin0 -> 371 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/sample.gifbin0 -> 983 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_long.gifbin0 -> 367 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_str.gifbin0 -> 576 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_unk.gifbin0 -> 368 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_void.gifbin0 -> 183 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/func_obj.gifbin0 -> 126 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/kernel_obj.gifbin0 -> 227 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/page_obj.gifbin0 -> 359 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/probe_obj.gifbin0 -> 149 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.properties70
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.xml317
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/IDEPerspective.java69
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/IDESessionSettings.java26
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/DefinitionAction.java154
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/ImportTapsetAction.java104
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptAction.java345
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptChartAction.java128
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptOptionsAction.java105
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/TempFileAction.java54
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/FunctionBrowserAction.java142
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/KernelSourceAction.java178
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/ProbeAliasAction.java134
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/TreeExpandCollapseAction.java136
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/dialogs/ErrorMessage.java31
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CConfiguration.java103
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CDocumentProvider.java51
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CEditor.java346
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CPartitionScanner.java42
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CScanner.java110
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/ICColorConstants.java28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPColorConstants.java24
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPCompletionProcessor.java159
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPConfiguration.java144
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPDocumentProvider.java68
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPEditor.java163
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPElementScanner.java110
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPMetadataSingleton.java305
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPPartitionScanner.java94
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPPartitioner.java61
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java278
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/strings.properties568
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/IDECloseMonitor.java46
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/IDEPlugin.java81
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/Localization.java22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/localization.properties70
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/CodeAssistPreferencePage.java73
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/ConditionalFilterPreferencePage.java50
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/EditorPreferencePage.java52
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/IDEPreferenceConstants.java91
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/IDEPreferencePage.java48
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/PathPreferencePage.java54
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/PreferenceInitializer.java93
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/StapOptionsPreferencePage.java60
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/StapPreferencePage.java45
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/SyntaxColoringPreferencePage.java185
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/TapsetsPreferencePage.java52
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/TypeingPreferencePage.java45
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/Query.java176
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/StapErrorParser.java84
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TapsetLibrary.java202
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TapsetParser.java679
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TreeSettings.java253
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/uistructures/StapSettingsDialog.java178
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/BrowserView.java167
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/FunctionBrowserView.java139
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/KernelBrowserView.java141
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/ProbeAliasBrowserView.java103
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/toc.xml17
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/ChangeLog12
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/META-INF/MANIFEST.MF15
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/build.properties6
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/plugin.properties1
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/plugin.xml16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/LogManager.java203
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/Localization.java22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LogDaemon.java69
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LogEntry.java25
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LoggingPlugin.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/localization.properties10
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/LoggingPreferencePage.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/PreferenceConstants.java49
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/PreferenceInitializer.java31
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/ChangeLog34
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/META-INF/MANIFEST.MF15
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/build.properties4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/AllTests.java53
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/CCodeFileFilterTest.java37
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/CopierTest.java54
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/IndexedObjectTest.java38
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/JarArchiveTest.java23
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/KernelSourceTreeTest.java78
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/LoggingStreamDaemonTest.java60
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/SortTest.java85
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/StringFormatterTest.java94
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeDefinitionNodeTest.java79
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeNodeTest.java231
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/ZipArchiveTest.java72
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/CommandTest.java80
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/LoggedCommandTest.java67
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/StreamGobblerTest.java62
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/ConditionalExpressionValidatorTest.java35
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/DirectoryValidatorTest.java32
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/IntegerValidatorTest.java32
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/MultiValidatorTest.java46
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/NumberValidatorTest.java31
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/ChangeLog12
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/META-INF/MANIFEST.MF16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/build.properties5
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/CCodeFileFilter.java37
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/Copier.java48
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IFormattingStyles.java30
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IPasswordPrompt.java16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IndexedObject.java37
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/JarArchive.java80
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/KernelSourceTree.java75
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/LoggingStreamDaemon.java131
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/PasswordPrompt.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/RegExParser.java57
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/Sort.java71
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/StringFormatter.java58
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeDefinitionNode.java34
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeNode.java130
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/UpdateManager.java84
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ZipArchive.java141
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/Localization.java22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/StructuresPlugin.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/localization.properties23
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IActionListener.java16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IGobblerListener.java21
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/ITabListener.java18
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IUpdateListener.java16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/Command.java279
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/LoggedCommand.java98
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/StreamGobbler.java201
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/ComboFieldEditor.java197
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/ListEditor.java74
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/PasswordDialog.java95
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/ConditionalExpressionValidator.java41
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/DirectoryValidator.java39
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/IntegerValidator.java36
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/MultiValidator.java42
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/NumberValidator.java38
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.project28
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.settings/org.eclipse.jdt.core.prefs65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/ChangeLog12
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/META-INF/MANIFEST.MF20
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/about.html23
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/aboutImage.gifbin0 -> 9770 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/build.properties14
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/gettingstarted/gettingStarted.html95
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/gettingstarted/installation.html46
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/toc.html18
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/tocgettingstarted.xml22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/eclipse.gifbin0 -> 308 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/perspective_obj.gifbin0 -> 361 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/welcome.gifbin0 -> 553 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin.properties10
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin.xml56
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin_customization.ini6
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/splash.bmpbin0 -> 464694 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/splash2.bmpbin0 -> 248214 bytes
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/Application.java44
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationActionBarAdvisor.java330
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationWorkbenchAdvisor.java54
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationWorkbenchWindowAdvisor.java61
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/Perspective.java44
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/SystemTapGUISettings.java20
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/Localization.java22
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/SystemTapGUIPlugin.java65
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/localization.properties11
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/EnvironmentVariablesPreferencePage.java168
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/PreferenceConstants.java43
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/PreferenceInitializer.java29
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/SystemTapPreferencePage.java57
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/views/WelcomeView.java87
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/toc.xml11
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/.project11
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/ChangeLog7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/build.properties4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/epl-v10.html256
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/feature.properties112
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/feature.xml91
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.classpath7
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.project17
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/ChangeLog16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/META-INF/MANIFEST.MF20
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/about.html26
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/build.properties10
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.properties13
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.xml16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiMockProcess.java56
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiTestsPlugin.java83
648 files changed, 37113 insertions, 0 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap-feature/.project b/systemtap/org.eclipse.linuxtools.systemtap-feature/.project
new file mode 100644
index 0000000000..aa03b2d5cd
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap-feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap-feature/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap-feature/ChangeLog
new file mode 100644
index 0000000000..ccfd32a243
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap-feature/ChangeLog
@@ -0,0 +1,25 @@
+2009-08-06 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Remove trailing period.
+ Add copyright.
+ * feature.xml: Add copyright.
+
+2009-08-06 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * feature.properties: Change the description.
+ * feature.xml: Change the label.
+
+2009-08-06 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * feature.xml:renaming systemtap.ui to systemtap
+
+2009-08-05 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: use feature.properties variables.
+ * feature.properties: Provider: Eclipse.org -> Eclipse
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * ChangeLog: Refactoring. Renaming all packages directories from *.systemtapgui.* to *.systemtap.ui.*
+ * .project:
+ * feature.xml: \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap-feature/build.properties b/systemtap/org.eclipse.linuxtools.systemtap-feature/build.properties
new file mode 100644
index 0000000000..33c989ca2c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap-feature/build.properties
@@ -0,0 +1,4 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ epl-v10.html
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap-feature/epl-v10.html b/systemtap/org.eclipse.linuxtools.systemtap-feature/epl-v10.html
new file mode 100644
index 0000000000..9321f4082e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap-feature/epl-v10.html
@@ -0,0 +1,256 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Eclipse Public License - Version 1.0</title>
+
+<style type="text/css">
+ body {
+ size: 8.5in 11.0in;
+ margin: 0.25in 0.5in 0.25in 0.5in;
+ tab-interval: 0.5in;
+ }
+ p {
+ margin-left: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ p.list {
+ margin-left: 0.5in;
+ margin-top: 0.05em;
+ margin-bottom: 0.05em;
+ }
+ </style></head><body lang="EN-US">
+
+<p align="center"><b>Eclipse Public License - v 1.0</b></p>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+</body></html> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap-feature/feature.properties b/systemtap/org.eclipse.linuxtools.systemtap-feature/feature.properties
new file mode 100644
index 0000000000..d33e0ae9ab
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap-feature/feature.properties
@@ -0,0 +1,115 @@
+#*******************************************************************************
+# Copyright (c) 2008 Red Hat, Inc.
+# 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
+#
+#********************************************************************************
+featureName=systemtapgui
+description=SystemTap IDE and visualization tool (Incubation)
+featureProvider=Eclipse
+copyright=\
+Copyright (c) 2009 IBM Corporation. All rights reserved.\n\
+\n\
+This program and the accompanying materials are made available under the terms\n\
+of the Eclipse Public License v1.0 which accompanies this distribution, and is\n\
+available at http://www.eclipse.org/legal/epl-v10.html\n
+licenseURL=epl-v10.html
+license=\
+ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
+March 17, 2005\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
+is provided to you under the terms and conditions of the Eclipse Public\n\
+License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
+Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse.org CVS\n\
+repository ("Repository") in CVS modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+Features may also include other Features ("Included Features"). Files named\n\
+"feature.xml" may contain a list of the names and version numbers of\n\
+Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Eclipse Update Manager, you must agree to a license ("Feature Update\n\
+License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties". Such Abouts,\n\
+Feature Licenses and Feature Update Licenses contain the terms and\n\
+conditions (or references to such terms and conditions) that govern your\n\
+use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use,\n\
+and re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap-feature/feature.xml b/systemtap/org.eclipse.linuxtools.systemtap-feature/feature.xml
new file mode 100644
index 0000000000..77f38a8099
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap-feature/feature.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.linuxtools.systemtap"
+ label="%description"
+ version="0.3.0.qualifier"
+ provider-name="%provider">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="Linux Tools Update Site" url="http://download.eclipse.org/technology/linuxtools/update"/>
+ </url>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.consolelog"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.editor"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.graphingapi.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.logging"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.structures"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.graphing"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.systemtapgui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.ide"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/.project b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/.project
new file mode 100644
index 0000000000..23875d0964
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.backup-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/ChangeLog
new file mode 100644
index 0000000000..64f4688042
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/ChangeLog
@@ -0,0 +1,38 @@
+2009-08-06 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * feature.xml:renaming to systemtap.backup
+
+2009-08-05 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Remove .feature from name.
+
+2009-07-08 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Temporarily revert change to included plugin.
+ * .project: Likewise.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * .project:
+ * feature.xml:
+ * ChangeLog: Refactoring the code to systemtap.backup.ui*. This code
+ has been merged with org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.*
+
+2009-05-19 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Change provider from Eclipse.org to Eclipse.
+
+2009-01-09 Phil Muldoon <pmuldoon@redhat.com>
+
+ * feature.xml: Add .qualifier to feature version.
+
+2009-01-06 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Add update site information. 1.0.0 -> 0.1.0.
+ * build.properties: Add feature.properties and epl-v10.html.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * epl-v10.html: New file.
+ * feature.properties: New file. Add more description feature.
+ * feature.xml: Use feature.properties for strings. \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/build.properties
new file mode 100644
index 0000000000..0c6ef87303
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/build.properties
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ epl-v10.html
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/epl-v10.html b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/epl-v10.html
new file mode 100644
index 0000000000..9321f4082e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/epl-v10.html
@@ -0,0 +1,256 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Eclipse Public License - Version 1.0</title>
+
+<style type="text/css">
+ body {
+ size: 8.5in 11.0in;
+ margin: 0.25in 0.5in 0.25in 0.5in;
+ tab-interval: 0.5in;
+ }
+ p {
+ margin-left: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ p.list {
+ margin-left: 0.5in;
+ margin-top: 0.05em;
+ margin-bottom: 0.05em;
+ }
+ </style></head><body lang="EN-US">
+
+<p align="center"><b>Eclipse Public License - v 1.0</b></p>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+</body></html> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/feature.properties b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/feature.properties
new file mode 100644
index 0000000000..9ffd1f8d0e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/feature.properties
@@ -0,0 +1,112 @@
+#*******************************************************************************
+# Copyright (c) 2008 Red Hat, Inc.
+# 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:
+# Red Hat, Inc. - initial API and implementation
+#********************************************************************************
+featureName=Systemtap script editor (Incubation)
+description=Plugins for maintaining and developing Systemtap scripts.
+provider=Eclipse
+copyright=Copyright 2008 Phillip Muldoon.
+licenseURL=epl-v10.html
+license=\
+ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
+March 17, 2005\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
+is provided to you under the terms and conditions of the Eclipse Public\n\
+License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
+Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse.org CVS\n\
+repository ("Repository") in CVS modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+Features may also include other Features ("Included Features"). Files named\n\
+"feature.xml" may contain a list of the names and version numbers of\n\
+Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Eclipse Update Manager, you must agree to a license ("Feature Update\n\
+License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties". Such Abouts,\n\
+Feature Licenses and Feature Update Licenses contain the terms and\n\
+conditions (or references to such terms and conditions) that govern your\n\
+use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use,\n\
+and re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/feature.xml b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/feature.xml
new file mode 100644
index 0000000000..512d5e60ea
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.backup-feature/feature.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.linuxtools.systemtap.backup"
+ label="%featureName"
+ version="0.1.0.qualifier"
+ provider-name="%provider">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="Linux Tools Update Site" url="http://download.eclipse.org/technology/linuxtools/update"/>
+ </url>
+
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.jface.text"/>
+ <import plugin="org.eclipse.ui.editors"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.editor"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/.classpath
new file mode 100644
index 0000000000..751c8f2e50
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/.project
new file mode 100644
index 0000000000..21f24f7a45
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.consolelog.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/ChangeLog
new file mode 100644
index 0000000000..1f18bac74c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/ChangeLog
@@ -0,0 +1,20 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * .classpath: New file.
+ * .project: New file.
+ * build.properties: New file.
+ * META-INF/MANIFEST.MF: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/AllTests.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ConsoleStreamDaemonTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ErrorStreamDaemonTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ErrorTableDisplayTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ScriptConsoleTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/views/ErrorViewTest.java: \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..8fa1850e95
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.consolelog.tests
+Bundle-Version: 0.3.0.qualifier
+Bundle-Vendor: Eclipse
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.consolelog.tests.ConsoleLogPlugin
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Import-Package: junit.framework,
+ org.eclipse.linuxtools.systemtap.ui.consolelog,
+ org.eclipse.linuxtools.systemtap.ui.consolelog.structures,
+ org.eclipse.linuxtools.systemtap.ui.structures.runnable,
+ org.eclipse.ui.console
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/build.properties
new file mode 100644
index 0000000000..34d2e4d2da
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/AllTests.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/AllTests.java
new file mode 100644
index 0000000000..f6add33796
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/AllTests.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.test;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.test.structures.ConsoleStreamDaemonTest;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.test.structures.ErrorStreamDaemonTest;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.test.structures.ErrorTableDisplayTest;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.test.structures.ScriptConsoleTest;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.test.views.ErrorViewTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.eclipse.linuxtools.systemtap.ui.consolelog.test");
+
+ //Structures
+ suite.addTestSuite(ConsoleStreamDaemonTest.class);
+ suite.addTestSuite(ErrorStreamDaemonTest.class);
+ suite.addTestSuite(ErrorTableDisplayTest.class);
+ suite.addTestSuite(ScriptConsoleTest.class);
+
+ //views
+ suite.addTestSuite(ErrorViewTest.class);
+
+ return suite;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ConsoleStreamDaemonTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ConsoleStreamDaemonTest.java
new file mode 100644
index 0000000000..2906906471
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ConsoleStreamDaemonTest.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.test.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.StreamGobbler;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ConsoleStreamDaemon;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
+
+import junit.framework.TestCase;
+
+public class ConsoleStreamDaemonTest extends TestCase {
+ public ConsoleStreamDaemonTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ StreamGobbler gobbler = new StreamGobbler(System.in);
+ gobbler.start();
+ daemon = new ConsoleStreamDaemon(null);
+ }
+
+ public void testConsoleStreamDaemon() {
+ assertNotNull(daemon);
+
+ ConsoleStreamDaemon csd = new ConsoleStreamDaemon(null);
+ assertNotNull(csd);
+
+ csd = new ConsoleStreamDaemon(ScriptConsole.getInstance("test"));
+ assertNotNull(csd);
+ }
+
+ public void testHandleDataEvent() {
+ daemon.handleDataEvent("");
+ assertNotNull(daemon);
+ }
+
+ public void testIsDisposed() {
+ ConsoleStreamDaemon csd = new ConsoleStreamDaemon(null);
+ assertFalse(csd.isDisposed());
+ csd.dispose();
+ assertTrue(csd.isDisposed());
+ }
+
+ public void testDispose() {
+ daemon.dispose();
+ assertNotNull(daemon);
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ private ConsoleStreamDaemon daemon;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ErrorStreamDaemonTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ErrorStreamDaemonTest.java
new file mode 100644
index 0000000000..adca740b56
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ErrorStreamDaemonTest.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.test.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ConsoleStreamDaemon;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ErrorStreamDaemon;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.StreamGobbler;
+
+import junit.framework.TestCase;
+
+public class ErrorStreamDaemonTest extends TestCase {
+ public ErrorStreamDaemonTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ StreamGobbler gobbler = new StreamGobbler(System.in);
+ gobbler.start();
+ daemon = new ErrorStreamDaemon(null, null, null);
+ }
+
+ public void testConsoleStreamDaemon() {
+ assertNotNull(daemon);
+
+ ConsoleStreamDaemon csd = new ConsoleStreamDaemon(null);
+ assertNotNull(csd);
+
+ csd = new ConsoleStreamDaemon(ScriptConsole.getInstance("test"));
+ assertNotNull(csd);
+ }
+
+ public void testHandleDataEvent() {
+ daemon.handleDataEvent("");
+ assertNotNull(daemon);
+ }
+
+ public void testIsDisposed() {
+ ConsoleStreamDaemon csd = new ConsoleStreamDaemon(null);
+ assertFalse(csd.isDisposed());
+ csd.dispose();
+ assertTrue(csd.isDisposed());
+ }
+
+ public void testDispose() {
+ daemon.dispose();
+ assertNotNull(daemon);
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ private ErrorStreamDaemon daemon;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ErrorTableDisplayTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ErrorTableDisplayTest.java
new file mode 100644
index 0000000000..42bc72496a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ErrorTableDisplayTest.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.test.structures;
+
+import junit.framework.TestCase;
+
+public class ErrorTableDisplayTest extends TestCase {
+ public ErrorTableDisplayTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ScriptConsoleTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ScriptConsoleTest.java
new file mode 100644
index 0000000000..3f5ac718fb
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/structures/ScriptConsoleTest.java
@@ -0,0 +1,65 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog.test.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
+
+
+import junit.framework.TestCase;
+
+public class ScriptConsoleTest extends TestCase {
+
+ public ScriptConsoleTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ console = ScriptConsole.getInstance("test");
+ }
+
+ public void testGetInstance() {
+ assertNotNull(console);
+ assertSame(console, ScriptConsole.getInstance("test"));
+ ScriptConsole console2 = ScriptConsole.getInstance("a");
+ assertNotNull(console2);
+ assertNotSame(console, console2);
+ }
+
+ public void testRun() {
+
+ }
+
+ public void testIsRunning() {
+
+ }
+
+ public void testIsDisposed() {
+
+ }
+
+ public void testSaveStream() {
+
+ }
+
+ public void testGetCommand() {
+
+ }
+
+ public void testStop() {
+
+ }
+
+ public void testDispose() {
+
+ }
+
+ public void testSetName() {
+
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ ScriptConsole console;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/views/ErrorViewTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/views/ErrorViewTest.java
new file mode 100644
index 0000000000..685832323c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog.tests/src/org/eclipse/linuxtools/systemtap/ui/consolelog/test/views/ErrorViewTest.java
@@ -0,0 +1,31 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog.test.views;
+
+import junit.framework.TestCase;
+
+public class ErrorViewTest extends TestCase {
+ public ErrorViewTest(String name) {
+ super(name);
+ }
+
+ public void testCreatePartControl() {
+ }
+
+ public void testAdd() {
+/* view.add(null);
+ view.add(new String[] {});
+ view.add(new String[] {"asdf"});
+ view.add(new String[] {"test", "one", "two"});
+*/ }
+
+ public void testClear() {
+// view.clear();
+ }
+
+ public void testSetFocus() {
+// view.setFocus();
+ }
+
+ public void testDispose() {
+// view.dispose();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.project
new file mode 100644
index 0000000000..166d553357
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.consolelog</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.settings/org.eclipse.jdt.core.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..e6130aa6a3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Fri Feb 27 18:15:40 IST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/ChangeLog
new file mode 100644
index 0000000000..9e11384b8d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/ChangeLog
@@ -0,0 +1,11 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * ChangeLog: Refactoring. Renaming all packages directories from *.systemtapgui.* to *.systemtap.ui.* \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..f421d48927
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ConsoleLog Plug-in
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.consolelog;singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.consolelog.internal.ConsoleLogPlugin
+Bundle-Vendor: Eclipse
+Bundle-Localization: plugin
+Export-Package: org.eclipse.linuxtools.systemtap.ui.consolelog,
+ org.eclipse.linuxtools.systemtap.ui.consolelog.actions,
+ org.eclipse.linuxtools.systemtap.ui.consolelog.dialogs,
+ org.eclipse.linuxtools.systemtap.ui.consolelog.internal,
+ org.eclipse.linuxtools.systemtap.ui.consolelog.preferences,
+ org.eclipse.linuxtools.systemtap.ui.consolelog.structures,
+ org.eclipse.linuxtools.systemtap.ui.consolelog.views
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.console;visibility:=reexport,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.linuxtools.systemtap.ui.editor,
+ org.eclipse.linuxtools.systemtap.ui.structures,
+ com.jcraft.jsch;bundle-version="0.1.37"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/build.properties
new file mode 100644
index 0000000000..fc993cec49
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/,\
+ plugin.properties,\
+ .classpath
+src.includes = .classpath
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/actions/save_log.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/actions/save_log.gif
new file mode 100644
index 0000000000..71ad510b41
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/actions/save_log.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/views/error_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/views/error_obj.gif
new file mode 100644
index 0000000000..b6922ac11c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/views/error_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/views/error_st_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/views/error_st_obj.gif
new file mode 100644
index 0000000000..0bc60689c6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/icons/views/error_st_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/plugin.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/plugin.properties
new file mode 100644
index 0000000000..afd8b0297e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/plugin.properties
@@ -0,0 +1,6 @@
+view.error.name=Error Log
+
+action.saveLog.name=Save &Log
+action.saveLog.desc=Save console log to file
+
+preference.consoleLog.name=RemoteServer \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/plugin.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/plugin.xml
new file mode 100644
index 0000000000..82a09c16b5
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/plugin.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ name="%view.error.name"
+ allowMultiple="false"
+ icon="icons/views/error_obj.gif"
+ class="org.eclipse.linuxtools.systemtap.ui.consolelog.views.ErrorView"
+ id="org.eclipse.linuxtools.systemtap.ui.consolelog.views.ErrorView"/>
+ </extension>
+
+
+ <extension
+ point="org.eclipse.ui.viewActions">
+ <viewContribution
+ id="org.eclipse.linuxtools.systemtap.ui.consolelog.consoleview.toolbar"
+ targetID="org.eclipse.ui.console.ConsoleView">
+ <action
+ id="org.eclipse.linuxtools.systemtap.ui.consolelog.actions.SaveLogAction"
+ label="%action.saveLog.name"
+ tooltip="%action.saveLog.desc"
+ class="org.eclipse.linuxtools.systemtap.ui.consolelog.actions.SaveLogAction"
+ icon="icons/actions/save_log.gif"
+ toolbarPath="launchGroup"
+ state="false"
+ style="push"/>
+
+ </viewContribution>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.linuxtools.systemtap.ui.consolelog.preferences.PreferenceInitializer"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="%preference.consoleLog.name"
+ id="com.qualityeclipse.systemtap.prefs.consoleLog"
+ class="org.eclipse.linuxtools.systemtap.ui.consolelog.preferences.ConsoleLogPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.view"/>
+ </extension>
+</plugin>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ClientSession.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ClientSession.java
new file mode 100644
index 0000000000..dc3db44111
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ClientSession.java
@@ -0,0 +1,326 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.TreeMap;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.dialogs.ErrorMessage;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.ConsoleLogPlugin;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.preferences.ConsoleLogPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.DMRequest;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.DMResponse;
+
+
+
+
+/**
+ * Singleton thread. Maintains the communication between the
+ * data manager and the client (this).
+ *
+ * @author patrickm
+ *
+ */
+public final class ClientSession extends Thread {
+
+ private static ClientSession instance = null;
+ private static int portnumber, clientID;
+ private static boolean connected;
+ private static String hostname;
+ private static int scriptnumber;
+ private static InputStream in;
+ private static TreeMap<Integer, LinkedBlockingQueue<byte[]>> mbox;
+
+ private ClientSession () {
+ // only happens once
+
+ hostname = ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.HOST_NAME);
+ portnumber = ConsoleLogPlugin.getDefault().getPluginPreferences().getInt(ConsoleLogPreferenceConstants.PORT_NUMBER);
+ mbox = new TreeMap<Integer, LinkedBlockingQueue<byte[]>> ();
+ connected = createConnection ();
+ scriptnumber = 15;
+ if (connected) this.start();
+ }
+
+ /**
+ * Send a request packet to the data manager. Synchronized, only
+ * one request can be sent at a time.
+ *
+ * @param req The filled in request packet to send over the socket.
+ * @return true if successfully sent, false otherwise.
+ */
+ public synchronized boolean sendRequest (DMRequest req) {
+
+ try {
+ // open perma-socket:
+ Socket tmp = new Socket(hostname, portnumber);
+ OutputStream out = tmp.getOutputStream();
+
+ out.write(req.getData());
+ out.flush();
+ out.flush();
+ out.close();
+
+ return true;
+
+ } catch (final UnknownHostException uhe) {
+ new ErrorMessage("Unknown host!", "Check if server is running").open();
+ System.err.println("Unknown host: " + uhe.getMessage());
+ connected = false;
+ return false;
+ } catch (final IOException ioe) {
+ new ErrorMessage("Unable to send request!", "Check if server is running").open();
+ System.err.println("Req I/O error " + ioe.getMessage());
+ connected = false;
+ return false;
+ }
+ }
+
+ /**
+ * Read a response from the data manager and return the response packet.
+ *
+ * @return A response packet. Possibly invalid/incomplete.
+ */
+ public DMResponse recvResponse (int scriptnum) {
+
+ if (!mbox.containsKey(scriptnum)) {
+ return null;
+ }
+ try {
+ DMResponse dm = new DMResponse (mbox.get(scriptnum).take());
+
+ return dm;
+ } catch (InterruptedException ie) {
+ return null;
+ }
+
+ }
+
+ /**
+ * Read size bytes from the socket and return the result as a String. The
+ * size is most likely from DMResponse.packetsize .
+ *
+ * @param size The number of bytes to read from the open socket.
+ * @return A String of size characters long, or null if there was an error.
+ */
+ public byte[] recvData (int scriptnum, int size) {
+ if (!mbox.containsKey(scriptnum)) {
+
+ return null;
+ }
+
+ try {
+ // maybe check that the sizes match?
+ return mbox.get(scriptnum).take();
+
+ } catch (InterruptedException ie) {
+// subscription.interrupt() was probably called
+ System.err.println("Interruptedrecvdata");
+ return null;
+ }
+ }
+
+ public boolean addSubscription (int scriptnum) {
+ if (mbox.containsKey(scriptnum))
+ {
+ return false;
+ }
+ mbox.put(scriptnum, new LinkedBlockingQueue<byte[]>());
+ return true;
+ }
+
+ public boolean delSubscription (int scriptnum)
+ {
+ if (!mbox.containsKey(scriptnum))
+ return false;
+
+
+ mbox.get(scriptnum).clear();
+ mbox.remove(scriptnum);
+ return true;
+ }
+
+ public static synchronized ClientSession getInstance () {
+ // synchronized so everybody has the same session
+ if (instance == null)
+ instance = new ClientSession ();
+ else
+ {
+ if(!isConnected())
+ {
+ connected=instance.createConnection();
+ scriptnumber = 15;
+ if (connected) instance.start();
+ }
+ }
+ return instance;
+ }
+
+ public static int getNewScriptId()
+ {
+ return scriptnumber++;
+ }
+
+ public static boolean isConnected () {
+ return connected;
+ }
+
+ public int getcid () {
+ return clientID;
+ }
+
+ public void run () {
+
+ while (!Thread.interrupted()) {
+
+ final byte[] headBuffer = new byte[DMResponse.packetsize];
+ final byte[] bodyBuffer;
+ DMResponse header;
+
+ try {
+ // Boolean first = new Boolean(true);
+ in.read(headBuffer, 0, headBuffer.length);
+ header = new DMResponse (headBuffer);
+ if(header.isValid())
+ {
+ bodyBuffer = new byte[header.getsize()];
+ in.read(bodyBuffer, 0, bodyBuffer.length);
+ if(header.getsource() == DMResponse.SUBSCRIPTION_MGR)
+ {
+ if(!mbox.containsKey(header.getscriptID()))
+ mbox.put(header.getscriptID (), new LinkedBlockingQueue<byte[]> ());
+ mbox.get(header.getscriptID()).put(header.tobytes());
+ mbox.get(header.getscriptID()).put(bodyBuffer);
+
+ }
+ else
+ {
+ if(!mbox.containsKey(header.getscriptID()))
+ mbox.put(header.getscriptID (), new LinkedBlockingQueue<byte[]> ());
+ mbox.get(header.getscriptID()).put(header.tobytes());
+ mbox.get(header.getscriptID()).put(bodyBuffer);
+
+ }
+ }
+ else {
+ // either the header was not valid,
+ // or the scriptid has not been seen before..
+
+ }
+
+ } catch (InterruptedException ie) {
+ // probably shutting down
+ System.err.println ("Interrupted: " + ie.getMessage());
+ break;
+
+ } catch (IOException ioe) {
+ new ErrorMessage("I/O Error Check host!", "See stderr for more details").open();
+ System.err.println ("i/o error: " + ioe.getMessage());
+ return;
+
+ } catch (Exception e) {
+ new ErrorMessage("Check if DMD is running", "See stderr for more details").open();
+ System.err.println ("Server terminated unexpectedly?," + e.getMessage());
+ return;
+ }
+
+
+
+ } // while
+ this.destroyConnection();
+
+ }
+
+ /**
+ * Grab hostname and port settings from the settings, attempt to open
+ * socket, and finally attempt to open a connection to the data manager
+ * and store a clientID. If anything fails the connection is left in an
+ * unknown state (see stderr).
+ *
+ * @return true if everything succeeded, false otherwise.
+ */
+ public boolean createConnection () {
+
+ final DMRequest ccpacket = new DMRequest (DMRequest.CREATE_CONN, 0, 0, 0);
+ final byte buffer[] = new byte[DMResponse.packetsize];
+ final DMResponse respacket;
+ hostname = ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.HOST_NAME);
+ portnumber = ConsoleLogPlugin.getDefault().getPluginPreferences().getInt(ConsoleLogPreferenceConstants.PORT_NUMBER);
+
+ OutputStream out = null;
+ try {
+
+ Socket tmp = new Socket(hostname, portnumber);
+ out = tmp.getOutputStream();
+ in = tmp.getInputStream();
+ out.write(ccpacket.getData());
+ out.flush();
+ in.read(buffer, 0, buffer.length);
+ respacket = new DMResponse (buffer);
+
+ } catch (final UnknownHostException uhe) {
+ new ErrorMessage("Unknown host!", "See stderr for more details").open();
+ System.err.println("Unknown host: " + uhe.getMessage());
+ return false;
+ } catch (final IOException ioe) {
+ new ErrorMessage("Connection I/O error!", "See stderr for more details").open();
+ System.err.println("Con I/O error: " + ioe.getMessage());
+ //ioe.printStackTrace();
+ return false;
+ }
+
+ if (!respacket.isValid())
+ {
+ return false;}
+
+
+ clientID = respacket.getclientID();
+ return true;
+ }
+
+ /**
+ * Send a disconnection request to the data manager, and attempt to
+ * close the open socket to the data manager. If anything fails the
+ * connection is left in a unknown state (see stderr).
+ *
+ * @return true if successfully destroyed, false otherwise
+ */
+ public boolean destroyConnection () {
+
+ final DMRequest dcpacket = new DMRequest (DMRequest.DESTROY_CONN, 0, clientID, 0);
+
+ try {
+ sendRequest (dcpacket);
+ in.close();
+ connected = false;
+ return true;
+ } catch (final IOException e) {
+ new ErrorMessage("Connection close error!", "See stderr for more details").open();
+ System.err.println("Close error: " + e.getMessage());
+ return false;
+ }
+
+// Old code that actually checks the response and whatnot,
+// removed because we can hang waiting for a response from
+// (for example) a recently deceased Data Manager
+// if (!sendRequest (dcpacket))
+// rc = false;
+//
+// final DMResponse respacket = recvResponse ();
+//
+// if (respacket.getreturnCode() != 0)
+// rc = false;
+//
+// try {
+// in.close();
+// } catch (final IOException e) {
+// System.err.println("Close error: " + e.getMessage());
+// rc = false;
+// }
+//
+// return rc;
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScpClient.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScpClient.java
new file mode 100644
index 0000000000..757b719c5e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/ScpClient.java
@@ -0,0 +1,232 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog;
+
+import com.jcraft.jsch.*;
+import java.awt.*;
+import javax.swing.*;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.dialogs.ErrorMessage;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.ConsoleLogPlugin;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.preferences.ConsoleLogPreferenceConstants;
+
+
+import java.io.*;
+
+public class ScpClient{
+
+ private Session session;
+
+ public ScpClient() {
+ //public static void main(String[] arg){
+
+
+ String user=ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_USER);
+ String host=ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.HOST_NAME);
+
+
+ //System.out.println(lfile + " " + rfile);
+
+ try{
+ JSch jsch=new JSch();
+
+ session=jsch.getSession(user, host, 22);
+
+ // username and password will be given via UserInfo interface.
+ //UserInfo ui=new MyUserInfo();
+ //session.setUserInfo(ui);
+ session.setPassword(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_PASSWORD));
+ java.util.Properties config = new java.util.Properties();
+ config.put("StrictHostKeyChecking", "no");
+ session.setConfig(config);
+ session.connect();
+ }catch(Exception e)
+ {
+ e.printStackTrace(System.err);
+ new ErrorMessage("Error in connection", "File Transfer failed.\n See stderr for more details").open();
+ }
+ }
+
+ public void transfer(String fromFile, String toFile) {
+ // exec 'scp -t rfile' remotely
+ FileInputStream fis=null;
+ String rfile=toFile;
+ String lfile=fromFile;
+ String command="scp -t "+rfile;
+ try {
+ Channel channel=session.openChannel("exec");
+ ((ChannelExec)channel).setCommand(command);
+
+ // get I/O streams for remote scp
+ OutputStream out=channel.getOutputStream();
+ InputStream in=channel.getInputStream();
+
+ channel.connect();
+
+
+ if(checkAck(in)!=0){
+ System.out.println("err");
+ }
+
+ // send "C0644 filesize filename", where filename should not include '/'
+ long filesize=(new File(lfile)).length();
+ command="C0644 "+filesize+" ";
+ if(lfile.lastIndexOf('/')>0){
+ command+=lfile.substring(lfile.lastIndexOf('/')+1);
+ }
+ else{
+ command+=lfile;
+ }
+ command+="\n";
+
+ out.write(command.getBytes()); out.flush();
+ if(checkAck(in)!=0){
+ System.out.println("err");
+ }
+
+
+
+ // send a content of lfile
+ fis=new FileInputStream(lfile);
+ byte[] buf=new byte[1024];
+ while(true){
+ int len=fis.read(buf, 0, buf.length);
+ if(len<=0) break;
+ out.write(buf, 0, len); //out.flush();
+
+ }
+ fis.close();
+ fis=null;
+ // send '\0'
+ buf[0]=0; out.write(buf, 0, 1); out.flush();
+ if(checkAck(in)!=0){
+ System.out.println("err");
+ }
+ out.close();
+
+ channel.disconnect();
+ session.disconnect();
+
+ }
+ catch(Exception e){
+ try{if(fis!=null)fis.close();}catch(Exception ee){}
+
+ }
+ }
+
+ static int checkAck(InputStream in) throws IOException{
+ int b=in.read();
+ // b may be 0 for success,
+ // 1 for error,
+ // 2 for fatal error,
+ // -1
+ if(b==0) return b;
+ if(b==-1) return b;
+
+ if(b==1 || b==2){
+ StringBuffer sb=new StringBuffer();
+ int c;
+ do {
+ c=in.read();
+ sb.append((char)c);
+ }
+ while(c!='\n');
+ if(b==1){ // error
+ //System.out.print(sb.toString());
+ }
+ if(b==2){ // fatal error
+ //System.out.print(sb.toString());
+ }
+ }
+ return b;
+ }
+
+ public static class MyUserInfo implements UserInfo, UIKeyboardInteractive{
+ public String getPassword(){ return passwd; }
+ public boolean promptYesNo(String str){
+ Object[] options={ "yes", "no" };
+ int foo=JOptionPane.showOptionDialog(null,
+ str,
+ "Warning",
+ JOptionPane.DEFAULT_OPTION,
+ JOptionPane.WARNING_MESSAGE,
+ null, options, options[0]);
+ return foo==0;
+ }
+
+ String passwd;
+ JTextField passwordField=(JTextField)new JPasswordField(20);
+
+ public String getPassphrase(){ return null; }
+ public boolean promptPassphrase(String message){ return true; }
+ public boolean promptPassword(String message){
+ Object[] ob={passwordField};
+ int result=
+ JOptionPane.showConfirmDialog(null, ob, message,
+ JOptionPane.OK_CANCEL_OPTION);
+ if(result==JOptionPane.OK_OPTION){
+ passwd=passwordField.getText();
+ return true;
+ }
+ else{ return false; }
+ }
+ public void showMessage(String message){
+ JOptionPane.showMessageDialog(null, message);
+ }
+ final GridBagConstraints gbc =
+ new GridBagConstraints(0,0,1,1,1,1,
+ GridBagConstraints.NORTHWEST,
+ GridBagConstraints.NONE,
+ new Insets(0,0,0,0),0,0);
+ private Container panel;
+ public String[] promptKeyboardInteractive(String destination,
+ String name,
+ String instruction,
+ String[] prompt,
+ boolean[] echo){
+ panel = new JPanel();
+ panel.setLayout(new GridBagLayout());
+
+ gbc.weightx = 1.0;
+ gbc.gridwidth = GridBagConstraints.REMAINDER;
+ gbc.gridx = 0;
+ panel.add(new JLabel(instruction), gbc);
+ gbc.gridy++;
+
+ gbc.gridwidth = GridBagConstraints.RELATIVE;
+
+ JTextField[] texts=new JTextField[prompt.length];
+ for(int i=0; i<prompt.length; i++){
+ gbc.fill = GridBagConstraints.NONE;
+ gbc.gridx = 0;
+ gbc.weightx = 1;
+ panel.add(new JLabel(prompt[i]),gbc);
+
+ gbc.gridx = 1;
+ gbc.fill = GridBagConstraints.HORIZONTAL;
+ gbc.weighty = 1;
+ if(echo[i]){
+ texts[i]=new JTextField(20);
+ }
+ else{
+ texts[i]=new JPasswordField(20);
+ }
+ panel.add(texts[i], gbc);
+ gbc.gridy++;
+ }
+
+ if(JOptionPane.showConfirmDialog(null, panel,
+ destination+": "+name,
+ JOptionPane.OK_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE)
+ ==JOptionPane.OK_OPTION){
+ String[] response=new String[prompt.length];
+ for(int i=0; i<prompt.length; i++){
+ response[i]=texts[i].getText();
+ }
+ return response;
+ }
+ else{
+ return null; // cancel
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/Subscription.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/Subscription.java
new file mode 100644
index 0000000000..aabb2ac17b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/Subscription.java
@@ -0,0 +1,420 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog;
+
+
+//import com.trilead.ssh2.SCPClient;
+//import com.trilead.ssh2.Connection;
+//import com.jcraft.jsch.*;
+
+
+import java.io.File;
+import java.io.PipedOutputStream;
+import java.io.PipedInputStream;
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.dialogs.ErrorMessage;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.DMRequest;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.DMResponse;
+import org.eclipse.linuxtools.systemtap.ui.structures.LoggingStreamDaemon;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IGobblerListener;
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.StreamGobbler;
+
+
+
+public class Subscription extends Thread {
+ private int scriptid;
+ private boolean running;
+ private final ClientSession session;
+ private final String filename;
+ private final boolean isGuru;
+ private boolean disposed = false;
+ private PipedOutputStream pos = null;
+ private PipedInputStream pis = null;
+ private StreamGobbler inputGobbler = null;
+ private StreamGobbler errorGobbler = null;
+ private ArrayList<IGobblerListener> inputListeners = new ArrayList<IGobblerListener>(); //Only used to allow adding listeners before creating the StreamGobbler
+ private ArrayList<IGobblerListener> errorListeners = new ArrayList<IGobblerListener>(); //Only used to allow adding listeners before creating the StreamGobbler
+ private LoggingStreamDaemon logger;
+
+ public Subscription(final int scriptid) {
+ this.scriptid = scriptid;
+ this.filename = null;
+ this.running = false;
+ this.session = ClientSession.getInstance();
+ this.isGuru = false;
+
+ }
+
+ public Subscription(final String filename,boolean isGuru) {
+ this.filename = filename;
+ this.scriptid = -1;
+ this.running = false;
+ this.session = ClientSession.getInstance();
+ this.isGuru = isGuru;
+ }
+
+ public boolean init() {
+ // send subscription request packet
+ // check if response is OK
+
+ if (!ClientSession.isConnected()) {
+ return false;
+ }
+
+
+ // BusyIndicator.showWhile(null, new Runnable() {
+ // public void run() {
+ try{
+ ScpClient scpclient = new ScpClient();
+ scpclient.transfer(filename,"/tmp/"+ filename.substring(filename.lastIndexOf('/')+1));
+ }catch(Exception e){e.printStackTrace();}
+ scriptid = ClientSession.getNewScriptId();
+ final DMRequest subreq = new DMRequest(DMRequest.SUBSCRIBE,scriptid, filename,session.getcid(), 0, isGuru);
+ if (!session.sendRequest(subreq)) {
+ //System.out.println("sent subscription");
+ // return false;
+ }
+
+
+ session.addSubscription(scriptid);
+ // FIXME: horrible hack. I think there is some sort of deadlock issue
+ // when starting up, either way this fixes it.
+ try { Thread.sleep(500); }
+ catch (InterruptedException ie) {}
+
+ final DMResponse subrep = session.recvResponse(scriptid);
+ if (subrep.isValid()) {
+ scriptid = subrep.getscriptID();
+
+
+ logger = new LoggingStreamDaemon();
+ inputListeners.add(logger);
+
+ try{
+ pos = new PipedOutputStream();
+ pis = new PipedInputStream(pos);
+ pos.flush();
+ }catch(Exception e)
+ {
+ new ErrorMessage("Could not subscribe!", "See stderr for more details").open();
+ }
+
+ inputGobbler = new StreamGobbler(pis);
+ addInputStreamListener(logger);
+
+ return true;
+ }
+ else {
+ session.delSubscription(scriptid);
+ new ErrorMessage("Could not subscribe!", "Response from Server not valid \n See stderr for more details").open();
+ return false;
+ }
+ }
+
+ /**
+ * Gather data from a previously started script and do stuff with it.
+ * Contains blocking reads.
+ *
+ */
+ public void run () {
+ running = true;
+ DMResponse subrep = null;
+ //long timeToRemove = 0;
+ inputGobbler.start();
+ while (!Thread.interrupted() && ClientSession.isConnected()) {
+ subrep = session.recvResponse(scriptid);
+ //timeToRemove = System.currentTimeMillis() - (1000 * ConsoleLogPlugin.getDefault().getPluginPreferences().getInt(ConsoleLogPreferenceConstants.SAVE_LENGTH));
+ if (subrep == null) {
+ // Interrupting this thread cause recvResponse to return
+ // from its blocking read, leaving subrep null
+ break;
+ }
+
+ if (subrep.isValid() && (subrep.getsource() == DMResponse.STDERR)) {
+ // log the err output?, maybe pop up a dialog? ignore for now..
+ final String outp = new String (session.recvData(scriptid, subrep.getsize()));
+ final String[] lines = outp.trim().split("\n");
+ for (final String str : lines) {
+ try{
+ inputGobbler.fireNewDataEvent(str + "\n");
+ }catch(Exception e)
+ {
+ System.err.println(e.toString());
+ }
+
+ }
+ return;
+ }
+ else if (subrep.isValid()) {
+
+ final String outp = new String (session.recvData(scriptid, subrep.getsize()));
+
+ final String[] lines = outp.trim().split("\n");
+ for (final String str : lines) {
+ try{
+ inputGobbler.fireNewDataEvent(str + "\n");
+ }catch(Exception e)
+ {
+ System.err.println(e.toString());
+ }
+
+ }
+
+ }
+ }
+
+ final DMRequest unsub = new DMRequest (DMRequest.UNSUBSCRIBE, scriptid, session.getcid(), 0);
+ if (!session.sendRequest (unsub))
+ System.err.println ("Failed Unsubscribing: " + session.getcid());
+
+ subrep = session.recvResponse(scriptid);
+ delSubscription();
+
+ running = false;
+ }
+
+ public boolean isRunning() {
+ return running;
+ }
+
+ public String getScriptName(final int script) {
+ return "table" + script;
+ }
+
+ public String getOutput()
+ {
+ return logger.getOutput();
+ }
+
+ public boolean saveLog(File file) {
+ return logger.saveLog(file);
+ }
+
+
+
+ public void dispose() {
+ if(!disposed) {
+ disposed = true;
+ inputListeners = null;
+ errorListeners = null;
+
+ if(null != inputGobbler){
+ inputGobbler.dispose();
+ inputGobbler.stop();
+ }
+ inputGobbler = null;
+
+ if(null != errorGobbler){
+ errorGobbler.dispose();
+ errorGobbler.stop();
+ }
+ errorGobbler = null;
+ }
+ }
+
+ /**
+ * Registers the provided <code>IGobblerListener</code> with the InputStream
+ * @param listener A listener to monitor the InputStream from the Process
+ */
+ public void addInputStreamListener(IGobblerListener listener) {
+ if(null != inputGobbler)
+ {
+ inputGobbler.addDataListener(listener);
+ }
+ else
+ inputListeners.add(listener);
+ }
+
+ /**
+ * Registers the provided <code>IGobblerListener</code> with the ErrorStream
+ * @param listener A listener to monitor the ErrorStream from the Process
+ */
+ public void addErrorStreamListener(IGobblerListener listener) {
+ if(null != errorGobbler)
+ errorGobbler.addDataListener(listener);
+ else
+ errorListeners.add(listener);
+ }
+
+ /**
+ * Returns the list of everything that is listening the the InputStream
+ * @return List of all <code>IGobblerListeners</code> that are monitoring the stream.
+ */
+ public ArrayList<IGobblerListener> getInputStreamListeners() {
+ if(null != inputGobbler)
+ return inputListeners;
+ else
+ return inputGobbler.getDataListeners();
+ }
+
+ /**
+ * Returns the list of everything that is listening the the ErrorStream
+ * @return List of all <code>IGobblerListeners</code> that are monitoring the stream.
+ */
+ public ArrayList<IGobblerListener> getErrorStreamListeners() {
+ if(null != errorGobbler)
+ return errorListeners;
+ else
+ return errorGobbler.getDataListeners();
+ }
+
+ /**
+ * Removes the provided listener from those monitoring the InputStream.
+ * @param listener An </code>IGobblerListener</code> that is monitoring the stream.
+ */
+ public void removeInputStreamListener(IGobblerListener listener) {
+ if(null != inputGobbler)
+ inputGobbler.removeDataListener(listener);
+ else
+ inputListeners.remove(listener);
+ }
+
+ /**
+ * Removes the provided listener from those monitoring the ErrorStream.
+ * @param listener An </code>IGobblerListener</code> that is monitoring the stream.
+ */
+ public void removeErrorStreamListener(IGobblerListener listener) {
+ if(null != errorGobbler)
+ errorGobbler.removeDataListener(listener);
+ else
+ errorListeners.remove(listener);
+ }
+
+ public void delSubscription()
+ {
+ session.delSubscription(scriptid);
+ }
+
+ /*private boolean sendFile()
+ {
+ /*try
+ {
+ Connection conn = new Connection(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.HOST_NAME));
+ conn.connect();
+ boolean isAuthenticated = conn.authenticateWithPassword(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_USER),ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_PASSWORD));
+ if (isAuthenticated == false)
+ {
+ new ErrorMessage("Could not send script!", "Authentication failure").open();
+ return false;
+ }
+ SCPClient scpclient = conn.createSCPClient();
+ scpclient.put(filename, "/tmp");
+ // return true;
+ }catch(Exception Ex)
+ {
+ new ErrorMessage("Could not send script!", "Check if scp is enabled on server").open();
+ return false;
+ }
+ FileInputStream fis=null;
+ try{
+ String osname=(String)(System.getProperties().get("os.name"));
+ System.out.println(osname);
+ JSch jsch = new JSch();
+ System.out.println("1");
+ Session session = jsch.getSession(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_USER), ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.HOST_NAME), 22);
+ System.out.println("1");
+ session.setPassword(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_PASSWORD));
+ System.out.println("1");
+ session.connect();
+ System.out.println("1");
+ String command="scp -p -t /tmp/"+ filename;
+ Channel channel=session.openChannel("exec");
+ ((ChannelExec)channel).setCommand(command);
+ OutputStream out=channel.getOutputStream();
+ InputStream in=channel.getInputStream();
+ System.out.println("2");
+ channel.connect();
+ System.out.println("3");
+ if(checkAck(in)!=0){
+ //System.exit(0);
+ }
+ System.out.println("4");
+ // send "C0644 filesize filename", where filename should not include '/'
+ long filesize=(new File(filename)).length();
+ command="C0644 "+filesize+" ";
+ if(filename.lastIndexOf('/')>0){
+ command+=filename.substring(filename.lastIndexOf('/')+1);
+ }
+ else{
+ command+=filename;
+ }
+ command+="\n";
+ System.out.println("5");
+ out.write(command.getBytes()); out.flush();
+ System.out.println("6");
+ if(checkAck(in)!=0){
+ //System.exit(0);
+ }
+ System.out.println("7");
+ // send a content of lfile
+ fis=new FileInputStream(filename);
+ byte[] buf=new byte[1024];
+ while(true){
+ int len=fis.read(buf, 0, buf.length);
+ if(len<=0) break;
+ out.write(buf, 0, len); //out.flush();
+ }
+ fis.close();
+ fis=null;
+ // send '\0'
+ System.out.println("8");
+ buf[0]=0; out.write(buf, 0, 1); out.flush();
+ System.out.println("9");
+ if(checkAck(in)!=0){
+ //System.exit(0);
+ }
+ System.out.println("10");
+ out.close();
+
+ channel.disconnect();
+ session.disconnect();
+
+ return true;
+ }
+ catch(Exception e){
+ System.out.println(e);
+ try{if(fis!=null)fis.close();}catch(Exception ee){}
+ }
+ return true;
+ }
+
+
+ static int checkAck(InputStream in) throws IOException{
+ int b=in.read();
+ // b may be 0 for success,
+ // 1 for error,
+ // 2 for fatal error,
+ // -1
+ if(b==0) return b;
+ if(b==-1) return b;
+
+ if(b==1 || b==2){
+ StringBuffer sb=new StringBuffer();
+ int c;
+ do {
+ c=in.read();
+ sb.append((char)c);
+ }
+ while(c!='\n');
+ if(b==1){ // error
+ System.out.print(sb.toString());
+ }
+ if(b==2){ // fatal error
+ System.out.print(sb.toString());
+ }
+ }
+ return b;
+ }
+ */
+ /**
+ * Removes the provided listener from those monitoring the ErrorStream.
+ * @param listener An </code>IGobblerListener</code> that is monitoring the stream.
+ *//*
+ public void removeInputStreamListeners() {
+ if(null != inputGobbler)
+ inputGobbler.r removeDataListener(listener);
+ else
+ inputListeners.remove
+ }
+ */
+
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/ConsoleAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/ConsoleAction.java
new file mode 100644
index 0000000000..0cbeb7d137
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/ConsoleAction.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.IConsoleConstants;
+import org.eclipse.ui.console.IConsoleView;
+
+
+
+
+/**
+ * A basic core class that provides common methods that are needed by any
+ * action that makes use of the Console.
+ * @author Ryan Morse
+ */
+public abstract class ConsoleAction extends Action implements IWorkbenchWindowActionDelegate, IViewActionDelegate {
+ public void init(IWorkbenchWindow window) {}
+
+ public void init(IViewPart part) {}
+
+ public void run(IAction action) {
+ run();
+ }
+
+ public abstract void run();
+
+
+ /**
+ * Finds and returns the active console.
+ * @return The active <code>ScriptConsole<code> in the ConsoleView
+ */
+ protected ScriptConsole getActive() {
+ IConsoleView ivp = (IConsoleView)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IConsoleConstants.ID_CONSOLE_VIEW);
+ return (ScriptConsole)ivp.getConsole();
+ }
+
+ /**
+ * Updates whether the action should be enabled when the user changes their ViewPart selection
+ */
+ public void selectionChanged(IAction act, ISelection select) {
+ this.setAct(act);
+ buildEnablementChecks();
+ }
+
+ /**
+ * Builds the checks to see if the action should be enabled or not
+ */
+ private void buildEnablementChecks() {
+ IViewPart ivp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IConsoleConstants.ID_CONSOLE_VIEW);
+ if(null != ivp) {
+ setEnablement(isRunning((IConsoleView)ivp));
+ ivp.addPropertyListener(listener);
+ }
+ }
+
+ /**
+ * Checks to see if the active console is still running
+ */
+ private boolean isRunning(IConsoleView cv) {
+ ScriptConsole console = (ScriptConsole)cv.getConsole();
+ return (console != null && console.isRunning());
+ }
+
+ /**
+ * Changes whether or not this action is enabled
+ */
+ private void setEnablement(boolean enabled) {
+ //act.setEnabled(enabled); //TODO: This is disabled until we figure out how to get it to realize script is running.
+ }
+
+ /**
+ * Disposes of all internal references held by this class. No method should be called after
+ * calling this.
+ */
+ public void dispose() {
+ setAct(null);
+ //Unable to findView when disposed is called, as a result null pointer exception is thrown
+ //PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IConsoleConstants.ID_CONSOLE_VIEW).removePropertyListener(listener);
+ listener = null;
+ }
+
+ public void setAct(IAction act) {
+ this.act = act;
+ }
+
+ public IAction getAct() {
+ return act;
+ }
+
+ private IAction act;
+ private IPropertyListener listener = new IPropertyListener() {
+ public void propertyChanged(Object o, int i) {
+ if(o instanceof IConsoleView)
+ setEnablement(isRunning((IConsoleView)o));
+ }
+ };
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/SaveLogAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/SaveLogAction.java
new file mode 100644
index 0000000000..e2b1b30774
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/SaveLogAction.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.actions;
+
+import java.io.File;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.PlatformUI;
+
+
+
+/**
+ * This class is used to allow the user to save the log generated from an active console
+ * @author Ryan Morse
+ */
+public class SaveLogAction extends ConsoleAction {
+ /**
+ * The main method of this class. Handles getting the currnet <code>ScriptConsole</code>
+ * and telling it to save the output to the selected file.
+ */
+ public void run() {
+ ScriptConsole console = getActive();
+ if(null != console && console.isRunning()) {
+ File file = getFile();
+
+ if(null != file)
+ console.saveStream(file);
+ }
+ }
+
+ /**
+ * Brings up a dialog box for the user to select a place to save the log output.
+ * @return File representing the desired destination for the log.
+ */
+ private File getFile() {
+ String path = null;
+ FileDialog dialog= new FileDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.SAVE);
+ dialog.setText(Localization.getString("SaveLogAction.OutputFile"));
+
+ path = dialog.open();
+
+ if(null == path)
+ return null;
+
+ return new File(path);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/StopScriptAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/StopScriptAction.java
new file mode 100644
index 0000000000..ed7ed07c1a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/actions/StopScriptAction.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.actions;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+
+
+
+/**
+ * A class that handles stopping the <code>ScriptConsole</code>.
+ * @author Ryan Morse
+ */
+public class StopScriptAction extends ConsoleAction {
+ /**
+ * This is the main method of the class. It handles stopping the
+ * currently active <code>ScriptConsole</code>.
+ */
+ public void run() {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ boolean stop = false;
+ public void run() {
+ if(stop) return;
+ try {
+ ScriptConsole console = getActive();
+ if(null != console && console.isRunning())
+ console.stop();
+ } catch (Exception e) {
+ stop = true;
+ }
+ }
+ });
+ }
+
+ /**
+ * This method will stop the i'th <code>ScriptConsole</code> if it is running.
+ * @param i The index value of the console that will be stopped.
+ */
+ public void run(int i) {
+ IConsole ic[] = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
+ ScriptConsole console = (ScriptConsole)ic[i];
+
+ if(console.isRunning())
+ console.stop();
+
+ }
+
+ /**
+ * This method will stop all consoles that are running.
+ */
+ public void stopAll() {
+ IConsole ic[] = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
+ ScriptConsole console;
+
+ for(int i=0; i<ic.length; i++) {
+ console = (ScriptConsole)ic[i];
+ if(console.isRunning())
+ console.stop();
+ }
+ }
+
+ /**
+ * This method will check to see if any scripts are currently running.
+ * @return - boolean indicating whether any scripts are running
+ */
+ public boolean anyRunning() {
+ IConsole ic[] = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
+ ScriptConsole console;
+
+ for(int i=0; i<ic.length; i++) {
+ console = (ScriptConsole)ic[i];
+ if(console.isRunning())
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/ErrorMessage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/ErrorMessage.java
new file mode 100644
index 0000000000..40de170e1c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/ErrorMessage.java
@@ -0,0 +1,31 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog.dialogs;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Creates and displays an error message box that runs in the UI thread.
+ *
+ */
+public class ErrorMessage {
+ private String title;
+ private String error;
+
+ public ErrorMessage(String title, String error) {
+ this.title = title;
+ this.error = error;
+ }
+
+ public void open() {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ MessageBox messageBox = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_ERROR | SWT.OK);
+ messageBox.setMessage(error);
+ messageBox.setText(title);
+ messageBox.open();
+ } // end run
+ }); // end new Runnable
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/SCPDetails.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/SCPDetails.java
new file mode 100644
index 0000000000..7800389b77
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/SCPDetails.java
@@ -0,0 +1,110 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog.dialogs;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.ConsoleLogPlugin;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.preferences.ConsoleLogPreferenceConstants;
+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 SCPDetails extends Dialog {
+ private Text userText;
+ private Text passwordText;
+// private Button rememberButton;
+ private Button sendButton;
+ private Button cancelButton;
+
+ public SCPDetails(Shell parent) {
+ super(parent);
+ }
+
+ public void open() {
+
+ Shell parent = getParent();
+ final Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ shell.setText("Enter SCP 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 userLabel = new Label(shell, SWT.NONE);
+ userLabel.setText("User: ");
+ userLabel.setLayoutData(data);
+
+ data = new GridData();
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = SWT.FILL;
+ userText = new Text(shell, SWT.SINGLE | SWT.BORDER);
+ userText.setLayoutData(data);
+ userText.setText(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_USER));
+
+ data = new GridData();
+ data.grabExcessHorizontalSpace = false;
+ data.horizontalAlignment = SWT.LEFT;
+ Label passwordLabel = new Label(shell, SWT.NONE);
+ passwordLabel.setText("Password: ");
+ passwordLabel.setLayoutData(data);
+
+ data = new GridData();
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = SWT.FILL;
+ passwordText = new Text(shell, SWT.SINGLE | SWT.BORDER);
+ passwordText.setEchoChar('*');
+ passwordText.setLayoutData(data);
+ passwordText.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();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ });
+
+ data = new GridData();
+ data.horizontalAlignment = SWT.RIGHT;
+ sendButton = new Button(shell, SWT.PUSH);
+ sendButton.setLayoutData(data);
+ sendButton.setSize(50, 100);
+ sendButton.setText("Send");
+ sendButton.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.
+ ConsoleLogPlugin.getDefault().getPreferenceStore().setValue(ConsoleLogPreferenceConstants.SCP_PASSWORD, passwordText.getText());
+ ConsoleLogPlugin.getDefault().getPreferenceStore().setValue(ConsoleLogPreferenceConstants.SCP_USER, userText.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.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/SelectServerDialog.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/SelectServerDialog.java
new file mode 100644
index 0000000000..2cfbbebe93
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/dialogs/SelectServerDialog.java
@@ -0,0 +1,165 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog.dialogs;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.ConsoleLogPlugin;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.preferences.ConsoleLogPreferenceConstants;
+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 SelectServerDialog extends Dialog {
+ private Text hostText;
+ private Text portText;
+ private Text userText;
+ private Text passwordText;
+ private Button rememberButton;
+ private Button connectButton;
+ private Button cancelButton;
+
+ public SelectServerDialog(Shell parent) {
+ super(parent);
+ }
+
+ public void open() {
+ if (ConsoleLogPlugin.getDefault().getPluginPreferences().getBoolean(ConsoleLogPreferenceConstants.REMEMBER_SERVER)) {
+ return;
+ }
+
+ Shell parent = getParent();
+ final Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
+ shell.setText("Remote Server Details");
+ shell.pack();
+ //shell.setSize(350, 220);
+
+ 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 hostLabel = new Label(shell, SWT.NONE);
+ hostLabel.setText("Host: ");
+ hostLabel.setLayoutData(data);
+
+ data = new GridData();
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = SWT.FILL;
+ hostText = new Text(shell, SWT.SINGLE | SWT.BORDER);
+ hostText.setLayoutData(data);
+ hostText.setText(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.HOST_NAME));
+
+ data = new GridData();
+ data.grabExcessHorizontalSpace = false;
+ data.horizontalAlignment = SWT.LEFT;
+ Label portLabel = new Label(shell, SWT.NONE);
+ portLabel.setText("Port: ");
+ portLabel.setLayoutData(data);
+
+ data = new GridData();
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = SWT.FILL;
+ portText = new Text(shell, SWT.SINGLE | SWT.BORDER);
+ portText.setLayoutData(data);
+ portText.setText(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.PORT_NUMBER));
+
+ data = new GridData();
+ data.grabExcessHorizontalSpace = false;
+ data.horizontalAlignment = SWT.LEFT;
+ Label userLabel = new Label(shell, SWT.NONE);
+ userLabel.setText("User: ");
+ userLabel.setLayoutData(data);
+
+ data = new GridData();
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = SWT.FILL;
+ userText = new Text(shell, SWT.SINGLE | SWT.BORDER);
+ userText.setLayoutData(data);
+ userText.setText(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_USER));
+
+ data = new GridData();
+ data.grabExcessHorizontalSpace = false;
+ data.horizontalAlignment = SWT.LEFT;
+ Label passwordLabel = new Label(shell, SWT.NONE);
+ passwordLabel.setText("Password: ");
+ passwordLabel.setLayoutData(data);
+
+ data = new GridData();
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = SWT.FILL;
+ passwordText = new Text(shell, SWT.SINGLE | SWT.BORDER);
+ passwordText.setEchoChar('*');
+ passwordText.setLayoutData(data);
+ passwordText.setText(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_PASSWORD));
+
+
+ data = new GridData();
+ data.horizontalAlignment = SWT.LEFT;
+ data.horizontalSpan = 2;
+ rememberButton = new Button(shell, SWT.CHECK);
+ rememberButton.setLayoutData(data);
+ rememberButton.setText("Always connect to this host.");
+ rememberButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ });
+
+ 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) {
+ ConsoleLogPlugin.getDefault().getPreferenceStore().setValue(ConsoleLogPreferenceConstants.CANCELLED, true);
+ shell.dispose();
+
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ });
+
+ data = new GridData();
+ data.horizontalAlignment = SWT.RIGHT;
+ connectButton = new Button(shell, SWT.PUSH);
+ connectButton.setLayoutData(data);
+ connectButton.setSize(50, 100);
+ connectButton.setText("Connect");
+ connectButton.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.
+ ConsoleLogPlugin.getDefault().getPreferenceStore().setValue(ConsoleLogPreferenceConstants.PORT_NUMBER, portText.getText());
+ ConsoleLogPlugin.getDefault().getPreferenceStore().setValue(ConsoleLogPreferenceConstants.HOST_NAME, hostText.getText());
+ ConsoleLogPlugin.getDefault().getPreferenceStore().setValue(ConsoleLogPreferenceConstants.REMEMBER_SERVER, rememberButton.getSelection());
+ ConsoleLogPlugin.getDefault().getPreferenceStore().setValue(ConsoleLogPreferenceConstants.SCP_PASSWORD, passwordText.getText());
+ ConsoleLogPlugin.getDefault().getPreferenceStore().setValue(ConsoleLogPreferenceConstants.SCP_USER, userText.getText());
+ ConsoleLogPlugin.getDefault().getPreferenceStore().setValue(ConsoleLogPreferenceConstants.CANCELLED, false);
+
+ shell.close();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ });
+
+ shell.pack();
+ shell.open();
+ Display display = parent.getDisplay();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) display.sleep();
+ }
+
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/ConsoleLogPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/ConsoleLogPlugin.java
new file mode 100644
index 0000000000..9e7e40f2af
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/ConsoleLogPlugin.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.internal;
+
+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 ConsoleLogPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static ConsoleLogPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public ConsoleLogPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ this.internalInitializeDefaultPluginPreferences();
+ }
+
+ /**
+ * 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 ConsoleLogPlugin 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.consolelog", path);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/Localization.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/Localization.java
new file mode 100644
index 0000000000..24f6d52101
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/Localization.java
@@ -0,0 +1,22 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Localization {
+ private static final String BUNDLE_NAME = "org.eclipse.linuxtools.systemtap.ui.consolelog.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.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/localization.properties
new file mode 100644
index 0000000000..7d933a4fd0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/internal/localization.properties
@@ -0,0 +1,13 @@
+SaveLogAction.OutputFile=Output File
+
+ErrorStreamDaemon.Password=Password:
+
+ErrorView.Description=Description
+
+ScriptConsole.Problem=Problem
+ScriptConsole.ErrorSavingLog=Error saving the log file.
+ScriptConsole.Terminated=<terminated>
+
+ErrorView.Type=Type
+ErrorView.Saw=Saw
+ErrorView.Line=Line
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/ConsoleLogPreferenceConstants.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/ConsoleLogPreferenceConstants.java
new file mode 100644
index 0000000000..65d5bf547c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/ConsoleLogPreferenceConstants.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.preferences;
+
+public class ConsoleLogPreferenceConstants {
+ //ide
+ public static final String HOST_NAME = "host";
+ public static final String PORT_NUMBER = "port";
+ public static final String DB_COMMIT = "commit";
+ public static final String SAVE_LENGTH = "saveLength";
+ public static final String REMEMBER_SERVER = "rememberServer";
+ public static final String SCP_USER = "scpuser";
+ public static final String SCP_PASSWORD = "scppassword";
+ public static final String REMEMBER_SCPUSER = "rememberscpuser";
+ public static final String CANCELLED = "cancel";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/ConsoleLogPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/ConsoleLogPreferencePage.java
new file mode 100644
index 0000000000..8cc1e47b32
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/ConsoleLogPreferencePage.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.ConsoleLogPlugin;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+
+
+
+
+public class ConsoleLogPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public ConsoleLogPreferencePage() {
+ super(GRID);
+ // LogManager.logDebug("Start ConsoleLogPreferencePage:", this);
+ setPreferenceStore(ConsoleLogPlugin.getDefault().getPreferenceStore());
+ setDescription("Preferences when accessing a remote server");
+ //LogManager.logDebug("End ConsoleLogPreferencePage:", this);
+ }
+
+ public void createFieldEditors() {
+
+ addField(new StringFieldEditor(ConsoleLogPreferenceConstants.HOST_NAME,
+ "Host Name: ", getFieldEditorParent()));
+
+ addField(new IntegerFieldEditor(ConsoleLogPreferenceConstants.PORT_NUMBER,
+ "Port: ", getFieldEditorParent()));
+
+ addField(new StringFieldEditor(ConsoleLogPreferenceConstants.SCP_USER,
+ "User Name: ", getFieldEditorParent()));
+
+ StringFieldEditor passwordField = new StringFieldEditor(
+ ConsoleLogPreferenceConstants.SCP_PASSWORD, "Password: ",
+ getFieldEditorParent());
+ passwordField.getTextControl(getFieldEditorParent()).setEchoChar('*');
+ addField(passwordField);
+
+ // addField(new StringFieldEditor(ConsoleLogPreferenceConstants.SCP_PASSWORD,
+ // "Password: ", getFieldEditorParent()));
+
+ addField(new BooleanFieldEditor(ConsoleLogPreferenceConstants.REMEMBER_SERVER,
+ "Always connect to this host.", getFieldEditorParent()));
+
+ addField(new IntegerFieldEditor(ConsoleLogPreferenceConstants.SAVE_LENGTH,
+ "Seconds to Save Data: ", getFieldEditorParent()));
+
+ }
+
+ public void init(IWorkbench workbench) {
+
+ }
+
+ public void dispose() {
+
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/PreferenceInitializer.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/PreferenceInitializer.java
new file mode 100644
index 0000000000..5d2b1b775f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/preferences/PreferenceInitializer.java
@@ -0,0 +1,38 @@
+ /* 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.preferences;
+
+
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.ConsoleLogPlugin;
+
+
+
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = ConsoleLogPlugin.getDefault().getPreferenceStore();
+
+ //ide
+ store.setDefault(ConsoleLogPreferenceConstants.HOST_NAME, "localhost");
+ store.setDefault(ConsoleLogPreferenceConstants.PORT_NUMBER, 22462);
+ store.setDefault(ConsoleLogPreferenceConstants.DB_COMMIT, false);
+ store.setDefault(ConsoleLogPreferenceConstants.SAVE_LENGTH, 5);
+ store.setDefault(ConsoleLogPreferenceConstants.REMEMBER_SERVER, false);
+ store.setDefault(ConsoleLogPreferenceConstants.SCP_USER, "guest");
+ store.setDefault(ConsoleLogPreferenceConstants.SCP_PASSWORD, "welcome");
+ store.setDefault(ConsoleLogPreferenceConstants.REMEMBER_SCPUSER, false);
+ store.setDefault(ConsoleLogPreferenceConstants.CANCELLED, false);
+
+
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ConsoleStreamDaemon.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ConsoleStreamDaemon.java
new file mode 100644
index 0000000000..18432e74ce
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ConsoleStreamDaemon.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IGobblerListener;
+import org.eclipse.ui.console.MessageConsoleStream;
+
+
+
+/**
+ * A class push data to a ScriptConsole.
+ * @author Ryan Morse
+ */
+public class ConsoleStreamDaemon implements IGobblerListener {
+ public ConsoleStreamDaemon(ScriptConsole console) {
+ this.console = console;
+ if(null != console)
+ msgConsole = console.newMessageStream();
+ disposed = false;
+ }
+
+ /**
+ * Prints out the new output data to the console
+ */
+ protected void pushData() {
+ if(null != msgConsole)
+ msgConsole.print(output);
+ }
+
+ /**
+ * Captures data events and pushes the data to the console
+ */
+ public void handleDataEvent(String line) {
+ output = line;
+ this.pushData();
+ }
+
+ /**
+ * Checks to see if the class has been disposed already
+ * @return boolean representing whether or not the class has been disposed
+ */
+ public boolean isDisposed() {
+ return disposed;
+ }
+
+ /**
+ * Disposes of all internal references in the class. No method should be called after this.
+ */
+ public void dispose() {
+ if(!disposed) {
+ disposed = true;
+ output = null;
+ console = null;
+ msgConsole = null;
+ }
+ }
+
+ protected String output;
+ protected ScriptConsole console;
+ protected MessageConsoleStream msgConsole;
+ private boolean disposed;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMError.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMError.java
new file mode 100644
index 0000000000..504aa75498
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMError.java
@@ -0,0 +1,62 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog.structures;
+
+/**
+ * Turn error codes into text. Taken from include/staperror.hpp
+ * from the data manager's source.
+ *
+ * @author patrickm
+ *
+ */
+public final class DMError {
+
+ private static String errtext;
+
+ public DMError (int errcode) {
+
+ if (errcode >= 0) {
+ errtext = "Success";
+ return;
+ }
+
+ switch (errcode) {
+ case 0x82100001:
+ errtext = "Invalid/Unknown request type";
+ break;
+ case 0x81100002:
+ errtext = "Error running script, or script unexpectedly died";
+ break;
+ case 0x82100003:
+ errtext = "Unknown / unused !?";
+ break;
+ case 0x81100004:
+ errtext = "Unused?";
+ break;
+ case 0x81200005:
+ errtext = "Invalid mailbox number requested";
+ break;
+ case 0x82200006:
+ errtext = "Duplicate/invalid un- or subscription request";
+ break;
+ case 0x82200007:
+ errtext = "Failed to release or aquire a mutex lock";
+ break;
+ case 0x82200009:
+ errtext = "Malformed or unrecognizable packet";
+ break;
+ case 0x8220000A:
+ errtext = "Invalid client ID";
+ break;
+ case 0x8220000B:
+ errtext = "Attemting to use unopen or bad channel";
+ break;
+ default:
+ errtext = "Unknown Error: " + errcode;
+ }
+ return;
+ }
+
+ public String toString() {
+ return new String(errtext);
+ }
+
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMPacket.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMPacket.java
new file mode 100644
index 0000000000..9eeeca569b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMPacket.java
@@ -0,0 +1,65 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog.structures;
+
+/**
+ * A class to represent a data packet. This abstract class just has all of the
+ * common fields and associated get-methods.
+ *
+ * @author patrickm
+ *
+ */
+public abstract class DMPacket {
+
+ // TODO?: replace with java enums
+
+ // header ID
+ protected final int BEGINSTR = 0xa1b2c3d4;
+ public int packetsize;
+
+ // common packet fields
+ protected int clientID;
+ protected int size;
+ protected int scriptID;
+ protected String filename;
+
+ /**
+ * Return the client ID number from this packet. This needs to be included
+ * in all outgoing packets (so the DM can tell who is sending what).
+ *
+ * @return The clientID of this packet.
+ */
+ public int getclientID() {
+ return clientID;
+ }
+ /**
+ * Return the filename from this packet. This needs to be included
+ * in all outgoing packets (so the DM can tell who is sending what).
+ *
+ * @return The filename.
+ */
+
+ public String getfilename() {
+ return filename;
+ }
+
+ /**
+ * Return the script number of this packet. Consult the data manager package
+ * for what these map to.
+ *
+ * @return The script number of this packet.
+ */
+ public int getscriptID() {
+ return scriptID;
+ }
+
+ /**
+ * Return the size field of this packet. This is not the size of the packet
+ * but the size of the following stream. All request packets this will be
+ * zero, most response packets will be non negative.
+ *
+ * @return The size in bytes of this packets "size" field
+ */
+ public int getsize() {
+ return size;
+ }
+
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMRequest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMRequest.java
new file mode 100644
index 0000000000..44abd3bfb2
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMRequest.java
@@ -0,0 +1,197 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog.structures;
+
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.dialogs.ErrorMessage;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.ConsoleLogPlugin;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.preferences.ConsoleLogPreferenceConstants;
+
+
+
+
+
+/**
+ * The request packet class. This class is used to construct a "packet", which
+ * is just a stream of bytes with specific properties. Normally a DMRequest
+ * object is constructed, and then its byte-stream is sent over a socket to the
+ * data manager.
+ *
+ * @author patrickm
+ *
+ */
+public class DMRequest extends DMPacket {
+
+ // packet size
+ public static final int packetsize = 28; // bytes
+
+ // request types
+ public static final int CREATE_CONN = 1;
+ public static final int SUBSCRIBE = 2;
+ public static final int UNSUBSCRIBE = 3;
+ public static final int GET_STATUS = 4;
+ public static final int SUBSCRIPTION_MODIFY = 5;
+ public static final int DESTROY_CONN = 6;
+ public static final int FILE = 7;
+
+ // request specific
+ private final int reqType;
+ private final boolean isGuru;
+
+ /**
+ * Construct a request packet. There is no error checking, if you construct
+ * a bad packet then send it to the data manager to see what is wrong with
+ * it.
+ *
+ * @param reqType
+ * One of the public REQ_* fields of this packet, the "request" /
+ * command of this packet.
+ * @param scriptID
+ * The script ID associated with this packet, right now only
+ * valid for un/subscribe.
+ * @param clientID
+ * The client ID of this packet. Every packet must have the
+ * correct client ID, or 0 if they are requesting one.
+ * @param size
+ * The size of the succeeding body. Always 0 for now, may change
+ * in the future.
+ */
+ public DMRequest(final int reqType, final int scriptID, final int clientID,
+ final int size) {
+ this.reqType = reqType;
+ this.scriptID = scriptID;
+ this.filename = "";
+ this.clientID = clientID;
+ this.size = size;
+ this.isGuru = false;
+ }
+
+ public DMRequest(final int reqType, final int scriptnum,final String filename, final int clientID,
+ final int size, final boolean isGuru) {
+ this.reqType = reqType;
+ this.filename = filename;
+ this.scriptID = scriptnum;
+ this.clientID = clientID;
+ this.size = size;
+ this.isGuru = isGuru;
+
+ }
+
+
+ /**
+ * Convert all of this packet's fields into a stream of bytes of length
+ * packetsize. Any errors would leave the packet in an unknown state, so
+ * null is returned.
+ *
+ * @return A stream of bytes representing the packet or null.
+ */
+ public byte[] getData() {
+ // TODO: close these open streams, if needed
+ if (reqType == SUBSCRIBE)
+ return getFile();
+ else
+ return getMessage();
+ }
+
+ public int getReqtype()
+ {
+ return reqType;
+ }
+
+ private byte[] getMessage()
+ {
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final DataOutputStream dos = new DataOutputStream(baos);
+ char a[] = new char[20];
+ for (int i = 0; i < 20 ; i++)
+ a[i] = ' ';
+ String b= ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_USER);
+ b.getChars(0, b.length(), a, 0);
+
+ b = null;
+ b = String.copyValueOf(a);
+
+ //String b = String.copyValueOf(a, 0, 20);
+ //System.out.println(a.toString() + " " + b + " " + b.length());
+ try {
+ dos.writeInt(BEGINSTR);
+ dos.writeInt(reqType);
+ dos.writeInt(scriptID);
+ dos.writeInt(clientID);
+ dos.writeInt(0);
+ dos.writeInt(ConsoleLogPlugin.getDefault().getPluginPreferences().getString(ConsoleLogPreferenceConstants.SCP_USER).length());
+ dos.writeBytes(b);
+ // System.out.println(a.length + " " + a.toString().length() + " " + filename.substring(filename.lastIndexOf('/')).length());
+ dos.flush();
+ } catch (final IOException ioe) {
+ new ErrorMessage("Request packet error!", "See stderr for more details").open();
+ System.err.println("Packet Error: " + ioe.getMessage());
+ // baos.close();
+ // dos.close();
+ return null;
+ }
+ return baos.toByteArray();
+ }
+
+
+ private byte[] getFile()
+ {
+
+ try {
+ /* int len = 0;
+ File f = new File(filename);
+ FileReader fr = new FileReader(f);
+
+ BufferedReader br = new BufferedReader(fr);
+ StringBuilder sb = new StringBuilder();
+ String line;
+ while(null != (line=br.readLine())) {
+ sb.append(line + "\n");
+ }
+ File tmpfile = new File("/home/anithra/eclipse/tmp.stp");
+ tmpfile.createNewFile();
+ FileWriter tmpfilewriter = new FileWriter(tmpfile);
+ tmpfilewriter.write(sb.toString());
+ tmpfilewriter.flush();
+ tmpfilewriter.close();
+
+ // System.out.println("file:" + sb.toString());
+ // BufferedInputStream in = new BufferedInputStream(new FileInputStream(filename));
+ // byte[] buffer = new byte[in.available()];*/
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+ final DataOutputStream dos = new DataOutputStream(baos);
+ // System.out.println("file:" + sb.length());
+ dos.writeInt(BEGINSTR);
+ dos.writeInt(reqType);
+ dos.writeInt(scriptID);
+ dos.writeInt(clientID);
+ if(isGuru)
+ dos.writeInt(1);
+ else
+ dos.writeInt(0);
+ dos.writeInt(filename.length());
+ dos.writeBytes(filename.substring(filename.lastIndexOf('/')));
+ dos.flush();
+ return baos.toByteArray();
+
+ } catch (final Exception ioe) {
+ new ErrorMessage("Request packet error!", "See stderr for more details").open();
+ System.err.println("Packet Error: " + ioe.getMessage());
+ // baos.close();
+ // dos.close();
+ return null;
+ }
+
+ }
+
+ /**
+ * For debugging, dump the packet contents to a formatted string
+ */
+ public String toString() {
+ return "ID String:\t" + BEGINSTR + "\nRequest Type:\t" + reqType
+ + "\nScript #:\t" + scriptID + "\nFilename:\t" + filename + "\nClient ID:\t" + clientID
+ + "\nData Size:\t" + size + "\n";
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMResponse.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMResponse.java
new file mode 100644
index 0000000000..93cdf1036f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/DMResponse.java
@@ -0,0 +1,136 @@
+package org.eclipse.linuxtools.systemtap.ui.consolelog.structures;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.EOFException;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.dialogs.ErrorMessage;
+
+
+
+/**
+ * A class to represent a response packet. A response packet prefaces all data
+ * sent from the data manager, even the DM is not sending any data (ie shutting
+ * down now).
+ *
+ * @author patrickm
+ *
+ */
+public class DMResponse extends DMPacket {
+
+ // packet size
+ public static final int packetsize = 24; // bytes
+
+ // data sources
+ public static final int STDOUT = 1;
+ public static final int STDERR = 2;
+ public static final int SUBSCRIPTION_MGR = 3;
+ public static final int DATA_MGR = 4;
+ public static final int MAILBOX = 5;
+
+ // response specific
+ private int returnCode;
+ private int source;
+ private boolean valid;
+
+ // for adding to ClientSession's buffer
+ private byte[] bacopy;
+
+ /**
+ * Construct a response object from a stream of bytes. If there are any
+ * errors, the valid flag is set to false.
+ *
+ * @param ba
+ * The array of bytes from the data manager, of length
+ * packetsize.
+ */
+ public DMResponse(final byte[] ba) {
+
+ if (ba.length != packetsize) {
+ // usually happens when reading garbage data
+ // ignore for now, but can be useful
+// System.err.println("Invalid packet length: " + ba.length);
+ valid = false;
+ return;
+ }
+
+ bacopy = ba;
+
+ final ByteArrayInputStream bais = new ByteArrayInputStream(ba);
+ final DataInputStream dis = new DataInputStream(bais);
+ int headerID = 0;
+
+ try {
+ headerID = dis.readInt();
+ source = dis.readInt();
+ scriptID = dis.readInt();
+ clientID = dis.readInt();
+ returnCode = dis.readInt();
+ size = dis.readInt();
+ // void ptr?
+ } catch (final EOFException eofe) {
+ valid = false;
+ new ErrorMessage("Response packet error!", "See stderr for more details").open();
+ System.err.println("response packet Error: " + eofe.getMessage());
+ } catch (final IOException ioe) {
+ valid = false;
+ new ErrorMessage("Response packet error!", "See stderr for more details").open();
+ System.err.println("response packet Error: " + ioe.getMessage());
+ }
+
+ valid = (headerID == BEGINSTR);
+ return;
+
+ }
+
+ /**
+ * The "source" of this packet, unused right now.
+ *
+ * @return An integer corresponding to the data manager, the subscription
+ * manager, or the mailbox, etc.
+ */
+ public int getsource() {
+ return source;
+ }
+
+ /**
+ * The return code. This does not apply to all responses.
+ *
+ * @return An integer: zero on success, non zero otherwise.
+ */
+ public int getreturnCode() {
+ return returnCode;
+ }
+
+ /**
+ * A packet is marked invalid if the size is wrong, there was any errors
+ * converting the stream of bytes to individual integers, or the header's
+ * magic number is wrong.
+ *
+ * @return True if the packet appears to be sane, false otherwise.
+ */
+ public boolean isValid() {
+ return valid;
+ }
+
+ /**
+ * For debugging, dump the packet contents to a formatted string
+ */
+ public String toString() {
+ return "ID String:\t" + BEGINSTR + "\nSource:\t" + source
+ + "\nScript #:\t" + scriptID + "\nClient ID:\t" + clientID
+ + "\nData Size:\t" + size + "\nReturn Code:\t" + returnCode
+ + "\n";
+ }
+
+ /**
+ * Hackish function to retrieve the original byte array. <ay be removed in
+ * the future.
+ *
+ * @return The original array of bytes this packet was constructed from.
+ */
+ public byte[] tobytes() {
+ return bacopy;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ErrorStreamDaemon.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ErrorStreamDaemon.java
new file mode 100644
index 0000000000..6754502191
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ErrorStreamDaemon.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.views.ErrorView;
+
+/**
+ * A class push data to both the </code>ScriptConsole</code> and the ErrorView
+ * @author Ryan Morse
+ */
+public class ErrorStreamDaemon extends ConsoleStreamDaemon {
+ public ErrorStreamDaemon(ScriptConsole console, ErrorView errorWindow, IErrorParser parser) {
+ super(console);
+
+ outputData = new StringBuilder();
+ this.parser = parser;
+
+ errorView = errorWindow;
+ errorView.clear();
+ }
+
+ /**
+ * Prints out the new output data to the console and parses it and sends it to the
+ * ErrorView.
+ */
+ protected void pushData() {
+ if(output.startsWith(Localization.getString("ErrorStreamDaemon.Password")))
+ output = output.substring(Localization.getString("ErrorStreamDaemon.Password").length());
+
+ super.pushData();
+
+ outputData.append(output);
+
+ /* Since we never know when the last set of data is comming we don't clear the
+ * errorStream in the hope of getting a more complete error message. As a result
+ * the parser will always return what we already had. Clear removes anything
+ * that was added before.
+ */
+ if(null != errorView) {
+ String[][] errors = parser.parseOutput(outputData.toString());
+
+ if(null != errors) {
+ errorView.clear();
+ for(int i=0; i<errors.length; i++)
+ errorView.add(errors[i]);
+ }
+ }
+ }
+
+ /**
+ * Disposes of all internal references in the class. No method should be called after this.
+ */
+ public void dispose() {
+ if(!isDisposed()) {
+ super.dispose();
+ errorView = null;
+ outputData.delete(0, outputData.length());
+ outputData = null;
+ parser = null;
+ }
+ }
+
+ private ErrorView errorView;
+ private StringBuilder outputData;
+ private IErrorParser parser;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ErrorTableDisplay.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ErrorTableDisplay.java
new file mode 100644
index 0000000000..ddeaeb47fc
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ErrorTableDisplay.java
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.ConsoleLogPlugin;
+import org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+
+
+
+/**
+ * A class push data to a ScriptConsole.
+ * @author Ryan Morse
+ */
+public class ErrorTableDisplay {
+ public ErrorTableDisplay(Composite parent, String[] titles) {
+ this.titles = titles;
+ createControl(parent);
+ }
+
+ /**
+ * Creates the table for displaying error messages in.
+ * @param parent The container for the new error table.
+ */
+ public void createControl(Composite parent) {
+ table = new Table(parent, SWT.SINGLE);
+ table.setHeaderVisible(true);
+ table.getVerticalBar().setVisible(true);
+ table.setLinesVisible(true);
+ table.addMouseListener(mouseListener);
+
+ TableColumn column;
+ for(int i = 0; i < titles.length; i++) {
+ column = new TableColumn(table, SWT.NONE);
+ column.setText(titles[i]);
+ }
+
+ updateColumns();
+ }
+
+ /**
+ * Clears all items from the table.
+ */
+ public void clear() {
+ table.getDisplay().syncExec(new Runnable() {
+ boolean stop = false;
+ public void run() {
+ if(stop) return;
+ try {
+ table.removeAll();
+ } catch (Exception e) {
+ stop = true;
+ }
+ }
+
+ });
+ }
+
+ /**
+ * Adds a new row to the table with an error icon.
+ * @param row The pre-divied sections of the error message.
+ */
+ public void addRow(final String[] row) {
+ addRow(row, ConsoleLogPlugin.getImageDescriptor("icons/views/error_st_obj.gif").createImage());
+ }
+
+ /**
+ * Adds a new row to the table.
+ * @param row The pre-divied sections of the error message.
+ * @param img The image to display with the error.
+ */
+ public void addRow(final String[] row, final Image img) {
+ table.getDisplay().syncExec(new Runnable() {
+ boolean stop = false;
+ public void run() {
+ if(stop) return;
+ try {
+ item = new TableItem(table, SWT.NULL);
+ for(int i=0; i<row.length; i++)
+ item.setText(i+1, row[i]);
+ item.setImage(img);
+ updateColumns();
+ } catch (Exception e) {
+ stop = true;
+ }
+ }
+
+ });
+ }
+
+ /**
+ * Updates each of the columns in the table to ensure that the entries all fit
+ * as well as possible.
+ */
+ private void updateColumns() {
+ TableColumn[] columns = table.getColumns();
+ for (int i = 0; i < columns.length; i++) {
+ columns[i].pack();
+ columns[i].setMoveable(true);
+ }
+ }
+
+ public Control getControl() {
+ return table;
+ }
+
+ /**
+ * Disposes of all internal references in the class. No method should be called after this.
+ */
+ public void dispose() {
+ if(null != table && !table.isDisposed()) {
+ table.removeMouseListener(mouseListener);
+ table.dispose();
+ table = null;
+ }
+
+ if(titles != null)
+ for(int i=0; i<titles.length; i++)
+ titles[i] = null;
+ titles = null;
+
+ if(null != item)
+ item.dispose();
+ item = null;
+ }
+
+ /**
+ * MouseListener that is used to detect when the user clicks on a row in the table.
+ * When clicked it will find the line number the error occured on and then set the
+ * cursor location to that location in the active editor.
+ */
+ private final MouseListener mouseListener = new MouseListener() {
+ public void mouseDown(MouseEvent me) {}
+ public void mouseUp(MouseEvent me) {}
+
+ public void mouseDoubleClick(MouseEvent me) {
+ try {
+ String location = table.getSelection()[0].getText(4);
+
+ if(location.length() > 0) {
+ int line = 0;
+ if(location.indexOf(':') > 0) {
+ String[] pos = location.split(":");
+ line = Integer.parseInt(pos[0]);
+ } else
+ line = Integer.parseInt(location);
+
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorPart ed = page.getActiveEditor();
+
+ if(ed instanceof SimpleEditor) {
+ SimpleEditor editor = ((SimpleEditor)ed);
+ editor.selectLine(line);
+ editor.setFocus();
+ }
+ }
+ } catch(Exception e) {}
+ }
+ };
+
+ private Table table;
+ private String[] titles;
+ private TableItem item;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/IErrorParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/IErrorParser.java
new file mode 100644
index 0000000000..9ee962367b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/IErrorParser.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.structures;
+
+public interface IErrorParser {
+ public String[][] parseOutput(String data);
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ScriptConsole.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ScriptConsole.java
new file mode 100644
index 0000000000..3f0e6f3072
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/structures/ScriptConsole.java
@@ -0,0 +1,288 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.structures;
+
+import java.io.File;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.Subscription;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.actions.StopScriptAction;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.views.ErrorView;
+import org.eclipse.linuxtools.systemtap.ui.structures.IPasswordPrompt;
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.LoggedCommand;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.console.ConsolePlugin;
+import org.eclipse.ui.console.IConsole;
+import org.eclipse.ui.console.MessageConsole;
+
+
+
+/**
+ * This class serves as a pain in the ConsoleView. It is used to create a new Command that,
+ * through ConsoleDaemons will print all the output the the console. In order to stop the
+ * running Command <code>StopScriptAction</code> should be used to stop this console from
+ * running.
+ * @author Ryan Morse
+ */
+public class ScriptConsole extends MessageConsole {
+ /**
+ * This method is used to get a reference to a <code>ScriptConsole</code>. If there
+ * is already an console that has the same name as that provided it will be stopped,
+ * cleared and returned to the caller to use. If there is no console matching the
+ * provided name then a new <code>ScriptConsole</code> will be created for use.
+ * @param name The name of the console that should be returned if available.
+ * @return The console with the provided name, or a new instance if none exist.
+ */
+ public static ScriptConsole getInstance(String name) {
+ ScriptConsole console = null;
+ try {
+ IConsole ic[] = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
+
+ //Prevent running the same script twice
+ if(null != ic) {
+ ScriptConsole activeConsole;
+ StopScriptAction ssa = new StopScriptAction();
+ ssa.init(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ for(int i=0; i<ic.length; i++) {
+ activeConsole = (ScriptConsole)ic[i];
+ if(activeConsole.getName().endsWith(name)) {
+ //Stop any script currently running
+ ssa.run(i);
+ //Remove output from last run
+ activeConsole.clearConsole();
+ activeConsole.setName(name);
+ console = activeConsole;
+ }
+ }
+ }
+
+ if(null == console) {
+ console = new ScriptConsole(name, null);
+ ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {console});
+ }
+ } catch(NullPointerException npe) {
+ console = null;
+ }
+ return console;
+ }
+
+ public static ScriptConsole getInstance(String name,Subscription sub) {
+ ScriptConsole console = null;
+ try {
+ IConsole ic[] = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
+
+ //Prevent running the same script twice
+ if(null != ic) {
+ ScriptConsole activeConsole;
+ StopScriptAction ssa = new StopScriptAction();
+ ssa.init(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ for(int i=0; i<ic.length; i++) {
+ activeConsole = (ScriptConsole)ic[i];
+ if(activeConsole.getName().endsWith(name)) {
+ //Stop any script currently running
+ ssa.run(i);
+
+ //Remove output from last run
+ activeConsole.clearConsole();
+ activeConsole.setName(name);
+ console = activeConsole;
+ }
+ }
+ }
+
+ if(null == console) {
+ console = new ScriptConsole(name, null, sub);
+ ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {console});
+ }
+ } catch(NullPointerException npe) {
+ console = null;
+ }
+ return console;
+ }
+ private ScriptConsole(String name, ImageDescriptor imageDescriptor) {
+ super(name, imageDescriptor);
+ cmd = null;
+ }
+
+ private ScriptConsole(String name, ImageDescriptor imageDescriptor, Subscription sub) {
+ super(name, imageDescriptor);
+ this.subscription = sub;
+ cmd = null;
+ }
+
+ /**
+ * Creates the <code>ConsoleStreamDaemon</code> for passing data from the
+ * <code>LoggedCommand</code>'s InputStream to the Console.
+ */
+ protected void createConsoleDaemon() {
+ consoleDaemon = new ConsoleStreamDaemon(this);
+ }
+
+ /**
+ * Creates the <code>ErrorStreamDaemon</code> for passing data from the
+ * <code>LoggedCommand</code>'s ErrorStream to the Console and ErrorView.
+ */
+ protected void createErrorDaemon(IErrorParser parser) {
+ ErrorView errorView = null;
+ try {
+ IViewPart ivp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(ErrorView.ID);
+ if(null != ivp && ivp instanceof ErrorView)
+ errorView = ((ErrorView)ivp);
+ } catch(Exception e) {}
+
+ errorDaemon = new ErrorStreamDaemon(this, errorView, parser);
+ }
+
+ /**
+ * Runs the provied command in this ScriptConsole instance.
+ * @param command The command and arguments to run.
+ * @param envVars The environment variables to use while running
+ * @param prompt The prompt to get the users password if needed.
+ * @param errorParser The parser to handle error messages generated by the command
+ */
+ public void run(String[] command, String[] envVars, IPasswordPrompt prompt, IErrorParser errorParser) {
+ if(subscription.init())
+ {
+ createConsoleDaemon();
+ createErrorDaemon(errorParser);
+ subscription.addErrorStreamListener(errorDaemon);
+ subscription.addInputStreamListener(consoleDaemon);
+
+ if (!subscription.isRunning())
+ {
+ subscription.start();
+ }
+ ConsolePlugin.getDefault().getConsoleManager().showConsoleView(this);
+ }
+ else
+ {
+ setName(Localization.getString("ScriptConsole.Terminated") + super.getName());
+ subscription.interrupt();
+ subscription.delSubscription();
+ ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new IConsole[] {this});
+ }
+ }
+
+ public void run() {
+ if(subscription.init())
+ {
+ createConsoleDaemon();
+ subscription.addInputStreamListener(consoleDaemon);
+ subscription.addErrorStreamListener(consoleDaemon);
+
+ if (!subscription.isRunning())
+ {
+ subscription.start();
+ }
+ ConsolePlugin.getDefault().getConsoleManager().showConsoleView(this);
+ //ConsolePlugin.getDefault().getConsoleManager().
+ //activate();
+ }
+ else
+ {
+ setName(Localization.getString("ScriptConsole.Terminated") + super.getName());
+ subscription.interrupt();
+ subscription.delSubscription();
+ ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new IConsole[] {this});
+ }
+
+ }
+
+ /**
+ * Check to see if the Command is still running
+ * @return boolean representing if the command is running
+ */
+ public boolean isRunning() {
+ return subscription.isRunning();
+ }
+
+ /**
+ * Check to see if this class has already been disposed.
+ * @return boolean represneting whether or not the class has been disposed.
+ */
+ public boolean isDisposed() {
+ return cmd.isDisposed();
+ }
+
+ /**
+ * Method to allow the user to save the Commands output to a file for use latter.
+ * @param file The new file to save the output to.
+ */
+ public void saveStream(File file) {
+ if(isRunning())
+ if(!subscription.saveLog(file))
+ MessageDialog.openWarning(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Localization.getString("ScriptConsole.Problem"), Localization.getString("ScriptConsole.ErrorSavingLog"));
+ }
+
+ /**
+ * Gets the command that is running in this console, or null if there is no running command.
+ * @return The <code>LoggedCommand</code> that is running in this console.
+ */
+ public LoggedCommand getCommand() {
+ return cmd;
+ }
+
+ public String getOutput() {
+ return subscription.getOutput();
+ }
+
+ /**
+ * Stops the running command and the associated listeners.
+ */
+ public synchronized void stop() {
+ if(isRunning()) {
+ setName(Localization.getString("ScriptConsole.Terminated") + super.getName());
+ subscription.interrupt();
+ subscription.delSubscription();
+ ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new IConsole[] {this});
+
+ }
+ }
+
+ /**
+ * Disposes of all internal references in the class. No method should be called after this.
+ */
+ public void dispose() {
+ if(!isDisposed()) {
+ if(null != subscription)
+ subscription.dispose();
+ subscription = null;
+ if(null != errorDaemon)
+ errorDaemon.dispose();
+ errorDaemon = null;
+ if(null != consoleDaemon)
+ consoleDaemon.dispose();
+ consoleDaemon = null;
+ }
+ }
+
+ /**
+ * Changes the name displayed on this console.
+ * @param name The new name to display on the console.
+ */
+ public void setName(String name) {
+ try {
+ super.setName(name);
+ if(null != ConsolePlugin.getDefault())
+ ConsolePlugin.getDefault().getConsoleManager().refresh(this);
+ } catch(Exception e) {}
+ }
+
+ private LoggedCommand cmd;
+
+ private ErrorStreamDaemon errorDaemon;
+ private ConsoleStreamDaemon consoleDaemon;
+ private Subscription subscription;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/views/ErrorView.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/views/ErrorView.java
new file mode 100644
index 0000000000..1606b00b59
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.consolelog/src/org/eclipse/linuxtools/systemtap/ui/consolelog/views/ErrorView.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.consolelog.views;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ErrorTableDisplay;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+
+
+/**
+ * A view to list error messages generated from trying to run a script in the editor.
+ * @author Ryan Morse
+ */
+public class ErrorView extends ViewPart {
+ public ErrorView() {
+ super();
+ }
+
+ /**
+ * Greates a new table to contain all of the error messages.
+ * @param parent The composite to draw all content to.
+ */
+ public void createPartControl(Composite parent) {
+ Composite c = new Composite(parent, SWT.NONE);
+
+ GridLayout grid = new GridLayout();
+ c.setLayout(grid);
+
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ table = new ErrorTableDisplay(c, new String[] {"", Localization.getString("ErrorView.Type"), Localization.getString("ErrorView.Description"), Localization.getString("ErrorView.Saw"), Localization.getString("ErrorView.Line")});
+ table.getControl().setLayoutData(gd);
+ }
+
+ /**
+ * Adds the log details to the table of errors.
+ * @param log The details for an error message to display in the table.
+ */
+ public void add(final String[] log) {
+ table.getControl().getDisplay().syncExec(new Runnable() {
+ boolean stop = false;
+ public void run() {
+ if(stop) return;
+ try {
+ table.addRow(log);
+
+ try {
+ PlatformUI.getWorkbench().getWorkbenchWindows()[0].getActivePage().showView(ID);
+ } catch(PartInitException pie) {
+ } catch(NullPointerException npe) {}
+ } catch (Exception e) {
+ stop = true;
+ }
+ }
+
+ });
+ }
+
+ /**
+ * Clears the entire table of error messages.
+ */
+ public void clear() {
+ table.clear();
+ }
+
+ public void setFocus() {}
+
+ /**
+ * Disposes of everything in this class.
+ */
+ public void dispose() {
+ if(null != table)
+ table.dispose();
+ table = null;
+ super.dispose();
+ }
+
+ private volatile ErrorTableDisplay table;
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.consolelog.views.ErrorView";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.project
new file mode 100644
index 0000000000..b71f278e84
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.editor</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.settings/org.eclipse.jdt.core.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..baa9fca64a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Fri Feb 27 17:31:01 IST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/ChangeLog
new file mode 100644
index 0000000000..44d839b55a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/ChangeLog
@@ -0,0 +1,18 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * src/org/eclipse/linuxtools/systemtap/ui/editor/ColorManager.java (dispose):
+ (getColor): Replacing with Phil's code
+ * src/org/eclipse/linuxtools/systemtap/ui/editor/SimpleEditor.java:
+
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * ChangeLog: Refactoring. Renaming all packages directories from *.systemtapgui.* to *.systemtap.ui.* \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..9a46e72b75
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Editor Plug-in
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.editor;singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.editor.internal.EditorPlugin
+Bundle-Vendor: Eclipse
+Bundle-Localization: plugin
+Export-Package: org.eclipse.linuxtools.systemtap.ui.editor,
+ org.eclipse.linuxtools.systemtap.ui.editor.actions.file
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.jface.text;visibility:=reexport,
+ org.eclipse.ui.editors;visibility:=reexport,
+ org.eclipse.ui.workbench.texteditor;visibility:=reexport,
+ org.eclipse.ui;bundle-version="3.4.1"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/build.properties
new file mode 100644
index 0000000000..370b6c6896
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ icons/,\
+ .,\
+ plugin.properties
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/copy_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/copy_edit.gif
new file mode 100644
index 0000000000..71d7c95aa8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/copy_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/cut_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/cut_edit.gif
new file mode 100644
index 0000000000..d044e59777
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/cut_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/delete_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/delete_edit.gif
new file mode 100644
index 0000000000..b6922ac11c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/delete_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/paste_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/paste_edit.gif
new file mode 100644
index 0000000000..39dd4d9d38
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/paste_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/redo_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/redo_edit.gif
new file mode 100644
index 0000000000..c84e5b1d84
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/redo_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/undo_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/undo_edit.gif
new file mode 100644
index 0000000000..eae118ad16
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/edit/undo_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/close_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/close_edit.gif
new file mode 100644
index 0000000000..2cd9c54443
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/close_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/closeall_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/closeall_edit.gif
new file mode 100644
index 0000000000..28a3785aac
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/closeall_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/new_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/new_wiz.gif
new file mode 100644
index 0000000000..7aea894d0b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/new_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/open_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/open_wiz.gif
new file mode 100644
index 0000000000..51e703b1b9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/open_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/print_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/print_edit.gif
new file mode 100644
index 0000000000..04cb84bf4f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/print_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/save_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/save_edit.gif
new file mode 100644
index 0000000000..499dd0ca60
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/save_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/saveall_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/saveall_edit.gif
new file mode 100644
index 0000000000..ef0eab5ba3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/saveall_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/saveas_edit.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/saveas_edit.gif
new file mode 100644
index 0000000000..466bfb1128
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/icons/actions/file/saveas_edit.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/plugin.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/plugin.properties
new file mode 100644
index 0000000000..e0f6e1371b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/plugin.properties
@@ -0,0 +1,18 @@
+
+
+category.file.name=File
+category.file.desc=File
+
+menu.recentFiles.name=Recent Files
+menu.recentFiles.slot0.name=1 NA
+menu.recentFiles.slot1.name=2 NA
+menu.recentFiles.slot2.name=3 NA
+menu.recentFiles.slot3.name=4 NA
+
+actionset.file.name=File Action Set
+action.open.name=&Open File
+action.open.desc=Open a file
+action.new.name=&New File
+action.new.desc=Create a new file
+
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/plugin.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/plugin.xml
new file mode 100644
index 0000000000..00139cc7d0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/plugin.xml
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.ui.startup">
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ name="%command.open.name"
+ description="%command.open.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.editor.category.file"
+ id="org.eclipse.linuxtools.systemtap.ui.editor.commands.file.OpenFileCommand"/>
+ <category
+ name="%category.file.name"
+ description="%category.file.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.editor.category.file"/>
+ </extension>
+
+
+
+ <extension
+ point="org.eclipse.ui.actionSets">
+
+ <actionSet
+ label="%actionset.file.name"
+ visible="false"
+ id="org.eclipse.linuxtools.systemtap.ui.editor.FileActionSet">
+ <action
+ label="%action.open.name"
+ tooltip="%action.open.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.editor.actions.file.OpenFileAction"
+ icon="icons/actions/file/open_wiz.gif"
+ toolbarPath="org.eclipse.ui.workbench.file/new.ext"
+ class="org.eclipse.linuxtools.systemtap.ui.editor.actions.file.OpenFileAction"
+ definitionId="org.eclipse.linuxtools.systemtap.ui.editor.commands.file.OpenFileCommand"
+ style="push"
+ state="false"/>
+ <action
+ label=""
+
+ id="org.eclipse.linuxtools.systemtap.ui.editor.actions.file.NewFileAction"
+
+ class="org.eclipse.linuxtools.systemtap.ui.editor.actions.file.NewFileAction"
+ definitionId="org.eclipse.ui.newWizard"
+
+ state="false"/>
+
+
+ <!--<menu
+ id="org.eclipse.linuxtools.systemtap.ui.editor.recentFilesMenu"
+ label="%menu.recentFiles.name"
+ path="file2/recentFiles.ext">
+ <groupMarker name="slot0"/>
+ <groupMarker name="slot1"/>
+ <groupMarker name="slot2"/>
+ <groupMarker name="slot3"/>
+ </menu> -->
+ <!--<action
+ label="%menu.recentFiles.slot3.name"
+ id="org.eclipse.linuxtools.systemtap.ui.editor.actions.file.openRecentFile"
+ menubarPath="file2/org.eclipse.linuxtools.systemtap.ui.editor.recentFilesMenu/slot3"
+ class="org.eclipse.linuxtools.systemtap.ui.editor.actions.file.OpenRecentFileAction"
+ definitionId="org.eclipse.ui.file.openRecentFile"
+ style="push"
+ state="false"/>-->
+ </actionSet>
+
+ </extension>
+</plugin>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/ColorManager.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/ColorManager.java
new file mode 100644
index 0000000000..93a0508b37
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/ColorManager.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Phil Muldoon <pkmuldoon@picobot.org>.
+ *
+ * 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:
+ * Phil Muldoon <pkmuldoon@picobot.org> - initial API and implementation.
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+
+public class ColorManager {
+
+ protected Map<RGB, Color> colorTable = new HashMap<RGB, Color>(10);
+
+ public void dispose() {
+ Iterator<Color> e = colorTable.values().iterator();
+ while (e.hasNext())
+ e.next().dispose();
+ }
+
+ public Color getColor(RGB rgb) {
+ Color color = colorTable.get(rgb);
+ if (color == null) {
+ color = new Color(Display.getCurrent(), rgb);
+ colorTable.put(rgb, color);
+ }
+ return color;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/DoubleClickStrategy.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/DoubleClickStrategy.java
new file mode 100644
index 0000000000..65016ed145
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/DoubleClickStrategy.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextDoubleClickStrategy;
+import org.eclipse.jface.text.ITextViewer;
+
+public class DoubleClickStrategy implements ITextDoubleClickStrategy {
+ protected ITextViewer fText;
+
+ public void doubleClicked(ITextViewer part) {
+ int pos = part.getSelectedRange().x;
+
+ if (pos < 0)
+ return;
+
+ fText = part;
+
+ if (!selectComment(pos))
+ selectWord(pos);
+ }
+
+ /**
+ * Method handles the selection of comments in the editor.
+ *
+ * @param caretPos postition of the caret
+ */
+ protected boolean selectComment(int caretPos) {
+ IDocument doc = fText.getDocument();
+ int startPos, endPos;
+
+ try {
+ int pos = caretPos;
+ char c = ' ';
+
+ while (pos >= 0) {
+ c = doc.getChar(pos);
+ if (c == '\\') {
+ pos -= 2;
+ continue;
+ }
+ if (c == Character.LINE_SEPARATOR || c == '\"')
+ break;
+ --pos;
+ }
+
+ if (c != '\"')
+ return false;
+
+ startPos = pos;
+
+ pos = caretPos;
+ int length = doc.getLength();
+ c = ' ';
+
+ while (pos < length) {
+ c = doc.getChar(pos);
+ if (c == Character.LINE_SEPARATOR || c == '\"')
+ break;
+ ++pos;
+ }
+ if (c != '\"')
+ return false;
+
+ endPos = pos;
+
+ int offset = startPos + 1;
+ int len = endPos - offset;
+ fText.setSelectedRange(offset, len);
+
+ return true;
+ } catch (BadLocationException x) {}
+
+ return false;
+ }
+
+ /**
+ * Method handles the selection of words in the editor.
+ *
+ * @param caretPos postition of the caret
+ */
+ protected boolean selectWord(int caretPos) {
+ IDocument doc = fText.getDocument();
+ int startPos, endPos;
+
+ try {
+ int pos = caretPos;
+ char c;
+
+ while (pos >= 0) {
+ c = doc.getChar(pos);
+ if (!Character.isJavaIdentifierPart(c))
+ break;
+ --pos;
+ }
+
+ startPos = pos;
+
+ pos = caretPos;
+ int length = doc.getLength();
+
+ while (pos < length) {
+ c = doc.getChar(pos);
+ if (!Character.isJavaIdentifierPart(c))
+ break;
+ ++pos;
+ }
+
+ endPos = pos;
+ selectRange(startPos, endPos);
+
+ return true;
+ } catch (BadLocationException x) {}
+
+ return false;
+ }
+
+ private void selectRange(int startPos, int stopPos) {
+ int offset = startPos + 1;
+ int length = stopPos - offset;
+ fText.setSelectedRange(offset, length);
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/NonRuleBasedDamagerRepairer.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/NonRuleBasedDamagerRepairer.java
new file mode 100644
index 0000000000..2940a6a906
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/NonRuleBasedDamagerRepairer.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor;
+
+import org.eclipse.swt.custom.StyleRange;
+
+import org.eclipse.core.runtime.Assert;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.DocumentEvent;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.presentation.IPresentationDamager;
+import org.eclipse.jface.text.presentation.IPresentationRepairer;
+
+public class NonRuleBasedDamagerRepairer
+ implements IPresentationDamager, IPresentationRepairer {
+
+ /** The document this object works on */
+ protected IDocument fDocument;
+ /** The default text attribute if non is returned as data by the current token */
+ protected TextAttribute fDefaultTextAttribute;
+
+ /**
+ * Constructor for NonRuleBasedDamagerRepairer.
+ * @param defaultTextAttribute
+ */
+ public NonRuleBasedDamagerRepairer(TextAttribute defaultTextAttribute) {
+ Assert.isNotNull(defaultTextAttribute);
+
+ fDefaultTextAttribute = defaultTextAttribute;
+ }
+
+ /**
+ * @see IPresentationRepairer#setDocument(IDocument)
+ */
+ public void setDocument(IDocument document) {
+ fDocument = document;
+ }
+
+ /**
+ * Returns the end offset of the line that contains the specified offset or
+ * if the offset is inside a line delimiter, the end offset of the next line.
+ *
+ * @param offset the offset whose line end offset must be computed
+ * @return the line end offset for the given offset
+ * @exception BadLocationException if offset is invalid in the current document
+ */
+ protected int endOfLineOf(int offset) throws BadLocationException {
+ IRegion info = fDocument.getLineInformationOfOffset(offset);
+ if (offset <= info.getOffset() + info.getLength())
+ return info.getOffset() + info.getLength();
+
+ int line = fDocument.getLineOfOffset(offset);
+ try {
+ info = fDocument.getLineInformation(line + 1);
+ return info.getOffset() + info.getLength();
+ } catch (BadLocationException x) {
+ return fDocument.getLength();
+ }
+ }
+
+ /**
+ * @see IPresentationDamager#getDamageRegion(ITypedRegion, DocumentEvent, boolean)
+ */
+ public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent event, boolean documentPartitioningChanged) {
+ if (!documentPartitioningChanged) {
+ try {
+ IRegion info = fDocument.getLineInformationOfOffset(event.getOffset());
+ int start = Math.max(partition.getOffset(), info.getOffset());
+
+ int end = event.getOffset() + (event.getText() == null
+ ? event.getLength()
+ : event.getText().length());
+
+ if (info.getOffset() <= end
+ && end <= info.getOffset() + info.getLength()) {
+ // optimize the case of the same line
+ end = info.getOffset() + info.getLength();
+ } else
+ end = endOfLineOf(end);
+
+ end = Math.min(partition.getOffset() + partition.getLength(), end);
+
+
+ return new Region(start, end - start);
+ } catch (BadLocationException x) {
+
+ }
+ }
+
+
+ return partition;
+ }
+
+ /**
+ * @see IPresentationRepairer#createPresentation(TextPresentation, ITypedRegion)
+ */
+ public void createPresentation(TextPresentation presentation, ITypedRegion region) {
+ addRange(
+ presentation,
+ region.getOffset(),
+ region.getLength(),
+ fDefaultTextAttribute);
+ }
+
+ /**
+ * Adds style information to the given text presentation.
+ *
+ * @param presentation the text presentation to be extended
+ * @param offset the offset of the range to be styled
+ * @param length the length of the range to be styled
+ * @param attr the attribute describing the style of the range to be styled
+ */
+ protected void addRange(TextPresentation presentation, int offset, int length, TextAttribute attr) {
+ if (attr != null)
+ presentation.addStyleRange(
+ new StyleRange(
+ offset,
+ length,
+ attr.getForeground(),
+ attr.getBackground(),
+ attr.getStyle()));
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/PathEditorInput.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/PathEditorInput.java
new file mode 100644
index 0000000000..594456de5e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/PathEditorInput.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.linuxtools.systemtap.ui.editor.internal.Localization;
+
+import org.eclipse.ui.IPathEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.editors.text.ILocationProvider;
+
+
+
+public class PathEditorInput implements IPathEditorInput, ILocationProvider {
+ private IPath fPath;
+ private IWorkbenchWindow fMainWindow;
+ public boolean temp = false;
+ private static int tempcount = 0;
+
+ public PathEditorInput(IPath path) {
+ if (path == null) {
+ throw new IllegalArgumentException();
+ }
+ this.fPath = path;
+ }
+ public PathEditorInput(IPath path, IWorkbenchWindow window) {
+ this(path);
+ this.fMainWindow = window;
+ }
+
+ public PathEditorInput() throws IOException {
+ temp = true;
+ tempcount++;
+ File file = File.createTempFile(Localization.getString("PathEditorInput.Untitled") , ".stp"); //$NON-NLS-1$ //$NON-NLS-2$
+ fPath = new Path(file.getAbsolutePath());
+ }
+
+ public int hashCode() {
+ return fPath.hashCode();
+ }
+
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!(obj instanceof PathEditorInput))
+ return false;
+ PathEditorInput other = (PathEditorInput) obj;
+
+ return fPath.equals(other.fPath);
+ }
+
+ public boolean exists() {
+ return fPath.toFile().exists();
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return PlatformUI.getWorkbench().getEditorRegistry().getImageDescriptor(fPath.toString());
+ }
+
+ public String getName() {
+ String[] substr = fPath.segments();
+ return substr[substr.length -1];
+ }
+
+ public String getToolTipText() {
+ return fPath.makeRelative().toOSString();
+ }
+
+ public IPath getPath() {
+ return fPath;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ public IWorkbenchWindow getMainWindow() {
+ return fMainWindow;
+ }
+
+ public IPath getPath(Object element) {
+ if(element instanceof PathEditorInput) {
+ return ((PathEditorInput)element).getPath();
+ }
+ return null;
+ }
+
+ public void setPath(IPath newPath) {
+ fPath = newPath;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/RecentFileMenuManager.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/RecentFileMenuManager.java
new file mode 100644
index 0000000000..8dd2531b61
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/RecentFileMenuManager.java
@@ -0,0 +1,42 @@
+package org.eclipse.linuxtools.systemtap.ui.editor;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.editor.actions.file.OpenRecentFileAction;
+import org.eclipse.ui.IActionBars;
+
+
+
+public class RecentFileMenuManager {
+ private RecentFileMenuManager() {
+ addedBars = new ArrayList<IActionBars>();
+ for(int i=0; i<MAX_RECENT_FILES; i++)
+ fileActions[i] = new OpenRecentFileAction(i);
+ }
+
+ public static RecentFileMenuManager getInstance() {
+ return manager;
+ }
+
+ public void registerActionBar(IActionBars bars) {
+ addedBars.add(bars);
+
+ for(int i=0; i<MAX_RECENT_FILES; i++)
+ bars.setGlobalActionHandler(
+ "org.eclipse.linuxtools.systemtap.ui.editor.actions.file.openRecentFile" + i,
+ fileActions[i]);
+ bars.updateActionBars();
+ }
+
+ public static void update() {
+ for(int i=0; i<MAX_RECENT_FILES; i++)
+ fileActions[i].update();
+ for(int i=0; i<addedBars.size(); i++)
+ ((IActionBars)addedBars.get(i)).updateActionBars();
+ }
+
+ public static final int MAX_RECENT_FILES = 4;
+ private static OpenRecentFileAction[] fileActions = new OpenRecentFileAction[MAX_RECENT_FILES];
+ private static RecentFileMenuManager manager = new RecentFileMenuManager();
+ private static ArrayList<IActionBars> addedBars;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/SimpleDocumentProvider.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/SimpleDocumentProvider.java
new file mode 100644
index 0000000000..23322b8a82
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/SimpleDocumentProvider.java
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+import org.eclipse.jface.operation.IRunnableContext;
+
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.source.IAnnotationModel;
+
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPathEditorInput;
+import org.eclipse.ui.texteditor.AbstractDocumentProvider;
+
+public class SimpleDocumentProvider extends AbstractDocumentProvider {
+ public boolean canSaveDocument(Object element) {
+ return super.canSaveDocument(element);
+ }
+
+ protected IDocument createDocument(Object element) throws CoreException {
+ if (element instanceof IEditorInput) {
+ IDocument document= new Document();
+ if (setDocumentContent(document, (IEditorInput) element)) {
+ setupDocument(document);
+ }
+ return document;
+ }
+
+ return null;
+ }
+
+ /**
+ * Tries to read the file pointed at by <code>input</code> if it is an
+ * <code>IPathEditorInput</code>. If the file does not exist, <code>true</code>
+ * is returned.
+ *
+ * @param document the document to fill with the contents of <code>input</code>
+ * @param input the editor input
+ * @return <code>true</code> if setting the content was successful or no file exists, <code>false</code> otherwise
+ * @throws CoreException if reading the file fails
+ */
+ private boolean setDocumentContent(IDocument document, IEditorInput input) throws CoreException {
+ Reader reader;
+ String inputClassName = input.getClass().getName();
+ try {
+ if (input instanceof IPathEditorInput){
+ reader= new FileReader(((IPathEditorInput)input).getPath().toFile());
+ }
+ else if ( inputClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" )
+ || inputClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) )
+ // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
+ // is used when opening a file from the menu File > Open... in Eclipse 3.2.x
+ // The class 'org.eclipse.ui.ide.FileStoreEditorInput' is used when
+ // opening a file from the menu File > Open... in Eclipse 3.3.x
+ {
+ reader = new FileReader( new File( input.getToolTipText() ) );
+ }
+ else
+ {
+ return false;
+ }
+ } catch (FileNotFoundException e) {
+ // return empty document and save later
+ return true;
+ }
+
+ try {
+ setDocumentContent(document, reader);
+ return true;
+ } catch (IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.linuxtools.systemtap.ui.editor", IStatus.OK, "error reading file", e)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+
+ /**
+ * Reads in document content from a reader and fills <code>document</code>
+ *
+ * @param document the document to fill
+ * @param reader the source
+ * @throws IOException if reading fails
+ */
+ private void setDocumentContent(IDocument document, Reader reader) throws IOException {
+ Reader in= new BufferedReader(reader);
+ try {
+
+ StringBuffer buffer= new StringBuffer(512);
+ char[] readBuffer= new char[512];
+ int n= in.read(readBuffer);
+ while (n > 0) {
+ buffer.append(readBuffer, 0, n);
+ n= in.read(readBuffer);
+ }
+
+ document.set(buffer.toString());
+ } finally {
+ in.close();
+ }
+ }
+
+ /**
+ * Set up the document - default implementation does nothing.
+ *
+ * @param document the new document
+ */
+ protected void setupDocument(IDocument document) {
+ }
+
+ /*
+ * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#createAnnotationModel(java.lang.Object)
+ */
+ protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
+ return null;
+ }
+
+ /*
+ * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#doSaveDocument(org.eclipse.core.runtime.IProgressMonitor, java.lang.Object, org.eclipse.jface.text.IDocument, boolean)
+ */
+ protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
+ String elementClassName = element.getClass().getName();
+ File file = null;
+ if (element instanceof IPathEditorInput) {
+ IPathEditorInput pei= (IPathEditorInput) element;
+ IPath path= pei.getPath();
+ file= path.toFile();
+ }
+ else if ( elementClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" )
+ || elementClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) )
+ // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
+ // is used when opening a file from the menu File > Open... in Eclipse 3.2.x
+ // The class 'org.eclipse.ui.ide.FileStoreEditorInput' is used when
+ // opening a file from the menu File > Open... in Eclipse 3.3.x
+ {
+ file = new File( ( ( IEditorInput ) element ).getToolTipText() );
+ }
+ if (file!=null){
+ try {
+ file.createNewFile();
+
+ if (file.exists()) {
+ if (file.canWrite()) {
+ Writer writer= new FileWriter(file);
+ writeDocumentContent(document, writer, monitor);
+ } else
+ throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.linuxtools.systemtap.ui.editor", IStatus.OK, "file is read-only", null)); //$NON-NLS-1$ //$NON-NLS-2$
+ } else
+ throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.linuxtools.systemtap.ui.editor", IStatus.OK, "error creating file", null)); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (IOException e) {
+ throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.linuxtools.systemtap.ui.editor", IStatus.OK, "error when saving file", e)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ }
+
+ /**
+ * Saves the document contents to a stream.
+ *
+ * @param document the document to save
+ * @param writer the stream to save it to
+ * @param monitor a progress monitor to report progress
+ * @throws IOException if writing fails
+ */
+ private void writeDocumentContent(IDocument document, Writer writer, IProgressMonitor monitor) throws IOException {
+ Writer out= new BufferedWriter(writer);
+ try {
+ out.write(document.get());
+ } finally {
+ out.close();
+ }
+ }
+
+ /*
+ * @see org.eclipse.ui.texteditor.AbstractDocumentProvider#getOperationRunner(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
+ return null;
+ }
+
+ /*
+ * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isModifiable(java.lang.Object)
+ */
+ public boolean isModifiable( Object element )
+ {
+ String elementClassName = element.getClass().getName();
+ if ( element instanceof IPathEditorInput )
+ {
+ IPathEditorInput pei = ( IPathEditorInput ) element;
+ File file = pei.getPath().toFile();
+ return file.canWrite() || !file.exists(); // Allow to edit new files
+ }
+ else if ( elementClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" )
+ || elementClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) )
+ // The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'
+ // is used when opening a file from the menu File > Open... in Eclipse 3.2.x
+ // The class 'org.eclipse.ui.ide.FileStoreEditorInput' is used when
+ // opening a file from the menu File > Open... in Eclipse 3.3.x
+ {
+ File file = new File( ( ( IEditorInput ) element ).getToolTipText() );
+ return file.canWrite() || !file.exists(); // Allow to edit new files
+ }
+
+ return false;
+ }
+
+
+ /*
+ * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isReadOnly(java.lang.Object)
+ */
+ public boolean isReadOnly(Object element) {
+ return false;
+ }
+
+ /*
+ * @see org.eclipse.ui.texteditor.IDocumentProviderExtension#isStateValidated(java.lang.Object)
+ */
+ public boolean isStateValidated(Object element) {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/SimpleEditor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/SimpleEditor.java
new file mode 100644
index 0000000000..edcc1b4542
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/SimpleEditor.java
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.PrintStream;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.editors.text.TextEditor;
+
+public class SimpleEditor extends TextEditor {
+ public SimpleEditor() {
+ super();
+ // make sure we inherit all the text editing commands (delete line etc).
+ setKeyBindingScopes(new String[] { "org.eclipse.ui.textEditorScope" });
+ internal_init();
+ }
+
+ protected void internal_init() {
+ configureInsertMode(SMART_INSERT, false);
+ setDocumentProvider(new SimpleDocumentProvider());
+ }
+
+ public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {
+ super.init(site, input);
+ RecentFileMenuManager.getInstance().registerActionBar(getEditorSite().getActionBars());
+ }
+
+ /**
+ * Searches the IDocument for the specified string.
+ *
+ * @param search string to find
+ * @return the integer line number of the string
+ */
+ public int find(String search) {
+ IDocument doc = getSourceViewer().getDocument();
+ FindReplaceDocumentAdapter finder = new FindReplaceDocumentAdapter(doc);
+
+ int line = 0;
+
+ jumpToLocation(0, 0);
+ try {
+ IRegion reg = finder.find(0, search, true, false, false, false);
+ int offset = reg.getOffset();
+ line = doc.getLineOfOffset(offset);
+ } catch(BadLocationException ble) {
+ } catch(NullPointerException npe) {
+ line = -1;
+ }
+
+ return line;
+ }
+
+ /**
+ * Jumps to the location in the IDocument.
+ * @param line the line you wish to jump to
+ * @param the character you wish to jump to
+ */
+ public void jumpToLocation(int line, int character) {
+ IDocument doc = getSourceViewer().getDocument();
+
+ try {
+ int offset = doc.getLineOffset(line-1) + character;
+ this.getSelectionProvider().setSelection(new TextSelection(doc, offset, 0));
+ } catch(BadLocationException boe) {}
+ }
+
+ /**
+ * Selects a line in the IDocument.
+ * @param line the line you wish to select
+ */
+ public void selectLine(int line) {
+ IDocument doc = getSourceViewer().getDocument();
+
+ try {
+ this.getSelectionProvider().setSelection(new TextSelection(doc, doc.getLineOffset(line-1), doc.getLineLength(line-1)-1));
+ } catch(BadLocationException boe) {}
+ }
+
+ /**
+ * Performs a SaveAs on the IDocument.
+ */
+ public void doSaveAs() {
+ File file = queryFile();
+ if(file == null) {
+ return;
+ }
+
+ IEditorInput inputFile = createEditorInput(file);
+
+ IDocument doc = getSourceViewer().getDocument();
+ String s = doc.get();
+
+ try {
+ FileOutputStream fos = new FileOutputStream(file);
+ PrintStream ps = new PrintStream(fos);
+
+ ps.print(s);
+ } catch(FileNotFoundException fnfe) {}
+
+ setInput(inputFile);
+ setPartName(inputFile.getName());
+ }
+
+ /**
+ * Sets up an editor input based on the specified file.
+ * @param file the location of the file you wish to set.
+ * @return input object created.
+ */
+ private IEditorInput createEditorInput(File file) {
+ IPath location= new Path(file.getAbsolutePath());
+ PathEditorInput input= new PathEditorInput(location);
+ return input;
+ }
+
+ /**
+ * Inserts text into the IDocument.
+ * @param text string to insert
+ */
+ public void insertText(String text) {
+ IDocument doc = getSourceViewer().getDocument();
+ String s = doc.get();
+ int offset = s.length();
+ s += text;
+ doc.set(s);
+ this.setHighlightRange(offset,0,true);
+ }
+
+ /**
+ * Inserts text at the current location.
+ * @param text string to insert
+ */
+ public void insertTextAtCurrent(String text) {
+ ISelection selection = this.getSelectionProvider().getSelection();
+ IDocument doc = getSourceViewer().getDocument();
+
+ if(selection instanceof ITextSelection) {
+ ITextSelection s = (ITextSelection) selection;
+ StringBuffer sb = new StringBuffer(doc.get().substring(0,s.getOffset()));
+ sb.append(text.trim());
+ sb.append(doc.get().substring(s.getOffset() + s.getLength(), doc.get().length()));
+ doc.set(sb.toString());
+ this.setHighlightRange(s.getOffset() + text.trim().length(),0,true);
+ }
+ }
+
+ private File queryFile() {
+ FileDialog dialog= new FileDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.SAVE);
+ dialog.setText("New File");
+ String path= dialog.open();
+ if (path != null && path.length() > 0)
+ return new File(path);
+ return null;
+ }
+
+ /**
+ * Determines whether saving is allowed currently.
+ * @return boolean value indicating whether or not saving is allowed
+ */
+ public boolean isSaveAsAllowed() {
+ return true;
+ }
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/WhitespaceDetector.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/WhitespaceDetector.java
new file mode 100644
index 0000000000..5e1b9e7656
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/WhitespaceDetector.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor;
+
+import org.eclipse.jface.text.rules.IWhitespaceDetector;
+
+public class WhitespaceDetector implements IWhitespaceDetector {
+
+ /**
+ * Determines whether or not a character is considered whitespace
+ *
+ * @param c the character to test
+ *
+ * @return a boolean value indicating if the character is whitespace
+ */
+ public boolean isWhitespace(char c) {
+ return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/WordDetector.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/WordDetector.java
new file mode 100644
index 0000000000..fa54b52156
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/WordDetector.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor;
+
+import org.eclipse.jface.text.rules.IWordDetector;
+
+public class WordDetector implements IWordDetector {
+
+ public boolean isWordPart(char character) {
+ if (character == '.') return true;
+
+ return Character.isJavaIdentifierPart(character);
+ }
+
+ public boolean isWordStart(char character) {
+ return Character.isJavaIdentifierStart(character);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/ActiveEditorAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/ActiveEditorAction.java
new file mode 100644
index 0000000000..893c27b741
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/ActiveEditorAction.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor.actions;
+
+public abstract class ActiveEditorAction extends EditorAction {
+ public ActiveEditorAction() {
+ super();
+ }
+
+ protected void buildEnablementChecks() {
+ setEnablement(null != getActiveEditor());
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/EditorAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/EditorAction.java
new file mode 100644
index 0000000000..5d2b9e3b5f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/EditorAction.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+
+public abstract class EditorAction extends Action implements IWorkbenchWindowActionDelegate {
+ public EditorAction() {
+ super();
+ setEnabled(true);
+ }
+
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ }
+
+ protected void updateState() {
+ IEditorPart editor = getActiveEditor();
+ setEnabled(editor != null && editor.isDirty());
+ }
+
+ protected IWorkbenchWindow getWorkbenchWindow() {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ }
+
+ protected IWorkbenchPage getActivePage() {
+ return getWorkbenchWindow().getActivePage();
+ }
+
+ protected IEditorPart getActiveEditor() {
+ return getActivePage().getActiveEditor();
+ }
+
+ public void selectionChanged(IAction act, ISelection select) {
+ action = act;
+ buildEnablementChecks();
+ }
+
+ protected void buildEnablementChecks() {
+ setEnablement(true);
+ }
+
+ protected void setEnablement(boolean enabled) {
+ action.setEnabled(enabled);
+ }
+
+ public void dispose() {
+ window = null;
+ action = null;
+ }
+
+ protected IWorkbenchWindow window;
+ protected IAction action;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/NewFileAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/NewFileAction.java
new file mode 100644
index 0000000000..a02f2eba10
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/NewFileAction.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor.actions.file;
+
+import java.io.File;
+
+import org.eclipse.linuxtools.systemtap.ui.editor.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.IWorkbenchWindow;
+
+
+
+public class NewFileAction extends OpenFileAction {
+
+ public NewFileAction() {
+ super();
+ }
+
+ public NewFileAction(IWorkbenchWindow window) {
+ super();
+ init(window);
+ }
+ /**
+ * Creates a new file.
+ * @return the new file object.
+ */
+ protected File queryFile() {
+ FileDialog dialog= new FileDialog(window.getShell(), SWT.SAVE);
+ dialog.setText(Localization.getString("NewFileAction.NewFile")); //$NON-NLS-1$
+ String path= dialog.open();
+ if (path != null && path.length() > 0)
+ return new File(path);
+ return null;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/OpenFileAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/OpenFileAction.java
new file mode 100644
index 0000000000..929113a25f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/OpenFileAction.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor.actions.file;
+
+import java.io.File;
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.systemtap.ui.editor.PathEditorInput;
+import org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor;
+import org.eclipse.linuxtools.systemtap.ui.editor.actions.EditorAction;
+import org.eclipse.linuxtools.systemtap.ui.editor.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.editor.internal.RecentFileLog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorRegistry;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+
+
+
+public class OpenFileAction extends EditorAction {
+ public OpenFileAction() {
+ super();
+ setEnabled(true);
+ }
+
+ public void run(IAction act) {
+ run();
+ }
+
+ /**
+ * Opens the editor input.
+ */
+ public void run() {
+ File file = queryFile();
+ if (file != null) {
+ IEditorInput input= createEditorInput(file);
+ String editorId= getEditorId(file);
+ IWorkbenchPage page= window.getActivePage();
+ try {
+ page.openEditor(input, editorId);
+ RecentFileLog.updateRecentFiles(file);
+ } catch (PartInitException e) {}
+ } else if (file != null) {
+ String msg = MessageFormat.format(Localization.getString("OpenFileAction.FileIsNull"), (Object [])(new String[] {file.getName()}));
+ MessageDialog.openWarning(window.getShell(), Localization.getString("OpenFileAction.Problem"), msg);
+ }
+ }
+
+ /**
+ * Request the name and location of the file to the user.
+ * @return the File object associated to the selected file.
+ */
+ protected File queryFile() {
+ FileDialog dialog= new FileDialog(window.getShell(), SWT.OPEN);
+ dialog.setText(Localization.getString("OpenFileAction.OpenFile"));
+ String path= dialog.open();
+ if (path != null && path.length() > 0)
+ return new File(path);
+ return null;
+ }
+
+ /**
+ * Returns the editor ID associated with the specified file.
+ * @param file the file to examine
+ * @return the editor ID
+ */
+ protected String getEditorId(File file) {
+ IWorkbench workbench= window.getWorkbench();
+ IEditorRegistry editorRegistry= workbench.getEditorRegistry();
+ IEditorDescriptor descriptor= editorRegistry.getDefaultEditor(file.getName());
+ if (descriptor != null && descriptor.getId().startsWith("org.eclipse.linuxtools.systemtap.ui")) { //TODO: descriptor.getId().startsWith("org.eclipse.linuxtools.systemtap.ui") is a temparary fix until we find out why .txt files are opening with org.eclipse.ui.DefautTextEditor //$NON-NLS-1$
+ return descriptor.getId();
+ }
+ return SimpleEditor.ID;
+ }
+
+ /**
+ * Creates an editor input.
+ * @param file the file you wish the editor to point at
+ * @return the input created
+ */
+ protected IEditorInput createEditorInput(File file) {
+ IPath location= new Path(file.getAbsolutePath());
+ PathEditorInput input= new PathEditorInput(location);
+ return input;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/OpenRecentFileAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/OpenRecentFileAction.java
new file mode 100644
index 0000000000..676f164b33
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/actions/file/OpenRecentFileAction.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2006
+ * 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:
+ * Ryan Morse
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor.actions.file;
+
+import java.io.File;
+
+import org.eclipse.linuxtools.systemtap.ui.editor.internal.RecentFileLog;
+
+
+
+public class OpenRecentFileAction extends OpenFileAction {
+ public OpenRecentFileAction(int item) {
+ super();
+
+ index = item;
+ update();
+ super.init(getWorkbenchWindow());
+ }
+
+ protected File queryFile() {
+ int index = Integer.parseInt(this.getText().substring(0, 1));
+
+ String path = RecentFileLog.getString("path" + (index-1));
+ if (path != null && path.length() > 0)
+ return new File(path);
+ return null;
+ }
+
+ public void update() {
+ String name = RecentFileLog.getString("file" + index);
+ this.setText(index+1 + " " + (name != null ? name : "NA"));
+ }
+
+ private int index;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/EditorPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/EditorPlugin.java
new file mode 100644
index 0000000000..f3577c7bea
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/EditorPlugin.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor.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 EditorPlugin extends AbstractUIPlugin implements IStartup {
+
+ //The shared instance.
+ private static EditorPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public EditorPlugin() {
+ 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 EditorPlugin 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.editor", path);
+ }
+
+ public void earlyStartup() {}
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/Localization.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/Localization.java
new file mode 100644
index 0000000000..0cedea30d3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/Localization.java
@@ -0,0 +1,22 @@
+package org.eclipse.linuxtools.systemtap.ui.editor.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Localization {
+ private static final String BUNDLE_NAME = "org.eclipse.linuxtools.systemtap.ui.editor.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.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/RecentFileLog.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/RecentFileLog.java
new file mode 100644
index 0000000000..5d68b19c5e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/RecentFileLog.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2006
+ * 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:
+ * Ryan Morse
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.editor.internal;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.linuxtools.systemtap.ui.editor.RecentFileMenuManager;
+
+
+
+public final class RecentFileLog {
+ private RecentFileLog() {
+ File f = new File(fileName);
+ try {
+ if(!f.exists()) {
+ f.createNewFile();
+ EditorPlugin.getDefault().getDialogSettings().save(fileName);
+ }
+ } catch(IOException ioe) {}
+ }
+
+ public static RecentFileLog getInstance() {
+ return log;
+ }
+
+ public static String getString(String key) {
+ try {
+ IDialogSettings settings = EditorPlugin.getDefault().getDialogSettings();
+ settings.load(fileName);
+ return settings.get(key);
+ } catch(IOException e) {}
+ return null;
+ }
+
+ private static boolean setString(String key, String val) {
+ try {
+ IDialogSettings settings = EditorPlugin.getDefault().getDialogSettings();
+ settings.load(fileName);
+ settings.put(key, val);
+ settings.save(fileName);
+ return true;
+ } catch(IOException e) {}
+ return false;
+ }
+
+ /**
+ * Updates the list of recently opened files.
+ * @param file the file that was just opened
+ */
+ public static boolean updateRecentFiles(File file) {
+ String[] temps = new String[RecentFileMenuManager.MAX_RECENT_FILES];
+ String[] files = new String[RecentFileMenuManager.MAX_RECENT_FILES];
+ String[] paths = new String[RecentFileMenuManager.MAX_RECENT_FILES];
+
+ for(int i=0; i<RecentFileMenuManager.MAX_RECENT_FILES; i++) {
+ files[i] = getString("file" + i);
+ paths[i] = getString("path" + i);
+ }
+
+ if(!file.getAbsolutePath().equals(paths[0])) {
+ temps[0] = files[0];
+ temps[1] = paths[0];
+ files[0] = file.getName();
+ paths[0] = file.getAbsolutePath();
+
+ if(file.getAbsolutePath().equals(paths[1])) {
+ files[1] = temps[0];
+ paths[1] = temps[1];
+ } else {
+ temps[2] = files[1];
+ temps[3] = paths[1];
+ files[1] = temps[0];
+ paths[1] = temps[1];
+
+ if(file.getAbsolutePath().equals(paths[2])) {
+ files[2] = temps[2];
+ paths[2] = temps[3];
+ } else {
+ temps[0] = files[2];
+ temps[1] = paths[2];
+ files[2] = temps[2];
+ paths[2] = temps[3];
+
+ if(file.getAbsolutePath().equals(paths[3])) {
+ files[3] = temps[0];
+ paths[3] = temps[1];
+ } else {
+ files[3] = temps[0];
+ paths[3] = temps[1];
+ }
+ }
+ }
+ }
+
+ for(int i=0; i<RecentFileMenuManager.MAX_RECENT_FILES; i++) {
+ if(null != files[i] && null != paths[i]) {
+ setString("file" + i, files[i]);
+ setString("path" + i, paths[i]);
+ RecentFileMenuManager.update();
+ }
+ }
+ return true;
+ }
+
+ private static final String fileName = EditorPlugin.getDefault().getStateLocation().append("recentFiles.log").toOSString();
+ private static final RecentFileLog log = new RecentFileLog();
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/localization.properties
new file mode 100644
index 0000000000..a73c31f992
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.editor/src/org/eclipse/linuxtools/systemtap/ui/editor/internal/localization.properties
@@ -0,0 +1,5 @@
+PathEditorInput.Untitled=untitled
+OpenFileAction.FileIsNull=File is null
+OpenFileAction.Problem=Problem
+OpenFileAction.OpenFile=Open File
+NewFileAction.NewFile=New File
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/.classpath
new file mode 100644
index 0000000000..751c8f2e50
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/.project
new file mode 100644
index 0000000000..582642ad82
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.graphing.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/ChangeLog
new file mode 100644
index 0000000000..2e69f0d2d8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/ChangeLog
@@ -0,0 +1,18 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * .classpath: New file.
+ * .project: New file.
+ * build.properties: New file.
+ * META-INF/MANIFEST.MF: New file.
+ * src/com/ibm/ras/systemtap/graphing/structures: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/graphing/AllTests.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/graphing/structures/GraphDisplaySetTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtapgui: \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..cbe10eeade
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.graphing.tests
+Bundle-Version: 0.3.0.qualifier
+Bundle-Vendor: Eclipse
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.graphing.tests.GraphingPlugin
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Import-Package: junit.framework
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/build.properties
new file mode 100644
index 0000000000..34d2e4d2da
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/src/org/eclipse/linuxtools/systemtap/ui/graphing/AllTests.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/src/org/eclipse/linuxtools/systemtap/ui/graphing/AllTests.java
new file mode 100644
index 0000000000..b3ab20eefd
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/src/org/eclipse/linuxtools/systemtap/ui/graphing/AllTests.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing;
+
+import org.eclipse.linuxtools.systemtap.ui.graphing.structures.GraphDisplaySetTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.eclipse.linuxtools.systemtap.ui.graphing");
+
+ //Structures
+ suite.addTestSuite(GraphDisplaySetTest.class);
+
+ return suite;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/src/org/eclipse/linuxtools/systemtap/ui/graphing/structures/GraphDisplaySetTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/src/org/eclipse/linuxtools/systemtap/ui/graphing/structures/GraphDisplaySetTest.java
new file mode 100644
index 0000000000..3f5ba4d18b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing.tests/src/org/eclipse/linuxtools/systemtap/ui/graphing/structures/GraphDisplaySetTest.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.structures;
+
+import junit.framework.TestCase;
+
+public class GraphDisplaySetTest extends TestCase {
+ public GraphDisplaySetTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.project
new file mode 100644
index 0000000000..4070a4c0ff
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.graphing</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.settings/org.eclipse.jdt.core.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..5cb5e1b38f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Fri Feb 27 18:15:17 IST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.settings/org.eclipse.pde.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000000..b67d47e77b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,22 @@
+#Tue Jan 20 16:47:22 IST 2009
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/ChangeLog
new file mode 100644
index 0000000000..9e11384b8d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/ChangeLog
@@ -0,0 +1,11 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * ChangeLog: Refactoring. Renaming all packages directories from *.systemtapgui.* to *.systemtap.ui.* \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..6253773d47
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/META-INF/MANIFEST.MF
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Graphing Plug-in
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.graphing;singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.graphing.internal.GraphingPlugin
+Bundle-Vendor: Eclipse
+Bundle-Localization: plugin
+Export-Package: org.eclipse.linuxtools.systemtap.ui.graphing,
+ org.eclipse.linuxtools.systemtap.ui.graphing.structures,
+ org.eclipse.linuxtools.systemtap.ui.graphing.views
+Require-Bundle: org.eclipse.linuxtools.systemtap.ui.graphingapi.ui,
+ org.eclipse.linuxtools.systemtap.ui.structures,
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.linuxtools.systemtap.ui.logging,
+ org.eclipse.ui.forms,
+ org.eclipse.linuxtools.systemtap.ui.systemtapgui,
+ org.eclipse.core.resources;bundle-version="3.4.1",
+ org.eclipse.ui.editors;bundle-version="3.4.0",
+ org.eclipse.ui.console;bundle-version="3.3.0"
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.linuxtools.systemtap.ui.consolelog.actions,
+ org.eclipse.linuxtools.systemtap.ui.consolelog.structures,
+ org.eclipse.linuxtools.systemtap.ui.editor
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/build.properties
new file mode 100644
index 0000000000..0137899eba
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/,\
+ documentation/,\
+ toc.xml,\
+ plugin.properties
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/concepts.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/concepts.html
new file mode 100644
index 0000000000..51789692fd
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/concepts.html
@@ -0,0 +1,24 @@
+<a href="../toc.html">Table of Contents</a>
+
+<h2>
+Concepts
+</h2>
+
+This section of the Graphing User Guide details conceptual topics of the application; the major
+components, what they do, and how how you interact with them.
+
+<ol>
+<li><a href="dataTable.html">DataTable</a></li>
+<li><a href="graphTypes.html">Graph Types</a>
+<ol>
+<li><a href="graphTypes/barGraph.html">Bar Graph</a></li>
+<li><a href="graphTypes/multiBarGraph.html">Multi-Bar Graph</a></li>
+<li><a href="graphTypes/lineGraph.html">Line Graph</a></li>
+<li><a href="graphTypes/multiLineGraph.html">Multi-Line Graph</a></li>
+<li><a href="graphTypes/scatterGraph.html">Scatter Graph</a></li>
+<li><a href="graphTypes/multiScatterGraph.html">Multi-Scatter Graph</a></li>
+</ol>
+</li>
+<li><a href="filters.html">Filters</a></li>
+<li><a href="graphInteraction.html">Graph Interaction</a></li>
+</ol> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/dataTable.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/dataTable.html
new file mode 100644
index 0000000000..daf7782402
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/dataTable.html
@@ -0,0 +1,38 @@
+<a href="../toc.html">Table of Contents</a> > <a href="concepts.html">Concepts</a>
+
+<h2>
+DataTable
+</h2>
+
+The DataTable is the default view the user sees when running a script with the chart option. It
+intitially starts empty and populates as it recieves information parsed from the console originally
+from the script. The DataTable is a visualization of the data structure that every other graph type
+spawns from.<br><br>
+
+<img src="images/GraphingPerspective.png"><br><br>
+
+The columns of the DataTable can be resized at will by dragging the seperation lines between column
+headers. In addition, the information in the data table can be <a href="../tasks/importDataSet.html">
+saved and loaded</a> without having to re-run the script. Furthermore, the user can populate the
+DataTable without having to run a script if a script's output has been saved into a file, see
+<a href="../tasks/openScriptOutput.html">Opening Script Output</a>.<br><br>
+
+Right clicking the DataTable provides a menu with the following options:
+<ul>
+<li><b>Format as...</b> - Depending on which column the user right clicked, his allows the user to
+format that column's data as one of the following:
+<ul>
+<li>Unformated - No formating is applied.</li>
+<li>String</li>
+<li>Date</li>
+<li>Double</li>
+<li>Hex</li>
+<li>Octal</li>
+<li>Binary</li>
+</ul>
+</li>
+<li><b>Add Filter...</b> - Adds a <a href="filters.html">filter</a> to the DataTable.
+<li><b>Remove Filter...</b> - Removes a <a href="filters.html">filter</a> from the DataTable.
+<li><b>Manually Resize</b> - Allows the user to resize column width without bouncing back to the
+minimum based on the largest value.</li>
+</ul> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/filters.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/filters.html
new file mode 100644
index 0000000000..4df03c9bdd
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/filters.html
@@ -0,0 +1,57 @@
+<a href="../toc.html">Table of Contents</a> > <a href="concepts.html">Concepts</a>
+
+<h2>
+Filters
+</h2>
+
+Filters are screens that you can set on your DataTable to limit the quantity of samples you wish to work with.
+Filters are very often used in restricting the sheer amount of information available to make data tables and
+graphs more substantial to people.<br><br>
+
+The following options exist to work with Filters in the DataTable:
+<ul>
+<li><b>Add Filter...</b> - Adds a Filter to the DataTable.
+<li><b>Remove Filter...</b> - Removes a Filter from the DataTable.
+</ul>
+
+When you select <b>Add Filter</b> you see the following dialogue box:<br><br>
+
+<img src="images/filters.png"><br><br>
+
+What follows is a breakdown of each Filter type:
+<ul>
+
+<li><b>Match Filter</b> - This filter removes everything from the data set where the selected column's
+value does not match the chosen value.<br><br>
+<img src="images/match.png"><br><br>
+Result:<br><br>
+<img src="images/match2.png"><br><br>
+</li>
+
+<li><b>Range Filter</b> - This filter removes everything from the data set that is not included in the
+selected range of values.
+<img src="images/range.png"><br><br>
+Result:<br><br>
+<img src="images/range2.png"><br><br>
+</li>
+
+<li><b>Sort Filter</b> - This filter will sort the data set based on the selected column. No data will be
+removed.
+<img src="images/sort.png"><br><br>
+Result:<br><br>
+<img src="images/sort2.png"><br><br>
+</li>
+
+<li><b>Unique Filter</b> - This filter will remove all merge all entries in that data set that share a common
+value in the selected column. Data for the removed rows will be aggregated together based on the chosen
+aggregation method.<br><br>
+<img src="images/unique.png"><br><br>
+<ul>
+<li><b>Average Aggregate</b> - This aggregate will return the average of all the items consolidated.</li>
+<li><b>Count Aggregate</b> - This aggregate will return the number of items consolidated.</li>
+<li><b>Max Aggregate</b> - This aggregate will return the maximum value of all the items consolidated.</li>
+<li><b>Min Aggregate</b> - This aggregate will return the minimum value of all the items consolidated.</li>
+<li><b>Sum Aggregate</b> - This aggregate will return the sum of all the items consolidated.</li>
+</ul>
+</li>
+</ul> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphInteraction.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphInteraction.html
new file mode 100644
index 0000000000..e6b74362c4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphInteraction.html
@@ -0,0 +1,22 @@
+<a href="../toc.html">Table of Contents</a> > <a href="concepts.html">Concepts</a>
+
+<h2>
+Graph Interaction
+</h2>
+
+Each of the <a href="graphTypes.html">graph types</a> have similar options that can be used in the Graphical
+Perspective:
+<ul>
+<li><b>Zoom Bar</b> - This enables the user to zoom in and out on the current graph by sliding the bar up and
+down. The current magnification is shown at the top of the bar. Magnification can range from as high as
+.0625x to as low as 4x the dimensions of the original graph.<br><br><img src="images/zoom.png"></li>
+<li><b>Title</b> - This option turns on and off the title specified in the graph creation wizard.</li>
+<li><b>Legend</b> - This option turns on and off the legend, particularly useful in the graph types that
+show multiple series.</li>
+<li><b>Grid Lines</b> - This option permits the user to turn and off the grid lines.</li>
+<li><b>Normalization</b> - The option to normalize occurs only in multi-series graphs. By default, series graphs are rendered using normalization which scales them to
+visuals easily comparable to one another. The user has the option to view the normalization scale by clicking
+the data in the graph. The user also has the option of disabling normalization by deselecting it.</li>
+</ul>
+
+<img src="images/graphExpanded.png"> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes.html
new file mode 100644
index 0000000000..330e4298db
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes.html
@@ -0,0 +1,19 @@
+<a href="../toc.html">Table of Contents</a> > <a href="concepts.html">Concepts</a>
+
+<h2>
+Graph Types
+</h2>
+
+Currently there are six graph types built into SystemTap GUI. They are:
+<ul>
+<li><a href="graphTypes/barGraph.html">Bar Graph</a></li>
+<li><a href="graphTypes/multiBarGraph.html">Multi-Bar Graph</a></li>
+<li><a href="graphTypes/lineGraph.html">Line Graph</a></li>
+<li><a href="graphTypes/multiLineGraph.html">Multi-Line Graph</a></li>
+<li><a href="graphTypes/scatterGraph.html">Scatter Graph</a></li>
+<li><a href="graphTypes/multiScatterGraph.html">Multi-Scatter Graph</a></li>
+</ul>
+
+These graph types can be used instantiated by using the Graph Wizard once the DataTable is populated.
+The Graphing Perspective can support multiple graphs from one DataTable. Each are updated and can
+be viewed by navigating through the tabs shown at the top of each graph. \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/barGraph.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/barGraph.html
new file mode 100644
index 0000000000..ff4abfefa3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/barGraph.html
@@ -0,0 +1,12 @@
+<h2>
+Bar Graph
+</h2>
+
+The Bar Graph typically uses bars to show frequencies or values.<br><br>
+
+Creating a Bar Graph will prompt the user for three values. The first is the title and is fully cosmetic. The
+option to turn on and off the title is given to the user, and its off by default. The second option is X Series;
+here you select which series of data you want to plot along the X Axis. The third option is the Y Series; here
+you select which series of data you want to plot along the Y Axis.<br><br>
+
+<img src="images/bar.png"> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/bar.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/bar.png
new file mode 100644
index 0000000000..50aeb04f48
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/bar.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/line.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/line.png
new file mode 100644
index 0000000000..593fd7f99c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/line.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multibar.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multibar.png
new file mode 100644
index 0000000000..6dbac24d0a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multibar.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multiline.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multiline.png
new file mode 100644
index 0000000000..0863a6850a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multiline.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multiscatter.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multiscatter.png
new file mode 100644
index 0000000000..a6f5446bf0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/multiscatter.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/scatter.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/scatter.png
new file mode 100644
index 0000000000..4cfa50eb11
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/images/scatter.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/lineGraph.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/lineGraph.html
new file mode 100644
index 0000000000..f3e3ce9517
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/lineGraph.html
@@ -0,0 +1,12 @@
+<h2>
+Line Graph
+</h2>
+
+The Line Graph is traditionally ideal for horozontally depicting non-cumulative data over, say, time.<br><br>
+
+Creating a Line Graph will prompt the user for three values. The first is the title and is fully cosmetic. The
+option to turn on and off the title is given to the user, and its off by default. The second option is X Series;
+here you select which series of data you want to plot along the X Axis. The third option is the Y Series; here
+you select which series of data you want to plot along the Y Axis.<br><br>
+
+<img src="images/line.png"> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiBarGraph.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiBarGraph.html
new file mode 100644
index 0000000000..094aa47348
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiBarGraph.html
@@ -0,0 +1,12 @@
+<h2>
+Multi-Bar Graph
+</h2>
+
+The Multi-Bar Graph is useful for illustrating compounding series data against a fixed interval, such as time.<br><br>
+
+Creating a Multi-Bar Graph will prompt the user for four values. The first is the title and is fully cosmetic. The
+option to turn on and off the title is given to the user, and its off by default. The second option is X Series;
+here you select which series of data you want to plot along the X Axis. The third option is the first Y Series; here
+you select one of the series of data you want to plot along the Y Axis. The fourth option is the second Y series;
+here you select the other series of data you want to plot along the Y Axis.<br><br>
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiLineGraph.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiLineGraph.html
new file mode 100644
index 0000000000..41e08f475d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiLineGraph.html
@@ -0,0 +1,13 @@
+<h2>
+Multi-Line Graph
+</h2>
+
+A Multi-Line Graph is useful for contrasting multiple series of data on a fixed interval, such as time.<br><br>
+
+Creating a Multi-Line Graph will prompt the user for four values. The first is the title and is fully cosmetic. The
+option to turn on and off the title is given to the user, and its off by default. The second option is X Series;
+here you select which series of data you want to plot along the X Axis. The third option is the first Y Series; here
+you select one of the series of data you want to plot along the Y Axis. The fourth option is the second Y series;
+here you select the other series of data you want to plot along the Y Axis.<br><br>
+
+<img src="images/multiline.png"> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiScatterGraph.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiScatterGraph.html
new file mode 100644
index 0000000000..8d822076e1
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/multiScatterGraph.html
@@ -0,0 +1,14 @@
+<h2>
+Multi-Scatter Graph
+</h2>
+
+The Multi-Scatter Graph is useful for comparing two sets of series data with multiple Y values on the same
+X value.<br><br>
+
+Creating a Multi-Scatter Graph will prompt the user for four values. The first is the title and is fully cosmetic. The
+option to turn on and off the title is given to the user, and its off by default. The second option is X Series;
+here you select which series of data you want to plot along the X Axis. The third option is the first Y Series; here
+you select one of the series of data you want to plot along the Y Axis. The fourth option is the second Y series;
+here you select the other series of data you want to plot along the Y Axis.<br><br>
+
+<img src="images/multiscatter.png"> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/scatterGraph.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/scatterGraph.html
new file mode 100644
index 0000000000..eee7b8c830
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/graphTypes/scatterGraph.html
@@ -0,0 +1,12 @@
+<h2>
+Scatter Graph
+</h2>
+
+A Scatter Graph uses Cartesian coordinates to show the relation of two or more quantitative variables.<br><br>
+
+Creating a Scatter Graph will prompt the user for three values. The first is the title and is fully cosmetic. The
+option to turn on and off the title is given to the user, and its off by default. The second option is X Series;
+here you select which series of data you want to plot along the X Axis. The third option is the Y Series; here
+you select which series of data you want to plot along the Y Axis.<br><br>
+
+<img src="images/scatter.png"> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphWizard.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphWizard.png
new file mode 100644
index 0000000000..33c3c125f6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphWizard.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphWizard2.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphWizard2.png
new file mode 100644
index 0000000000..068a8d094e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphWizard2.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphingPerspective.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphingPerspective.png
new file mode 100644
index 0000000000..aa931e2611
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphingPerspective.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphingPerspective2.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphingPerspective2.png
new file mode 100644
index 0000000000..769260571d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/GraphingPerspective2.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/filters.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/filters.png
new file mode 100644
index 0000000000..bece7fa052
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/filters.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/graphExpanded.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/graphExpanded.png
new file mode 100644
index 0000000000..870bfe97c5
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/graphExpanded.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/match.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/match.png
new file mode 100644
index 0000000000..fcb5d4e91a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/match.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/match2.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/match2.png
new file mode 100644
index 0000000000..fa636f875f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/match2.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/range.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/range.png
new file mode 100644
index 0000000000..26d0eaaafb
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/range.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/range2.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/range2.png
new file mode 100644
index 0000000000..7bac7f86e5
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/range2.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/scale2.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/scale2.png
new file mode 100644
index 0000000000..03c32ab128
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/scale2.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/sort.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/sort.png
new file mode 100644
index 0000000000..f07e646646
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/sort.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/sort2.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/sort2.png
new file mode 100644
index 0000000000..9f29b1e59d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/sort2.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/unique.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/unique.png
new file mode 100644
index 0000000000..a1fda64c2f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/unique.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/zoom.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/zoom.png
new file mode 100644
index 0000000000..4ff3b64665
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/concepts/images/zoom.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/gettingStarted.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/gettingStarted.html
new file mode 100644
index 0000000000..c6f4d546b0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/gettingStarted.html
@@ -0,0 +1,13 @@
+<a href="../toc.html">Table of Contents</a>
+
+<h2>
+Getting Started
+</h2>
+
+This section of the SystemTap Graphing User Guide covers the essentials of getting started using the Graphing
+Perspective.
+
+<ol>
+<li><a href="introduction.html">Introduction</a></li>
+<li><a href="configurationTutorial.html">Configuration Tutorial</a></li>
+</ol>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/graphingTutorial.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/graphingTutorial.html
new file mode 100644
index 0000000000..01b960c6d8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/graphingTutorial.html
@@ -0,0 +1,78 @@
+<a href="../toc.html">Table of Contents</a> > <a href="gettingStarted.html">Getting Started</a>
+
+<h2>
+Graphing Tutorial
+</h2>
+
+In order to graph SystemTap scripts you must have a script open in the IDE Perspective, and the <b><u>R</u>un->Run
+w/ Chart</b> option must be used. If you are unfamiliar with how to load or write a SystemTap script, please
+review the IDE Tutorial in the SystemTap IDE User's Guide. Please use the following script for this example by
+copying and pasting it into a new file (any name is fine that ends in a .stp extension):<br><br>
+
+<pre>
+global read, write, start
+
+probe begin {
+ start = gettimeofday_s()
+}
+probe syscall.write {
+ write += count
+}
+
+probe syscall.read {
+ read += count
+}
+
+probe timer.ms(1000) {
+ printf("%d\t%d\t%d\n", (gettimeofday_s()-start), read, write)
+ read=0
+ write=0
+}
+</pre>
+
+Now select <b><u>R</u>un->Run w/ <u>C</u>hart</b>. This feature will prompt the user for the number of columns for the chart, in addition to
+their titles and regular expressions. The regular expressions are used to parse the console output for
+the script and determine the values of each column at a certain sample point. The combined regular
+expression is shown at the bottom of the dialogue box. You should see the following:<br><br>
+
+<br><img src="images/chartbox1.png"><br><br></li>
+
+For this example enter the following:<br>
+
+<pre> Columns: 3
+
+ TITLE REGULAR EXPRESSION DELIMITER
+ Time \d+ .* \D+
+ Read \d+ .* \D+
+ Write \d+ .* \D+
+</pre><br>
+
+The title fields simply display the associated string in the column's header. After clicking OK the
+script will prompt you for details regarding the Remote Server. Provide the ip address of the remote server
+that is running the systemtapgui Server or the Data Management Daemon. The port is by default 22462. Enter
+a username and password.This will give the application permissions to run your script on the remote machine.
+You have the option of saving your password as well, however be warned this is currently NOT encrypted so this
+convenience runs at a risk. The username is also used to transfer the file to the remote system using SCP. If the
+same machine is used as both the server and the client enter 'localhost' for the Host field.
+When the script is executed the application will switch into the Graphing perspective. A Data View chart is
+populated with live data, in addition to the output in the console. <br><br>
+You should see a screen similar to the following:<br><br>
+
+<img src="images/graphics.png"><br><br>
+
+You will see that the data table poplulates from live data parsed from the console. Now we'll make a
+graph to briefly illustrate the Graphing perspective. Click the Create Graph button next to bring up the
+Select Chart dialogue.<br><br>
+
+<img src="images/GraphWizard.png"><br><br>
+
+Select line graph. You will be prompted to select a column of the X series and Y
+series; select "Time" and "Write" respectively. After you click ok you should see the line graph as follows:<br><br>
+
+<img src="images/graph.png"><br><br>
+
+Note that the multiple series graphs (Multi-Line, Multi-Bar, and Multi-Scatter) will request two Y series, Y1
+and Y2. In the case of our example, these would be "Read" and "Write". Each series will be assigned a different
+color value for the purposes of differentiation and will be plotted both in respect to the specified X series.<br><br>
+
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/GraphWizard.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/GraphWizard.png
new file mode 100644
index 0000000000..33c3c125f6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/GraphWizard.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/chartbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/chartbox1.png
new file mode 100644
index 0000000000..0008258b2b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/chartbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/graph.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/graph.png
new file mode 100644
index 0000000000..4b1b57f3e0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/graph.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/graphics.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/graphics.png
new file mode 100644
index 0000000000..91034b6395
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/graphics.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/multi.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/multi.png
new file mode 100644
index 0000000000..86cb90e94c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/images/multi.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/introduction.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/introduction.html
new file mode 100644
index 0000000000..93bacc6779
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/gettingstarted/introduction.html
@@ -0,0 +1,26 @@
+<a href="../toc.html">Table of Contents</a> > <a href="gettingStarted.html">Getting Started</a>
+
+<h2>
+Introduction
+</h2>
+
+The Graphing Perspective in the SystemTap GUI is a perspective that is active once a user runs a script with
+the chart option (<b><u>R</u>un->Run w/ <u>C</u>hart</b>). From this point a
+<a href="../concepts/dataTable.html">DataTable</a> is populated with live data as it is parsed from the Console.
+From the information in the DataTable you can generate the following graphs:
+
+<ul>
+<li><a href="../concepts/graphTypes/barGraph.html">Bar Graph</a></li>
+<li><a href="../concepts/graphTypes/multiBarGraph.html">Multi-Bar Graph</a></li>
+<li><a href="../concepts/graphTypes/lineGraph.html">Line Graph</a></li>
+<li><a href="../concepts/graphTypes/multiLineGraph.html">Multi-Line Graph</a></li>
+<li><a href="../concepts/graphTypes/scatterGraph.html">Scatter Graph</a></li>
+<li><a href="../concepts/graphTypes/multiScatterGraph.html">Multi-Scatter Graph</a></li>
+</ul>
+
+These graph types can be used instantiated by using the Graph Wizard once the DataTable is populated.
+The Graphing Perspective can support multiple graphs from one DataTable. Each are updated and can
+be viewed by navigating through the tabs shown at the top of each graph.<br><br>
+
+If you have not already, you will want to review the <a href="graphingTutorial.html">Graphing Tutorial</a> and
+the <a href="configurationTutorial.html">Configuration Tutorial</a>.
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/exampleGraphingScripts.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/exampleGraphingScripts.html
new file mode 100644
index 0000000000..935aec4bcb
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/exampleGraphingScripts.html
@@ -0,0 +1,32 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Example Graphing Scripts
+</h2>
+
+Provided below are a few scripts that you can use with the Graphing Perspective.<br><br>
+
+<b>readwrite.stp</b><br><br>
+
+<i>Counts the reads and writes that occur and provide this information once per second.</i><br><br>
+
+<pre>
+global read, write, startasdfasdf
+
+probe begin {
+ start = gettimeofday_s()
+}
+probe syscall.write {
+ write += count
+}
+
+probe syscall.read {
+ read += count
+}
+
+probe timer.ms(1000) {
+ printf("%d\t%d\t%d\n", (gettimeofday_s()-start), read, write)
+ read=0
+ write=0
+}
+</pre> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/frequentlyAskedQuestions.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/frequentlyAskedQuestions.html
new file mode 100644
index 0000000000..8e50ac675f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/frequentlyAskedQuestions.html
@@ -0,0 +1,37 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Frequently Asked Questions
+</h2>
+
+This section details frequently asked questions relating to the Graphing Perspective.<br><br>
+
+<b>
+Can I make more than one graph at one time? Do they update concurrently?
+</b><br><br>
+
+A: Yes and yes. Start another graph the same way you started the first one, by clicking the Graph Wizard button.
+<br><br><br>
+
+<b>
+Can I increase the rate at which SystemTap GUI update the graph?
+</b><br><br>
+
+A: Yes. By default it is set to once per second, but you can increase this in the <a href="preferences.html">
+Preferences.</a>
+<br><br><br>
+
+<b>
+Is there any way to save or export the graph images?
+</b><br><br>
+
+A: Yes. Use <b><u>F</u>ile->Save <u>G</u>raph Image</b> to save the graph.
+<br><br><br>
+
+<b>
+What if I want to preserve this data for manipulation later?
+</b><br><br>
+
+A: You can do this by using <b><u>F</u>ile-><u>E</u>xport Data Set</b>. This will save your data set for further
+work.
+<br><br><br> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/export.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/export.png
new file mode 100644
index 0000000000..ebfdcb39b2
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/export.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/import.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/import.png
new file mode 100644
index 0000000000..acbb91fd64
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/import.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/openbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/openbox1.png
new file mode 100644
index 0000000000..3155183cf4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/openbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/preferencesbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/preferencesbox1.png
new file mode 100644
index 0000000000..31b0cbc9f1
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/preferencesbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/saveoutput.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/saveoutput.png
new file mode 100644
index 0000000000..1c1d81daab
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/saveoutput.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/viewbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/viewbox1.png
new file mode 100644
index 0000000000..28e5cd8db3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/menu/viewbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/dash.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/dash.png
new file mode 100644
index 0000000000..4e1dc2ee25
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/dash.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/export_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/export_wiz.gif
new file mode 100644
index 0000000000..5a0837d1e4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/export_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/graphing.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/graphing.png
new file mode 100644
index 0000000000..adfa0c2943
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/graphing.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/ide.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/ide.png
new file mode 100644
index 0000000000..43dacebd97
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/ide.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/import_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/import_wiz.gif
new file mode 100644
index 0000000000..d38085ad9c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/import_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/open_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/open_wiz.gif
new file mode 100644
index 0000000000..51e703b1b9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/open_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/save_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/save_wiz.gif
new file mode 100644
index 0000000000..499dd0ca60
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/save_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/stop_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/stop_obj.gif
new file mode 100644
index 0000000000..dc47edf069
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/images/toolbars/stop_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/menus.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/menus.html
new file mode 100644
index 0000000000..f7131ec4c7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/menus.html
@@ -0,0 +1,49 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+IDE Perspective Menus
+</h2>
+
+What follows is a comprehension list of the menu options available within the Systemtap GUI Graphing Perspective.
+
+
+<h3>
+<u>F</u>ile
+</h3>
+<ul>
+<li><b><u>O</u>pen Script Output</b> - This option opens the specified file and reads the contents into the DataTable for use in the Graphing Perspective.<br><img src="images/menu/openbox1.png"><br><br></li>
+<li><b>Save <u>G</u>raph Image</b> - This option saves the graph in the specified file extension format.<br><img src="images/menu/saveoutput.png"><br><br></li>
+<li><b><u>I</u>mport Data Set</b> - This option allows you to load a previously saved set of data obtained from running a SystemTap script. You can proceed from this point as if you had just ran a script and populated the DataTable.<br><img src="images/menu/import.png"><br><br></li>
+<li><b><u>E</u>xport Data Set</b> - This option allows you to save a current data set after you've ran a script in the intention of having someone else look at the user's script results through the tool or for further work done by the user. (Shortcut: Ctrl+X)<br><img src="images/menu/export.png"><br><br></li>
+<li><b><u>P</u>rint</b> - This option prints the graph currently holding the focus. (Shortcut: Crtl+P)</li>
+<li><b>E<u>x</u>it</b> - Exits Systemtap GUI.
+</ul>
+
+<h3>
+<a name="run"><u>R</u>un</a>
+</h3>
+<ul>
+<li><b><u>S</u>top</b> - This option terminates the script thread associated with whichever script currently has the focus. (Shortcut: Ctrl+F9)</li>
+</ul>
+
+<h3>
+<u>W</u>indow
+</h3>
+<ul>
+<li><b>Open in <u>N</u>ew Window</b> - This option opens a new instance of SystemTap GUI.</li>
+<li><b><u>O</u>pen Perspective</b> - This submenu lists each of the available perspectives to open:
+<ul>
+<li>IDE Perspective</li>
+<li>Graphing Perspective</li>
+</ul></li>
+<li><b>Show <u>V</u>iews</b> - This submenus lists each of the available views to open:
+<ul>
+<li>Console</li>
+<li>Error Log</li>
+<li>Functions</li>
+<li>Kernel Source</li>
+<li>Probe Alias</li>
+<li>Other - Lists all views in the application.</li><br><img src="images/menu/viewbox1.png"><br><br>
+</ul></li>
+<li><b><u>P</u>references</b> - Due to the breath of this topic it is covered in another section. Please see <a href="preferences.html">Preferences Help</a>.<br><img src="images/menu/preferencesbox1.png"><br><br></li>
+</ul>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/preferences.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/preferences.html
new file mode 100644
index 0000000000..cb8a709681
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/preferences.html
@@ -0,0 +1,129 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Preferences
+</h2>
+
+This section details each of the options listed under <b><u>W</u>indow-><u>P</u>references</b>. The Preferences dialog is the dialog used to set user preferences. The Preferences dialog pages can be searched using the filter function. To filter by matching the page title, simply type the name of the page you are seeking and the available pages will be presented below. The filter also searches on keywords such as appearance and java.
+
+<ul>
+<li><b>Logging</b>
+<ul>
+<li><b>Enable logging</b> - This option turns on and off the ability to log data from the console.</li>
+<li><b>Logging level</b> - This dropdown box allows you to select one of our levels of logging.
+<ul>
+<li>Debug - A very large quantity of debug information, difficult to identify what you are looking for but extremely exhaustive.</li>
+<li>Info - Displays most information regarding program execution; the default level.</li>
+<li>Critical - Lists only critical errors duration execution.</li>
+<li>Fatal - Lists only fatal errors during execution.</li>
+</ul>
+</li>
+<li><b>Log to</b> - Specifies where you wish the logging to be written:
+<ul>
+<li>Console - Writes the debug information directly to the console.</li>
+<li>File - Write the debug information to a file.</li>
+</ul>
+<li><b>File</b> - The location of the file that logging sends the debug information to.</li>
+</ul>
+<li><b>SystemTap</b> - This section contains options relevent to SystemTap itself.
+<ul>
+<li><b>Remember window state</b> - Preserves the state of the window on exitting SystemTap GUI.
+<li><b>Dashboard Preferences</b> - Preferences relate to the Dashboard Perspective.
+<ul>
+<li>Additional Modules - Provides for the addition of more modules to the Dashboard. Modules are files containing a SystemTap script and associated metadata.</li>
+</ul>
+<li><b>Environment Variables</b> - Allows the user to set specific values to the following environment variables
+<ul>
+<li>LD_LIBRARY_PATH</li>
+<li>PATH</li>
+<li>SYSTEMTAP_TAPSET</li>
+<li>SYSTEMTAP_RUNTIME</li>
+</ul>
+</li>
+<li><b>Graphing</b> - Preferences related to the Graphing Perspective.
+<ul>
+<li><b><u>R</u>efresh Delay (ms)</b> - Milliseconds in between re-painting the graph.</li>
+<li><b>Data Table</b> - Preferences related to the data table.
+<ul>
+<li><u>J</u>ump to the newest entry - Determines whether the scroll bar maintains its location at the newest entry.</li>
+<li><u>A</u>uto resize columns - Determines whether columns automatically resize to the width of the contents or whether they remain placed when moved.</li>
+<li><u>M</u>ax data items - Maximum number of entries that the table shows, though the table itself may have more not visible.</li>
+</ul>
+</li>
+<li><b>Graph</b> - Preferences related to graphs.
+<ul>
+<li><u>S</u>how grid lines - Turns on and off painting of the grid lines.</li>
+<li><u>V</u>iewable data items - Number of maximum samples plotted at any time.</li>
+</ul>
+</ul>
+<li><b>IDE</b> - Preferences when loading the IDE Perspective.
+<ul>
+<li><b>Use stored tapset trees</b> - Loads the stored tapset trees on initialization.</li>
+<li><b>Editor</b> - Preferences related to the editor.
+<ul>
+<li><u>E</u>ditor Background Color - Sets the color painted in the background of the editor pane.</li>
+<li>Show Line <u>N</u>umbers - Option to turn on and off line numbers in the editor pane.
+<li>Code Assist
+<ul>
+<li><u>U</u>se Code Assist - Turns on and off the option to use Code Assist, which is a method that predicts what you are typing based on existing probe aliasi and opens a window that allows you to scroll down and select and/or continue typing for refined results.</li>
+<li>How Code Assist adds code - Method used in Code Assist.
+<ul>
+<li><u>I</u>nsert - Inserts the selected text directly into the cursor point.</li>
+<li><u>O</u>verwrite - Overwrites as you type.</li>
+</ul>
+</li>
+<li>Activation <u>D</u>elay (requires restart) - Delay in milliseconds before the code assist routines attempts to run.
+<li>Activation <u>T</u>rigger - This is the key that actives Code Assist. For SystemTap GUI it is set to the divider between tapset and probe alias.
+</ul>
+</li>
+<li>Syntax Coloring - These options assign color values to identified types within the .stp and .c editors.
+<ul>
+<li>STP editor
+<ul>
+<li><u>D</u>efault Color - Color of normal code.</li>
+<li><u>K</u>eyword Color - Color of keywords.</li>
+<li><u>E</u>mbedded C Color - Color of embedded C code.</li>
+<li><u>E</u>mbedded Color - Color of embedded code.</li>
+<li><u>C</u>omment Color - Color of comments.</li>
+<li><u>T</u>ype Color - Color of items identified as types.</li>
+<li><u>S</u>tring Color - Color of strings.</li>
+</ul>
+</li>
+<li>C editor
+<ul>
+<li><u>D</u>efault Color - Color of normal code.</li>
+<li><u>K</u>eyword Color - Color of keywords.</li>
+<li><u>P</u>reprocessor Color - Color of preprocessor code.</li>
+<li><u>C</u>omment Color - Color of comments.</li>
+<li><u>T</u>ype Color - Color of items identified as types.</li>
+<li><u>S</u>tring Color - Color of strings.</li>
+</ul>
+</li>
+</ul
+</li>
+<li>Typeing - No options available at this time.</li>
+</ul>
+</li>
+<li><b>Path</b>
+<ul>
+<li><u>K</u>ernel Source Directory - Location of the directory that the kernel source code is pulled from.</li>
+<li>Stap - No options available at this time.
+<ul>
+<li>Tapsets - Preferences related to tapsets.
+<ul>
+<li><u>A</u>dditional Tapsets - Allows you to specify additional tapsets scripts to be added in with every script.</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+<li><b>Remote Server</b> - Details regarding the remote machine running the systemtapgui Server
+<ul>
+<li><b>Host Name</b> - IP address of the remote machine</li>
+<li><b>Port</b> - Port used for communication. Default is 22462.</li>
+<li><b>User Name</b> - User name that has sufficient permissions to transfer and run the script on the remote machine. </li>
+<li><b>Password</b> - Password for the above user. </li>
+</ul>
+</ul> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/reference.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/reference.html
new file mode 100644
index 0000000000..4840dbc7d8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/reference.html
@@ -0,0 +1,19 @@
+<a href="../toc.html">Table of Contents</a > <a href="reference.html">Reference</a>
+
+<h2>
+Reference
+</h2>
+
+This section of the Graphing User Guild is intended to provide the following resources should you have any
+very specific questions regarding the Graphing Perspective in general or one of the options associated with
+it. It also contains example scripts and FAQs.
+
+<ol>
+<li><a href="exampleGraphingScripts.html">Example SystemTap Scripts</a></li>
+<li><a href="frequentlyAskedQuestions.html">Frequently Asked Questions</a></li>
+<li><a href="menus.html">Menus</a></li>
+<li><a href="preferences.html">Preferences</a></li>
+<li><a href="toolbars.html">Toolbars</a></li>
+<li><a href="regex.html">Guide to Regular Expressions</a></li>
+</ol>
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/regex.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/regex.html
new file mode 100644
index 0000000000..8643733fde
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/regex.html
@@ -0,0 +1,144 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Regex Reference Page
+</h2>
+
+Regular expressions are used in SystemTap GUI to define how the GUI interprets information that it recieves
+from the script file. If the user wishes to change the regular expression during runtime they may do so by
+selecting <b><u>E</u>dit->Modify <u>P</u>arsing Expression</b>.<br><br>
+
+Basic regex (taken from <a href="http://java.sun.com/j2se/1.5.0/docs/api/">http://java.sun.com/j2se/1.5.0/docs/api/</a> ) -
+
+<pre> Summary of regular-expression constructs
+
+Construct Matches
+
+Characters
+x The character x
+\\ The backslash character
+\0n The character with octal value 0n (0 <= n <= 7)
+\0nn The character with octal value 0nn (0 <= n <= 7)
+\0mnn The character with octal value 0mnn (0 <= m <= 3, 0 <= n <= 7)
+\xhh The character with hexadecimal value 0xhh
+\uhhhh The character with hexadecimal value 0xhhhh
+\t The tab character ('\u0009')
+\n The newline (line feed) character ('\u000A')
+\r The carriage-return character ('\u000D')
+\f The form-feed character ('\u000C')
+\a The alert (bell) character ('\u0007')
+\e The escape character ('\u001B')
+\cx The control character corresponding to x
+
+Character classes
+[abc] a, b, or c (simple class)
+[^abc] Any character except a, b, or c (negation)
+[a-zA-Z] a through z or A through Z, inclusive (range)
+[a-d[m-p]] a through d, or m through p: [a-dm-p] (union)
+[a-z&&[def]] d, e, or f (intersection)
+[a-z&&[^bc]] a through z, except for b and c: [ad-z] (subtraction)
+[a-z&&[^m-p]] a through z, and not m through p: [a-lq-z](subtraction)
+
+Predefined character classes
+. Any character (may or may not match line terminators)
+\d A digit: [0-9]
+\D A non-digit: [^0-9]
+\s A whitespace character: [ \t\n\x0B\f\r]
+\S A non-whitespace character: [^\s]
+\w A word character: [a-zA-Z_0-9]
+\W A non-word character: [^\w]
+
+POSIX character classes (US-ASCII only)
+\p{Lower} A lower-case alphabetic character: [a-z]
+\p{Upper} An upper-case alphabetic character:[A-Z]
+\p{ASCII} All ASCII:[\x00-\x7F]
+\p{Alpha} An alphabetic character:[\p{Lower}\p{Upper}]
+\p{Digit} A decimal digit: [0-9]
+\p{Alnum} An alphanumeric character:[\p{Alpha}\p{Digit}]
+\p{Punct} Punctuation: One of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
+\p{Graph} A visible character: [\p{Alnum}\p{Punct}]
+\p{Print} A printable character: [\p{Graph}\x20]
+\p{Blank} A space or a tab: [ \t]
+\p{Cntrl} A control character: [\x00-\x1F\x7F]
+\p{XDigit} A hexadecimal digit: [0-9a-fA-F]
+\p{Space} A whitespace character: [ \t\n\x0B\f\r]
+
+java.lang.Character classes (simple java character type)
+\p{javaLowerCase} Equivalent to java.lang.Character.isLowerCase()
+\p{javaUpperCase} Equivalent to java.lang.Character.isUpperCase()
+\p{javaWhitespace} Equivalent to java.lang.Character.isWhitespace()
+\p{javaMirrored} Equivalent to java.lang.Character.isMirrored()
+
+Classes for Unicode blocks and categories
+\p{InGreek} A character in the Greek block (simple block)
+\p{Lu} An uppercase letter (simple category)
+\p{Sc} A currency symbol
+\P{InGreek} Any character except one in the Greek block (negation)
+[\p{L}&&[^\p{Lu}]] Any letter except an uppercase letter (subtraction)
+
+Boundary matchers
+^ The beginning of a line
+$ The end of a line
+\b A word boundary
+\B A non-word boundary
+\A The beginning of the input
+\G The end of the previous match
+\Z The end of the input but for the final terminator, if any
+\z The end of the input
+
+Greedy quantifiers
+X? X, once or not at all
+X* X, zero or more times
+X+ X, one or more times
+X{n} X, exactly n times
+X{n,} X, at least n times
+X{n,m} X, at least n but not more than m times
+
+Reluctant quantifiers
+X?? X, once or not at all
+X*? X, zero or more times
+X+? X, one or more times
+X{n}? X, exactly n times
+X{n,}? X, at least n times
+X{n,m}? X, at least n but not more than m times
+
+Possessive quantifiers
+X?+ X, once or not at all
+X*+ X, zero or more times
+X++ X, one or more times
+X{n}+ X, exactly n times
+X{n,}+ X, at least n times
+X{n,m}+ X, at least n but not more than m times
+
+Logical operators
+XY X followed by Y
+X|Y Either X or Y
+(X) X, as a capturing group
+
+Back references
+\n Whatever the nth capturing group matched
+
+Quotation
+\ Nothing, but quotes the following character
+\Q Nothing, but quotes all characters until \E
+\E Nothing, but ends quoting started by \Q
+
+Special constructs (non-capturing)
+(?:X) X, as a non-capturing group
+(?idmsux-idmsux) Nothing, but turns match flags on - off
+(?idmsux-idmsux:X) X, as a non-capturing group with the given flags on - off
+(?=X) X, via zero-width positive lookahead
+(?!X) X, via zero-width negative lookahead
+(?<=X) X, via zero-width positive lookbehind
+(?<!X) X, via zero-width negative lookbehind
+(?>X) X, as an independent, non-capturing group
+Match a position that is not a word boundary.
+</pre>
+
+<br>Information regarding regular expressions can be found all over the Internet. A few examples have been listed
+below:<br><br>
+
+<ul>
+<li><a href="http://www.javascriptkit.com/javatutors/redev.shtml">http://www.javascriptkit.com/javatutors/redev.shtml</a></li>
+<li><a href="http://www.zytrax.com/tech/web/regex.htm">http://www.zytrax.com/tech/web/regex.htm</a></li>
+</ul> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/toolbars.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/toolbars.html
new file mode 100644
index 0000000000..d300e7e139
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/reference/toolbars.html
@@ -0,0 +1,29 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Toolbars
+</h2>
+
+
+SystemTap GUI currently has two toolbars built in; an Action Bar for file and execution operations and a Perspective Selector to jump to different perspectives.
+
+<h3>
+Action Bar
+</h3>
+
+<ul>
+<li><img src="images/toolbars/open_wiz.gif"> <b>Open Script Output</b> - This option opens the specified file and reads the contents into the DataTable for use in the Graphing Perspective.</li>
+<li><img src="images/toolbars/save_wiz.gif"> <b>Save Graph Image</b> - This option saves the graph in the specified file extension format.</li>
+<li><img src="images/toolbars/import_wiz.gif"> <b>Import Data Set</b> - This option allows you to load a previously saved set of data obtained from running a SystemTap script. You can proceed from this point as if you had just ran a script and populated the DataTable.</li>
+<li><img src="images/toolbars/export_wiz.gif"> <b>Export Data Set</b> - This option allows you to save a current data set after you've ran a script in the intention of having someone else look at the user's script results through the tool or for further work done by the user.</li>
+<li><img src="images/toolbars/stop_obj.gif"> <b>Stop Script</b> - This button will stop the currently active script from running.</li>
+</ul>
+
+<h3>
+Perspective Selector
+</h3>
+
+<ul>
+<li><img src="images/toolbars/ide.png"> <b>IDE Perspective</b> - This button brings you into the IDE Perspective, useful for writing and executing scripts.</li>
+<li><img src="images/toolbars/graphing.png"> <b>Graphing Perspective</b> - This button brings you into the Graphing Perspective, useful for graphing scripts.</li>
+</ul>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/importDataSet.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/importDataSet.html
new file mode 100644
index 0000000000..e1c24d9a72
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/importDataSet.html
@@ -0,0 +1,30 @@
+<a href="../toc.html">Table of Contents</a> > <a href="tasks.html">Tasks</a>
+
+<h2>
+Importing/Exporting Data Sets
+</h2>
+
+From time to time the user may want to preserve the script results for continued work at a later date/time or
+to share findings with others. The Importing and Exporting options provide an easy way to do this.
+
+<h3>
+Importing a Data Set
+</h3>
+
+In order to import a Data Set the user must first have one either from running a script or from another
+user. To import the Data Set select <b><u>F</u>ile-><u>I</u>mport Data Set</b>. The user will be prompted with an
+Open File dialogue box. Navigate to the Data Set file you wish to open and select it. Keep in mind Data Set
+files can have any extension type, though the user may want to use .set for consistency.<br><br>
+
+<img src="../reference/images/menu/import.png"><br><br>
+
+<h3>
+Exporting a Data Set
+</h3>
+
+In order to export a Data Set the user must first have a populated DataTable from a previously running script.
+To export the Data Set select <b><u>F</u>ile-><u>E</u>xport Data Set</b>. The user will be prompted with an
+New File dialogue box. Navigate to the location you wish to export the Data Set to and save it. Keep in mind Data Set
+files can have any extension type, though the user may want to use .set for consistency.<br><br>
+
+<img src="../reference/images/menu/export.png"><br><br> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/makingGraphs.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/makingGraphs.html
new file mode 100644
index 0000000000..d1aa0088b7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/makingGraphs.html
@@ -0,0 +1,16 @@
+<a href="../toc.html">Table of Contents</a> > <a href="tasks.html">Tasks</a>
+
+<h2>
+Making Graphs
+</h2>
+
+In order to graph SystemTap scripts you must have a script open in the IDE Perspective, and the <b><u>R</u>un->Run
+w/ Chart</b> option must be used. If you are unfamiliar with how to load or write a SystemTap script, please
+review the IDE Tutorial in the SystemTap IDE User's Guide.<br><br>
+
+A <a href="../gettingstarted/graphingTutorial.html">tutorial</a> has been written to guide the user through the execution
+and charting of a provided script. Any script can be used however that provides consistent data along with a
+regular expression (regex). For instructions on using regex see our
+<a href="../reference/regex.html">Regex Reference Page</a>.<br><br>
+
+<img src="../concepts/graphTypes/images/multiline.png"> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/openScriptOutput.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/openScriptOutput.html
new file mode 100644
index 0000000000..e699a63960
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/openScriptOutput.html
@@ -0,0 +1,12 @@
+<a href="../toc.html">Table of Contents</a> > <a href="tasks.html">Tasks</a>
+
+<h2>
+Opening Script Output
+</h2>
+
+This option allows the user to open a text file containing the output of a SystemTap script, and to parse it
+as it would real time data from a running script. Select <b><u>F</u>ile-><u>O</u>pen Script Output</b>.
+Navigate to the file you wish to open and select it. The DataTable will populate with the data, at which point
+you can graph the results.<br><br>
+
+<img src="../reference/images/menu/openbox1.png">
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/savingGraphImage.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/savingGraphImage.html
new file mode 100644
index 0000000000..73fade531c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/savingGraphImage.html
@@ -0,0 +1,11 @@
+<a href="../toc.html">Table of Contents</a> > <a href="tasks.html">Tasks</a>
+
+<h2>
+Saving Graph Images
+</h2>
+
+The Graphics Perspective provides a unique feature to users that allows them to save their graphs in a
+standard image format. In order to do this use the menu option <b><u>F</u>ile->Save <u>G</u>raph Image</b>.
+This opens a dialogue box where the user can navigate to the location they desire to save the image file.<br><br>
+
+<img src="../reference/images/menu/saveoutput.png"> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/tasks.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/tasks.html
new file mode 100644
index 0000000000..f4adeea8d4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/tasks/tasks.html
@@ -0,0 +1,16 @@
+<a href="../toc.html">Table of Contents</a>
+
+<h2>
+Tasks
+</h2>
+
+This section of the Graphing User Guild is intended to provide help pages for common tasks that the user may
+wish to perform in the Graphics Perspective.
+
+<ol>
+<li><a href="importDataSet.html">Importing/Exporting Data Sets</a></li>
+<li><a href="makingGraphs.html">Making Graphs</a></li>
+<li><a href="openScriptOutput.html">Opening Script Output</a></li>
+<li><a href="savingGraphImage.html">Saving a Graph Image</a></li>
+</ol>
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/toc.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/toc.html
new file mode 100644
index 0000000000..925c8a4823
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/html/toc.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Table of Contents</title>
+</head>
+
+<body>
+<h1>Table of Contents</h1>
+
+Welcome to SystemTap GUI help pages. Here you will find wide selection of help pages covering the Graphics
+Perspective of SystemTap GUI.
+
+<ol>
+
+<li><a href="gettingstarted/gettingStarted.html">Getting Started</a>
+<ol>
+<li><a href="gettingstarted/introduction.html">Introduction</a></li>
+<li><a href="gettingstarted/graphingTutorial.html">Graphing Tutorial</a></li>
+</ol>
+</li>
+
+<li><a href="concepts/concepts.html">Concepts</a></li>
+<ol>
+<li><a href="concepts/dataTable.html">DataTable</a></li>
+<li><a href="concepts/graphTypes.html">Graph Types</a>
+<ul>
+<li><a href="concepts/graphTypes/barGraph.html">Bar Graph</a></li>
+<li><a href="concepts/graphTypes/multiBarGraph.html">Multi-Bar Graph</a></li>
+<li><a href="concepts/graphTypes/lineGraph.html">Line Graph</a></li>
+<li><a href="concepts/graphTypes/multiLineGraph.html">Multi-Line Graph</a></li>
+<li><a href="concepts/graphTypes/scatterGraph.html">Scatter Graph</a></li>
+<li><a href="concepts/graphTypes/multiScatterGraph.html">Multi-Scatter Graph</a></li>
+</ul>
+</li>
+<li><a href="concepts/filters.html">Filters</a></li>
+<li><a href="concepts/graphInteraction.html">Graph Interaction</a></li>
+</ol>
+</li>
+
+<li><a href="tasks/tasks.html">Tasks</a>
+<ol>
+<li><a href="tasks/importDataSet.html">Importing/Exporting Data Sets</a></li>
+<li><a href="tasks/makingGraphs.html">Making Graphs</a></li>
+<li><a href="tasks/openScriptOutput.html">Opening Script Output</a></li>
+<li><a href="tasks/savingGraphImage.html">Saving a Graph Image</a></li>
+</ol>
+</li>
+
+<li><a href="reference/reference.html">Reference</li>
+<ol>
+<li><a href="reference/exampleGraphingScripts.html">Example SystemTap Scripts</a></li>
+<li><a href="reference/frequentlyAskedQuestions.html">Frequently Asked Questions</a></li>
+<li><a href="reference/menus.html">Menus</a></li>
+<li><a href="reference/preferences.html">Preferences</a></li>
+<li><a href="reference/toolbars.html">Toolbars</a></li>
+<li><a href="reference/regex.html">Guide to Regular Expressions</a></li>
+</ol>
+</body>
+</html> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocconcepts.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocconcepts.xml
new file mode 100644
index 0000000000..25abcb96cd
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocconcepts.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Concepts" link_to="toc.xml#concepts">
+ <topic label="DataTable" href="documentation/html/concepts/dataTable.html" />
+ <topic label="Graph Types" href="documentation/html/concepts/graphTypes.html" />
+
+ <topic label="Line Graph" href="documentation/html/concepts/graphTypes/lineGraph.html" />
+ <topic label="Multi-Line Graph" href="documentation/html/concepts/graphTypes/multiLineGraph.html" />
+ <topic label="Bar Graph" href="documentation/html/concepts/graphTypes/barGraph.html" />
+ <topic label="Multi-Bar Graph" href="documentation/html/concepts/graphTypes/multiBarGraph.html" />
+ <topic label="Scatter Graph" href="documentation/html/concepts/graphTypes/scatterGraph.html" />
+ <topic label="Multi-Scatter Graph" href="documentation/html/concepts/graphTypes/multiScatterGraph.html" />
+
+ <topic label="Filters" href="documentation/html/concepts/filters.html" />
+ <topic label="Graph Interaction" href="documentation/html/concepts/graphInteraction.html" />
+</toc>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocgettingstarted.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocgettingstarted.xml
new file mode 100644
index 0000000000..43f8239efb
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocgettingstarted.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Getting Started" link_to="toc.xml#gettingstarted">
+ <topic label="Introduction" href="documentation/html/gettingstarted/introduction.html" />
+ <topic label="Graphing Tutorial" href="documentation/html/gettingstarted/graphingTutorial.html" />
+</toc>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocreference.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocreference.xml
new file mode 100644
index 0000000000..3ab8f2df69
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/tocreference.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Reference" link_to="toc.xml#reference">
+ <topic label="Example Graphing Scripts" href="documentation/html/reference/exampleGraphingScripts.html" />
+ <topic label="Frequently Asked Questions" href="documentation/html/reference/frequentlyAskedQuestions.html" />
+ <topic label="Menus" href="documentation/html/reference/menus.html" />
+ <topic label="Preferences" href="documentation/html/reference/preferences.html" />
+ <topic label="Toolbars" href="documentation/html/reference/toolbars.html" />
+ <topic label="Regex" href="documentation/html/reference/regex.html" />
+</toc>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/toctasks.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/toctasks.xml
new file mode 100644
index 0000000000..e8ce52f2ad
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/documentation/toctasks.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Tasks" link_to="toc.xml#tasks">
+ <topic label="Importing/Exporting Data Sets" href="documentation/html/tasks/importDataSet.html" />
+ <topic label="Making Graphs" href="documentation/html/tasks/makingGraphs.html" />
+ <topic label="Opening Script Output" href="documentation/html/tasks/openScriptOutput.html" />
+ <topic label="Saving Graph Images" href="documentation/html/tasks/savingGraphImage.html" />
+</toc>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/export_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/export_wiz.gif
new file mode 100644
index 0000000000..5a0837d1e4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/export_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/import_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/import_wiz.gif
new file mode 100644
index 0000000000..d38085ad9c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/import_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/new_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/new_wiz.gif
new file mode 100644
index 0000000000..7aea894d0b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/new_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/open_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/open_wiz.gif
new file mode 100644
index 0000000000..51e703b1b9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/open_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/regEx.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/regEx.gif
new file mode 100644
index 0000000000..fc4c9fadd3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/regEx.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/save_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/save_wiz.gif
new file mode 100644
index 0000000000..499dd0ca60
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/actions/save_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiBar.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiBar.gif
new file mode 100644
index 0000000000..b396c353b4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiBar.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiLine.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiLine.gif
new file mode 100644
index 0000000000..2a09ccf943
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiLine.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiScatter.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiScatter.gif
new file mode 100644
index 0000000000..3542e06835
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/MultiScatter.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleBar.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleBar.gif
new file mode 100644
index 0000000000..186a1168a6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleBar.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleLine.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleLine.gif
new file mode 100644
index 0000000000..10616b199b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleLine.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleScatter.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleScatter.gif
new file mode 100644
index 0000000000..1416c03e32
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/graphs/SingleScatter.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/perspective_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/perspective_obj.gif
new file mode 100644
index 0000000000..34fb3c9d8c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/perspective_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/views/selector_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/views/selector_obj.gif
new file mode 100644
index 0000000000..34fb3c9d8c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/icons/views/selector_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.properties
new file mode 100644
index 0000000000..6ef90e8dfb
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.properties
@@ -0,0 +1,31 @@
+perspective.graphing.name=Graphing
+
+view.graphSelector.name=Graph Selector
+
+preference.graphing.name=Graphing
+
+command.open.name=Open Script Output
+command.open.desc=Open script output file
+command.import.name=Import Data Set
+command.import.desc=Import data set from file
+command.export.name=Export Data Set
+command.export.desc=Export data set to file
+command.save.name=Save Graph
+command.save.desc=Save graph as image
+
+category.file.name=File2
+cateogry.file.desc=File2
+
+actionset.graph.name=Graph Display Action Set
+action.open.name=Open Script Output
+action.open.desc=Open script output file
+action.import.name=Import Data Set
+action.import.name=Import data set from file
+action.export.name=Export Data Set
+action.export.desc=Export data set to file
+action.save.name=Save Graph
+action.save.desc=Save graph as image
+
+actionset.parsing.name=Parsing Action Set
+action.modifyParsing.name=Modify Parsing Expression
+action.modifyParsing.desc=Modify Parsing Expression
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.xml
new file mode 100644
index 0000000000..c73341ca65
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/plugin.xml
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ name="%perspective.graphing.name"
+ class="org.eclipse.linuxtools.systemtap.ui.graphing.GraphingPerspective"
+ icon="icons/perspective_obj.gif"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.GraphingPerspective"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ name="%view.graphSelector.name"
+ allowMultiple="false"
+ icon="icons/views/selector_obj.gif"
+ class="org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView">
+ </view>
+ </extension>
+
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="toc.xml"
+ primary="true"/>
+ <toc file="documentation/tocconcepts.xml"/>
+ <toc file="documentation/tocgettingstarted.xml"/>
+ <toc file="documentation/tocreference.xml"/>
+ <toc file="documentation/toctasks.xml"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="%preference.graphing.name"
+ id="com.qualityeclipse.systemtap.prefs.graphing"
+ class="org.eclipse.linuxtools.systemtap.ui.graphing.preferences.GraphingPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.view"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.linuxtools.systemtap.ui.graphing.preferences.PreferenceInitializer"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ name="%command.open.name"
+ description="%command.open.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.graphing.category.file"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.commands.OpenScriptOutput"/>
+ <command
+ name="%command.export.name"
+ description="%command.export.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.graphing.category.file"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.commands.ExportDataSet"/>
+ <command
+ name="%command.save.name"
+ description="%command.save.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.graphing.category.file"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.commands.SaveGraphImage"/>
+ <command
+ name="%command.import.name"
+ description="%command.import.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.graphing.category.file"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.commands.ImportDataSet"/>
+
+ <category
+ name="%category.file.name"
+ description="%category.file.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.category.file"/>
+ <command
+ name="%command.modifyParsing.name"
+ description="%command.modifyParsing.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.graphing.category.edit"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.commands.ModifyParsing"/>
+
+ <category
+ name="%category.edit.name"
+ description="%category.edit.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.category.edit"/>
+ </extension>
+
+
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ label="actionset.graph.name"
+ visible="false"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.GraphingActionSet">
+ <action
+ label="%action.save.name"
+ tooltip="%action.save.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.actions.SaveGraphImage"
+ icon="icons/actions/save_wiz.gif"
+ toolbarPath="org.eclipse.ui.workbench.file/save.ext"
+ class="org.eclipse.linuxtools.systemtap.ui.graphing.actions.SaveGraphImageAction"
+ definitionId="org.eclipse.linuxtools.systemtap.ui.graphing.commands.SaveGraphImage"
+ style="push"
+ state="false"/>
+ <action
+ label="%action.export.name"
+ tooltip="%action.export.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.actions.ExportDataSet"
+ icon="icons/actions/export_wiz.gif"
+ toolbarPath="org.eclipse.ui.workbench.file/export.ext"
+ class="org.eclipse.linuxtools.systemtap.ui.graphing.actions.ExportDataSetAction"
+ definitionId="org.eclipse.linuxtools.systemtap.ui.graphing.commands.ExportDataSet"
+ style="push"
+ state="false"/>
+ <action
+ label="%action.import.name"
+ tooltip="%action.import.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.actions.ImportDataSet"
+ icon="icons/actions/import_wiz.gif"
+ toolbarPath="org.eclipse.ui.workbench.file/import.ext"
+ class="org.eclipse.linuxtools.systemtap.ui.graphing.actions.ImportDataSetAction"
+ definitionId="org.eclipse.linuxtools.systemtap.ui.graphing.commands.ImportDataSet"
+ style="push"
+ state="false"/>
+ <action
+ label="%action.open.name"
+ tooltip="%action.open.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.actions.OpenScriptOutput"
+ icon="icons/actions/open_wiz.gif"
+ toolbarPath="org.eclipse.ui.workbench.file/new.ext"
+ class="org.eclipse.linuxtools.systemtap.ui.graphing.actions.OpenScriptOutputAction"
+ definitionId="org.eclipse.linuxtools.systemtap.ui.graphing.commands.OpenScriptOutput"
+ style="push"
+ state="false"/>
+ </actionSet>
+ <actionSet
+ label="%actionset.modifyParsing.name"
+ visible="false"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.ParsingActionSet">
+ <action
+ label="%action.modifyParsing.name"
+ tooltip="%action.modifyParsing.name"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.actions.ModifyParsingAction"
+ icon="icons/actions/regEx.gif"
+ toolbarPath="org.eclipse.ui.workbench.file/build.ext"
+ menubarPath="edit/edit.ext"
+ class="org.eclipse.linuxtools.systemtap.ui.graphing.actions.ModifyParsingAction"
+ definitionId="org.eclipse.linuxtools.systemtap.ui.graphing.commands.ModifyParsing"
+ style="push"
+ state="false"/>
+ </actionSet>
+
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.linuxtools.systemtap.ui.graphing.GraphingPerspective">
+ <actionSet id="org.eclipse.linuxtools.systemtap.ui.graphing.GraphingActionSet"/>
+ <actionSet id="org.eclipse.linuxtools.systemtap.ui.graphing.ParsingActionSet"/>
+ </perspectiveExtension>
+ <perspectiveExtension
+ targetID="org.eclipse.linuxtools.systemtap.ui.graphing.GraphingPerspective">
+
+ <view
+ ratio="0.60f"
+ relative="org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView"
+ relationship="top"
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView"/>
+ <viewShortcut id="org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView"/>
+
+ </perspectiveExtension>
+ </extension>
+</plugin>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/GraphingConstants.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/GraphingConstants.java
new file mode 100644
index 0000000000..0fb671b35c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/GraphingConstants.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing;
+
+import java.io.File;
+
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.SystemTapGUISettings;
+
+
+
+public final class GraphingConstants {
+ private static final String dataSetFileName = "/GraphSettings.xml";
+ public static final File DataSetMetaData = new File(SystemTapGUISettings.settingsFolder.getAbsolutePath() + dataSetFileName);
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/GraphingPerspective.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/GraphingPerspective.java
new file mode 100644
index 0000000000..f4faa4bbc8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/GraphingPerspective.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing;
+
+import org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+
+
+/**
+ * The <code>GraphingPerspective</code> class defines the layout of the Graphing perspective
+ * in the application.
+ * @see org.eclipse.ui.IPerspectiveFactory
+ * @author Ryan Morse
+ */
+public class GraphingPerspective implements IPerspectiveFactory {
+ public static String ID = "org.eclipse.linuxtools.systemtap.ui.graphing.GraphingPerspective";
+
+ public void createInitialLayout(IPageLayout layout) {
+ LogManager.logDebug("Start createInitialLayout: layout-" + layout, this);
+ LogManager.logInfo("Initializing", this);
+ String editorArea = layout.getEditorArea();
+ layout.setEditorAreaVisible(false);
+
+ layout.addStandaloneView(GraphSelectorView.ID, false, IPageLayout.TOP, .75f, editorArea);
+
+ layout.getViewLayout(GraphSelectorView.ID).setCloseable(false);
+
+ //Add all perspectives to the MainMenu. Window->Show View
+ layout.addShowViewShortcut(GraphSelectorView.ID);
+
+ //Add a link to the perspective in the MainMenu. Window->Open Perspective
+ layout.addPerspectiveShortcut(ID);
+
+ LogManager.logDebug("End createInitialLayout:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ExportDataSetAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ExportDataSetAction.java
new file mode 100644
index 0000000000..f7ce968532
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ExportDataSetAction.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.actions;
+
+import java.io.File;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphing.structures.GraphDisplaySet;
+import org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.ITabListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+
+
+
+/**
+ * This action handles exporting all of the data that was collected for the DataSet. It
+ * exports everything as a table, that can easily be read back in at a later time.
+ * @author Ryan Morse
+ */
+public class ExportDataSetAction extends Action implements IWorkbenchWindowActionDelegate {
+ public void init(IWorkbenchWindow window) {
+ LogManager.logDebug("Start ExportDataSetAction.init", this);
+ LogManager.logInfo("Initialize ExportDataSetAction", this);
+ fWindow = window;
+ LogManager.logDebug("End ExportDataSetAction.init", this);
+ }
+
+ /**
+ * This is the main method of the action. It handles getting the active dataset,
+ * and then saving it to a file that can be accessed later.
+ * @param act The action that fired this method.
+ */
+ public void run(IAction act) {
+ LogManager.logDebug("Start ExportDataSetAction.run", this);
+ File f = null;
+ IDataSet data = getDataSet();
+
+ if(null != data)
+ f = getFile();
+
+ if(f != null && data != null)
+ data.writeToFile(f);
+ LogManager.logDebug("End ExportDataSetAction.run", this);
+ }
+
+ /**
+ * This method retreives the active <code>DataSet</code> from the <code>GraphSelectorView</code>. If no
+ * DataSet is active it will return null.
+ * @return The IDataSet in tha active display set.
+ */
+ public IDataSet getDataSet() {
+ LogManager.logDebug("Start ExportDataSetAction.getDataSet", this);
+ IViewPart ivp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(GraphSelectorView.ID);
+ IDataSet data = null;
+ GraphDisplaySet gds = ((GraphSelectorView)ivp).getActiveDisplaySet();
+ if(null != gds)
+ data = gds.getDataSet();
+ LogManager.logDebug("End ExportDataSetAction.getDataSet", this);
+ return data;
+ }
+
+ /**
+ * This method will display a dialog box for the user to select a
+ * location to save the graph image.
+ * @return The File selected to save the image to.
+ */
+ public File getFile() {
+ LogManager.logDebug("Start ExportDataSetAction.getFile", this);
+ String path = null;
+ FileDialog dialog= new FileDialog(fWindow.getShell(), SWT.SAVE);
+ dialog.setText(Localization.getString("ExportDataSetAction.NewFile"));
+
+ path = dialog.open();
+
+ if(null == path)
+ return null;
+
+ LogManager.logDebug("End ExportDataSetAction.getFile", this);
+ return new File(path);
+ }
+
+ public void selectionChanged(IAction a, ISelection s) {
+ action = a;
+ setEnablement(false);
+ buildEnablementChecks();
+ }
+
+ /**
+ * This method is used to generate the checks to see it this button
+ * should be enabled or not.
+ */
+ private void buildEnablementChecks() {
+ IViewPart ivp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(GraphSelectorView.ID);
+ if(null != ivp) {
+ final GraphSelectorView gsv = (GraphSelectorView)ivp;
+ setEnablement(null != gsv.getActiveDisplaySet());
+ gsv.addTabListener(new ITabListener() {
+ public void tabClosed() {
+ setEnablement(null != gsv.getActiveDisplaySet());
+ }
+
+ public void tabOpened() {
+ setEnablement(true);
+ }
+
+ public void tabChanged() {}
+ });
+ }
+ }
+
+ private void setEnablement(boolean enable) {
+ action.setEnabled(enable);
+ }
+
+ /**
+ * Removes all internal references in this class. Nothing should make any references
+ * to anyting in this class after calling the dispose method.
+ */
+ public void dispose() {
+ LogManager.logDebug("Start ExportDataSetAction.dispose", this);
+ LogManager.logInfo("Dispose ExportDataSetAction", this);
+ fWindow = null;
+ action = null;
+ LogManager.logDebug("End ExportDataSetAction.dispose", this);
+ }
+
+ private IWorkbenchWindow fWindow;
+ private IAction action;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ImportDataSetAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ImportDataSetAction.java
new file mode 100644
index 0000000000..b181a13349
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ImportDataSetAction.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.actions;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.linuxtools.systemtap.ui.graphing.GraphingPerspective;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset.DataSetFactory;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.IViewPart;
+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;
+
+
+
+/**
+ * This action is designed to open up an exported <code>DataSet</code> from the graphing.
+ * It allows users to bring up data from previous runs of stap so they can
+ * see old data. Importing DataSets is no different then a script live and getting data.
+ * @author Ryan Morse
+ */
+public class ImportDataSetAction extends Action implements IWorkbenchWindowActionDelegate {
+ public void init(IWorkbenchWindow window) {
+ LogManager.logDebug("Start ImportDataSetAction.init", this);
+ LogManager.logDebug("Initializing", this);
+ fWindow = window;
+ LogManager.logDebug("End ImportDataSetAction.init", this);
+ }
+
+ /**
+ * This is the main method of the action. It handles prompting the user
+ * for a file that contans an exported DataSet. Then, it will generate
+ * a new <code>DataSet</code> to hold all of the data.
+ * @param act The action that fired this method.
+ */
+ public void run(IAction act) {
+ LogManager.logDebug("Start ImportDataSetAction.run", this);
+ //Get the file
+ FileDialog dialog= new FileDialog(fWindow.getShell(), SWT.OPEN);
+ dialog.setText(Localization.getString("ImportDataSetAction.OpenDataSetFile"));
+ String fileName = dialog.open();
+
+ File f = null;
+
+ if(null == fileName || fileName.length() <= 0)
+ return;
+
+ f = new File(fileName);
+
+ if(!f.exists() || !f.canRead())
+ return;
+
+ //Create a new DataSet
+ IDataSet dataSet = readFile(f);
+
+ if(null == dataSet) {
+ displayError(Localization.getString("ImportDataSetAction.ErrorReadingDataSet"));
+ return;
+ }
+
+ //Create a new script set
+ try {
+ IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(GraphingPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ IViewPart ivp = p.findView(GraphSelectorView.ID);
+ ((GraphSelectorView)ivp).createScriptSet(fileName, dataSet);
+ } catch(WorkbenchException we) {
+ LogManager.logCritical("WorkbenchException ImportDataSetAction.run:" + we.getMessage(), this);
+ }
+ LogManager.logDebug("End ImportDataSetAction.run", this);
+ }
+
+ public void selectionChanged(IAction a, ISelection s) {}
+
+ /**
+ * Read the contents of the file into a new DataSet
+ * @param f The file that was selected to read a DataSet from
+ * @return The newly created DataSet containing the data from the file.
+ */
+ private IDataSet readFile(File f) {
+ LogManager.logDebug("Start ImportDataSetAction.readFile", this);
+ IDataSet data;
+
+ readHeader(f);
+ if(null == labels || null == id)
+ return null;
+
+ data = DataSetFactory.createFilteredDataSet(id, labels);
+ data.readFromFile(f);
+
+ LogManager.logDebug("End ImportDataSetAction.readFile", this);
+ return data;
+ }
+
+ /**
+ * This method will read out the labels and DataSet type from the file
+ * @param f The file that was selected for reading.
+ * @return An array of all of the labels found in the file
+ */
+ private void readHeader(File f) {
+ LogManager.logDebug("Start ImportDataSetAction.readLabels", this);
+
+ try {
+ FileReader fr = new FileReader(f);
+ BufferedReader br = new BufferedReader(fr);
+
+ id = br.readLine();
+
+ String line = br.readLine();
+ labels = line.split(", ");
+ } catch(FileNotFoundException fnfe) {
+ LogManager.logCritical("FileNotFoundException ImportDataSetAction.readLabels:" + fnfe.getMessage(), this);
+ } catch(IOException ioe) {
+ LogManager.logCritical("IOException ImportDataSetAction.readLabels:" + ioe.getMessage(), this);
+ }
+
+ LogManager.logDebug("End ImportDataSetAction.readLabels", this);
+ }
+
+ private void displayError(String message) {
+ LogManager.logInfo("Initializing", MessageDialog.class);
+ MessageDialog.openWarning(fWindow.getShell(), Localization.getString("ImportDataSetAction.Problem"), message);
+ LogManager.logInfo("Disposing", MessageDialog.class);
+ }
+
+ public void dispose() {
+ LogManager.logDebug("Start ImportDataSetAction.dispose", this);
+ LogManager.logInfo("Disposing", this);
+ fWindow = null;
+ LogManager.logDebug("End ImportDataSetAction.dispose", this);
+ }
+
+ private IWorkbenchWindow fWindow;
+ private String id;
+ private String[] labels;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ModifyParsingAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ModifyParsingAction.java
new file mode 100644
index 0000000000..2c246742dc
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/ModifyParsingAction.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.actions;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.actions.ConsoleAction;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
+import org.eclipse.linuxtools.systemtap.ui.editor.PathEditorInput;
+import org.eclipse.linuxtools.systemtap.ui.graphing.GraphingConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphing.GraphingPerspective;
+import org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView;
+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.structures.ChartStreamDaemon;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.ChartStreamDaemon2;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset.DataSetWizard;
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.LoggedCommand;
+import org.eclipse.ui.IEditorPart;
+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;
+
+
+
+
+/**
+ * The action to allow users to change the parsing expression while a script is activly running.
+ * @author Ryan Morse
+ */
+public class ModifyParsingAction extends ConsoleAction implements IWorkbenchWindowActionDelegate {
+ /**
+ * Prompts the user for a new regular expression to use in parsing the stap output for
+ * the <code>DataSet</code>. If the user enters a new parsing expression then it will
+ * get the active <code>ScriptConsole</code> and from that the active <code>LoggedCommand</code>.
+ * Finally, it will dispose of the old <code>ChartStreamDaemon2</code> and add an new
+ * one in its place.
+ */
+ public void run() {
+ DataSetWizard wizard = new DataSetWizard(GraphingConstants.DataSetMetaData, getFilePath());
+ 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();
+
+ if(null != parser && null != dataSet) {
+ ScriptConsole console = super.getActive();
+ LoggedCommand cmd = console.getCommand();
+
+ ArrayList<?> listeners = cmd.getInputStreamListeners();
+ ChartStreamDaemon2 daemon = null;
+ if(null != listeners) {
+ for(int i=0; i<listeners.size(); i++) {
+ if(listeners.get(i) instanceof ChartStreamDaemon) {
+ daemon = (ChartStreamDaemon2)listeners.get(i);
+ break;
+ }
+ }
+ }
+ if(null == daemon) {
+ daemon = new ChartStreamDaemon2(console, dataSet, parser);
+ cmd.addInputStreamListener(daemon);
+ } else
+ daemon.setParser(dataSet, parser);
+
+ IViewPart ivp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(GraphSelectorView.ID);
+ GraphSelectorView graphSelector = ((GraphSelectorView)ivp);
+ String name = console.getName();
+ graphSelector.createScriptSet(name.substring(name.lastIndexOf('/')+1), dataSet);
+ }
+
+ wizard.dispose();
+ }
+
+ /**
+ * Gets the file location of the file open in the editor window.
+ * @return The path of the file in the active editor window.
+ */
+ private String getFilePath() {
+ try {
+ IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective("org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective", PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ IEditorPart ed = p.getActiveEditor();
+ PlatformUI.getWorkbench().showPerspective(GraphingPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ return ((PathEditorInput)ed.getEditorInput()).getPath().toString();
+ } catch(WorkbenchException we) {}
+ return null;
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/OpenScriptOutputAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/OpenScriptOutputAction.java
new file mode 100644
index 0000000000..d011363901
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/OpenScriptOutputAction.java
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.actions;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.linuxtools.systemtap.ui.graphing.GraphingConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphing.GraphingPerspective;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+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.ui.wizards.dataset.DataSetWizard;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+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;
+
+
+
+/**
+ * This action is designed to open up the raw script output from a stap command.
+ * It will act just like the user is running a script with graphing, but will
+ * not cause update events.
+ * @author Ryan Morse
+ */
+public class OpenScriptOutputAction extends Action implements IWorkbenchWindowActionDelegate {
+ public void init(IWorkbenchWindow window) {
+ LogManager.logDebug("Start OpenScriptOutputAction.init", this);
+ LogManager.logDebug("Initializing", this);
+ fWindow = window;
+ LogManager.logDebug("End OpenScriptOutputAction.init", this);
+ }
+
+ /**
+ * This is the main method of the action. It handles prompting the user
+ * for a file that they want to graph. Then prompts the user to select a
+ * parsing expression to use to break the table into tabular output. Finally,
+ * it will generate a new <code>DataSet</code> to hold all of the data.
+ * @param act The action that fired this method.
+ */
+ public void run(IAction act) {
+ LogManager.logDebug("Start OpenScriptOutputAction.run", this);
+
+ File f = queryFile();
+
+ if(null == f) {
+ } else if(!f.exists()) {
+ displayError(Localization.getString("OpenScriptOutputAction.SelectedFileDNE"));
+ } else if(!f.canRead()) {
+ displayError(Localization.getString("OpenScriptOutputAction.SelectedFileCanNotRead"));
+ } else {
+ //Get the file from the user
+ StringBuilder sb = new StringBuilder();
+ readFile(f, sb);
+ if(getChartingOptions(f.getAbsolutePath())) {
+ IDataEntry output;
+ while(true) {
+ output = parser.parse(sb);
+ if(null != output)
+ dataSet.setData(output);
+ else
+ break;
+ }
+
+ try {
+ IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(GraphingPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ IViewPart ivp = p.findView(GraphSelectorView.ID);
+ ((GraphSelectorView)ivp).createScriptSet(f.getName(), dataSet);
+ } catch(WorkbenchException we) {
+ LogManager.logCritical("WorkbenchException OpenScriptOutputAction.run:" + we.getMessage(), this);
+ }
+ }
+ }
+
+ LogManager.logDebug("End OpenScriptOutputAction.run", this);
+ }
+
+
+ /**
+ * This method will display a dialog box for the user to select a
+ * location to open a file from.
+ * @return The File selected to open.
+ */
+ private File queryFile() {
+ LogManager.logDebug("Start queryFile:", this);
+ FileDialog dialog= new FileDialog(fWindow.getShell(), SWT.OPEN);
+ dialog.setText(Localization.getString("OpenScriptOutputAction.OpenFile"));
+ String path= dialog.open();
+ if (path != null && path.length() > 0) {
+ LogManager.logDebug("queryFile: returnVal-" + path, this);
+ return new File(path);
+ }
+ LogManager.logDebug("queryFile: returnVal-null", this);
+ return null;
+ }
+
+ /**
+ * This method will display the error message to the user in the case
+ * that something went wrong.
+ * @param message The message that should be shown in the error dialog.
+ */
+ private void displayError(String message) {
+ LogManager.logDebug("Start OpenScriptOutputAction.displayError", this);
+ LogManager.logInfo("Initializing", MessageDialog.class);
+ MessageDialog.openWarning(fWindow.getShell(), Localization.getString("OpenScriptOutputAction.Problem"), message);
+ LogManager.logInfo("Disposing", MessageDialog.class);
+ LogManager.logDebug("End OpenScriptOutputAction.displayError", this);
+ }
+
+ /**
+ * This method will read the contents of the provided file and
+ * add the contents to the provided StringBuilder.
+ * @param f The file that will be opened for reading
+ * @param sb The StringBuilder to store the contents of the file
+ */
+ private void readFile(File f, StringBuilder sb) {
+ LogManager.logDebug("Start ImportDataSetAction.readData", this);
+ try {
+ FileReader fr = new FileReader(f);
+ BufferedReader br = new BufferedReader(fr);
+
+ String line;
+ while(null != (line=br.readLine())) {
+ sb.append(line);
+ }
+ } catch(FileNotFoundException fnfe) {
+ fnfe.printStackTrace();
+ LogManager.logCritical("FileNotFoundException ImportDataSetAction.readData:" + fnfe.getMessage(), this);
+ } catch(IOException ioe) {
+ ioe.printStackTrace();
+ LogManager.logCritical("IOException ImportDataSetAction.readData:" + ioe.getMessage(), this);
+ }
+ LogManager.logDebug("End ImportDataSetAction.readData", this);
+ }
+
+ /**
+ * This method will get all of the parsing information from the user.
+ * @param filePath The location of the file to be opened.
+ * @return boolean representing whether or not it was successful
+ */
+ protected boolean getChartingOptions(String filePath) {
+ DataSetWizard wizard = new DataSetWizard(GraphingConstants.DataSetMetaData, filePath);
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ wizard.init(workbench, null);
+ WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard);
+ dialog.create();
+ dialog.open();
+
+ parser = wizard.getParser();
+ dataSet = wizard.getDataSet();
+
+ wizard.dispose();
+ return(null != parser && null != dataSet);
+ }
+
+ public void selectionChanged(IAction a, ISelection s) {
+ }
+
+ /**
+ * Removes all internal references in this class. Nothing should make any references
+ * to anyting in this class after calling the dispose method.
+ */
+ public void dispose() {
+ LogManager.logDebug("Start OpenScriptOutputAction.dispose", this);
+ LogManager.logInfo("Disposing", this);
+ fWindow = null;
+ parser = null;
+ LogManager.logDebug("End OpenScriptOutputAction.dispose", this);
+ }
+
+ private IWorkbenchWindow fWindow;
+ private IDataSet dataSet;
+ private IDataSetParser parser;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/SaveGraphImageAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/SaveGraphImageAction.java
new file mode 100644
index 0000000000..1d88bce6cc
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/actions/SaveGraphImageAction.java
@@ -0,0 +1,234 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.actions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphing.structures.GraphDisplaySet;
+import org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.IGraph;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphCanvas;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.ITabListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+
+
+
+/**
+ * This action is designed to allow for saving of the graph in the active window.
+ * It will let the user select the location to save the image, and then save it as
+ * a jpg image.
+ * @author Ryan Morse
+ */
+public class SaveGraphImageAction extends Action implements IWorkbenchWindowActionDelegate {
+ public void init(IWorkbenchWindow window) {
+ fWindow = window;
+ }
+
+ /**
+ * This is the main method of the action. It handles getting the active graph,
+ * prompting the user for a location to save the image to, and then actually doing
+ * the save.
+ * @param act The action that fired this method.
+ */
+ public void run(IAction act) {
+ LogManager.logDebug("Start run", this);
+ IGraph g = getGraph();
+ try {
+ PlatformUI.getWorkbench().getDisplay().update();
+ } catch(SWTException swte) {
+ LogManager.logCritical("SWTException SaveGraphImageAction.run:" + swte.getMessage(), this);
+ }
+ if(null == g) {
+ displayError(Localization.getString("SaveGraphImageAction.CanNotGetGraph"));
+ return;
+ }
+
+ ImageData image = getImage(g);
+ if(null == image) {
+ displayError(Localization.getString("SaveGraphImageAction.CanNotCreateImage"));
+ return;
+ }
+
+ String path = getFile();
+ if(null == path)
+ return;
+
+ save(image, path);
+ LogManager.logDebug("End run", this);
+ }
+
+ /**
+ * This method retreives the active graph from the GraphSelectorView. If no
+ * graph is active it will return null.
+ * @return The IGraph in tha active display set.
+ */
+ public IGraph getGraph() {
+ LogManager.logDebug("Start getGraph", this);
+ IViewPart ivp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(GraphSelectorView.ID);
+ IGraph g = null;
+
+ GraphDisplaySet gds = ((GraphSelectorView)ivp).getActiveDisplaySet();
+ if(null != gds)
+ g = gds.getActiveGraph();
+ LogManager.logDebug("End getGraph", this);
+ return g;
+ }
+
+ /**
+ * This method converts the Graph into an actual image.
+ * @param g The graph that needs to be converted to an image
+ * @return The Image that was generated by the supplied Graph.
+ */
+ public ImageData getImage(IGraph g) {
+ LogManager.logDebug("Start getImage", this);
+ GraphCanvas canvas = (GraphCanvas)g;
+ GC gc = new GC(canvas);
+ Image image = new Image(canvas.getDisplay(), canvas.getSize().x, canvas.getSize().y);
+ gc.copyArea(image, 0, 0);
+ gc.dispose();
+
+ ImageData data = image.getImageData();
+ image.dispose();
+ LogManager.logDebug("End getImage", this);
+ return data;
+ }
+
+ /**
+ * This method will display a dialog box for the user to select a
+ * location to save the graph image.
+ * @return The String location selected to save the image to.
+ */
+ public String getFile() {
+ LogManager.logDebug("Start getFile", this); //$NON-NLS-1$
+ FileDialog dialog= new FileDialog(fWindow.getShell(), SWT.SAVE);
+ dialog.setText(Localization.getString("SaveGraphImageAction.NewFile"));
+
+ LogManager.logInfo("Init FileDialog", dialog);
+ LogManager.logDebug("End getFile", this);
+ return dialog.open();
+ }
+
+ /**
+ * This method will perform the save operation to store the generated
+ * image as an image file on the computer
+ * @param image The image data generated from the graph
+ * @param path The location to create the new file in and save to.
+ */
+ public void save(ImageData image, String path) {
+ LogManager.logDebug("Start save", this);
+
+ ImageLoader loader = new ImageLoader();
+ loader.data = new ImageData[] {image};
+ loader.save(path, SWT.IMAGE_JPEG);
+
+ LogManager.logDebug("End save", this);
+ }
+
+ /**
+ * This method will display the error message to the user in the case
+ * that something went wrong.
+ * @param message The message that should be shown in the error dialog.
+ */
+ private void displayError(String message) {
+ LogManager.logInfo("Initializing", MessageDialog.class);
+ MessageDialog.openWarning(fWindow.getShell(), Localization.getString("SaveGraphImageAction.Problem"), message);
+ LogManager.logInfo("Disposing", MessageDialog.class);
+ }
+
+ /**
+ * This method is used to generate the checks to see it this button
+ * should be enabled or not.
+ */
+ public void selectionChanged(IAction a, ISelection s) {
+ action = a;
+ setEnablement(false);
+ buildEnablementChecks();
+ }
+
+ /**
+ * This method is used to generate the checks to see it this button
+ * should be enabled or not.
+ */
+ private void buildEnablementChecks() {
+ IViewPart ivp = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(GraphSelectorView.ID);
+ if(null != ivp) {
+ final GraphSelectorView gsv = (GraphSelectorView)ivp;
+ gsv.addTabListener(new ITabListener() {
+ public void tabClosed() {
+ if(null == gsv.getActiveDisplaySet() || null == gsv.getActiveDisplaySet().getActiveGraph())
+ setEnablement(false);
+ }
+
+ public void tabOpened() {
+ gsv.getActiveDisplaySet().addTabListener(new ITabListener() {
+ public void tabClosed() {
+ if(null == gsv.getActiveDisplaySet().getActiveGraph())
+ setEnablement(false);
+ }
+
+ public void tabOpened() {
+ if(null != gsv.getActiveDisplaySet().getActiveGraph())
+ setEnablement(true);
+ }
+
+ public void tabChanged() {
+ if(null == gsv.getActiveDisplaySet() || null == gsv.getActiveDisplaySet().getActiveGraph())
+ setEnablement(false);
+ else
+ setEnablement(true);
+ }
+ });
+ }
+
+ public void tabChanged() {
+ if(null == gsv.getActiveDisplaySet() || null == gsv.getActiveDisplaySet().getActiveGraph())
+ setEnablement(false);
+ else
+ setEnablement(true);
+ }
+ });
+ }
+ }
+
+ private void setEnablement(boolean enable) {
+ action.setEnabled(enable);
+ }
+
+ /**
+ * Removes all internal references in this class. Nothing should make any references
+ * to anyting in this class after calling the dispose method.
+ */
+ public void dispose() {
+ LogManager.logInfo("Start dispose", this);
+ LogManager.logInfo("Disposing", MessageDialog.class);
+ fWindow = null;
+ action = null;
+ LogManager.logDebug("End dispose", this);
+ }
+
+ private IWorkbenchWindow fWindow;
+ private IAction action;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/GraphingPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/GraphingPlugin.java
new file mode 100644
index 0000000000..4cc210b09e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/GraphingPlugin.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.internal;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class GraphingPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static GraphingPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public GraphingPlugin() {
+ 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 GraphingPlugin 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.graphing", path);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/Localization.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/Localization.java
new file mode 100644
index 0000000000..7525e5f791
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/Localization.java
@@ -0,0 +1,22 @@
+package org.eclipse.linuxtools.systemtap.ui.graphing.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Localization {
+ private static final String BUNDLE_NAME = "org.eclipse.linuxtools.systemtap.ui.graphing.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.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/localization.properties
new file mode 100644
index 0000000000..75ee813387
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/internal/localization.properties
@@ -0,0 +1,20 @@
+ExportDataSetAction.NewFile=New File
+
+ImportDataSetAction.OpenDataSetFile=Open DataSet File
+ImportDataSetAction.ErrorReadingDataSet=Error reading the selected dataset.
+ImportDataSetAction.Problem=Problem
+
+OpenScriptOutputAction.SelectedFileDNE=Selected file does not exist\!
+OpenScriptOutputAction.SelectedFileCanNotRead=Selected file can not be read\!
+OpenScriptOutputAction.OpenFile=Open File
+OpenScriptOutputAction.Problem=Problem
+
+SaveGraphImageAction.CanNotGetGraph=Can't get active graph.
+SaveGraphImageAction.CanNotCreateImage=Can't create image
+SaveGraphImageAction.NewFile=New File
+SaveGraphImageAction.Problem=Problem
+
+GraphingPreferencePage.GraphDisplayPreferences=Basic preferences for graph display.
+GraphingPreferencePage.RefreshDelay=&Refresh delay (ms):
+
+GraphDisplaySet.DataView=Data View
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/DataTablePreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/DataTablePreferencePage.java
new file mode 100644
index 0000000000..eb90cf2ac4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/DataTablePreferencePage.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.GraphingPlugin;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences.GraphingAPIPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+
+public class DataTablePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public DataTablePreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start DataTablePreferencePage:", this);
+ //setPreferenceStore(GraphingAPIUIPlugin.getDefault().getPreferenceStore());
+ setPreferenceStore(GraphingPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("DataTablePreferencePage.GraphDisplayPreferences"));
+ LogManager.logDebug("End DataTablePreferencePage:", this);
+ }
+
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+
+ addField(new BooleanFieldEditor(
+ GraphingAPIPreferenceConstants.P_JUMP_NEW_TABLE_ENTRY,
+ Localization.getString("DataTablePreferencePage.JumpNewestEntry"),
+ getFieldEditorParent()));
+
+ addField(new BooleanFieldEditor(
+ GraphingAPIPreferenceConstants.P_AUTO_RESIZE,
+ Localization.getString("DataTablePreferencePage.AutoResizeColumns"),
+ getFieldEditorParent()));
+
+ addField(
+ new IntegerFieldEditor(
+ GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS,
+ Localization.getString("DataTablePreferencePage.MaxDataItems"),
+ getFieldEditorParent()));
+
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logDebug("Start init:", this);
+ LogManager.logInfo("Initializing", this);
+ LogManager.logDebug("End init:", this);
+ }
+
+ public void dispose() {
+ LogManager.logDebug("Start dispose:", this);
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ LogManager.logDebug("End dispose:", this);
+ }
+}
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphPreferencePage.java
new file mode 100644
index 0000000000..ce88e48916
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphPreferencePage.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.GraphingPlugin;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences.GraphingAPIPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+
+public class GraphPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public GraphPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start GraphPreferencePage:", this);
+ setPreferenceStore(GraphingPlugin.getDefault().getPreferenceStore());
+ //setPreferenceStore(GraphingAPIUIPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("GraphPreferencePage.GraphDisplayPreferences"));
+ LogManager.logDebug("End GraphPreferencePage:", this);
+ }
+
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+
+ addField(new BooleanFieldEditor(
+ GraphingAPIPreferenceConstants.P_SHOW_GRID_LINES,
+ Localization.getString("GraphPreferencePage.ShowGridLines"),
+ getFieldEditorParent()));
+
+ addField(
+ new IntegerFieldEditor(
+ GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS,
+ Localization.getString("GraphPreferencePage.MaxDataItems"),
+ getFieldEditorParent()));
+
+ addField(
+ new IntegerFieldEditor(
+ GraphingAPIPreferenceConstants.P_VIEWABLE_DATA_ITEMS,
+ Localization.getString("GraphPreferencePage.ViewableDataItems"),
+ getFieldEditorParent()));
+
+ addField(
+ new IntegerFieldEditor(
+ GraphingAPIPreferenceConstants.P_X_SERIES_TICKS,
+ Localization.getString("GraphPreferencePage.XSeriesTicks"),
+ getFieldEditorParent()));
+
+ addField(
+ new IntegerFieldEditor(
+ GraphingAPIPreferenceConstants.P_Y_SERIES_TICKS,
+ Localization.getString("GraphPreferencePage.YSeriesTicks"),
+ getFieldEditorParent()));
+
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logDebug("Start init:", this);
+ LogManager.logInfo("Initializing", this);
+ LogManager.logDebug("End init:", this);
+ }
+
+ public void dispose() {
+ LogManager.logDebug("Start dispose:", this);
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ LogManager.logDebug("End dispose:", this);
+ }
+}
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphingPreferenceConstants.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphingPreferenceConstants.java
new file mode 100644
index 0000000000..208328151f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphingPreferenceConstants.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.preferences;
+
+public class GraphingPreferenceConstants {
+
+ //graphing
+ public static final String P_GRAPH_UPDATE_DELAY = "GraphUpdateDelay";
+
+
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphingPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphingPreferencePage.java
new file mode 100644
index 0000000000..8e526657a2
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/GraphingPreferencePage.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.preferences;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.GraphingPlugin;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+
+public class GraphingPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public GraphingPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start GraphingPreferencePage:", this);
+ setPreferenceStore(GraphingPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("GraphingPreferencePage.GraphDisplayPreferences"));
+ LogManager.logDebug("End GraphingPreferencePage:", this);
+ }
+
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+
+ addField(
+ new IntegerFieldEditor(
+ GraphingPreferenceConstants.P_GRAPH_UPDATE_DELAY,
+ Localization.getString("GraphingPreferencePage.RefreshDelay"),
+ getFieldEditorParent()));
+
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logDebug("Start init:", this);
+ LogManager.logInfo("Initializing", this);
+ LogManager.logDebug("End init:", this);
+ }
+
+ public void dispose() {
+ LogManager.logDebug("Start dispose:", this);
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ LogManager.logDebug("End dispose:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/PreferenceInitializer.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/PreferenceInitializer.java
new file mode 100644
index 0000000000..c49d777230
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/preferences/PreferenceInitializer.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.GraphingPlugin;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+
+
+
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+ public void initializeDefaultPreferences() {
+ LogManager.logDebug("Start initializeDefaultPreferences:", this);
+ IPreferenceStore store = GraphingPlugin.getDefault().getPreferenceStore();
+
+ //graphing
+ store.setDefault(GraphingPreferenceConstants.P_GRAPH_UPDATE_DELAY, 1000);
+
+/* These are set in graphingapi.ui. They shouldn't be reset here
+
+ IPreferenceStore store2 = GraphingAPIUIPlugin.getDefault().getPreferenceStore();
+ //graphing.graph
+ store2.setDefault(GraphingAPIPreferenceConstants.P_SHOW_GRID_LINES, true);
+ store2.setDefault(GraphingAPIPreferenceConstants.P_VIEWABLE_DATA_ITEMS, 100);
+
+ //graphing.datatable
+ store2.setDefault(GraphingAPIPreferenceConstants.P_AUTO_RESIZE, true);
+ store2.setDefault(GraphingAPIPreferenceConstants.P_JUMP_NEW_TABLE_ENTRY, false);
+ store2.setDefault(GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS, 250);
+*/
+ LogManager.logDebug("End initializeDefaultPreferences:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/structures/GraphDisplaySet.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/structures/GraphDisplaySet.java
new file mode 100644
index 0000000000..2ad625742e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/structures/GraphDisplaySet.java
@@ -0,0 +1,272 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.structures;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.GraphingPlugin;
+import org.eclipse.linuxtools.systemtap.ui.graphing.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphing.preferences.GraphingPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.GraphData;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.datadisplay.DataGrid;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.IGraph;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphComposite;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset.DataSetFactory;
+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.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.UpdateManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.ITabListener;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IUpdateListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabFolder2Listener;
+import org.eclipse.swt.custom.CTabFolderEvent;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+
+
+
+/**
+ * This class is used to contain all of the graphing components that can
+ * be displayed as individual tabs in a single location.
+ * @author Ryan Morse
+ */
+public class GraphDisplaySet {
+ public GraphDisplaySet(Composite parent, IDataSet data) {
+ LogManager.logDebug("Start GraphSelectorView:", this);
+ LogManager.logInfo("Initializing", this);
+ IPreferenceStore p = GraphingPlugin.getDefault().getPreferenceStore();
+ int delay = p.getInt(GraphingPreferenceConstants.P_GRAPH_UPDATE_DELAY);
+
+ dataSet = data;
+ // if(null != cmd) {
+ updater = new UpdateManager(delay);
+ updater.addUpdateListener(new IUpdateListener() {
+ public void handleUpdateEvent() {
+ // if(!cmd.isRunning())
+ // updater.stop();
+ }
+ });
+ // }
+ createPartControl(parent);
+
+ graphs = new ArrayList<IGraph>();
+ tabListeners = new ArrayList<ITabListener>();
+ LogManager.logDebug("End GraphSelectorView:", this);
+ }
+
+ /**
+ * This method creates the framework for what will be displayed by this dialog box.
+ * @param parent The composite that will contain all the elements from this dialog
+ */
+ public void createPartControl(Composite parent) {
+ LogManager.logDebug("Start createPartControl: parent-" + parent, this);
+
+ parent.setLayout(new FormLayout());
+ FormData data1 = new FormData();
+ Composite cmpCoolBar = new Composite(parent, SWT.NONE);
+ data1.left = new FormAttachment(0, 0);
+ data1.top = new FormAttachment(0, 0);
+ data1.right = new FormAttachment(100, 0);
+ data1.bottom = new FormAttachment(0, 10);
+ cmpCoolBar.setLayoutData(data1);
+
+ FormData data2 = new FormData();
+ data2.left = new FormAttachment(0, 0);
+ data2.top = new FormAttachment(cmpCoolBar);
+ data2.right = new FormAttachment(100, 0);
+ data2.bottom = new FormAttachment(100, 0);
+ Composite cmpGraph = new Composite(parent, SWT.NONE);
+ cmpGraph.setLayoutData(data2);
+
+ //This is for the tab view
+ cmpGraph.setLayout(new FormLayout());
+
+ folder = new CTabFolder(cmpGraph, SWT.NONE);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.bottom = new FormAttachment(100, 0);
+ folder.setLayoutData(data);
+
+ listener = new ButtonClickListener();
+ folder.addSelectionListener(listener);
+
+ folder.addCTabFolder2Listener(new CTabFolder2Listener() {
+ public void restore(CTabFolderEvent e) {}
+ public void showList(CTabFolderEvent e) {}
+ public void minimize(CTabFolderEvent e) {}
+ public void maximize(CTabFolderEvent e) {}
+ public void close(CTabFolderEvent e) {
+ int selected = folder.indexOf((CTabItem)e.item)-2;
+ if(null != updater)
+ updater.removeUpdateListener((IGraph)graphs.get(selected));
+ graphs.remove(selected);
+ fireTabCloseEvent();
+ }
+ });
+
+ //This is a tab/button for opening new graphs
+ CTabItem newGraph = new CTabItem(folder, SWT.NONE);
+ newGraph.setImage(GraphingPlugin.getImageDescriptor("icons/actions/new_wiz.gif").createImage());
+
+ //Tab containing the data table
+ CTabItem item = new CTabItem(folder, SWT.NONE);
+ item.setText(Localization.getString("GraphDisplaySet.DataView"));
+ Composite c = new Composite(folder, SWT.NONE);
+ GridLayout grid = new GridLayout();
+ grid.marginHeight = 0;
+ grid.marginWidth = 0;
+ c.setLayout(grid);
+
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ DataGrid table = DataSetFactory.getDataGrid(c, dataSet);
+ if(null != updater)
+ updater.addUpdateListener(table);
+ table.getControl().setLayoutData(gd);
+ item.setControl(c);
+ folder.setSelection(item);
+ lastSelectedTab = 1;
+
+ LogManager.logDebug("End createPartControl", this);
+ }
+
+ public IDataSet getDataSet() {
+ return dataSet;
+ }
+
+ /**
+ * Finds the graph that is open in the current tab
+ * @return The graph that is currently visible on the screen
+ */
+ public IGraph getActiveGraph() {
+ if(0 == graphs.size() || folder.getSelectionIndex() < 2)
+ return null;
+ return (IGraph)graphs.get(folder.getSelectionIndex()-2);
+ }
+
+ public void setFocus() {}
+
+ /**
+ * Removes all internal references in this class. Nothing should make any references
+ * to anyting in this class after calling the dispose method.
+ */
+ public void dispose() {
+ LogManager.logDebug("Start dispose:", this);
+ LogManager.logInfo("Disposing", this);
+
+ if(null != updater)
+ updater.dispose();
+ updater = null;
+
+ dataSet = null;
+ if(null != folder) {
+ folder.removeSelectionListener(listener);
+ folder.dispose();
+ folder = null;
+ }
+ listener = null;
+
+ LogManager.logDebug("End dispose:", this);
+ }
+
+ /**
+ * This class handles switching between tabs and creating new graphs.
+ * When the user selects the first tab a new dialog is displayed for
+ * them to slect what they want to display for the new graph.
+ */
+ public class ButtonClickListener implements SelectionListener {
+ public void widgetDefaultSelected(SelectionEvent event) {}
+ public void widgetSelected(SelectionEvent event) {
+ CTabFolder folder = (CTabFolder)event.getSource();
+
+ if(folder.getSelectionIndex() == 0) {
+ folder.setSelection(lastSelectedTab);
+ SelectGraphWizard wizard = new SelectGraphWizard(dataSet);
+ 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) {
+ CTabItem item = new CTabItem(folder, SWT.CLOSE);
+ item.setText(GraphFactory.getGraphName(gd.graphID));
+ GraphComposite gc = new GraphComposite(folder, SWT.FILL, gd, dataSet);
+ gc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ folder.setSelection(item);
+
+ IGraph g = gc.getGraph();
+ item.setControl(gc);
+
+ if(null != g) {
+ if(null != updater)
+ updater.addUpdateListener(g);
+ graphs.add(g);
+ }
+ }
+ wizard.dispose();
+ fireTabOpenEvent();
+ }
+ lastSelectedTab = folder.getSelectionIndex();
+ fireTabChangedEvent();
+ }
+ }
+
+ public void addTabListener(ITabListener listener) {
+ tabListeners.add(listener);
+ }
+
+ public void removeTabListener(ITabListener listener) {
+ tabListeners.remove(listener);
+ }
+
+ private void fireTabCloseEvent() {
+ for(int i=0; i<tabListeners.size(); i++)
+ ((ITabListener)tabListeners.get(i)).tabClosed();
+ }
+
+ private void fireTabOpenEvent() {
+ for(int i=0; i<tabListeners.size(); i++)
+ ((ITabListener)tabListeners.get(i)).tabOpened();
+ }
+
+ private void fireTabChangedEvent() {
+ for(int i=0; i<tabListeners.size(); i++)
+ ((ITabListener)tabListeners.get(i)).tabChanged();
+ }
+
+ private int lastSelectedTab;
+ private IDataSet dataSet;
+ private CTabFolder folder;
+ private ButtonClickListener listener;
+ private UpdateManager updater;
+ private ArrayList<ITabListener> tabListeners;
+
+ private ArrayList<IGraph> graphs;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/views/GraphSelectorView.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/views/GraphSelectorView.java
new file mode 100644
index 0000000000..9acb449480
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/src/org/eclipse/linuxtools/systemtap/ui/graphing/views/GraphSelectorView.java
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphing.views;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphing.structures.GraphDisplaySet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.ITabListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabFolder2Listener;
+import org.eclipse.swt.custom.CTabFolderEvent;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.part.ViewPart;
+
+
+
+/**
+ * This class is designed to hold a number of different running script sets.
+ * Each running script is given its own tab that contains all the details for
+ * that specific script. Script sets can be created or disposed of at the will
+ * of the user.
+ * @author Ryan Morse
+ */
+public class GraphSelectorView extends ViewPart {
+ public GraphSelectorView() {
+ super();
+ LogManager.logDebug("Start GraphSelectorView:", this);
+ LogManager.logInfo("Initializing", this);
+ displaySets = new ArrayList<GraphDisplaySet>();
+ tabListeners = new ArrayList<ITabListener>();
+ LogManager.logDebug("End GraphSelectorView:", this);
+ }
+
+ /**
+ * This method will create a new script set for the provided dataSet
+ * The new script set will be given a new tab item at the end of
+ * the list.
+ * @param title The name to be shown on the new tab
+ * @param dataSet The <code>IDataSet</code> for the new script set
+ * @param cmd The running command that this script set represents.
+ */
+ public void createScriptSet(String title, IDataSet dataSet) {
+ CTabItem item;
+
+ item = new CTabItem(scriptFolder, SWT.CLOSE);
+ item.setText(title);
+ Composite parent = new Composite(scriptFolder, SWT.NONE);
+ parent.setBackground(new Color(parent.getDisplay(), 0, 0, 255));
+ GraphDisplaySet gds = new GraphDisplaySet(parent, dataSet);
+ displaySets.add(gds);
+ item.setControl(parent);
+
+ scriptFolder.setSelection(item);
+ fireTabOpenEvent();
+ }
+
+ /**
+ * This method creates the framework for what will be displayed by this dialog box.
+ * @param parent The composite that will contain all the elements from this dialog
+ */
+ public void createPartControl(Composite parent) {
+ LogManager.logDebug("Start createPartControl: parent-" + parent, this);
+
+ FormData data2 = new FormData();
+ data2.left = new FormAttachment(0, 0);
+ data2.top = new FormAttachment(0, 0);
+ data2.right = new FormAttachment(100, 0);
+ data2.bottom = new FormAttachment(100, 0);
+ Composite cmpGraph = new Composite(parent, SWT.NONE);
+ cmpGraph.setLayoutData(data2);
+
+ //This is for the tab view
+ cmpGraph.setLayout(new FormLayout());
+
+ //Create the folder for all of the script sets, so it takes up all of the parent composite
+ scriptFolder = new CTabFolder(cmpGraph, SWT.NONE);
+ FormData data = new FormData();
+ data.top = new FormAttachment(0, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(100, 0);
+ data.bottom = new FormAttachment(100, 0);
+ scriptFolder.setLayoutData(data);
+ scriptFolder.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ fireTabChangedEvent();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ });
+
+
+ scriptFolder.addCTabFolder2Listener(new CTabFolder2Listener() {
+ public void restore(CTabFolderEvent e) {}
+ public void showList(CTabFolderEvent e) {}
+ public void minimize(CTabFolderEvent e) {}
+ public void maximize(CTabFolderEvent e) {}
+ public void close(CTabFolderEvent e) {
+ displaySets.remove(scriptFolder.indexOf((CTabItem)e.item));
+ fireTabCloseEvent();
+ }
+ });
+
+ LogManager.logDebug("End createPartControl", this);
+ }
+
+ /**
+ * Finds and returns the active component inside of the active script set
+ * @return The <code>GraphDisplaySet</code> that is currently active
+ */
+ public GraphDisplaySet getActiveDisplaySet() {
+ int index = scriptFolder.getSelectionIndex();
+ if(index >= 0 && index < displaySets.size())
+ return (GraphDisplaySet)displaySets.get(index);
+ else
+ return null;
+ }
+
+ public void setFocus() {}
+
+ public void addTabListener(ITabListener listener) {
+ tabListeners.add(listener);
+ }
+
+ public void removeTabListener(ITabListener listener) {
+ tabListeners.remove(listener);
+ }
+
+ private void fireTabCloseEvent() {
+ for(int i=0; i<tabListeners.size(); i++)
+ ((ITabListener)tabListeners.get(i)).tabClosed();
+ }
+
+ private void fireTabOpenEvent() {
+ for(int i=0; i<tabListeners.size(); i++)
+ ((ITabListener)tabListeners.get(i)).tabOpened();
+ }
+
+ private void fireTabChangedEvent() {
+ for(int i=0; i<tabListeners.size(); i++)
+ ((ITabListener)tabListeners.get(i)).tabChanged();
+ }
+
+ /**
+ * Removes all internal references in this class. Nothing should make any references
+ * to anyting in this class after calling the dispose method.
+ */
+ public void dispose() {
+ LogManager.logDebug("Start dispose:", this);
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+
+ if(null != scriptFolder)
+ scriptFolder.dispose();
+ scriptFolder = null;
+ if(null != tabListeners)
+ tabListeners.removeAll(tabListeners);
+ tabListeners = null;
+ LogManager.logDebug("End dispose:", this);
+ }
+
+ private CTabFolder scriptFolder;
+ private ArrayList<GraphDisplaySet> displaySets;
+ private ArrayList<ITabListener> tabListeners;
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView";
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/toc.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/toc.xml
new file mode 100644
index 0000000000..6d1ee401f4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphing/toc.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Systemtap Graphing User Guide" topic="documentation/html/toc.html">
+ <topic label="Getting Started" href="documentation/html/gettingstarted/gettingStarted.html">
+ <anchor id="gettingstarted"/>
+ </topic>
+ <topic label="Concepts" href="documentation/html/concepts/concepts.html">
+ <anchor id="concepts"/>
+ </topic>
+ <topic label="Tasks" href="documentation/html/tasks/tasks.html">
+ <anchor id="tasks"/>
+ </topic>
+ <topic label="Reference" href="documentation/html/reference/reference.html">
+ <anchor id="reference"/>
+ </topic>
+</toc>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/.classpath
new file mode 100644
index 0000000000..c035463db3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/.project
new file mode 100644
index 0000000000..42646c7e08
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/ChangeLog
new file mode 100644
index 0000000000..7329545877
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/ChangeLog
@@ -0,0 +1,7 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse. \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..da4ed2c05c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests;singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-Vendor: Eclipse
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.GraphingAPINonUIPlugin
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.linuxtools.systemtap.ui.structures
+Bundle-ActivationPolicy: lazy
+Import-Package: junit.framework,
+ org.eclipse.linuxtools.systemtap.ui.consolelog.structures
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/build.properties
new file mode 100644
index 0000000000..34d2e4d2da
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/AllTests.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/AllTests.java
new file mode 100644
index 0000000000..e6a62f22a6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/AllTests.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.adapters.BlockAdapterTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.adapters.ScrollAdapterTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.aggregates.AverageAggregateTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.aggregates.CountAggregateTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.aggregates.MaxAggregateTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.aggregates.MinAggregateTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.aggregates.SumAggregateTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.row.FilteredRowDataSetTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.row.RowDataSetTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.row.RowEntryTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.row.RowParserTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.table.FilteredTableDataSetTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.table.TableDataSetTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.table.TableEntryTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.table.TableParserTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.filters.MatchFilterTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.filters.RangeFilterTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.filters.SortFilterTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.filters.UniqueFilterTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures.ChartStreamDaemonTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures.ChartStreamDaemonTest2;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures.DataPointTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures.GraphDataTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures.NumberTypeTest;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures.UpdateManagerTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests");
+
+ //Adapters
+ suite.addTestSuite(BlockAdapterTest.class);
+ suite.addTestSuite(ScrollAdapterTest.class);
+
+ //Aggregates
+ suite.addTestSuite(AverageAggregateTest.class);
+ suite.addTestSuite(CountAggregateTest.class);
+ suite.addTestSuite(MaxAggregateTest.class);
+ suite.addTestSuite(MinAggregateTest.class);
+ suite.addTestSuite(SumAggregateTest.class);
+
+ //DataSets
+
+ //DataSets.Row
+ suite.addTestSuite(FilteredRowDataSetTest.class);
+ suite.addTestSuite(RowDataSetTest.class);
+ suite.addTestSuite(RowEntryTest.class);
+ suite.addTestSuite(RowParserTest.class);
+
+ //DataSets.Table
+ suite.addTestSuite(FilteredTableDataSetTest.class);
+ suite.addTestSuite(TableDataSetTest.class);
+ suite.addTestSuite(TableEntryTest.class);
+ suite.addTestSuite(TableParserTest.class);
+
+ //Filters
+ suite.addTestSuite(MatchFilterTest.class);
+ suite.addTestSuite(RangeFilterTest.class);
+ suite.addTestSuite(SortFilterTest.class);
+ suite.addTestSuite(UniqueFilterTest.class);
+
+ //Structures
+ suite.addTestSuite(ChartStreamDaemonTest.class);
+ suite.addTestSuite(ChartStreamDaemonTest2.class);
+ suite.addTestSuite(DataPointTest.class);
+ suite.addTestSuite(GraphDataTest.class);
+ suite.addTestSuite(NumberTypeTest.class);
+ suite.addTestSuite(UpdateManagerTest.class);
+
+ return suite;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/MockDataSet.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/MockDataSet.java
new file mode 100644
index 0000000000..9ed699d2f6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/MockDataSet.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowEntry;
+
+
+public final class MockDataSet {
+ public static RowDataSet buildDataSet(int rows, int cols) {
+ String[] titles = new String[cols];
+ int i;
+ for(i=0; i<cols; i++)
+ titles[i] = ""+ i;
+
+ RowDataSet data = new RowDataSet(titles);
+ RowEntry entry;
+
+ int j;
+ for(i=0; i<rows; i++) {
+ Object[] d = new Object[cols];
+ for(j=0; j< cols; j++)
+ d[j] = new Double(i*cols + j);
+ entry = new RowEntry();
+ entry.putRow(0, d);
+ data.append(entry);
+ }
+ return data;
+ }
+
+ public static ArrayList[] buildArray(int width, int height, int wrap) {
+ ArrayList[] list = new ArrayList[width];
+
+ for(int i=0; i<width; i++) {
+ list[i] = new ArrayList();
+ for(int j=0; j<height; j++) {
+ list[i].add("" + ((j+i) % wrap));
+ }
+ }
+ return list;
+ }
+
+ public static Integer[] buildIntegerArray(int[] arr) {
+ Integer[] ints = new Integer[arr.length];
+ for(int i=0; i<arr.length; i++)
+ ints[i] = new Integer(arr[i]);
+ return ints;
+ }
+
+ public static Double[] buildDoubleArray(double[] arr) {
+ Double[] doubles = new Double[arr.length];
+ for(int i=0; i<arr.length; i++)
+ doubles[i] = new Double(arr[i]);
+ return doubles;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/adapters/BlockAdapterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/adapters/BlockAdapterTest.java
new file mode 100644
index 0000000000..5579279e49
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/adapters/BlockAdapterTest.java
@@ -0,0 +1,20 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.adapters;
+
+import junit.framework.TestCase;
+
+public class BlockAdapterTest extends TestCase {
+ public BlockAdapterTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testIsValid() {
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/adapters/ScrollAdapterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/adapters/ScrollAdapterTest.java
new file mode 100644
index 0000000000..39d4e9fa40
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/adapters/ScrollAdapterTest.java
@@ -0,0 +1,20 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.adapters;
+
+import junit.framework.TestCase;
+
+public class ScrollAdapterTest extends TestCase {
+ public ScrollAdapterTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testIsValid() {
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/AverageAggregateTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/AverageAggregateTest.java
new file mode 100644
index 0000000000..14fb182203
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/AverageAggregateTest.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.aggregates;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.AverageAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.MockDataSet;
+
+import junit.framework.TestCase;
+
+public class AverageAggregateTest extends TestCase {
+ public AverageAggregateTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testAggregate() {
+ AverageAggregate aa = new AverageAggregate();
+ Number num;
+
+ num = aa.aggregate(null);
+ assertNull(num);
+
+ num = aa.aggregate(new Number[] {});
+ assertNull(num);
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,0}));
+ assertEquals(0, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {-1,0,1}));
+ assertEquals(0, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,1}));
+ assertEquals(0, num.intValue());
+
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,0}));
+ assertEquals(0.0, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {-1,0,1}));
+ assertEquals(0.0, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,1}));
+ assertEquals(1.0/3.0, num.doubleValue(), 0.0);
+ }
+
+ public void testGetID() {
+ AverageAggregate aa = new AverageAggregate();
+ assertTrue(AverageAggregate.ID.equals(aa.getID()));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/CountAggregateTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/CountAggregateTest.java
new file mode 100644
index 0000000000..051ffc4c68
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/CountAggregateTest.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.aggregates;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.CountAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.MockDataSet;
+
+import junit.framework.TestCase;
+
+public class CountAggregateTest extends TestCase {
+ public CountAggregateTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testAggregate() {
+ CountAggregate aa = new CountAggregate();
+ Number num;
+
+ num = aa.aggregate(null);
+ assertNull(num);
+
+ num = aa.aggregate(new Number[] {});
+ assertNull(num);
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,0}));
+ assertEquals(3, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {-1,0}));
+ assertEquals(2, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,1,2,3}));
+ assertEquals(5, num.intValue());
+
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,0}));
+ assertEquals(3, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {-1,1}));
+ assertEquals(2, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,1,4,5}));
+ assertEquals(5, num.doubleValue(), 0.0);
+ }
+
+ public void testGetID() {
+ CountAggregate aa = new CountAggregate();
+ assertTrue(CountAggregate.ID.equals(aa.getID()));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/MaxAggregateTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/MaxAggregateTest.java
new file mode 100644
index 0000000000..e3be6c8f82
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/MaxAggregateTest.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.aggregates;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.MaxAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.MockDataSet;
+
+import junit.framework.TestCase;
+
+public class MaxAggregateTest extends TestCase {
+ public MaxAggregateTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testAggregate() {
+ MaxAggregate aa = new MaxAggregate();
+ Number num;
+
+ num = aa.aggregate(null);
+ assertNull(num);
+
+ num = aa.aggregate(new Number[] {});
+ assertNull(num);
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,0}));
+ assertEquals(0, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {-1,0,1}));
+ assertEquals(1, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,1}));
+ assertEquals(1, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,0}));
+ assertEquals(0.0, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {-1,0,1}));
+ assertEquals(1.0, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,1,2}));
+ assertEquals(2.0, num.doubleValue(), 0.0);
+ }
+
+ public void testGetID() {
+ MaxAggregate aa = new MaxAggregate();
+ assertTrue(MaxAggregate.ID.equals(aa.getID()));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/MinAggregateTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/MinAggregateTest.java
new file mode 100644
index 0000000000..43386877cf
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/MinAggregateTest.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.aggregates;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.MinAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.MockDataSet;
+
+import junit.framework.TestCase;
+
+public class MinAggregateTest extends TestCase {
+ public MinAggregateTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testAggregate() {
+ MinAggregate aa = new MinAggregate();
+ Number num;
+
+ num = aa.aggregate(null);
+ assertNull(num);
+
+ num = aa.aggregate(new Number[] {});
+ assertNull(num);
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,0}));
+ assertEquals(0, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {-1,0,1}));
+ assertEquals(-1, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,1}));
+ assertEquals(0, num.intValue());
+
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,0}));
+ assertEquals(0.0, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {-1,0,1}));
+ assertEquals(-1.0, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,1}));
+ assertEquals(0.0, num.doubleValue(), 0.0);
+ }
+
+ public void testGetID() {
+ MinAggregate aa = new MinAggregate();
+ assertTrue(MinAggregate.ID.equals(aa.getID()));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/SumAggregateTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/SumAggregateTest.java
new file mode 100644
index 0000000000..6678fde62f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/aggregates/SumAggregateTest.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.aggregates;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.SumAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.MockDataSet;
+
+import junit.framework.TestCase;
+
+public class SumAggregateTest extends TestCase {
+ public SumAggregateTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testAggregate() {
+ SumAggregate aa = new SumAggregate();
+ Number num;
+
+ num = aa.aggregate(null);
+ assertNull(num);
+
+ num = aa.aggregate(new Number[] {});
+ assertNull(num);
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,0}));
+ assertEquals(0, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {-1,0,1}));
+ assertEquals(0, num.intValue());
+
+ num = aa.aggregate(MockDataSet.buildIntegerArray(new int[] {0,0,1}));
+ assertEquals(1, num.intValue());
+
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,0}));
+ assertEquals(0.0, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {-1,0,1}));
+ assertEquals(0.0, num.doubleValue(), 0.0);
+
+ num = aa.aggregate(MockDataSet.buildDoubleArray(new double[] {0,0,1,2}));
+ assertEquals(3.0, num.doubleValue(), 0.0);
+ }
+
+ public void testGetID() {
+ SumAggregate aa = new SumAggregate();
+ assertTrue(SumAggregate.ID.equals(aa.getID()));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/FilteredRowDataSetTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/FilteredRowDataSetTest.java
new file mode 100644
index 0000000000..0caf8b57ee
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/FilteredRowDataSetTest.java
@@ -0,0 +1,271 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.row;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.FilteredRowDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.IDataSetFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.RangeFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.SortFilter;
+
+import junit.framework.TestCase;
+
+public class FilteredRowDataSetTest extends TestCase {
+ public FilteredRowDataSetTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ data = new RowDataSet(new String[] {"a", "b", "c"});
+ fdata = new FilteredRowDataSet(data);
+ new FilteredRowDataSet(data.getTitles());
+
+ entry0 = new RowEntry();
+ entry0.putRow(0, new String[] {"1", "2", "3"});
+ data.setData(entry0);
+ RowEntry entry = new RowEntry();
+ entry.putRow(0, new String[] {"4", "5", "6"});
+ data.setData(entry);
+ }
+
+ //Overwrite methods to insure data is removed from the original DataSet
+ public void testAppend() {
+ assertEquals(2, data.getEntryCount());
+ RowEntry entry = new RowEntry();
+ entry.putRow(0, new String[] {"1", "2", "3"});
+ fdata.append(entry);
+ assertEquals(3, data.getEntryCount());
+ }
+
+ public void testRemove() {
+ assertFalse(fdata.remove(null));
+ assertFalse(fdata.remove(new RowEntry()));
+ assertFalse(fdata.remove(-1));
+ assertFalse(fdata.remove(10));
+ assertEquals(2, fdata.getEntryCount());
+
+ IDataEntry entry = data.getEntry(0);
+ assertTrue(fdata.remove(entry));
+ assertEquals(1, fdata.getEntryCount());
+ assertFalse(fdata.remove(entry));
+ assertTrue(fdata.remove(0));
+ }
+ //End overwrite methods to insure data is removed from the original DataSet
+
+ //Overwrite to ensure the data returned has all the filters applied
+ public void testGetColumn() {
+ assertNull(fdata.getColumn(-3));
+ assertNull(fdata.getColumn(10));
+
+ assertNull(fdata.getColumn(-3, 0, 1));
+ assertNull(fdata.getColumn(10, 0, 1));
+ assertNull(fdata.getColumn(1, 3, 1));
+ assertNull(fdata.getColumn(1, -2, 1));
+ assertNull(fdata.getColumn(1, 0, 20));
+
+ Object[] col = fdata.getColumn(0);
+ assertEquals(2, col.length);
+ assertSame("1", col[0]);
+ assertSame("4", col[1]);
+
+ col = fdata.getColumn(RowDataSet.COL_ROW_NUM);
+ assertEquals(2, col.length);
+ assertEquals("1", col[0].toString());
+ assertEquals("2", col[1].toString());
+
+ col = fdata.getColumn(1, 0, 1);
+ assertEquals(1, col.length);
+ assertSame("2", col[0]);
+ }
+
+ public void testGetRow() {
+ assertNull(fdata.getRow(-3));
+ assertNull(fdata.getRow(10));
+
+ Object[] row = fdata.getRow(1);
+ assertEquals(3, row.length);
+ assertSame("5", row[1]);
+ }
+
+ public void testGetHistoricalData() {
+ assertNull(fdata.getHistoricalData(null, -3));
+ assertNull(fdata.getHistoricalData(null, 10));
+
+ assertNull(fdata.getHistoricalData(null, -3, 0, 1));
+ assertNull(fdata.getHistoricalData(null, 10, 0, 1));
+ assertNull(fdata.getHistoricalData(null, 1, 3, 1));
+ assertNull(fdata.getHistoricalData(null, 1, -2, 1));
+ assertNull(fdata.getHistoricalData(null, 1, 0, 20));
+
+ Object[] col = fdata.getHistoricalData(null, 0);
+ assertEquals(2, col.length);
+ assertSame("1", col[0]);
+ assertSame("4", col[1]);
+
+ col = fdata.getHistoricalData(null, RowDataSet.COL_ROW_NUM);
+ assertEquals(2, col.length);
+ assertEquals("1", col[0].toString());
+ assertEquals("2", col[1].toString());
+
+ col = fdata.getHistoricalData(null, 1, 0, 1);
+ assertEquals(1, col.length);
+ assertSame("2", col[0]);
+ }
+
+ public void testGetEntryCount() {
+ assertEquals(2, fdata.getEntryCount());
+ }
+
+ public void testGetEntry() {
+ assertNull(fdata.getEntry(-1));
+ assertNull(fdata.getEntry(20));
+ assertEquals(entry0, data.getEntry(0));
+ }
+ //End overwrite to ensure the data returned has all the filters applied
+
+ //IFilteredDataSet Methods
+ public void testAddFilter() {
+ data.remove(0);
+ data.remove(0);
+
+ RowEntry entry;
+
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(3), new Integer(2), new Integer(5)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(4), new Integer(2), new Integer(3)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(7), new Integer(2), new Integer(9)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(2), new Integer(2), new Integer(6)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(5), new Integer(2), new Integer(2)});
+ data.append(entry);
+
+ fdata.addFilter(new RangeFilter(0, new Integer(3), new Integer(5), RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS));
+
+ assertEquals(3, fdata.getRowCount());
+ Object[] row = fdata.getRow(1);
+ assertEquals(4, ((Integer)row[0]).intValue());
+ assertEquals(3, ((Integer)row[2]).intValue());
+
+ row = fdata.getRow(2);
+ assertEquals(5, ((Integer)row[0]).intValue());
+ assertEquals(2, ((Integer)row[1]).intValue());
+
+
+ fdata.addFilter(new SortFilter(2, SortFilter.ASCENDING));
+
+ assertEquals(3, fdata.getRowCount());
+ row = fdata.getRow(0);
+ assertEquals(5, ((Integer)row[0]).intValue());
+ assertEquals(2, ((Integer)row[2]).intValue());
+
+ row = fdata.getRow(1);
+ assertEquals(4, ((Integer)row[0]).intValue());
+ assertEquals(3, ((Integer)row[2]).intValue());
+ }
+
+ public void testRemoveFilter() {
+ data.remove(0);
+ data.remove(0);
+
+ RowEntry entry;
+
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(3), new Integer(2), new Integer(5)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(4), new Integer(2), new Integer(3)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(7), new Integer(2), new Integer(9)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(2), new Integer(2), new Integer(6)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(5), new Integer(2), new Integer(2)});
+ data.append(entry);
+
+ RangeFilter filter = new RangeFilter(0, new Integer(3), new Integer(5), RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS);
+ fdata.addFilter(filter);
+ fdata.addFilter(new SortFilter(2, SortFilter.ASCENDING));
+ fdata.removeFilter(filter);
+
+
+ assertEquals(5, fdata.getRowCount());
+ Object[] row = fdata.getRow(0);
+ assertEquals(5, ((Integer)row[0]).intValue());
+ assertEquals(2, ((Integer)row[2]).intValue());
+
+ row = fdata.getRow(1);
+ assertEquals(4, ((Integer)row[0]).intValue());
+ assertEquals(3, ((Integer)row[2]).intValue());
+ }
+
+ public void testClearFilters() {
+ data.remove(0);
+ data.remove(0);
+
+ RowEntry entry;
+
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(3), new Integer(2), new Integer(5)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(4), new Integer(2), new Integer(3)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(7), new Integer(2), new Integer(9)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(2), new Integer(2), new Integer(6)});
+ data.append(entry);
+ entry = new RowEntry();
+ entry.putRow(0, new Integer[] {new Integer(5), new Integer(2), new Integer(2)});
+ data.append(entry);
+
+ RangeFilter filter = new RangeFilter(0, new Integer(3), new Integer(5), RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS);
+ fdata.addFilter(filter);
+ fdata.addFilter(new SortFilter(2, SortFilter.ASCENDING));
+
+ fdata.clearFilters();
+
+ assertEquals(5, fdata.getRowCount());
+ Object[] row = fdata.getRow(0);
+ assertEquals(3, ((Integer)row[0]).intValue());
+ assertEquals(5, ((Integer)row[2]).intValue());
+
+ row = fdata.getRow(1);
+ assertEquals(4, ((Integer)row[0]).intValue());
+ assertEquals(3, ((Integer)row[2]).intValue());
+ }
+
+ public void testGetFilters() {
+ assertEquals(0, fdata.getFilters().length);
+
+ RangeFilter filter1 = new RangeFilter(0, new Integer(3), new Integer(5), RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS);
+ SortFilter filter2 = new SortFilter(2, SortFilter.ASCENDING);
+
+ fdata.addFilter(filter1);
+ fdata.addFilter(filter2);
+
+ IDataSetFilter[] filters = fdata.getFilters();
+ assertEquals(2, filters.length);
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ private RowDataSet data;
+ private FilteredRowDataSet fdata;
+ private RowEntry entry0;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowDataSetTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowDataSetTest.java
new file mode 100644
index 0000000000..7cabb6e0d2
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowDataSetTest.java
@@ -0,0 +1,157 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.row;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowEntry;
+
+import junit.framework.TestCase;
+
+public class RowDataSetTest extends TestCase {
+ public RowDataSetTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ data = new RowDataSet(new String[] {"a", "b", "c"});
+ entry0 = new RowEntry();
+ entry0.putRow(0, new String[] {"1", "2", "3"});
+ data.setData(entry0);
+ RowEntry entry = new RowEntry();
+ entry.putRow(0, new String[] {"4", "5", "6"});
+ data.setData(entry);
+ }
+
+ public void testSetData() {
+ assertEquals(2, data.getEntryCount());
+ RowEntry entry = new RowEntry();
+ entry.putRow(0, new String[] {"1", "2", "3"});
+ data.setData(entry);
+ assertEquals(3, data.getEntryCount());
+ }
+
+ public void testAppend() {
+ assertEquals(2, data.getEntryCount());
+ RowEntry entry = new RowEntry();
+ entry.putRow(0, new String[] {"1", "2", "3"});
+ data.append(entry);
+ assertEquals(3, data.getEntryCount());
+ }
+
+ public void testGetTitles() {
+ String[] titles = data.getTitles();
+ assertEquals(3, titles.length);
+ assertSame("a", titles[0]);
+ }
+
+ public void testGetColumn() {
+ assertNull(data.getColumn(-3));
+ assertNull(data.getColumn(10));
+
+ assertNull(data.getColumn(-3, 0, 1));
+ assertNull(data.getColumn(10, 0, 1));
+ assertNull(data.getColumn(1, 3, 1));
+ assertNull(data.getColumn(1, -2, 1));
+ assertNull(data.getColumn(1, 0, 20));
+
+ Object[] col = data.getColumn(0);
+ assertEquals(2, col.length);
+ assertSame("1", col[0]);
+ assertSame("4", col[1]);
+
+ col = data.getColumn(RowDataSet.COL_ROW_NUM);
+ assertEquals(2, col.length);
+ assertEquals("1", col[0].toString());
+ assertEquals("2", col[1].toString());
+
+ col = data.getColumn(1, 0, 1);
+ assertEquals(1, col.length);
+ assertSame("2", col[0]);
+ }
+
+ public void testGetRow() {
+ assertNull(data.getRow(-3));
+ assertNull(data.getRow(10));
+
+ Object[] row = data.getRow(1);
+ assertEquals(3, row.length);
+ assertSame("5", row[1]);
+ }
+
+ public void testGetRowCount() {
+ assertEquals(2, data.getRowCount());
+ }
+
+ public void testGetColCount() {
+ assertEquals(3, data.getColCount());
+
+ assertEquals(-1, new RowDataSet(null).getColCount());
+ }
+
+ public void testReadFromFile() {}
+
+ public void testWriteToFile() {}
+
+ public void testGetID() {
+ assertEquals(RowDataSet.ID, data.getID());
+ }
+ //End IDataSet Methods
+
+ //IHistoricalDataSet Methods
+ public void testGetHistoricalData() {
+ assertNull(data.getHistoricalData(null, -3));
+ assertNull(data.getHistoricalData(null, 10));
+
+ assertNull(data.getHistoricalData(null, -3, 0, 1));
+ assertNull(data.getHistoricalData(null, 10, 0, 1));
+ assertNull(data.getHistoricalData(null, 1, 3, 1));
+ assertNull(data.getHistoricalData(null, 1, -2, 1));
+ assertNull(data.getHistoricalData(null, 1, 0, 20));
+
+ Object[] col = data.getHistoricalData(null, 0);
+ assertEquals(2, col.length);
+ assertSame("1", col[0]);
+ assertSame("4", col[1]);
+
+ col = data.getHistoricalData(null, RowDataSet.COL_ROW_NUM);
+ assertEquals(2, col.length);
+ assertEquals("1", col[0].toString());
+ assertEquals("2", col[1].toString());
+
+ col = data.getHistoricalData(null, 1, 0, 1);
+ assertEquals(1, col.length);
+ assertSame("2", col[0]);
+ }
+
+ public void testGetEntryCount() {
+ assertEquals(2, data.getEntryCount());
+ }
+
+ public void testRemove() {
+ assertFalse(data.remove(null));
+ assertFalse(data.remove(new RowEntry()));
+ assertFalse(data.remove(-1));
+ assertFalse(data.remove(10));
+ assertEquals(2, data.getEntryCount());
+
+ IDataEntry entry = data.getEntry(0);
+ assertTrue(data.remove(entry));
+ assertEquals(1, data.getEntryCount());
+ assertFalse(data.remove(entry));
+ assertTrue(data.remove(0));
+ }
+
+ public void testGetEntry() {
+ assertNull(data.getEntry(-1));
+ assertNull(data.getEntry(20));
+ assertEquals(entry0, data.getEntry(0));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ RowDataSet data;
+ RowEntry entry0;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowEntryTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowEntryTest.java
new file mode 100644
index 0000000000..4f747fc3ff
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowEntryTest.java
@@ -0,0 +1,109 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.row;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowEntry;
+
+import junit.framework.TestCase;
+
+public class RowEntryTest extends TestCase {
+ public RowEntryTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ entry = new RowEntry();
+ data = new Integer[] {new Integer(2), new Integer(5), new Integer(4)};
+ entry.putRow(0, data);
+ }
+
+ public void testGetRowCount() {
+ RowEntry entry2 = new RowEntry();
+ assertEquals(0, entry2.getRowCount());
+
+ entry2 = new RowEntry();
+ entry2.putRow(0, null);
+ assertEquals(0, entry2.getRowCount());
+
+ assertEquals(1, entry.getRowCount());
+ }
+
+ public void testGetColCount() {
+ RowEntry entry2 = new RowEntry();
+ assertEquals(0, entry2.getColCount());
+
+ entry2 = new RowEntry();
+ entry2.putRow(0, null);
+ assertEquals(0, entry2.getColCount());
+
+ assertEquals(3, entry.getColCount());
+ }
+
+ public void testGet() {
+ assertEquals(data[1], entry.get(null, 1));
+ assertEquals(data[1], entry.get("asdf", 1));
+ assertNull(entry.get(null, 10));
+ assertNull(entry.get(null, -1));
+ }
+
+ public void testGetRow() {
+ assertEquals(data, entry.getRow(0));
+ assertNull(entry.getRow(10));
+ assertNull(entry.getRow(-1));
+
+ assertEquals(data, entry.getRow(null));
+ assertEquals(data, entry.getRow("asdf"));
+ }
+
+ public void testGetColumn() {
+ assertEquals(data[1], entry.getColumn(1)[0]);
+ assertNull(entry.getColumn(10));
+ assertNull(entry.getColumn(-1));
+ }
+
+ public void testGetData() {
+ assertEquals(data[0], entry.getData()[0][0]);
+ assertEquals(data[1], entry.getData()[0][1]);
+ }
+
+ public void testCopy() {
+ IDataEntry entry2 = entry.copy();
+ assertEquals(entry2.getRowCount(), entry.getRowCount());
+ assertEquals(entry2.getColCount(), entry.getColCount());
+ assertSame(entry2.getRow(0)[1], entry.getRow(0)[1]);
+ }
+
+ public void testPutRow() {
+ Integer[] data2 = new Integer[] {new Integer(2), new Integer(5)};
+
+ //Can't add to -1 position
+ entry.putRow(-1, data2);
+ assertEquals(3, entry.getColCount());
+
+ //Cant add to non 0 position
+ entry.putRow(10, data2);
+ assertEquals(3, entry.getColCount());
+
+ //Add successful
+ entry.putRow(0, data2);
+ assertEquals(2, entry.getColCount());
+ }
+
+ public void testRemove() {
+ assertFalse(entry.remove(-1));
+ assertEquals(3, entry.getColCount());
+ assertFalse(entry.remove(10));
+ assertEquals(3, entry.getColCount());
+
+ assertTrue(entry.remove(0));
+ assertEquals(0, entry.getColCount());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ RowEntry entry;
+ Integer[] data;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowParserTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowParserTest.java
new file mode 100644
index 0000000000..6158edaec4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/row/RowParserTest.java
@@ -0,0 +1,66 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.row;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowParser;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.XMLMemento;
+
+
+import junit.framework.TestCase;
+
+public class RowParserTest extends TestCase {
+ public RowParserTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ parser = new RowParser(new String[] {"\\d+", "(\\D+)", "\\d+", "\\D+"});
+
+ IMemento m = XMLMemento.createWriteRoot("a");
+ parser.saveXML(m);
+ parser2 = new RowParser(m);
+ }
+
+ public void testParse() {
+ assertNull(parser.parse(null));
+ assertNull(parser.parse(new StringBuilder("")));
+ assertNull(parser.parse(new StringBuilder("asdf")));
+ assertNull(parser.parse(new StringBuilder("1, ")));
+ assertNull(parser.parse(new StringBuilder("1, 3")));
+
+ IDataEntry entry = parser.parse(new StringBuilder("1, (2), 3, 4, 5"));
+ assertNotNull(entry);
+ assertEquals(2, entry.getColCount());
+ assertEquals(1, entry.getRowCount());
+ assertEquals("1", entry.getRow(0)[0]);
+
+ entry = parser2.parse(new StringBuilder("1, 2, 3, 4, 5"));
+ assertNotNull(entry);
+ assertEquals(2, entry.getColCount());
+ assertEquals(1, entry.getRowCount());
+ assertEquals("1", entry.getRow(0)[0]);
+ }
+
+ public void testSaveXML() {
+ IMemento m = XMLMemento.createWriteRoot("a");
+ parser.saveXML(m);
+ assertSame(RowDataSet.ID, m.getString("dataset"));
+
+ IMemento[] children = m.getChildren("Series");
+ assertEquals(2, children.length);
+ assertSame("\\d+", children[0].getString("parsingExpression"));
+ assertSame("(\\D+)", children[0].getString("parsingSpacer"));
+ assertSame("\\d+", children[1].getString("parsingExpression"));
+ assertSame("\\D+", children[1].getString("parsingSpacer"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ RowParser parser;
+ RowParser parser2;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/FilteredTableDataSetTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/FilteredTableDataSetTest.java
new file mode 100644
index 0000000000..16ab53c76f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/FilteredTableDataSetTest.java
@@ -0,0 +1,267 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.table;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.FilteredTableDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.TableDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.TableEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.IDataSetFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.RangeFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.SortFilter;
+
+import junit.framework.TestCase;
+
+public class FilteredTableDataSetTest extends TestCase {
+ public FilteredTableDataSetTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ data = new TableDataSet(new String[] {"a", "b", "c"});
+ dataSet = new FilteredTableDataSet(data);
+ }
+
+ public void testFilteredDataSet() {
+ FilteredTableDataSet fds = new FilteredTableDataSet(new String[] {"a", "b", "c"});
+ assertNotNull(fds);
+ assertNotNull(fds.getTitles());
+ }
+
+ public void testAppend() {
+ TableEntry entry;
+
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(3), new Integer(2), new Integer(5)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(4), new Integer(2), new Integer(3)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(7), new Integer(2), new Integer(9)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(2), new Integer(2), new Integer(6)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(5), new Integer(2), new Integer(2)});
+ dataSet.append(entry);
+
+ Object[] row = dataSet.getRow(0);
+ assertEquals(5, ((Integer)row[0]).intValue());
+ assertEquals(2, ((Integer)row[2]).intValue());
+
+ assertNull(dataSet.getRow(2));
+ }
+
+ public void testRemove() {
+ assertFalse(dataSet.remove(null));
+ assertFalse(dataSet.remove(new RowEntry()));
+ assertFalse(dataSet.remove(-1));
+ assertFalse(dataSet.remove(10));
+ assertEquals(0, dataSet.getEntryCount());
+
+ TableEntry entry= new TableEntry();
+ entry.add(new String[] {"1", "2", "3"});
+ data.append(entry);
+
+ entry = (TableEntry)data.getEntry(0);
+ assertEquals(1, dataSet.getEntryCount());
+ assertTrue(dataSet.remove(entry));
+ assertEquals(0, dataSet.getEntryCount());
+ assertFalse(dataSet.remove(entry));
+ assertFalse(dataSet.remove(0));
+ }
+ //End overwrite methods to insure data is removed from the original DataSet
+ public void testGetHistoricalData() {
+ TableEntry entry = new TableEntry();
+ entry.putRow(0, new String[] {"1", "2", "3"});
+ dataSet.setData(entry);
+ entry = new TableEntry();
+ entry.putRow(0, new String[] {"4", "5", "6"});
+ dataSet.setData(entry);
+
+ assertNull(dataSet.getHistoricalData(null, -3));
+ assertNull(dataSet.getHistoricalData(null, 10));
+
+ assertNull(dataSet.getHistoricalData(null, -3, 0, 1));
+ assertNull(dataSet.getHistoricalData(null, 10, 0, 1));
+ assertNull(dataSet.getHistoricalData(null, 1, 3, 1));
+ assertNull(dataSet.getHistoricalData(null, 1, -2, 1));
+ assertNull(dataSet.getHistoricalData(null, 1, 0, 20));
+
+ Object[] col = dataSet.getHistoricalData(null, 0);
+ assertEquals(2, col.length);
+ assertEquals("0", col[0].toString());
+ assertEquals("0", col[1].toString());
+
+ col = dataSet.getHistoricalData(null, TableDataSet.COL_ROW_NUM);
+ assertEquals(2, col.length);
+ assertEquals("1", col[0].toString());
+ assertEquals("2", col[1].toString());
+
+ col = dataSet.getHistoricalData("4", 1, 1, 2);
+ assertEquals(1, col.length);
+ assertSame("5", col[0]);
+ }
+
+ public void testGetEntryCount() {
+ assertEquals(0, dataSet.getEntryCount());
+ }
+
+ public void testGetEntry() {
+ assertNull(dataSet.getEntry(-1));
+ assertNull(dataSet.getEntry(20));
+ }
+
+ public void testGetData() {
+ TableEntry entry= new TableEntry();
+ entry.add(new String[] {"1", "2", "3"});
+ data.append(entry);
+
+ Object[][] d = dataSet.getData();
+ assertNotNull(d);
+ assertEquals(1, d.length);
+ assertEquals("3", d[0][2]);
+ }
+
+ //Overwrite to ensure the data returned has all the filters applied
+ public void testGetColumn() {
+ TableEntry entry= new TableEntry();
+ entry.add(new String[] {"1", "2", "3"});
+ data.append(entry);
+
+ assertNull(dataSet.getColumn(-3));
+ assertNull(dataSet.getColumn(10));
+
+ assertNull(dataSet.getColumn(-3, 0, 1));
+ assertNull(dataSet.getColumn(10, 0, 1));
+ assertNull(dataSet.getColumn(1, 3, 1));
+ assertNull(dataSet.getColumn(1, -2, 1));
+ assertNull(dataSet.getColumn(1, 0, 20));
+
+ Object[] col = dataSet.getColumn(0);
+ assertEquals(1, col.length);
+ assertSame("1", col[0]);
+
+ col = dataSet.getColumn(RowDataSet.COL_ROW_NUM);
+ assertEquals(1, col.length);
+ assertEquals("1", col[0].toString());
+
+ col = dataSet.getColumn(1, 0, 1);
+ assertEquals(1, col.length);
+ assertSame("2", col[0]);
+ }
+
+ public void testAddFilter() {
+ TableEntry entry;
+
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(3), new Integer(2), new Integer(5)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(4), new Integer(2), new Integer(3)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(7), new Integer(2), new Integer(9)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(2), new Integer(2), new Integer(6)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(5), new Integer(2), new Integer(2)});
+ dataSet.append(entry);
+
+ dataSet.addFilter(new RangeFilter(0, new Integer(3), new Integer(4), RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS));
+ assertEquals(0, dataSet.getRowCount());
+ dataSet.clearFilters();
+ dataSet.addFilter(new RangeFilter(0, new Integer(3), new Integer(5), RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS));
+
+ assertEquals(1, dataSet.getRowCount());
+ Object[] row = dataSet.getRow(0);
+ assertEquals(5, ((Integer)row[0]).intValue());
+ assertEquals(2, ((Integer)row[2]).intValue());
+ }
+
+ public void testRemoveFilter() {
+ TableEntry entry;
+
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(3), new Integer(2), new Integer(5)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(4), new Integer(2), new Integer(3)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(7), new Integer(2), new Integer(9)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(2), new Integer(2), new Integer(6)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(5), new Integer(2), new Integer(2)});
+ dataSet.append(entry);
+
+ RangeFilter filter = new RangeFilter(0, new Integer(3), new Integer(5), RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS);
+ dataSet.addFilter(filter);
+ dataSet.addFilter(new SortFilter(2, SortFilter.ASCENDING));
+ dataSet.removeFilter(filter);
+
+ assertEquals(1, dataSet.getRowCount());
+ Object[] row = dataSet.getRow(0);
+ assertEquals(5, ((Integer)row[0]).intValue());
+ assertEquals(2, ((Integer)row[2]).intValue());
+ }
+
+ public void testClearFilters() {
+ TableEntry entry;
+
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(3), new Integer(2), new Integer(5)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(4), new Integer(2), new Integer(3)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(7), new Integer(2), new Integer(9)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(2), new Integer(2), new Integer(6)});
+ dataSet.append(entry);
+ entry = new TableEntry();
+ entry.add(new Integer[] {new Integer(5), new Integer(2), new Integer(2)});
+ dataSet.append(entry);
+
+ dataSet.addFilter(new RangeFilter(0, new Integer(3), new Integer(5), RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS));
+ dataSet.addFilter(new SortFilter(2, SortFilter.ASCENDING));
+
+ assertEquals(2, dataSet.getFilters().length);
+ dataSet.clearFilters();
+
+ assertEquals(1, dataSet.getRowCount());
+ Object[] row = dataSet.getRow(0);
+ assertEquals(5, ((Integer)row[0]).intValue());
+ assertEquals(2, ((Integer)row[2]).intValue());
+ assertEquals(0, dataSet.getFilters().length);
+ }
+
+ public void testGetFilters() {
+ assertEquals(0, dataSet.getFilters().length);
+
+ RangeFilter filter1 = new RangeFilter(0, new Integer(3), new Integer(5), RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS);
+ SortFilter filter2 = new SortFilter(2, SortFilter.ASCENDING);
+
+ dataSet.addFilter(filter1);
+ dataSet.addFilter(filter2);
+
+ IDataSetFilter[] filters = dataSet.getFilters();
+ assertEquals(2, filters.length);
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ FilteredTableDataSet dataSet;
+ TableDataSet data;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableDataSetTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableDataSetTest.java
new file mode 100644
index 0000000000..2f1f00c5b9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableDataSetTest.java
@@ -0,0 +1,164 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.table;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.TableDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.TableEntry;
+
+import junit.framework.TestCase;
+
+public class TableDataSetTest extends TestCase {
+ public TableDataSetTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ data = new TableDataSet(new String[] {"a", "b", "c"});
+ entry0 = new TableEntry();
+ entry0.putRow(0, new String[] {"1", "2", "3"});
+ data.setData(entry0);
+ TableEntry entry = new TableEntry();
+ entry.putRow(0, new String[] {"4", "5", "6"});
+ data.setData(entry);
+ }
+
+ public void testSetData() {
+ assertEquals(2, data.getEntryCount());
+ TableEntry entry = new TableEntry();
+ entry.putRow(0, new String[] {"1", "2", "3"});
+ data.setData(entry);
+ assertEquals(3, data.getEntryCount());
+ }
+
+ public void testAppend() {
+ assertEquals(2, data.getEntryCount());
+ TableEntry entry = new TableEntry();
+ entry.putRow(0, new String[] {"1", "2", "3"});
+ data.append(entry);
+ assertEquals(3, data.getEntryCount());
+ }
+
+ public void testGetTitles() {
+ String[] titles = data.getTitles();
+ assertEquals(3, titles.length);
+ assertSame("a", titles[0]);
+ }
+
+ public void testGetColumn() {
+ assertNull(data.getColumn(-3));
+ assertNull(data.getColumn(10));
+
+ assertNull(data.getColumn(-3, 0, 1));
+ assertNull(data.getColumn(10, 0, 1));
+ assertNull(data.getColumn(1, 3, 1));
+ assertNull(data.getColumn(1, -2, 1));
+ assertNull(data.getColumn(1, 0, 20));
+
+ Object[] col = data.getColumn(0);
+ assertEquals(1, col.length);
+ assertSame("4", col[0]);
+
+ col = data.getColumn(TableDataSet.COL_ROW_NUM);
+ assertEquals(1, col.length);
+ assertEquals("1", col[0].toString());
+
+ col = data.getColumn(1, 0, 1);
+ assertEquals(1, col.length);
+ assertSame("5", col[0]);
+ }
+
+ public void testGetRow() {
+ assertNull(data.getRow(-3));
+ assertNull(data.getRow(10));
+
+ assertNull(data.getRow(1));
+
+ Object[] row = data.getRow(0);
+ assertEquals(3, row.length);
+ assertSame("5", row[1]);
+ }
+
+ public void testGetRowCount() {
+ assertEquals(1, data.getRowCount());
+ }
+
+ public void testGetColCount() {
+ assertEquals(3, data.getColCount());
+
+ assertEquals(0, new TableDataSet(null).getColCount());
+ }
+
+ public void testReadFromFile() {}
+
+ public void testWriteToFile() {}
+
+ public void testGetID() {
+ assertEquals(TableDataSet.ID, data.getID());
+ }
+ //End IDataSet Methods
+
+ //IHistoricalDataSet Methods
+ public void testGetHistoricalData() {
+ assertNull(data.getHistoricalData(null, -3));
+ assertNull(data.getHistoricalData(null, 10));
+
+ assertNull(data.getHistoricalData(null, -3, 0, 1));
+ assertNull(data.getHistoricalData(null, 10, 0, 1));
+ assertNull(data.getHistoricalData(null, 1, 3, 1));
+ assertNull(data.getHistoricalData(null, 1, -2, 1));
+ assertNull(data.getHistoricalData(null, 1, 0, 20));
+
+ Object[] col = data.getHistoricalData(null, 0);
+ assertEquals(2, col.length);
+ assertEquals("0", col[0].toString());
+ assertEquals("0", col[1].toString());
+
+ col = data.getHistoricalData(null, TableDataSet.COL_ROW_NUM);
+ assertEquals(2, col.length);
+ assertEquals("1", col[0].toString());
+ assertEquals("2", col[1].toString());
+
+ col = data.getHistoricalData("4", 1, 1, 2);
+ assertEquals(1, col.length);
+ assertSame("5", col[0]);
+ }
+
+ public void testGetEntryCount() {
+ assertEquals(2, data.getEntryCount());
+ }
+
+ public void testRemove() {
+ assertFalse(data.remove(null));
+ assertFalse(data.remove(new TableEntry()));
+ assertFalse(data.remove(-1));
+ assertFalse(data.remove(10));
+ assertEquals(2, data.getEntryCount());
+
+ IDataEntry entry = data.getEntry(0);
+ assertTrue(data.remove(entry));
+ assertEquals(1, data.getEntryCount());
+ assertFalse(data.remove(entry));
+ assertTrue(data.remove(0));
+ }
+
+ public void testGetEntry() {
+ assertNull(data.getEntry(-1));
+ assertNull(data.getEntry(20));
+ assertEquals(entry0, data.getEntry(0));
+ }
+
+ public void testGetData() {
+ Object[][] d = data.getData();
+ assertNotNull(d);
+ assertEquals(1, d.length);
+ assertEquals("6", d[0][2]);
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ TableDataSet data;
+ TableEntry entry0;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableEntryTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableEntryTest.java
new file mode 100644
index 0000000000..a42dab9d42
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableEntryTest.java
@@ -0,0 +1,125 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.table;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.TableEntry;
+
+import junit.framework.TestCase;
+
+public class TableEntryTest extends TestCase {
+ public TableEntryTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ entry = new TableEntry();
+ data = new Integer[] {new Integer(2), new Integer(5), new Integer(4)};
+ entry.add(data);
+ data = new Integer[] {new Integer(5), new Integer(1), new Integer(3)};
+ entry.add(data);
+ }
+
+ public void testGetRowCount() {
+ TableEntry entry2 = new TableEntry();
+ assertEquals(0, entry2.getRowCount());
+
+ entry2 = new TableEntry();
+ entry2.putRow(0, null);
+ assertEquals(0, entry2.getRowCount());
+
+ assertEquals(2, entry.getRowCount());
+ }
+
+ public void testGetColCount() {
+ TableEntry entry2 = new TableEntry();
+ assertEquals(0, entry2.getColCount());
+
+ entry2 = new TableEntry();
+ entry2.putRow(0, null);
+ assertEquals(0, entry2.getColCount());
+
+ assertEquals(3, entry.getColCount());
+ }
+
+ public void testGet() {
+ assertNull(entry.get(null, 1));
+ assertNull(entry.get("asdf", 1));
+ assertNull(entry.get(null, 10));
+ assertNull(entry.get(null, -1));
+ assertEquals("5", entry.get("2", 1).toString());
+ }
+
+ public void testGetData() {
+ assertEquals(data[0], entry.getData()[1][0]);
+ assertEquals(data[1], entry.getData()[1][1]);
+ }
+
+ public void testGetRow() {
+ assertNull(entry.getRow(10));
+ assertNull(entry.getRow(-1));
+ assertNotNull(entry.getRow(0));
+ assertEquals(data, entry.getRow(1));
+
+ assertNull(entry.getRow(null));
+ assertNull(entry.getRow("asdf"));
+ assertNotNull(entry.getRow("2"));
+ assertEquals(data, entry.getRow("5"));
+ }
+
+ public void testGetColumn() {
+ assertEquals(data[1], entry.getColumn(1)[1]);
+ assertNull(entry.getColumn(10));
+ assertNull(entry.getColumn(-1));
+ }
+
+ public void testPutRow() {
+ Integer[] data2 = new Integer[] {new Integer(2), new Integer(5)};
+
+ //Can't add to -1 position
+ entry.putRow(-1, data2);
+ assertEquals(2, entry.getRowCount());
+
+ //Cant add wrong sized array
+ entry.putRow(10, data2);
+ assertEquals(2, entry.getRowCount());
+
+ entry.putRow(0, data2);
+ assertEquals(2, entry.getRowCount());
+
+ //Add successful
+ data2 = new Integer[] {new Integer(2), new Integer(5), new Integer(6)};
+ entry.putRow(0, data2);
+ assertEquals(2, entry.getRowCount());
+ }
+
+ public void testAdd() {
+ Integer[] data2 = new Integer[] {new Integer(2), new Integer(5)};
+ entry.add(data2);
+ assertEquals(2, entry.getRowCount());
+
+ //Add successful
+ data2 = new Integer[] {new Integer(2), new Integer(5), new Integer(6)};
+ entry.add(data2);
+ assertEquals(3, entry.getRowCount());
+ }
+
+ public void testCopy() {
+ IDataEntry entry2 = entry.copy();
+ assertEquals(entry2.getRowCount(), entry.getRowCount());
+ assertEquals(entry2.getColCount(), entry.getColCount());
+ assertSame(entry2.getRow(0)[1], entry.getRow(0)[1]);
+ }
+
+ public void testRemove() {
+ assertTrue(entry.remove(0));
+ assertEquals(1, entry.getRowCount());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ TableEntry entry;
+ Integer[] data;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableParserTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableParserTest.java
new file mode 100644
index 0000000000..a5f2a64901
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/datasets/table/TableParserTest.java
@@ -0,0 +1,69 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.datasets.table;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.TableDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.TableParser;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.XMLMemento;
+
+
+import junit.framework.TestCase;
+
+public class TableParserTest extends TestCase {
+ public TableParserTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ parser = new TableParser(new String[] {"\\d+", "(\\D+)", "\\d+", "\\D+"}, "\n\n");
+
+ IMemento m = XMLMemento.createWriteRoot("a");
+ parser.saveXML(m);
+ parser2 = new TableParser(m);
+ }
+
+ public void testParse() {
+ assertNull(parser.parse(null));
+ assertNull(parser.parse(new StringBuilder("")));
+ assertNull(parser.parse(new StringBuilder("asdf")));
+ assertNull(parser.parse(new StringBuilder("1, ")));
+ assertNull(parser.parse(new StringBuilder("1, 3")));
+
+ IDataEntry entry = parser.parse(new StringBuilder("1, (2), 3, 4, 5\n\n"));
+ assertNotNull(entry);
+ assertEquals(2, entry.getColCount());
+ assertEquals(2, entry.getRowCount());
+ assertEquals("1", entry.getRow(0)[0]);
+
+ entry = parser2.parse(new StringBuilder("1, 2, 3, 4, 5\n\n"));
+ assertNotNull(entry);
+ assertEquals(2, entry.getColCount());
+ assertEquals(2, entry.getRowCount());
+ assertEquals("1", entry.getRow(0)[0]);
+ }
+
+ public void testSaveXML() {
+ IMemento m = XMLMemento.createWriteRoot("a");
+ parser.saveXML(m);
+ assertSame(TableDataSet.ID, m.getString("dataset"));
+
+ IMemento[] children = m.getChildren("Series");
+ assertEquals(2, children.length);
+ assertSame("\\d+", children[0].getString("parsingExpression"));
+ assertSame("(\\D+)", children[0].getString("parsingSpacer"));
+ assertSame("\\d+", children[1].getString("parsingExpression"));
+ assertSame("\\D+", children[1].getString("parsingSpacer"));
+
+ IMemento child = m.getChild("Delimiter");
+ assertSame("\n\n", child.getString("parsingExpression"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ TableParser parser;
+ TableParser parser2;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/MatchFilterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/MatchFilterTest.java
new file mode 100644
index 0000000000..2bd69f2b6a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/MatchFilterTest.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.filters;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.MatchFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.MockDataSet;
+import org.eclipse.ui.XMLMemento;
+
+
+import junit.framework.TestCase;
+
+public class MatchFilterTest extends TestCase {
+ public MatchFilterTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testMatchFilter() {
+ MatchFilter filter = new MatchFilter(-1, null, MatchFilter.KEEP_MATCHING);
+ assertNotNull(filter);
+ }
+
+ public void testFilter() {
+ int width = 4;
+ int height = 10;
+ int wrap = height / 3;
+ ArrayList[] data = MockDataSet.buildArray(width, height, wrap);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ MatchFilter filter = new MatchFilter(0, data[0].get(0), MatchFilter.KEEP_MATCHING);
+ ArrayList[] data2 = filter.filter(data);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ assertEquals(width, data2.length);
+ assertEquals((int)Math.ceil(height/((double)wrap)), data2[0].size());
+ assertEquals("0", data2[0].get(0));
+ assertEquals("0", data2[0].get(1));
+ assertEquals("0", data2[0].get(2));
+ assertEquals("0", data2[0].get(3));
+
+ assertEquals(data[2].get(0), data2[2].get(0));
+ assertEquals(data[2].get(3), data2[2].get(1));
+ assertEquals(data[2].get(6), data2[2].get(2));
+ assertEquals(data[2].get(9), data2[2].get(3));
+
+ filter = new MatchFilter(-1, "", MatchFilter.KEEP_MATCHING);
+ assertNull(filter.filter(data));
+ }
+
+ public void testGetID() {
+ MatchFilter filter = new MatchFilter(0, "", MatchFilter.KEEP_MATCHING);
+ assertTrue(MatchFilter.ID.equals(filter.getID()));
+ }
+
+ public void testWriteXML() {
+ MatchFilter filter = new MatchFilter(0, "", MatchFilter.KEEP_MATCHING);
+ filter.writeXML(XMLMemento.createWriteRoot("test"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/RangeFilterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/RangeFilterTest.java
new file mode 100644
index 0000000000..faa5982c6e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/RangeFilterTest.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.filters;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.RangeFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.MockDataSet;
+import org.eclipse.ui.XMLMemento;
+
+
+import junit.framework.TestCase;
+
+public class RangeFilterTest extends TestCase {
+ public RangeFilterTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ filter = new RangeFilter(0, new Integer(1), new Integer(2), RangeFilter.INSIDE_BOUNDS | RangeFilter.INCLUSIVE);
+ }
+
+ public void testRangeFilter() {
+ RangeFilter filter = new RangeFilter(-1, new Integer(3), new Integer(5), RangeFilter.INSIDE_BOUNDS);
+ assertNotNull(filter);
+ }
+
+ public void testFilter() {
+ int width = 4;
+ int height = 10;
+ int wrap = height / 3;
+ ArrayList[] data = MockDataSet.buildArray(width, height, wrap);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ ArrayList[] data2 = filter.filter(data);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ assertEquals(width, data2.length);
+ assertEquals(6, data2[0].size());
+ assertEquals("1", data2[0].get(0));
+ assertEquals("2", data2[0].get(1));
+ assertEquals("1", data2[0].get(2));
+ assertEquals("2", data2[0].get(3));
+
+ assertEquals(data[2].get(1), data2[2].get(0));
+ assertEquals(data[2].get(2), data2[2].get(1));
+ assertEquals(data[2].get(4), data2[2].get(2));
+ assertEquals(data[2].get(5), data2[2].get(3));
+
+
+ filter = new RangeFilter(0, new Integer(0), new Integer(2), RangeFilter.INSIDE_BOUNDS);
+ data2 = filter.filter(data);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ assertEquals(width, data2.length);
+ assertEquals(3, data2[0].size());
+ assertEquals("1", data2[0].get(0));
+ assertEquals("1", data2[0].get(1));
+ assertEquals("1", data2[0].get(2));
+
+ assertEquals(data[2].get(1), data2[2].get(0));
+ assertEquals(data[2].get(4), data2[2].get(1));
+ assertEquals(data[2].get(7), data2[2].get(2));
+
+
+ filter = new RangeFilter(0, new Integer(0), new Integer(2), RangeFilter.OUTSIDE_BOUNDS | RangeFilter.INCLUSIVE);
+ data2 = filter.filter(data);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ assertEquals(width, data2.length);
+ assertEquals(7, data2[0].size());
+ assertEquals("0", data2[0].get(0));
+ assertEquals("2", data2[0].get(1));
+ assertEquals("0", data2[0].get(2));
+ assertEquals("2", data2[0].get(3));
+
+ assertEquals(data[2].get(0), data2[2].get(0));
+ assertEquals(data[2].get(2), data2[2].get(1));
+ assertEquals(data[2].get(3), data2[2].get(2));
+ assertEquals(data[2].get(5), data2[2].get(3));
+
+
+ filter = new RangeFilter(0, new Integer(0), new Integer(2), RangeFilter.INSIDE_BOUNDS);
+ data2 = filter.filter(data);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ assertEquals(width, data2.length);
+ assertEquals(3, data2[0].size());
+ assertEquals("1", data2[0].get(0));
+ assertEquals("1", data2[0].get(1));
+ assertEquals("1", data2[0].get(2));
+
+ assertEquals(data[2].get(1), data2[2].get(0));
+ assertEquals(data[2].get(4), data2[2].get(1));
+ assertEquals(data[2].get(7), data2[2].get(2));
+
+
+ filter = new RangeFilter(0, new Integer(0), new Integer(2), RangeFilter.OUTSIDE_BOUNDS);
+ data2 = filter.filter(data);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ assertEquals(width, data2.length);
+ assertEquals(0, data2[0].size());
+
+
+ filter = new RangeFilter(-1, new Integer(1), new Integer(3), 0);
+ assertNull(filter.filter(data));
+ }
+
+ public void testGetID() {
+ assertTrue(RangeFilter.ID.equals(filter.getID()));
+ }
+
+ public void testWriteXML() {
+ filter.writeXML(XMLMemento.createWriteRoot("test"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ RangeFilter filter;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/SortFilterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/SortFilterTest.java
new file mode 100644
index 0000000000..5d2fcc1788
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/SortFilterTest.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.filters;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.SortFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.MockDataSet;
+import org.eclipse.ui.XMLMemento;
+
+
+import junit.framework.TestCase;
+
+public class SortFilterTest extends TestCase {
+ public SortFilterTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ filter = new SortFilter(0, SortFilter.ASCENDING);
+ }
+
+ public void testSortFilter() {
+ SortFilter filter = new SortFilter(-1, SortFilter.ASCENDING);
+ assertNotNull(filter);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void testFilter() {
+ int width = 4;
+ int height = 10;
+ int wrap = height / 3;
+ ArrayList[] data = MockDataSet.buildArray(width, height, wrap);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ ArrayList[] data2 = filter.filter(data);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ assertEquals(width, data2.length);
+ assertEquals(height, data2[0].size());
+ assertEquals("0", data2[0].get(0));
+ assertEquals("0", data2[0].get(1));
+ assertEquals("0", data2[0].get(2));
+ assertEquals("0", data2[0].get(3));
+ assertEquals("1", data2[0].get(4));
+ assertEquals("2", data2[0].get(7));
+
+ assertEquals(data[2].get(0), data2[2].get(0));
+ assertEquals(data[2].get(3), data2[2].get(1));
+ assertEquals(data[2].get(6), data2[2].get(2));
+ assertEquals(data[2].get(9), data2[2].get(3));
+
+
+ filter = new SortFilter(0, SortFilter.DESCENDING);
+ data2 = filter.filter(data);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ assertEquals(width, data2.length);
+ assertEquals(height, data2[0].size());
+ assertEquals("2", data2[0].get(0));
+ assertEquals("2", data2[0].get(1));
+ assertEquals("2", data2[0].get(2));
+ assertEquals("1", data2[0].get(3));
+ assertEquals("0", data2[0].get(7));
+
+ assertEquals(data[2].get(2), data2[2].get(0));
+ assertEquals(data[2].get(5), data2[2].get(1));
+ assertEquals(data[2].get(8), data2[2].get(2));
+ assertEquals(data[2].get(9), data2[2].get(7));
+
+ filter = new SortFilter(-1, 0);
+ assertNull(filter.filter(data));
+
+ data[0].add("a");
+ data[0].add("a");
+ data[1].add("b");
+ data[1].add("c");
+ filter = new SortFilter(0, 0);
+ assertNotNull(filter.filter(data));
+ }
+
+ public void testGetID() {
+ assertTrue(SortFilter.ID.equals(filter.getID()));
+ }
+
+ public void testWriteXML() {
+ filter.writeXML(XMLMemento.createWriteRoot("test"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ filter = null;
+ }
+
+ SortFilter filter;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/UniqueFilterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/UniqueFilterTest.java
new file mode 100644
index 0000000000..3cd62d11c8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/filters/UniqueFilterTest.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.filters;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.MaxAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.SumAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.UniqueFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.MockDataSet;
+import org.eclipse.ui.XMLMemento;
+
+
+import junit.framework.TestCase;
+
+public class UniqueFilterTest extends TestCase {
+ public UniqueFilterTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ filter = new UniqueFilter(0, new SumAggregate(), 0);
+ }
+
+ public void testUniqueFilter() {
+ filter = new UniqueFilter(-1, new MaxAggregate(), 0);
+ assertNotNull(filter);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void testFilter() {
+ int width = 4;
+ int height = 10;
+ int wrap = height / 3;
+ ArrayList[] data = MockDataSet.buildArray(width, height, wrap);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+
+ ArrayList[] data2 = filter.filter(data);
+
+ assertEquals(width, data.length);
+ assertEquals(height, data[0].size());
+ assertEquals(width, data2.length);
+ assertEquals(wrap, data2[0].size());
+ assertEquals("1", data2[0].get(0));
+ assertEquals("2", data2[0].get(1));
+ assertEquals("0", data2[0].get(2));
+
+ assertEquals(0, ((Number)data2[2].get(0)).intValue());
+ assertEquals(3, ((Number)data2[2].get(1)).intValue());
+ assertEquals(8, ((Number)data2[2].get(2)).intValue());
+
+ filter = new UniqueFilter(-1, new SumAggregate(), 0);
+ assertNull(filter.filter(null));
+
+ data = new ArrayList[2];
+ data[0] = new ArrayList();
+ data[1] = new ArrayList();
+
+ data[0].add("a");
+ data[0].add("a");
+ data[1].add("b");
+ data[1].add("c");
+ filter = new UniqueFilter(0, new SumAggregate(), 0);
+ assertNotNull(filter.filter(data));
+ }
+
+ public void testGetID() {
+ assertTrue(UniqueFilter.ID.equals(filter.getID()));
+ }
+
+ public void testWriteXML() {
+ filter.writeXML(XMLMemento.createWriteRoot("test"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ filter = null;
+ }
+ UniqueFilter filter;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/ChartStreamDaemonTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/ChartStreamDaemonTest.java
new file mode 100644
index 0000000000..6248dc5e13
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/ChartStreamDaemonTest.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowParser;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.ChartStreamDaemon;
+
+import junit.framework.TestCase;
+
+public class ChartStreamDaemonTest extends TestCase {
+ public ChartStreamDaemonTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ csd = new ChartStreamDaemon(null, null);
+ assertNotNull(csd);
+
+ csd1 = new ChartStreamDaemon(new RowDataSet(new String[] {"a"}), new RowParser(new String[] {"\\w", "\\s"}));
+ assertNotNull(csd1);
+ }
+
+ public void testHandleEvent() {
+ csd.handleDataEvent("a a a");
+ csd1.handleDataEvent("a a a");
+ }
+
+ public void testIsDisposed() {
+ assertFalse(csd1.isDisposed());
+ }
+
+ public void testDispose() {
+ assertFalse(csd1.isDisposed());
+ csd1.dispose();
+ assertTrue(csd1.isDisposed());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ private ChartStreamDaemon csd, csd1;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/ChartStreamDaemonTest2.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/ChartStreamDaemonTest2.java
new file mode 100644
index 0000000000..4273854a27
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/ChartStreamDaemonTest2.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowParser;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.ChartStreamDaemon2;
+
+import junit.framework.TestCase;
+
+public class ChartStreamDaemonTest2 extends TestCase {
+ public ChartStreamDaemonTest2(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ csd = new ChartStreamDaemon2(null, null, null);
+ assertNotNull(csd);
+
+ csd1 = new ChartStreamDaemon2(null, new RowDataSet(new String[] {"a"}), new RowParser(new String[] {"\\w", "\\s"}));
+ assertNotNull(csd1);
+ }
+
+ public void testHandleEvent() {
+ csd.handleDataEvent("a a a");
+ csd1.handleDataEvent("a a a");
+ }
+
+ public void testIsDisposed() {
+ assertFalse(csd1.isDisposed());
+ }
+
+ public void testSetParser() {
+ csd1.handleDataEvent("a a a");
+ csd1.setParser(new RowDataSet(new String[] {"a"}), new RowParser(new String[] {"\\w", "\\s"}));
+ }
+
+ public void testDispose() {
+ assertFalse(csd1.isDisposed());
+ csd1.dispose();
+ assertTrue(csd1.isDisposed());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ private ChartStreamDaemon2 csd, csd1;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/DataPointTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/DataPointTest.java
new file mode 100644
index 0000000000..f41bd0dafa
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/DataPointTest.java
@@ -0,0 +1,19 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures;
+
+import junit.framework.TestCase;
+
+public class DataPointTest extends TestCase {
+ public DataPointTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void test() {}
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/GraphDataTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/GraphDataTest.java
new file mode 100644
index 0000000000..286adb246e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/GraphDataTest.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures;
+
+import junit.framework.TestCase;
+
+public class GraphDataTest extends TestCase {
+ public GraphDataTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void test() {}
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/NumberTypeTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/NumberTypeTest.java
new file mode 100644
index 0000000000..5712834a36
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/NumberTypeTest.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+
+import junit.framework.TestCase;
+
+public class NumberTypeTest extends TestCase {
+ public NumberTypeTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testGetNumber() {
+ Number n = NumberType.getNumber(new Integer(3), 3.2);
+ assertTrue(n instanceof Integer);
+ assertEquals(3, n.intValue());
+
+ n = NumberType.getNumber(new Double(3), 3.2);
+ assertTrue(n instanceof Double);
+ assertEquals(3.2, n.doubleValue(), 0.0);
+
+ n = NumberType.getNumber(new Float(3), 3.2);
+ assertTrue(n instanceof Float);
+ assertEquals(3.2, n.floatValue(), 0.0001);
+
+ n = NumberType.getNumber(new Long(3), 3.2);
+ assertTrue(n instanceof Long);
+ assertEquals(3, n.longValue());
+
+ n = NumberType.getNumber(new Byte((byte)3), 3.2);
+ assertTrue(n instanceof Byte);
+ assertEquals(3, n.byteValue());
+
+ n = NumberType.getNumber(new Short((short)3), 3.2);
+ assertTrue(n instanceof Short);
+ assertEquals(3, n.shortValue());
+ }
+
+ public void testObj2num() {
+ Object[] obj = new Object[] {new Integer(3), new Double(2.3), new Float(4.2)};
+ Number[] num = NumberType.obj2num(obj);
+
+ assertEquals(0, NumberType.obj2num("a").intValue());
+ assertEquals(3, num.length);
+ assertTrue(num[0] instanceof Integer);
+ assertTrue(num[1] instanceof Double);
+ assertTrue(num[2] instanceof Float);
+ assertEquals(3, num[0].intValue());
+ assertEquals(2.3, num[1].doubleValue(), 0.00001);
+ assertEquals(4.2, num[2].doubleValue(), 0.00001);
+ }
+
+ public void testCleanObj2Num() {
+ assertEquals(3, NumberType.cleanObj2Num("3").intValue());
+ assertEquals(3.2, NumberType.cleanObj2Num("3.2").doubleValue(), 0.00001);
+ assertEquals(3, NumberType.cleanObj2Num(new Integer(3)).intValue());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/UpdateManagerTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/UpdateManagerTest.java
new file mode 100644
index 0000000000..79e07a367d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/tests/structures/UpdateManagerTest.java
@@ -0,0 +1,57 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.*;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IUpdateListener;
+import org.eclipse.linuxtools.systemtap.ui.structures.UpdateManager;
+
+import junit.framework.TestCase;
+
+public class UpdateManagerTest extends TestCase {
+ public UpdateManagerTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ manager = new UpdateManager(5);
+ }
+
+ public void testStop() {
+ assertTrue(manager.isRunning());
+ manager.stop();
+ assertFalse(manager.isRunning());
+ }
+
+ public void testAddUpdateListener() {
+ manager.addUpdateListener(listener);
+ }
+
+ public void testRemoveUpdateListener() {
+ manager.addUpdateListener(listener);
+ manager.removeUpdateListener(listener);
+ }
+
+ public void testIsRunning() {
+ assertTrue(manager.isRunning());
+ manager.stop();
+ assertFalse(manager.isRunning());
+ }
+
+ public void testDispose() {
+ manager.dispose();
+ assertFalse(manager.isRunning());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ manager.stop();
+ manager.dispose();
+ }
+
+ private UpdateManager manager;
+ private IUpdateListener listener = new IUpdateListener() {
+ public void handleUpdateEvent() {
+ //Do nothing;
+ }
+ };
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.project
new file mode 100644
index 0000000000..832d492a5c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.settings/org.eclipse.jdt.core.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..316c96002d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Fri Feb 27 17:29:26 IST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/ChangeLog
new file mode 100644
index 0000000000..9e11384b8d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/ChangeLog
@@ -0,0 +1,11 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * ChangeLog: Refactoring. Renaming all packages directories from *.systemtapgui.* to *.systemtap.ui.* \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..cb73f9c520
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/META-INF/MANIFEST.MF
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: GraphingAPI NonUI Plug-in
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui;singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.internal.GraphingAPINonUIPlugin
+Bundle-Vendor: Eclipse
+Export-Package: org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.linuxtools.systemtap.ui.structures
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.linuxtools.systemtap.ui.consolelog.structures
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/build.properties
new file mode 100644
index 0000000000..98def4deb0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ src/
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/IGraphColorConstants.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/IGraphColorConstants.java
new file mode 100644
index 0000000000..61d8424e8b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/IGraphColorConstants.java
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui;
+
+import org.eclipse.swt.graphics.RGB;
+
+public interface IGraphColorConstants {
+ static final RGB[] COLORS = new RGB[] {
+ new RGB(0, 0, 255),
+ new RGB(255, 0, 0),
+ new RGB(0, 255, 0),
+ new RGB(255, 0, 255),
+ new RGB(0, 255, 255),
+ new RGB(255, 255, 0),
+ new RGB(127, 127, 255),
+ new RGB(255, 127, 127),
+ new RGB(127, 255, 127),
+
+ new RGB(255, 255, 255),
+ new RGB(255, 255, 204),
+ new RGB(255, 255, 153),
+ new RGB(255, 255, 102),
+ new RGB(255, 255, 51),
+ new RGB(255, 255, 0),
+ new RGB(255, 204, 255),
+ new RGB(255, 204, 204),
+ new RGB(255, 204, 153),
+ new RGB(255, 204, 102),
+ new RGB(255, 204, 51),
+ new RGB(255, 204, 0),
+ new RGB(255, 153, 255),
+ new RGB(255, 153, 204),
+ new RGB(255, 153, 153),
+ new RGB(255, 153, 102),
+ new RGB(255, 153, 51),
+ new RGB(255, 153, 0),
+ new RGB(255, 102, 255),
+ new RGB(255, 102, 204),
+ new RGB(255, 102, 153),
+ new RGB(255, 102, 102),
+ new RGB(255, 102, 51),
+ new RGB(255, 102, 0),
+ new RGB(255, 51, 255),
+ new RGB(255, 51, 204),
+ new RGB(255, 51, 153),
+ new RGB(255, 51, 102),
+ new RGB(255, 51, 51),
+ new RGB(255, 51, 0),
+ new RGB(255, 0, 255),
+ new RGB(255, 0, 204),
+ new RGB(255, 0, 153),
+ new RGB(255, 0, 102),
+ new RGB(255, 0, 51),
+ new RGB(255, 0, 0),
+ new RGB(204, 255, 255),
+ new RGB(204, 255, 204),
+ new RGB(204, 255, 153),
+ new RGB(204, 255, 102),
+ new RGB(204, 255, 51),
+ new RGB(204, 255, 0),
+ new RGB(204, 204, 255),
+ new RGB(204, 204, 204),
+ new RGB(204, 204, 153),
+ new RGB(204, 204, 102),
+ new RGB(204, 204, 51),
+ new RGB(204, 204, 0),
+ new RGB(204, 153, 255),
+ new RGB(204, 153, 204),
+ new RGB(204, 153, 153),
+ new RGB(204, 153, 102),
+ new RGB(204, 153, 51),
+ new RGB(204, 153, 0),
+ new RGB(204, 102, 255),
+ new RGB(204, 102, 204),
+ new RGB(204, 102, 153),
+ new RGB(204, 102, 102),
+ new RGB(204, 102, 51),
+ new RGB(204, 102, 0),
+ new RGB(204, 51, 255),
+ new RGB(204, 51, 204),
+ new RGB(204, 51, 153),
+ new RGB(204, 51, 102),
+ new RGB(204, 51, 51),
+ new RGB(204, 51, 0),
+ new RGB(204, 0, 255),
+ new RGB(204, 0, 204),
+ new RGB(204, 0, 153),
+ new RGB(204, 0, 102),
+ new RGB(204, 0, 51),
+ new RGB(204, 0, 0),
+ new RGB(153, 255, 255),
+ new RGB(153, 255, 204),
+ new RGB(153, 255, 153),
+ new RGB(153, 255, 102),
+ new RGB(153, 255, 51),
+ new RGB(153, 255, 0),
+ new RGB(153, 204, 255),
+ new RGB(153, 204, 204),
+ new RGB(153, 204, 153),
+ new RGB(153, 204, 102),
+ new RGB(153, 204, 51),
+ new RGB(153, 204, 0),
+ new RGB(153, 153, 255),
+ new RGB(153, 153, 204),
+ new RGB(153, 153, 153),
+ new RGB(153, 153, 102),
+ new RGB(153, 153, 51),
+ new RGB(153, 153, 0),
+ new RGB(153, 102, 255),
+ new RGB(153, 102, 204),
+ new RGB(153, 102, 153),
+ new RGB(153, 102, 102),
+ new RGB(153, 102, 51),
+ new RGB(153, 102, 0),
+ new RGB(153, 51, 255),
+ new RGB(153, 51, 204),
+ new RGB(153, 51, 153),
+ new RGB(153, 51, 102),
+ new RGB(153, 51, 51),
+ new RGB(153, 51, 0),
+ new RGB(153, 0, 255),
+ new RGB(153, 0, 204),
+ new RGB(153, 0, 153),
+ new RGB(153, 0, 102),
+ new RGB(153, 0, 51),
+ new RGB(153, 0, 0),
+ new RGB(102, 255, 255),
+ new RGB(102, 255, 204),
+ new RGB(102, 255, 153),
+ new RGB(102, 255, 102),
+ new RGB(102, 255, 51),
+ new RGB(102, 255, 0),
+ new RGB(102, 204, 255),
+ new RGB(102, 204, 204),
+ new RGB(102, 204, 153),
+ new RGB(102, 204, 102),
+ new RGB(102, 204, 51),
+ new RGB(102, 204, 0),
+ new RGB(102, 153, 255),
+ new RGB(102, 153, 204),
+ new RGB(102, 153, 153),
+ new RGB(102, 153, 102),
+ new RGB(102, 153, 51),
+ new RGB(102, 153, 0),
+ new RGB(102, 102, 255),
+ new RGB(102, 102, 204),
+ new RGB(102, 102, 153),
+ new RGB(102, 102, 102),
+ new RGB(102, 102, 51),
+ new RGB(102, 102, 0),
+ new RGB(102, 51, 255),
+ new RGB(102, 51, 204),
+ new RGB(102, 51, 153),
+ new RGB(102, 51, 102),
+ new RGB(102, 51, 51),
+ new RGB(102, 51, 0),
+ new RGB(102, 0, 255),
+ new RGB(102, 0, 204),
+ new RGB(102, 0, 153),
+ new RGB(102, 0, 102),
+ new RGB(102, 0, 51),
+ new RGB(102, 0, 0),
+ new RGB(51, 255, 255),
+ new RGB(51, 255, 204),
+ new RGB(51, 255, 153),
+ new RGB(51, 255, 102),
+ new RGB(51, 255, 51),
+ new RGB(51, 255, 0),
+ new RGB(51, 204, 255),
+ new RGB(51, 204, 204),
+ new RGB(51, 204, 153),
+ new RGB(51, 204, 102),
+ new RGB(51, 204, 51),
+ new RGB(51, 204, 0),
+ new RGB(51, 153, 255),
+ new RGB(51, 153, 204),
+ new RGB(51, 153, 153),
+ new RGB(51, 153, 102),
+ new RGB(51, 153, 51),
+ new RGB(51, 153, 0),
+ new RGB(51, 102, 255),
+ new RGB(51, 102, 204),
+ new RGB(51, 102, 153),
+ new RGB(51, 102, 102),
+ new RGB(51, 102, 51),
+ new RGB(51, 102, 0),
+ new RGB(51, 51, 255),
+ new RGB(51, 51, 204),
+ new RGB(51, 51, 153),
+ new RGB(51, 51, 102),
+ new RGB(51, 51, 51),
+ new RGB(51, 51, 0),
+ new RGB(51, 0, 255),
+ new RGB(51, 0, 204),
+ new RGB(51, 0, 153),
+ new RGB(51, 0, 102),
+ new RGB(51, 0, 51),
+ new RGB(51, 0, 0),
+ new RGB(0, 255, 255),
+ new RGB(0, 255, 204),
+ new RGB(0, 255, 153),
+ new RGB(0, 255, 102),
+ new RGB(0, 255, 51),
+ new RGB(0, 255, 0),
+ new RGB(0, 204, 255),
+ new RGB(0, 204, 204),
+ new RGB(0, 204, 153),
+ new RGB(0, 204, 102),
+ new RGB(0, 204, 51),
+ new RGB(0, 204, 0),
+ new RGB(0, 153, 255),
+ new RGB(0, 153, 204),
+ new RGB(0, 153, 153),
+ new RGB(0, 153, 102),
+ new RGB(0, 153, 51),
+ new RGB(0, 153, 0),
+ new RGB(0, 102, 255),
+ new RGB(0, 102, 204),
+ new RGB(0, 102, 153),
+ new RGB(0, 102, 102),
+ new RGB(0, 102, 51),
+ new RGB(0, 102, 0),
+ new RGB(0, 51, 255),
+ new RGB(0, 51, 204),
+ new RGB(0, 51, 153),
+ new RGB(0, 51, 102),
+ new RGB(0, 51, 51),
+ new RGB(0, 51, 0),
+ new RGB(0, 0, 255),
+ new RGB(0, 0, 204),
+ new RGB(0, 0, 153),
+ new RGB(0, 0, 102),
+ new RGB(0, 0, 51),
+ new RGB(0, 0, 0)
+ };
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/BlockAdapter.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/BlockAdapter.java
new file mode 100644
index 0000000000..137cc5b8e6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/BlockAdapter.java
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IBlockDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.internal.Localization;
+
+public class BlockAdapter implements IAdapter {
+ public BlockAdapter(IBlockDataSet data, int xSeries, int[] ySeries) {
+ this.data = data;
+ this.xSeries = xSeries;
+ this.ySeries = ySeries;
+ }
+
+ public Number getXMax() {
+ return getXMax(0, getRecordCount());
+ }
+
+ public Number getXMax(int start, int end) {
+ return getSeriesMax(xSeries, start, end);
+ }
+
+ public Number getYMax() {
+ return getYMax(0, getRecordCount());
+ }
+
+ public Number getYMax(int start, int end) {
+ Number max = new Double(Double.MIN_VALUE);
+ Number a;
+ for(int i=0; i<ySeries.length; i++) {
+ a = getSeriesMax(ySeries[i], start, end);
+ max = (max.doubleValue()) > a.doubleValue() ? max : a;
+ }
+ return max;
+ }
+
+ public Number getYSeriesMax(int y) {
+ return getYSeriesMax(y, 0, getRecordCount());
+ }
+
+ public Number getYSeriesMax(int y, int start, int end) {
+ return getSeriesMax(ySeries[y], start, end);
+ }
+
+ public Number getSeriesMax(int series) {
+ return getSeriesMax(series, 0, getRecordCount());
+ }
+
+ public Number getSeriesMax(int series, int start, int end) {
+ if(start < 0 || end > data.getRowCount() || start > end)
+ return null;
+
+ Number max = new Double(Double.NEGATIVE_INFINITY);
+ Number cur;
+
+ Object[] dataColumn = data.getColumn(series, start, end);
+ for(int i=0; i<dataColumn.length; i++) {
+ try {
+ cur = new Double(Double.parseDouble(dataColumn[i].toString()));
+ if(max.doubleValue() < cur.doubleValue())
+ max = cur;
+ } catch (NumberFormatException e) {}
+ }
+ return max;
+ }
+
+ public Number getXMin() {
+ return getXMin(0, getRecordCount());
+ }
+
+ public Number getXMin(int start, int end) {
+ return getSeriesMin(xSeries, start, end);
+ }
+
+ public Number getYMin() {
+ return getYMin(0, getRecordCount());
+ }
+
+ public Number getYMin(int start, int end) {
+ Number min = new Double(Double.MIN_VALUE);
+ Number a;
+ for(int i=0; i<ySeries.length; i++) {
+ a = getSeriesMin(ySeries[i], start, end);
+ min = (min.doubleValue()) < a.doubleValue() ? min : a;
+ }
+ return min;
+ }
+
+ public Number getYSeriesMin(int y) {
+ return getYSeriesMin(y, 0, getRecordCount());
+ }
+
+ public Number getYSeriesMin(int y, int start, int end) {
+ return getSeriesMin(ySeries[y], start, end);
+ }
+
+ public Number getSeriesMin(int series) {
+ return getSeriesMin(series, 0, getRecordCount());
+ }
+
+ public Number getSeriesMin(int series, int start, int end) {
+ if(start < 0 || end > data.getRowCount() || start > end)
+ return null;
+
+ Number min = new Double(Double.POSITIVE_INFINITY);
+ Number cur;
+
+ Object[] dataColumn = data.getColumn(series, start, end);
+ for(int i=0; i<dataColumn.length; i++) {
+ try {
+ cur = new Double(Double.parseDouble(dataColumn[i].toString()));
+ if(min.doubleValue() > cur.doubleValue())
+ min = cur;
+ } catch (NumberFormatException e) {}
+ }
+ return min;
+ }
+
+ public String[] getLabels() {
+ String[] labels = data.getTitles();
+
+ String[] labels2 = new String[ySeries.length + 1];
+ labels2[0] = (IDataSet.COL_ROW_NUM == xSeries) ? Localization.getString("BlockAdapter.RowNum") : labels[xSeries];
+
+ for(int i=0; i<ySeries.length; i++)
+ labels2[i+1] = labels[ySeries[i]];
+
+ return labels2;
+ }
+
+ public int getSeriesCount() {
+ return ySeries.length;
+ }
+
+ public int getRecordCount() {
+ return data.getRowCount();
+ }
+
+ public Object[][] getData() {
+ return getData(0, getRecordCount());
+ }
+
+ //[Row][Column]
+ public Object[][] getData(int start, int end) {
+ Object[][] o = new Object[Math.min(end-start,getRecordCount())][ySeries.length+1];
+
+ Object[] row;
+ for(int j,i=0; i<o.length; i++) {
+ row = data.getRow(i+start);
+ o[i][0] = (IDataSet.COL_ROW_NUM == xSeries) ? new Integer(i) : row[xSeries];
+
+ for(j=0; j<ySeries.length; j++)
+ o[i][j+1] = row[ySeries[j]];
+ }
+
+ return o;
+ }
+
+ private IBlockDataSet data;
+ private int xSeries;
+ private int[] ySeries;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/IAdapter.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/IAdapter.java
new file mode 100644
index 0000000000..107d08c05c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/IAdapter.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters;
+
+public interface IAdapter {
+ public Number getXMax();
+ public Number getXMax(int start, int end);
+ public Number getYMax();
+ public Number getYMax(int start, int end);
+ public Number getYSeriesMax(int series);
+ public Number getYSeriesMax(int series, int start, int end);
+ public Number getSeriesMax(int series);
+ public Number getSeriesMax(int series, int start, int end);
+
+ public Number getXMin();
+ public Number getXMin(int start, int end);
+ public Number getYMin();
+ public Number getYMin(int start, int end);
+ public Number getYSeriesMin(int series);
+ public Number getYSeriesMin(int series, int start, int end);
+ public Number getSeriesMin(int series);
+ public Number getSeriesMin(int series, int start, int end);
+
+ public String[] getLabels();
+ public int getRecordCount();
+ public int getSeriesCount();
+ public Object[][] getData();
+ public Object[][] getData(int start, int end);
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/ScrollAdapter.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/ScrollAdapter.java
new file mode 100644
index 0000000000..5ff4990386
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/adapters/ScrollAdapter.java
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IHistoricalDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.internal.Localization;
+
+public class ScrollAdapter implements IAdapter {
+ public ScrollAdapter(IHistoricalDataSet data, int xSeries, int[] ySeries, String key) {
+ this.data = data;
+ this.xSeries = xSeries;
+ this.ySeries = ySeries;
+ this.key = key;
+ }
+
+ public Number getXMax() {
+ return getXMax(0, getRecordCount());
+ }
+
+ public Number getXMax(int start, int end) {
+ return getSeriesMax(xSeries, start, end);
+ }
+
+ public Number getYMax() {
+ return getYMax(0, getRecordCount());
+ }
+
+ public Number getYMax(int start, int end) {
+ Number max = new Double(Double.MIN_VALUE);
+ Number a;
+ for(int i=0; i<ySeries.length; i++) {
+ a = getSeriesMax(ySeries[i], start, end);
+ max = (max.doubleValue()) > a.doubleValue() ? max : a;
+ }
+ return max;
+ }
+
+ public Number getYSeriesMax(int y) {
+ return getYSeriesMax(y, 0, getRecordCount());
+ }
+
+ public Number getYSeriesMax(int y, int start, int end) {
+ return getSeriesMax(ySeries[y], start, end);
+ }
+
+ public Number getSeriesMax(int series) {
+ return getSeriesMax(series, 0, getRecordCount());
+ }
+
+ public Number getSeriesMax(int series, int start, int end) {
+ if(start < 0 || end > data.getRowCount() || start > end)
+ return null;
+
+ Number max = new Double(Double.NEGATIVE_INFINITY);
+ Number cur;
+
+ Object[] dataColumn = data.getHistoricalData(key, series, start, end);
+ for(int i=0; i<dataColumn.length; i++) {
+ try {
+ cur = new Double(Double.parseDouble(dataColumn[i].toString()));
+ if(max.doubleValue() < cur.doubleValue())
+ max = cur;
+ } catch (NumberFormatException e) {}
+ }
+ return max;
+ }
+
+ public Number getXMin() {
+ return getXMin(0, getRecordCount());
+ }
+
+ public Number getXMin(int start, int end) {
+ return getSeriesMin(xSeries, start, end);
+ }
+
+ public Number getYMin() {
+ return getYMin(0, getRecordCount());
+ }
+
+ public Number getYMin(int start, int end) {
+ Number min = new Double(Double.MIN_VALUE);
+ Number a;
+ for(int i=0; i<ySeries.length; i++) {
+ a = getSeriesMin(ySeries[i], start, end);
+ min = (min.doubleValue()) < a.doubleValue() ? min : a;
+ }
+ return min;
+ }
+
+ public Number getYSeriesMin(int y) {
+ return getYSeriesMin(y, 0, getRecordCount());
+ }
+
+ public Number getYSeriesMin(int y, int start, int end) {
+ return getSeriesMin(ySeries[y], start, end);
+ }
+
+ public Number getSeriesMin(int series) {
+ return getSeriesMin(series, 0, getRecordCount());
+ }
+
+ public Number getSeriesMin(int series, int start, int end) {
+ if(start < 0 || end > data.getRowCount() || start > end)
+ return null;
+
+ Number min = new Double(Double.POSITIVE_INFINITY);
+ Number cur;
+
+ Object[] dataColumn = data.getHistoricalData(key, series, start, end);
+ for(int i=0; i<dataColumn.length; i++) {
+ try {
+ cur = new Double(Double.parseDouble(dataColumn[i].toString()));
+ if(min.doubleValue() > cur.doubleValue())
+ min = cur;
+ } catch (NumberFormatException e) {}
+ }
+ return min;
+ }
+
+ public String[] getLabels() {
+ String[] labels = data.getTitles();
+
+ String[] labels2 = new String[ySeries.length + 1];
+ labels2[0] = (IDataSet.COL_ROW_NUM == xSeries) ? Localization.getString("ScrollAdapter.RowNum") : labels[xSeries];
+
+ for(int i=0; i<ySeries.length; i++)
+ labels2[i+1] = labels[ySeries[i]];
+
+ return labels2;
+ }
+
+ public int getSeriesCount() {
+ return ySeries.length;
+ }
+
+ public int getRecordCount() {
+ return data.getEntryCount();
+ }
+
+ public Object[][] getData() {
+ return getData(0, getRecordCount());
+ }
+
+ //[Row][Column]
+ public Object[][] getData(int start, int end) {
+ Object[][] o = new Object[Math.min(end-start,getRecordCount())][ySeries.length+1];
+
+ Object[] x = data.getHistoricalData(key, xSeries, start, end);
+ Object[][] y = new Object[ySeries.length][data.getEntryCount()];
+
+ for(int i=0; i<ySeries.length; i++)
+ y[i] = data.getHistoricalData(key, ySeries[i], start, end);
+
+ for(int j,i=0; i<o.length; i++) {
+ o[i][0] = x[i];
+ for(j=0; j<ySeries.length; j++)
+ o[i][j+1] = y[j][i];
+ }
+
+ return o;
+ }
+
+ private IHistoricalDataSet data;
+ private int xSeries;
+ private int[] ySeries;
+ private String key;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/AverageAggregate.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/AverageAggregate.java
new file mode 100644
index 0000000000..b8e9131038
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/AverageAggregate.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+
+public class AverageAggregate implements IDataAggregate {
+
+ /**
+ * Ensure column isn't empty, then get the average of all the column's values.
+ *
+ * @param column The column to average.
+ *
+ * @return Average of all the column's values.
+ */
+ public Number aggregate(Number[] column) {
+ if(column == null || column.length == 0)
+ return null;
+
+ double num = 0;
+
+ for(int i=0; i<column.length; i++)
+ num += column[i].doubleValue();
+
+ num /= column.length;
+ return NumberType.getNumber(column[0], num);
+ }
+
+ public String getID() {
+ return ID;
+ }
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.AverageAggregate";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/CountAggregate.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/CountAggregate.java
new file mode 100644
index 0000000000..cd0750dd87
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/CountAggregate.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates;
+
+public class CountAggregate implements IDataAggregate {
+
+ /**
+ * Ensure column isn't empty, then get the count of the column's values.
+ *
+ * @param column The column to count.
+ *
+ * @return Count of that column's values.
+ */
+ public Number aggregate(Number[] column) {
+ if(column == null || column.length == 0)
+ return null;
+
+ int num = 0;
+
+ for(int i=0; i<column.length; i++)
+ num++;
+
+ return new Integer(num);
+ }
+
+ public String getID() {
+ return ID;
+ }
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.CountAggregate";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/IDataAggregate.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/IDataAggregate.java
new file mode 100644
index 0000000000..1558e24f1b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/IDataAggregate.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates;
+
+public interface IDataAggregate {
+ public Number aggregate(Number[] column);
+ public String getID();
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/MaxAggregate.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/MaxAggregate.java
new file mode 100644
index 0000000000..7da69d4795
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/MaxAggregate.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+
+public class MaxAggregate implements IDataAggregate {
+
+ /**
+ * Ensure column isn't empty, then get the maximum of all the column's values.
+ *
+ * @param column The column to search.
+ *
+ * @return Maximum of all the column's values.
+ */
+ public Number aggregate(Number[] column) {
+ if(column == null || column.length == 0)
+ return null;
+
+ double num = Double.NEGATIVE_INFINITY;
+
+ for(int i=0; i<column.length; i++) {
+ if(num < column[i].doubleValue())
+ num = column[i].doubleValue();
+ }
+
+ return NumberType.getNumber(column[0], num);
+ }
+
+ public String getID() {
+ return ID;
+ }
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.MaxAggregate";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/MinAggregate.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/MinAggregate.java
new file mode 100644
index 0000000000..bf86ddd8f3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/MinAggregate.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+
+public class MinAggregate implements IDataAggregate {
+
+ /**
+ * Ensure column isn't empty, then get the minimum of all the column's values.
+ *
+ * @param column The column to search.
+ *
+ * @return Minimum of all the column's values.
+ */
+ public Number aggregate(Number[] column) {
+ if(column == null || column.length == 0)
+ return null;
+
+ double num = Double.POSITIVE_INFINITY;
+
+ for(int i=0; i<column.length; i++) {
+ if(num > column[i].doubleValue())
+ num = column[i].doubleValue();
+ }
+
+ return NumberType.getNumber(column[0], num);
+ }
+
+ public String getID() {
+ return ID;
+ }
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.MinAggregate";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/SumAggregate.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/SumAggregate.java
new file mode 100644
index 0000000000..09a3bb23ec
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/aggregates/SumAggregate.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+
+public class SumAggregate implements IDataAggregate {
+
+ /**
+ * Ensure column isn't empty, then get the sum total of all the column's values.
+ *
+ * @param column The column to total.
+ *
+ * @return The sum total of all the column's values.
+ */
+ public Number aggregate(Number[] column) {
+ if(column == null || column.length == 0)
+ return null;
+
+ double num = 0;
+
+ for(int i=0; i<column.length; i++)
+ num += column[i].doubleValue();
+
+ return NumberType.getNumber(column[0], num);
+ }
+
+ public String getID() {
+ return ID;
+ }
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.SumAggregate";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IBlockDataSet.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IBlockDataSet.java
new file mode 100644
index 0000000000..d9681b9bb4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IBlockDataSet.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets;
+
+public interface IBlockDataSet extends IDataSet {
+ public Object[][] getData();
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataEntry.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataEntry.java
new file mode 100644
index 0000000000..1a408ab214
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataEntry.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets;
+
+public interface IDataEntry {
+ public int getRowCount();
+ public int getColCount();
+ public Object get(String key, int col);
+ public Object[] getRow(int row);
+ public Object[] getRow(String key);
+ public Object[] getColumn(int col);
+ public Object[][] getData();
+ public IDataEntry copy();
+ public void putRow(int row, Object[] data);
+ public boolean remove(int row);
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataSet.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataSet.java
new file mode 100644
index 0000000000..5a6efba3f4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataSet.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets;
+
+import java.io.File;
+
+
+public interface IDataSet {
+ public String[] getTitles();
+ public String getID();
+ public boolean writeToFile(File file);
+ public boolean readFromFile(File file);
+
+ public int getRowCount();
+ public int getColCount();
+
+ public Object[] getRow(int row);
+ public Object[] getColumn(int col);
+ public Object[] getColumn(int col, int start, int end);
+
+ public void setData(IDataEntry entry);
+
+ public boolean remove(IDataEntry entry);
+
+ public static final int COL_ROW_NUM = -1;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataSetParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataSetParser.java
new file mode 100644
index 0000000000..dd1cb1d827
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IDataSetParser.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets;
+
+import org.eclipse.ui.IMemento;
+
+
+public interface IDataSetParser {
+ public IDataEntry parse(StringBuilder entry);
+ public boolean saveXML(IMemento target);
+
+ public static final String XMLDataSetSettings = "DataSetSettings";
+ public static final String XMLparsingExpression = "parsingExpression";
+ public static final String XMLparsingSpacer = "parsingSpacer";
+ public static final String XMLColumn = "Column";
+ public static final String XMLdataset = "dataset";
+ public static final String XMLFile = "File";
+ public static final String XMLSeries = "Series";
+ public static final String XMLname = "name";
+ public static final String XMLDelimiter = "Delimiter";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IFilteredDataSet.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IFilteredDataSet.java
new file mode 100644
index 0000000000..cb496d1b08
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IFilteredDataSet.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.IDataSetFilter;
+
+public interface IFilteredDataSet extends IDataSet {
+ public void addFilter(IDataSetFilter filter);
+ public IDataSetFilter[] getFilters();
+ public void clearFilters();
+ public boolean removeFilter(IDataSetFilter filter);
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IHistoricalDataSet.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IHistoricalDataSet.java
new file mode 100644
index 0000000000..d0ca7d7d7a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/IHistoricalDataSet.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets;
+
+public interface IHistoricalDataSet extends IDataSet {
+ public void append(IDataEntry entry) throws ArrayIndexOutOfBoundsException;
+
+ public Object[] getHistoricalData(String key, int col);
+ public Object[] getHistoricalData(String key, int col, int start, int end);
+ public int getEntryCount();
+ public IDataEntry getEntry(int entry);
+ public boolean remove(int entry);
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/FilteredRowDataSet.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/FilteredRowDataSet.java
new file mode 100644
index 0000000000..0958a4773f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/FilteredRowDataSet.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IFilteredDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.IDataSetFilter;
+
+
+
+public class FilteredRowDataSet extends RowDataSet implements IFilteredDataSet {
+ public FilteredRowDataSet(RowDataSet data) {
+ super(data.getTitles());
+ original = data;
+ this.data = data.data;
+ filters = new ArrayList<IDataSetFilter>();
+
+ filtersChanged = false;
+ topData = null;
+ dataCount = data.getRowCount();
+ }
+
+ public FilteredRowDataSet(String[] titles) {
+ this(new RowDataSet(titles));
+ }
+
+ //Overwrite methods to insure data is removed from the original DataSet
+ public void append(IDataEntry entry) throws ArrayIndexOutOfBoundsException {
+ original.append(entry);
+ }
+
+ public boolean remove(IDataEntry entry) {
+ return original.remove(entry);
+ }
+
+ public boolean remove(int entry) {
+ return original.remove(entry);
+ }
+ //End overwrite methods to insure data is removed from the original DataSet
+
+ //Overwrite to ensure the data returned has all the filters applied
+ public Object[] getColumn(int col, int start, int end) {
+ rebuildDataSet();
+ return super.getColumn(col, start, end);
+ }
+
+ public Object[] getRow(int row) {
+ rebuildDataSet();
+ return super.getRow(row);
+ }
+
+ //public int getRowCount() - calls getEntryCount();
+
+ public Object[] getHistoricalData(String key, int col, int start, int end) {
+ rebuildDataSet();
+ return super.getHistoricalData(key, col, start, end);
+ }
+
+ public int getEntryCount() {
+ rebuildDataSet();
+ return super.getEntryCount();
+ }
+
+ public IDataEntry getEntry(int entry) {
+ rebuildDataSet();
+ return super.getEntry(entry);
+ }
+ //End overwrite to ensure the data returned has all the filters applied
+
+ //IFilteredDataSet Methods
+ public void addFilter(IDataSetFilter filter) {
+ filters.add(filter);
+ filtersChanged = true;
+ }
+
+ public boolean removeFilter(IDataSetFilter filter) {
+ filtersChanged = filters.remove(filter);
+ return filtersChanged;
+ }
+
+ public void clearFilters() {
+ filters.clear();
+ filtersChanged = true;
+ }
+
+ public IDataSetFilter[] getFilters() {
+ IDataSetFilter[] f = new IDataSetFilter[filters.size()];
+ filters.toArray(f);
+ return f;
+ }
+ //End IFilteredDataSet Methods
+
+ @SuppressWarnings("unchecked")
+ private void rebuildDataSet() {
+ IDataEntry top = original.getEntry(original.getEntryCount()-1);
+
+ if(filtersChanged || dataCount != original.getRowCount() || topData != top) {
+ dataCount = original.getRowCount();
+ topData = top;
+
+ ArrayList[] filterData = getFilterData();
+ for(int i=0; i<filters.size(); i++)
+ filterData = ((IDataSetFilter)filters.get(i)).filter(filterData);
+ setFilteredData(filterData);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private ArrayList[] getFilterData() {
+ ArrayList[] data = new ArrayList[original.getColCount()];
+ for(int i=0; i<data.length; i++)
+ data[i] = new ArrayList<Object>();
+
+ Object[] row;
+ for(int j,i=0; i<original.getRowCount(); i++) {
+ row = original.getRow(i);
+ for(j=0; j<data.length; j++)
+ data[j].add(row[j]);
+ }
+
+ return data;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void setFilteredData(ArrayList[] data) {
+ this.data = new ArrayList<IDataEntry>();
+
+ RowEntry entry;
+ Object[] row;
+ for(int j,i=0; i<data[0].size(); i++) {
+ row = new Object[data.length];
+ entry = new RowEntry();
+ for(j=0; j<data.length; j++)
+ row[j] = data[j].get(i);
+ entry.putRow(0, row);
+ this.data.add(entry);
+ }
+ }
+
+ private RowDataSet original;
+ private ArrayList<IDataSetFilter> filters;
+
+ private boolean filtersChanged;
+ private int dataCount;
+ private Object topData;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowDataSet.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowDataSet.java
new file mode 100644
index 0000000000..82d7d5ef11
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowDataSet.java
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IHistoricalDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.internal.Localization;
+
+
+
+public class RowDataSet implements IHistoricalDataSet {
+ //IDataSet Methods
+ public RowDataSet(String[] titles) {
+ this.titles = titles;
+ data = new ArrayList<IDataEntry>();
+ }
+
+ public void setData(IDataEntry entry) {
+ append(entry);
+ }
+
+ public void append(IDataEntry entry) throws ArrayIndexOutOfBoundsException {
+ RowEntry dataBlock = (RowEntry)entry;
+ if(dataBlock.getRow(null).length != this.getColCount())
+ throw new ArrayIndexOutOfBoundsException(Localization.getString("RowDataSet.ArraySizeMismatch") + dataBlock.getRow(null).length + " != " + this.getColCount());
+
+ data.add(entry);
+ }
+
+ public String[] getTitles() {
+ return titles;
+ }
+
+ public Object[] getColumn(int col) {
+ return getColumn(col, 0, getRowCount());
+ }
+
+ public Object[] getColumn(int col, int start, int end) {
+ return getHistoricalData(null, col, start, end);
+ }
+
+ public Object[] getRow(int row) {
+ IDataEntry entry = getEntry(row);
+ if(null != entry)
+ return entry.getRow(null);
+ return null;
+ }
+
+ public int getRowCount() {
+ return getEntryCount();
+ }
+
+ public int getColCount() {
+ if(null == titles)
+ return -1;
+ return titles.length;
+ }
+
+ public boolean readFromFile(File file) {
+ try {
+ FileReader fr = new FileReader(file);
+ BufferedReader br = new BufferedReader(fr);
+
+ br.readLine(); //Skip the ID
+ br.readLine(); //Skip the Titles
+ String line;
+ RowEntry entry;
+ while(null != (line = br.readLine())) {
+ entry = new RowEntry();
+ entry.putRow(0, line.split(", "));
+ append(entry);
+ }
+ return true;
+ } catch(FileNotFoundException fnfe) {
+ } catch(IOException ioe) {
+ } catch(ArrayIndexOutOfBoundsException aioobe) {}
+ return false;
+ }
+
+ public boolean writeToFile(File file) {
+ try {
+ file.createNewFile();
+ FileOutputStream fos = new FileOutputStream(file);
+ PrintStream ps = new PrintStream(fos);
+
+ String line = "";
+ Object[] dataRow;
+
+ //ID
+ ps.print(ID + "\n");
+
+ //Labels
+ int i, j;
+ for(i=0; i<titles.length; i++)
+ line += titles[i] + ", ";
+ ps.print(line + "\n");
+
+ //Data
+ for(i=0; i<getRowCount(); i++) {
+ dataRow = getRow(i);
+ line = "";
+ for(j=0; j<dataRow.length; j++)
+ line += dataRow[j].toString() + ", ";
+ ps.print(line + "\n");
+ }
+ return true;
+ } catch(FileNotFoundException e) {
+ } catch(IOException e) {}
+ return false;
+ }
+
+ public String getID() {
+ return ID;
+ }
+ //End IDataSet Methods
+
+ //IHistoricalDataSet Methods
+ public Object[] getHistoricalData(String key, int col) {
+ return getHistoricalData(key, col, 0, getRowCount());
+ }
+
+ public Object[] getHistoricalData(String key, int col, int start, int end) {
+ if(start > end || start < 0 || end > getRowCount() || col < COL_ROW_NUM || col >= this.getColCount())
+ return null;
+
+ if(COL_ROW_NUM == col) {
+ Integer[] rows = new Integer[Math.min(end-start, data.size())];
+ for(int i=0;i<rows.length; i++)
+ rows[i] = new Integer(start+i+1);
+ return rows;
+ }
+
+ Object[] d = new Object[Math.min(end-start, data.size())];
+
+ for(int i=0; i<d.length; i++)
+ d[i] = ((IDataEntry)data.get(start+i)).getColumn(col)[0];
+ return d;
+ }
+
+ public int getEntryCount() {
+ return data.size();
+ }
+
+ public boolean remove(IDataEntry entry) {
+ return data.remove(entry);
+ }
+
+ public boolean remove(int entry) {
+ if(entry < 0 || entry >= data.size())
+ return false;
+ return (null != data.remove(entry));
+ }
+
+ public IDataEntry getEntry(int entry) {
+ if(entry < 0 || entry >= getEntryCount())
+ return null;
+ else
+ return (IDataEntry)data.get(entry);
+ }
+ //End IHistoricalDataSet Methods
+
+ protected ArrayList<IDataEntry> data;
+ private String[] titles;
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.rowdataset";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowEntry.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowEntry.java
new file mode 100644
index 0000000000..f5d346d383
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowEntry.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+
+public class RowEntry implements IDataEntry {
+ public RowEntry() {
+ data = null;
+ }
+
+ public int getRowCount() {
+ if(null != data)
+ return 1;
+ return 0;
+ }
+
+ public int getColCount() {
+ return (null == data) ? 0 : data.length;
+ }
+
+ public Object get(String key, int col) {
+ return (0 <= col && col < getColCount()) ? data[col] : null;
+ }
+
+ public Object[] getRow(int row) {
+ if(0 == row)
+ return data;
+ return null;
+ }
+
+ public Object[] getRow(String key) {
+ return data;
+ }
+
+ public Object[] getColumn(int col) {
+ if(0 <= col && getColCount() > col)
+ return new Object[] {get(null, col)};
+ return null;
+ }
+
+ public Object[][] getData() {
+ return new Object[][] {getRow(null)};
+ }
+
+ public IDataEntry copy() {
+ RowEntry entry = new RowEntry();
+ if(null != data) {
+ entry.data = new Object[data.length];
+ System.arraycopy(data, 0, entry.data, 0, data.length);
+ }
+
+ return entry;
+ }
+
+ public void putRow(int row, Object[] data) {
+ if(0 == row)
+ this.data = data;
+ }
+
+ public boolean remove(int row) {
+ if(row == 0) {
+ data = null;
+ return true;
+ } else
+ return false;
+ }
+
+ private Object[] data;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowParser.java
new file mode 100644
index 0000000000..227d751bd3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/row/RowParser.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSetParser;
+import org.eclipse.ui.IMemento;
+
+
+
+public class RowParser implements IDataSetParser {
+ public RowParser(String[] regEx) {
+ this.regEx = regEx;
+ buildPattern();
+ }
+
+ public RowParser(IMemento source) {
+ IMemento[] children = source.getChildren(IDataSetParser.XMLSeries);
+ regEx = new String[children.length<<1];
+ for(int j=0; j<children.length; j++) {
+ regEx[j<<1] = children[j].getString(IDataSetParser.XMLparsingExpression);
+ regEx[(j<<1)+1] = children[j].getString(IDataSetParser.XMLparsingSpacer);
+ }
+ buildPattern();
+ }
+
+ private void buildPattern() {
+ StringBuilder wholeRegExpr = new StringBuilder();
+ for(int i=0; i<regEx.length; i++)
+ wholeRegExpr.append('(' + regEx[i] + ')');
+ wholePattern = Pattern.compile(wholeRegExpr.toString());
+ }
+
+ public IDataEntry parse(StringBuilder s) {
+ if(null == s)
+ return null;
+
+ RowEntry e = null;
+ Matcher wholeMatcher = wholePattern.matcher(s);
+
+ if(wholeMatcher.find()) {
+ e = new RowEntry();
+ Object[] data = new Object[regEx.length>>1];
+
+ int group=0, j;
+
+ for(int i=0; i<regEx.length; i++) {
+ group++;
+ for(j=0; j<regEx[i].length(); j++)
+ if(regEx[i].charAt(j) == ')')
+ group++;
+
+ if(0 == (i&1))
+ data[i>>1] = wholeMatcher.group(group);
+ }
+ e.putRow(0, data);
+ s.delete(0, wholeMatcher.end());
+ }
+
+ return e;
+ }
+
+ public boolean saveXML(IMemento target) {
+ target.putString(IDataSetParser.XMLdataset, RowDataSet.ID);
+ IMemento child2;
+ for(int i=0; i<regEx.length>>1; i++) {
+ child2 = target.createChild(IDataSetParser.XMLSeries);
+ child2.putString(IDataSetParser.XMLparsingExpression, regEx[i<<1]);
+ child2.putString(IDataSetParser.XMLparsingSpacer, regEx[(i<<1)+1]);
+ }
+ return true;
+ }
+
+ private String[] regEx;
+ private Pattern wholePattern;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/FilteredTableDataSet.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/FilteredTableDataSet.java
new file mode 100644
index 0000000000..67d3c6c30b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/FilteredTableDataSet.java
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IFilteredDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.IDataSetFilter;
+
+
+
+public class FilteredTableDataSet extends TableDataSet implements IFilteredDataSet {
+ public FilteredTableDataSet(TableDataSet data) {
+ super(data.getTitles());
+ original = data;
+ this.data = data.data;
+ filters = new ArrayList<IDataSetFilter>();
+
+ filtersChanged = false;
+ historical = false;
+ topData = null;
+ dataCount = data.getRowCount();
+ }
+
+ public FilteredTableDataSet(String[] titles) {
+ this(new TableDataSet(titles));
+ }
+
+ //Overwrite methods to insure data is removed from the original DataSet
+ public void append(IDataEntry entry) throws ArrayIndexOutOfBoundsException {
+ original.append(entry);
+ }
+
+ public boolean remove(IDataEntry entry) {
+ return original.remove(entry);
+ }
+
+ public boolean remove(int entry) {
+ return original.remove(entry);
+ }
+ //End overwrite methods to insure data is removed from the original DataSet
+
+ //Overwrite to ensure the data returned has all the filters applied
+ public Object[] getColumn(int col, int start, int end) {
+ rebuildDataSet();
+ return super.getColumn(col, start, end);
+ }
+
+ public Object[] getRow(int row) {
+ rebuildDataSet();
+ return super.getRow(row);
+ }
+
+ public int getRowCount() {
+ rebuildDataSet();
+ return super.getRowCount();
+ }
+
+ public Object[] getHistoricalData(String key, int col, int start, int end) {
+ return original.getHistoricalData(key, col, start, end);
+ //rebuildHistoricalDataSet();
+ //return super.getHistoricalData(key, col, start, end);
+ }
+
+ public int getEntryCount() {
+ return original.getEntryCount();
+ //rebuildHistoricalDataSet();
+ //return super.getEntryCount();
+ }
+
+ public IDataEntry getEntry(int entry) {
+ return original.getEntry(entry);
+ //rebuildHistoricalDataSet();
+ //return super.getEntry(entry);
+ }
+
+ public Object[][] getData() {
+ rebuildDataSet();
+ return super.getData();
+ }
+ //End overwrite to ensure the data returned has all the filters applied
+
+ //IFilteredDataSet Methods
+ public void addFilter(IDataSetFilter filter) {
+ filters.add(filter);
+ filtersChanged = true;
+ }
+
+ public boolean removeFilter(IDataSetFilter filter) {
+ filtersChanged = filters.remove(filter);
+ return filtersChanged;
+ }
+
+ public void clearFilters() {
+ filters.clear();
+ filtersChanged = true;
+ }
+
+ public IDataSetFilter[] getFilters() {
+ IDataSetFilter[] f = new IDataSetFilter[filters.size()];
+ filters.toArray(f);
+ return f;
+ }
+ //End IFilteredDataSet Methods
+
+ @SuppressWarnings("unchecked")
+ private void rebuildDataSet() {
+ IDataEntry top = original.getEntry(original.getEntryCount()-1);
+
+ if(filtersChanged || dataCount != original.getRowCount() || topData != top || historical) {
+ dataCount = original.getRowCount();
+ topData = top;
+ historical = false;
+
+ ArrayList[] filterData = getFilterData();
+ for(int i=0; i<filters.size(); i++)
+ filterData = ((IDataSetFilter)filters.get(i)).filter(filterData);
+ setFilteredData(filterData);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private ArrayList[] getFilterData() {
+ ArrayList[] data = new ArrayList[original.getColCount()];
+ for(int i=0; i<data.length; i++)
+ data[i] = new ArrayList();
+
+ Object[][] table = original.getData();
+ for(int j,i=0; i<original.getRowCount(); i++) {
+ for(j=0; j<data.length; j++)
+ data[j].add(table[i][j]);
+ }
+
+ return data;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void setFilteredData(ArrayList[] data) {
+ this.data = new ArrayList<TableEntry>();
+
+ TableEntry entry = new TableEntry();
+ Object[] row;
+ for(int j,i=0; i<data[0].size(); i++) {
+ row = new Object[data.length];
+ for(j=0; j<data.length; j++)
+ row[j] = data[j].get(i);
+ entry.add(row);
+ }
+ this.data.add(entry);
+ }
+
+ private TableDataSet original;
+ private ArrayList<IDataSetFilter> filters;
+
+ private boolean filtersChanged;
+ private int dataCount;
+ private Object topData;
+ private boolean historical;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableDataSet.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableDataSet.java
new file mode 100644
index 0000000000..05ae546d22
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableDataSet.java
@@ -0,0 +1,204 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IBlockDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IHistoricalDataSet;
+
+
+
+public class TableDataSet implements IHistoricalDataSet, IBlockDataSet {
+ public TableDataSet(String[] labels) {
+ if(null == labels)
+ this.titles = new String[0];
+ else {
+ this.titles = labels;
+ }
+ data = new ArrayList<TableEntry>();
+ }
+
+ //IDataSet Methods
+ public String[] getTitles() {
+ return titles;
+ }
+
+ public String getID() {
+ return ID;
+ }
+
+ public boolean readFromFile(File file) {
+ try {
+ FileReader fr = new FileReader(file);
+ BufferedReader br = new BufferedReader(fr);
+
+ br.readLine(); //Skip the ID
+ br.readLine(); //Skip the Titles
+ String line;
+ TableEntry entry = new TableEntry();
+ while(null != (line = br.readLine())) {
+ if(line.equals("")) {
+ append(entry);
+ entry = new TableEntry();
+ } else
+ entry.add(line.split(", "));
+ }
+ return true;
+ } catch(FileNotFoundException fnfe) {
+ } catch(IOException ioe) {
+ } catch(ArrayIndexOutOfBoundsException aioobe) {}
+ return false;
+ }
+
+ public boolean writeToFile(File file) {
+ try {
+ file.createNewFile();
+ FileOutputStream fos = new FileOutputStream(file);
+ PrintStream ps = new PrintStream(fos);
+ StringBuilder b = new StringBuilder();
+
+ //ID
+ b.append(ID + "\n");
+
+ //Labels
+ int i, j, k;
+ for(i=0; i<titles.length; i++)
+ b.append(titles[i] + ", ");
+ b.append("\n");
+
+ //Data
+ TableEntry e;
+ Object[] o;
+ for(i=0; i<data.size(); i++) {
+ e = (TableEntry)data.get(i);
+ for(j=0; j<e.getRowCount(); j++) {
+ o = e.getRow(j);
+ for(k=0; k<o.length; k++)
+ b.append(o[k].toString() + ", ");
+ b.append("\n");
+ }
+ b.append("\n");
+ }
+ ps.print(b.toString());
+ return true;
+ } catch(FileNotFoundException e) {
+ } catch(IOException e) {}
+ return false;
+ }
+
+ public int getRowCount() {
+ if(data.size() > 0)
+ return ((TableEntry)data.get(data.size()-1)).getRowCount();
+ else
+ return 0;
+ }
+
+ public int getColCount() {
+ return titles.length;
+ }
+
+ public Object[] getRow(int row) {
+ return ((TableEntry)data.get(data.size()-1)).getRow(row);
+ }
+
+ public Object[] getColumn(int col) {
+ return getColumn(col, 0, getRowCount());
+ }
+
+ public Object[] getColumn(int col, int start, int end) {
+ if(start > end || start < 0 || end > getEntryCount() || col < COL_ROW_NUM || col >= this.getColCount())
+ return null;
+ if(COL_ROW_NUM == col) {
+ Integer[] rows = new Integer[Math.min(end-start, getRowCount())];
+ for(int i=0;i<rows.length; i++)
+ rows[i] = new Integer(start+i+1);
+ return rows;
+ }
+ return ((TableEntry)data.get(data.size()-1)).getColumn(col, start, end);
+ }
+
+ public void setData(IDataEntry data) {
+ append(data);
+ }
+
+ public boolean remove(IDataEntry entry) {
+ return data.remove(entry);
+ }
+ //End IDataSet Methods
+
+ //IHistoricalDataSet Methods
+ public void append(IDataEntry data) {
+ if(data instanceof TableEntry)
+ this.data.add((TableEntry)data);
+ }
+
+ public Object[] getHistoricalData(String key, int col) {
+ return getHistoricalData(key, col, 0, getEntryCount());
+ }
+
+ public Object[] getHistoricalData(String key, int col, int start, int end) {
+ if(start > end || start < 0 || end > getEntryCount() || col < COL_ROW_NUM || col >= this.getColCount())
+ return null;
+
+ if(COL_ROW_NUM == col) {
+ Integer[] rows = new Integer[Math.min(end-start, data.size())];
+ for(int i=0;i<rows.length; i++)
+ rows[i] = new Integer(start+i+1);
+ return rows;
+ }
+
+ Object[] d = new Object[Math.min(end-start, getEntryCount())];
+
+ for(int i=0; i<d.length; i++) {
+ d[i] = getEntry(i+start).get(key, col);
+ if(null == d[i])
+ d[i] = new Integer(0);
+ }
+ return d;
+ }
+
+ public int getEntryCount() {
+ return data.size();
+ }
+
+ public IDataEntry getEntry(int entry) {
+ if(entry >=0 && entry < getEntryCount())
+ return (TableEntry)data.get(entry);
+ return null;
+ }
+
+ public boolean remove(int entry) {
+ if(entry < 0 || entry >= data.size())
+ return false;
+ return (null != data.remove(entry));
+ }
+ //End IHistoricalDataSet Methods
+
+ //IBlockDataSet Methods
+ public Object[][] getData() {
+ return ((TableEntry)data.get(getEntryCount()-1)).getData();
+ }
+ //End IBlockDataSet Methods
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.tabledataset";
+ protected ArrayList<TableEntry> data;
+ private String[] titles;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableEntry.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableEntry.java
new file mode 100644
index 0000000000..0011984166
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableEntry.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+
+
+
+public class TableEntry implements IDataEntry {
+ public TableEntry() {
+ bodyContent = new ArrayList<Object[]>();
+ }
+
+ public int getRowCount() {
+ return bodyContent.size();
+ }
+
+ public int getColCount() {
+ if(getRowCount() > 0) {
+ try {
+ return ((Object [])bodyContent.get(0)).length;
+ } catch(Exception cce) {}
+ }
+ return 0;
+ }
+
+ public Object get(String key, int col) {
+ if(col >= 0 && col < getColCount()) {
+ Object[] row = getRow(key);
+ if(null != row)
+ return row[col];
+ }
+ return null;
+ }
+
+ public Object[][] getData() {
+ Object[][] d = new Object[getRowCount()][getColCount()];
+ for(int i=0; i<getRowCount(); i++) {
+ d[i] = getRow(i);
+ }
+ return d;
+ }
+
+ public Object[] getRow(int row) {
+ if(row < 0 || row >= getRowCount())
+ return null;
+ return (Object[])bodyContent.get(row);
+ }
+
+ public Object[] getRow(String key) {
+ Object[] row;
+ for(int i=0; i<bodyContent.size(); i++) {
+ row = (Object[])bodyContent.get(i);
+ if(row[0].toString().equals(key))
+ return row;
+ }
+ return null;
+ }
+
+ public Object[] getColumn(int col) {
+ return getColumn(col, 0, getRowCount());
+ }
+
+ public Object[] getColumn(int col, int start, int end) {
+ if(0 <= col && getColCount() > col && start >=0 && end > start && end <= getRowCount()) {
+ Object[] res = new Object[Math.min(end-start, getRowCount())];
+ for(int i=0; i<res.length; i++)
+ res[i] = ((Object[])bodyContent.get(i+start))[col];
+ return res;
+ }
+ return null;
+ }
+
+ public void putRow(int row, Object[] data) {
+ if(row >= bodyContent.size())
+ add(data);
+ else if(row >= 0) {
+ bodyContent.add(row, data);
+ bodyContent.remove(row+1);
+ }
+ }
+
+ public void add(Object[] data) {
+ if(null != data && (data.length == getColCount() || getRowCount() == 0))
+ bodyContent.add(data);
+ }
+
+ public IDataEntry copy() {
+ TableEntry entry = new TableEntry();
+ for(int i=0; i<bodyContent.size(); i++)
+ entry.add((Object[])bodyContent.get(i));
+
+ return entry;
+ }
+
+ public boolean remove(int row) {
+ return (null != bodyContent.remove(row));
+ }
+
+ private ArrayList<Object[]> bodyContent; //ArrayList of arrays
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableParser.java
new file mode 100644
index 0000000000..217e37a54c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/datasets/table/TableParser.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSetParser;
+import org.eclipse.ui.IMemento;
+
+
+
+public class TableParser implements IDataSetParser {
+ public TableParser(String[] regEx, String delimiter) {
+ this.regEx = regEx;
+ this.delimiter = delimiter;
+ buildPattern();
+ }
+
+ public TableParser(IMemento source) {
+ IMemento[] children = source.getChildren(IDataSetParser.XMLSeries);
+ regEx = new String[children.length<<1];
+ for(int j=0; j<children.length; j++) {
+ regEx[j<<1] = children[j].getString(IDataSetParser.XMLparsingExpression);
+ regEx[(j<<1)+1] = children[j].getString(IDataSetParser.XMLparsingSpacer);
+ }
+ IMemento del = source.getChild(IDataSetParser.XMLDelimiter);
+ delimiter = del.getString(IDataSetParser.XMLparsingExpression);
+ buildPattern();
+ }
+
+ private void buildPattern() {
+ StringBuilder wholeRegExpr = new StringBuilder();
+ for(int i=0; i<regEx.length; i++)
+ wholeRegExpr.append('(' + regEx[i] + ')');
+ wholePattern = Pattern.compile(wholeRegExpr.toString());
+ delimPattern = Pattern.compile(delimiter);
+ }
+
+ public IDataEntry parse(StringBuilder s) {
+ if(null == s)
+ return null;
+
+ TableEntry e = null;
+
+ Matcher wholeMatcher = wholePattern.matcher(s);
+ Matcher delimMatcher = delimPattern.matcher(s);
+
+ Object[] data;
+ int end = 0;
+ if(delimMatcher.find()) {
+ e = new TableEntry();
+ end = delimMatcher.start();
+
+ int group, j;
+ while(wholeMatcher.find() && wholeMatcher.end() < end) {
+ group = 0;
+ data = new Object[regEx.length>>1];
+ for(int i=0; i<regEx.length; i++) {
+ group++;
+ for(j=0; j<regEx[i].length(); j++)
+ if(regEx[i].charAt(j) == ')')
+ group++;
+
+ if(0 == (i&1))
+ data[i>>1] = wholeMatcher.group(group);
+ }
+ e.add(data);
+ }
+ s.delete(0, delimMatcher.end());
+ }
+
+ return e;
+ }
+
+ public boolean saveXML(IMemento target) {
+ target.putString(IDataSetParser.XMLdataset, TableDataSet.ID);
+ IMemento child;
+ for(int i=0; i<regEx.length>>1; i++) {
+ child = target.createChild(IDataSetParser.XMLSeries);
+ child.putString(IDataSetParser.XMLparsingExpression, regEx[i<<1]);
+ child.putString(IDataSetParser.XMLparsingSpacer, regEx[(i<<1)+1]);
+ }
+ child = target.createChild(IDataSetParser.XMLDelimiter);
+ child.putString(IDataSetParser.XMLparsingExpression, delimiter);
+ return true;
+ }
+
+ private String[] regEx;
+ private String delimiter;
+
+ private Pattern wholePattern;
+ private Pattern delimPattern;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/IDataSetFilter.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/IDataSetFilter.java
new file mode 100644
index 0000000000..b30fca05e1
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/IDataSetFilter.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters;
+
+import java.util.ArrayList;
+
+import org.eclipse.ui.IMemento;
+
+public interface IDataSetFilter {
+ @SuppressWarnings("unchecked")
+ public ArrayList[] filter(ArrayList[] data);
+ public String getID();
+ public void writeXML(IMemento parent);
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/MatchFilter.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/MatchFilter.java
new file mode 100644
index 0000000000..121209d6b9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/MatchFilter.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.Copier;
+import org.eclipse.ui.IMemento;
+
+
+
+public class MatchFilter implements IDataSetFilter {
+ public MatchFilter(int column, Object value, int style) {
+ this.column = column;
+ this.value = value;
+ this.style = style;
+ }
+
+ /**
+ * Apply the MatchFilter to the passed dataset.
+ *
+ * @param data The dataset to filter.
+ *
+ * @return The filtered dataset.
+ */
+ @SuppressWarnings("unchecked")
+ public ArrayList[] filter(ArrayList[] data) {
+ if(column < 0 || column >= data.length)
+ return null;
+
+ ArrayList[] newData = Copier.copy(data);
+ boolean equals;
+ for(int j, i=newData[column].size()-1; i>=0; i--) {
+ equals = newData[column].get(i).toString().equals(value.toString()); //TODO: Find better equivilance method
+ if((equals && REMOVE_MATCHING == (style & 1)) || (!equals && KEEP_MATCHING == (style & 1))) {
+ for(j=0; j<newData.length; j++)
+ newData[j].remove(i);
+ }
+ }
+ return newData;
+ }
+
+ public String getID() {
+ return ID;
+ }
+
+ /**
+ * Preserve what filter was applied.
+ *
+ * @param parent Parent object of the new child Memento to create.
+ */
+ public void writeXML(IMemento parent) {
+ IMemento child = parent.createChild("Filter", ID);
+ child.putInteger("column", column);
+ child.putString("value", value.toString());
+ child.putInteger("style", style);
+ }
+
+ private int column;
+ private Object value;
+ private int style;
+
+ public static final int KEEP_MATCHING = 0;
+ public static final int REMOVE_MATCHING = 1;
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.MatchFilter";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/RangeFilter.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/RangeFilter.java
new file mode 100644
index 0000000000..25ea29d1e2
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/RangeFilter.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+import org.eclipse.linuxtools.systemtap.ui.structures.Copier;
+import org.eclipse.ui.IMemento;
+
+
+
+public class RangeFilter implements IDataSetFilter {
+ public RangeFilter(int column, Number lowerBound, Number upperBound, int style) {
+ this.column = column;
+ this.lowerBound = lowerBound;
+ this.upperBound = upperBound;
+ this.style = style;
+ }
+
+ /**
+ * Apply the RangeFilter to the passed dataset.
+ *
+ * @param data The dataset to filter.
+ *
+ * @return The filtered dataset.
+ */
+ @SuppressWarnings("unchecked")
+ public ArrayList[] filter(ArrayList[] data) {
+ if(column < 0 || column >= data.length)
+ return null;
+
+ ArrayList[] newData = Copier.copy(data);
+ for(int j,i=newData[column].size()-1; i>=0; i--) {
+ if(!inBounds(NumberType.obj2num(newData[column].get(i)))) {
+ for(j=0; j<newData.length; j++)
+ newData[j].remove(i);
+ }
+ }
+ return newData;
+ }
+
+ public String getID() {
+ return ID;
+ }
+
+ /**
+ * Verify that the number passed is in the bounds of the created filter.
+ *
+ * @param num The number to verify.
+ *
+ * @return True if the number is within bounds.
+ */
+ private boolean inBounds(Number num) {
+ if(INSIDE_BOUNDS == (style & 1)) {
+ if(INCLUSIVE == (style & 2)) {
+ if(num.doubleValue() > upperBound.doubleValue()
+ || num.doubleValue() < lowerBound.doubleValue())
+ return false;
+ } else {
+ if(num.doubleValue() >= upperBound.doubleValue()
+ || num.doubleValue() <= lowerBound.doubleValue())
+ return false;
+ }
+ }
+
+ if(OUTSIDE_BOUNDS == (style & 1)) {
+ if(INCLUSIVE == (style & 2)) {
+ if(num.doubleValue() < upperBound.doubleValue()
+ && num.doubleValue() > lowerBound.doubleValue())
+ return false;
+ } else {
+ if(num.doubleValue() <= upperBound.doubleValue()
+ && num.doubleValue() >= lowerBound.doubleValue())
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Preserve what filter was applied.
+ *
+ * @param parent Parent object of the new child Memento to create.
+ */
+ public void writeXML(IMemento parent) {
+ IMemento child = parent.createChild("Filter", ID);
+ child.putInteger("column", column);
+ child.putString("low", lowerBound.toString());
+ child.putString("high", upperBound.toString());
+ child.putInteger("style", style);
+ }
+
+ private int column;
+ private Number upperBound;
+ private Number lowerBound;
+ private int style;
+
+ public static final int INSIDE_BOUNDS = 0;
+ public static final int OUTSIDE_BOUNDS = 1;
+
+ public static final int INCLUSIVE = 2;
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.RangeFilter";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/SortFilter.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/SortFilter.java
new file mode 100644
index 0000000000..9cd9178c25
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/SortFilter.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+import org.eclipse.linuxtools.systemtap.ui.structures.Copier;
+import org.eclipse.linuxtools.systemtap.ui.structures.IndexedObject;
+import org.eclipse.linuxtools.systemtap.ui.structures.Sort;
+import org.eclipse.ui.IMemento;
+
+
+
+public class SortFilter implements IDataSetFilter {
+ public SortFilter(int column, int ordering) {
+ this.column = column;
+ this.style = (ordering==ASCENDING ? ASCENDING : DESCENDING);
+ }
+
+ /**
+ * Apply the RangeFilter to the passed dataset.
+ *
+ * @param data The dataset to filter.
+ *
+ * @return The filtered dataset.
+ */
+ @SuppressWarnings("unchecked")
+ public ArrayList[] filter(ArrayList[] data) {
+ if(column < 0 || column >= data.length)
+ return null;
+
+ ArrayList[] newData = Copier.copy(data);
+ IndexedObject[] items = new IndexedObject[newData[0].size()];
+
+ try {
+ for(int i=0; i<newData[column].size(); i++)
+ items[i] = new IndexedObject(i, NumberType.cleanObj2Num(newData[column].get(i)));
+ } catch(NumberFormatException nfe) {
+ for(int i=0; i<newData[column].size(); i++)
+ items[i] = new IndexedObject(i, newData[column].get(i));
+ }
+
+ Sort.quicksort(items, 0, items.length-1);
+
+ for(int j, i=0; i<newData.length; i++) {
+ for(j=0; j<items.length; j++) {
+ if(DESCENDING == style)
+ newData[i].add(newData[i].get(items[items.length-j-1].index));
+ else
+ newData[i].add(newData[i].get(items[j].index));
+ }
+ for(j=0; j<items.length; j++)
+ newData[i].remove(0);
+ }
+ return newData;
+ }
+
+ public String getID() {
+ return ID;
+ }
+
+ /**
+ * Preserve what filter was applied.
+ *
+ * @param parent Parent object of the new child Memento to create.
+ */
+ public void writeXML(IMemento parent) {
+ IMemento child = parent.createChild("Filter", ID);
+ child.putInteger("column", column);
+ child.putInteger("style", style);
+ }
+
+ private int column;
+ private int style;
+
+ public static final int ASCENDING = 0;
+ public static final int DESCENDING = 1;
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.SortFilter";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/UniqueFilter.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/UniqueFilter.java
new file mode 100644
index 0000000000..4a08d7469c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/filters/UniqueFilter.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters;
+
+import java.util.ArrayList;
+
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.IDataAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+import org.eclipse.linuxtools.systemtap.ui.structures.Copier;
+import org.eclipse.ui.IMemento;
+
+
+
+public class UniqueFilter implements IDataSetFilter {
+ public UniqueFilter(int column, IDataAggregate aggregate, int style) {
+ this.column = column;
+ this.aggregate = aggregate;
+ this.style = style;
+ }
+
+ /**
+ * Verify that the number passed is in the bounds of the created filter.
+ *
+ * @param num The number to verify.
+ *
+ * @return True if the number is within bounds.
+ */
+ @SuppressWarnings("unchecked")
+ public ArrayList[] filter(ArrayList[] data) {
+ if(column < 0 || column >= data.length)
+ return null;
+
+ ArrayList[] newData = Copier.copy(data);
+ ArrayList[] aggregates = new ArrayList[newData.length];
+ for(int i=0; i<aggregates.length;i++)
+ aggregates[i] = new ArrayList();
+
+ for(int k,j,i=newData[0].size()-1; i>=0; i--) {
+ for(j=i-1; j>=0; j--) {
+ if(newData[column].get(i).toString().equals(newData[column].get(j).toString())) { //TODO: Find better equivilance method
+ i--;
+ for(k=0; k<newData.length; k++) {
+ aggregates[k].add(newData[k].get(j));
+ newData[k].remove(j);
+ }
+ }
+ }
+ for(k=0; k<newData.length; k++) {
+ aggregates[k].add(newData[k].get(i));
+ if(k!=column) {
+ newData[k].remove(i);
+ try {
+ newData[k].add(i, aggregate.aggregate(NumberType.cleanObj2Num(aggregates[k].toArray())));
+ } catch(NumberFormatException nfe) {
+ newData[k].add(i, columnMerge(aggregates[k].toArray()));
+ }
+ }
+ aggregates[k].clear();
+ }
+ }
+ return newData;
+ }
+
+ /**
+ * Merges two passed columns into a StringBuilder object.
+ *
+ * @param col The columns to merge.
+ *
+ * @return The StringBuilder object made as a result of the merge.
+ */
+ private String columnMerge(Object[] col) {
+ StringBuilder sb = new StringBuilder(col[0].toString());
+ for(int i=1; i<col.length; i++) {
+ if(sb.indexOf(col[i].toString()) < 0)
+ sb.append("/" + col[i].toString());
+ }
+ return sb.toString();
+ }
+
+ public String getID() {
+ return ID;
+ }
+
+ /**
+ * Preserve what filter was applied.
+ *
+ * @param parent Parent object of the new child Memento to create.
+ */
+ public void writeXML(IMemento parent) {
+ IMemento child = parent.createChild("Filter", ID);
+ child.putInteger("column", column);
+ child.putString("aggregate", aggregate.getID());
+ child.putInteger("style", style);
+ }
+
+ private int column;
+ private IDataAggregate aggregate;
+ private int style;
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.UniqueFilter";
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/GraphingAPINonUIPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/GraphingAPINonUIPlugin.java
new file mode 100644
index 0000000000..06e36a97ba
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/GraphingAPINonUIPlugin.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.internal;
+
+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 GraphingAPINonUIPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static GraphingAPINonUIPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public GraphingAPINonUIPlugin() {
+ 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 GraphingAPINonUIPlugin 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.graphingapi.nonui", path);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/Localization.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/Localization.java
new file mode 100644
index 0000000000..6250f6f872
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/Localization.java
@@ -0,0 +1,22 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Localization {
+ private static final String BUNDLE_NAME = "org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.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.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/localization.properties
new file mode 100644
index 0000000000..fb17d5caa3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/internal/localization.properties
@@ -0,0 +1,5 @@
+ScrollAdapter.RowNum=Row Num
+
+BlockAdapter.RowNum=Row Num
+
+RowDataSet.ArraySizeMismatch=Array size mismatch
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/ChartStreamDaemon.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/ChartStreamDaemon.java
new file mode 100644
index 0000000000..c5f4f86bdc
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/ChartStreamDaemon.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataEntry;
+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.structures.listeners.IGobblerListener;
+
+
+
+public class ChartStreamDaemon implements IGobblerListener {
+ public ChartStreamDaemon(IDataSet d, IDataSetParser p) {
+ data = d;
+ outputData = new StringBuilder("");
+ parser = p;
+ disposed = false;
+ }
+
+ /**
+ * Takes one line from the output data and appends it to data object.
+ */
+ protected void pushData() {
+ if(null == data || null == parser)
+ return;
+
+ IDataEntry e = parser.parse(outputData);
+ if(null != e)
+ data.setData(e);
+ }
+
+ public void handleDataEvent(String line) {
+ outputData.append(line);
+ this.pushData();
+ }
+
+ public boolean isDisposed() {
+ return disposed;
+ }
+
+ public void dispose() {
+ if(!disposed) {
+ disposed = true;
+ data = null;
+ if(null != outputData)
+ outputData.delete(0, outputData.length());
+ outputData = null;
+ parser = null;
+ }
+ }
+
+ protected IDataSet data;
+ protected StringBuilder outputData;
+ protected IDataSetParser parser;
+ private boolean disposed;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/ChartStreamDaemon2.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/ChartStreamDaemon2.java
new file mode 100644
index 0000000000..e31b27fb95
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/ChartStreamDaemon2.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures;
+
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSetParser;
+
+
+/**
+ * Listens for data events and populates the internal <code>DataSet</code> with the data
+ * that was received and matched the regExpr
+ * @author Ryan Morse
+ */
+public class ChartStreamDaemon2 extends ChartStreamDaemon {
+ public ChartStreamDaemon2(ScriptConsole console, IDataSet d, IDataSetParser p) {
+ super(d, p);
+
+ }
+
+ /**
+ * Changes the internal <code>DataSet</code> and parsing expression.
+ * @param d The new <code>DataSet</code> to store the parsed output.
+ * @param regExpr String[] containing the RegEx patterns to match against.
+ */
+ public void setParser(IDataSet d, IDataSetParser p) {
+ data = d;
+ parser = p;
+ if(0 != outputData.length())
+ outputData.delete(0, outputData.length()-1);
+ outputData.append(console.getOutput());
+ }
+
+ /**
+ * Disposes of all the internal data.
+ */
+ public void dispose() {
+ if(!isDisposed()) {
+ super.dispose();
+ console = null;
+ }
+ }
+
+ private ScriptConsole console;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/DataPoint.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/DataPoint.java
new file mode 100644
index 0000000000..6074f0cfd9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/DataPoint.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures;
+
+public class DataPoint {
+ public DataPoint() {
+ this(0, 0);
+ }
+
+ public DataPoint(double x, double y) {
+ this.x = x;
+ this.y = y;
+ }
+
+ public double x;
+ public double y;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/GraphData.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/GraphData.java
new file mode 100644
index 0000000000..fc81a838a4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/GraphData.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures;
+
+public class GraphData {
+ public int xSeries;
+ public int[] ySeries;
+ public String key;
+ public String graphID;
+ public String title;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/NumberType.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/NumberType.java
new file mode 100644
index 0000000000..5e19408ce5
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/nonui/structures/NumberType.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures;
+
+public final class NumberType {
+
+ /**
+ * Returns a new instance of the passed in num of type orig.
+ *
+ * @param orig The desired datatype.
+ * @param num The number to replicate.
+ *
+ * @return The new cast number.
+ */
+ public static Number getNumber(Number orig, double num) {
+ if(orig instanceof Long)
+ return new Long((long)num);
+ else if(orig instanceof Double)
+ return new Double(num);
+ else if(orig instanceof Float)
+ return new Float((float)num);
+ else if(orig instanceof Byte)
+ return new Byte((byte)num);
+ else if(orig instanceof Short)
+ return new Short((short)num);
+ return new Integer((int)num);
+ }
+
+ /**
+ * Takes an array of objects and returns an array of Numbers.
+ *
+ * @param o The array of objects to convert.
+ *
+ * @return The array of Numbers from o.
+ */
+ public static Number[] obj2num(Object[] o) {
+ Number[] arr = new Number[o.length];
+ for(int i = 0; i < o.length; i++)
+ arr[i] = obj2num(o[i]);
+
+ return arr;
+ }
+
+ /**
+ * Takes an array of Numbers and returns an array of objects.
+ *
+ * @param o The array of Numbers to convert.
+ *
+ * @return The array of objects from o.
+ */
+ public static Number obj2num(Object o) {
+ Number n = null;
+
+ try {
+ n = cleanObj2Num(o);
+ } catch(NumberFormatException e ) {
+ n = new Long(0);
+ }
+ return n;
+ }
+
+ /**
+ * Returns an array of Numbers type if they are Numbers, otherwise, returns Doubles and Longs as appropriate
+ * based on whether or not it has a '.'
+ *
+ * @param o The object array to clean.
+ *
+ * @return The Number array cleaned.
+ */
+ public static Number[] cleanObj2Num(Object[] o) throws NumberFormatException {
+ Number[] arr = new Number[o.length];
+ for(int i = 0; i < o.length; i++)
+ arr[i] = cleanObj2Num(o[i]);
+
+ return arr;
+ }
+
+ /**
+ * Returns a Number type if its a Number, otherwise, returns Doubles and Longs as appropriate
+ * based on whether or not it has a '.'
+ *
+ * @param o The object to clean.
+ *
+ * @return The Number object cleaned.
+ */
+ public static Number cleanObj2Num(Object o) throws NumberFormatException {
+ if(o instanceof Number)
+ return (Number)o;
+ else {
+ if(o.toString().contains("."))
+ return new Double(Double.parseDouble(o.toString()));
+ else
+ return new Long(Long.parseLong(o.toString()));
+ }
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.project
new file mode 100644
index 0000000000..688d7e359d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.graphingapi.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.settings/org.eclipse.jdt.core.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..9e7431cd31
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Fri Feb 27 18:15:25 IST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/ChangeLog
new file mode 100644
index 0000000000..9c2ebd1f0b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/ChangeLog
@@ -0,0 +1,11 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * ChangeLog: Refactoring. Renaming all packages directories from *.systemtapgui.* to *.systemtap.ui.* \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..61d6d8f1c8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: GraphingAPI UI Plug-in
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.graphingapi.ui;singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.GraphingAPIUIPlugin
+Bundle-Vendor: Eclipse
+Bundle-Localization: plugin
+Export-Package:
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.datadisplay,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.graph
+Require-Bundle: org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui;visibility:=reexport,
+ org.eclipse.linuxtools.systemtap.ui.structures,
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.forms
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/build.properties
new file mode 100644
index 0000000000..c88359b87e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/,\
+ plugin.properties
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/BarGraph.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/BarGraph.gif
new file mode 100644
index 0000000000..b396c353b4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/BarGraph.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/LineGraph.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/LineGraph.gif
new file mode 100644
index 0000000000..2a09ccf943
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/LineGraph.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/PieChart.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/PieChart.gif
new file mode 100644
index 0000000000..d9e7b13ce1
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/PieChart.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/ScatterGraph.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/ScatterGraph.gif
new file mode 100644
index 0000000000..3542e06835
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/icons/graphs/ScatterGraph.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/plugin.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/plugin.properties
new file mode 100644
index 0000000000..1c7f6fbc11
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/plugin.properties
@@ -0,0 +1,3 @@
+preference.graphing.name=GraphingAPI
+preference.dataTable.name=Data Table
+preference.graph.name=Graph
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/plugin.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/plugin.xml
new file mode 100644
index 0000000000..10c8211584
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/plugin.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="%preference.graphing.name"
+ id="com.qualityeclipse.generic.prefs.graphingapi"
+ class="org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences.GraphingAPIPreferencePage"/>
+ <page
+ name="%preference.dataTable.name"
+ id="com.qualityeclipse.generic.prefs.graphing.datatable"
+ class="org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences.DataTablePreferencePage"
+ category="com.qualityeclipse.generic.prefs.graphingapi"/>
+ <page
+ name="%preference.graph.name"
+ id="com.qualityeclipse.generic.prefs.graphing.graph"
+ class="org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences.GraphPreferencePage"
+ category="com.qualityeclipse.generic.prefs.graphingapi"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences.PreferenceInitializer"/>
+ </extension>
+</plugin>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/datadisplay/DataGrid.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/datadisplay/DataGrid.java
new file mode 100644
index 0000000000..cd4e9bb2a2
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/datadisplay/DataGrid.java
@@ -0,0 +1,344 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.datadisplay;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IFilteredDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.IDataSetFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.GraphingAPIUIPlugin;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences.GraphingAPIPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset.DataSetFactory;
+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.structures.IFormattingStyles;
+import org.eclipse.linuxtools.systemtap.ui.structures.StringFormatter;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IUpdateListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+
+
+
+public class DataGrid implements IUpdateListener {
+ public DataGrid(Composite composite, IDataSet set, int style) {
+ prefs = GraphingAPIUIPlugin.getDefault().getPreferenceStore();
+ manualResize = !prefs.getBoolean(GraphingAPIPreferenceConstants.P_AUTO_RESIZE);
+
+ dataSet = set;
+ filteredDataSet = (dataSet instanceof IFilteredDataSet)
+ ? (IFilteredDataSet)dataSet
+ : DataSetFactory.createFilteredDataSet(dataSet);
+ this.style = style;
+ clickLocation = new Point(-1, -1);
+ removedItems = 0;
+ createPartControl(composite);
+ }
+
+ public void setLayoutData(Object data) {
+ table.setLayoutData(data);
+ }
+
+ public IDataSet getDataSet() { return dataSet; }
+ public Control getControl() { return table; }
+
+ public void createPartControl(Composite parent) {
+ table = new Table(parent, SWT.SINGLE | SWT.FULL_SELECTION);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ table.getVerticalBar().setVisible(true);
+
+ String[] names = dataSet.getTitles();
+ TableColumn column = new TableColumn(table, SWT.LEFT);
+ column.setText(Localization.getString("DataGrid.Row"));
+ column.pack();
+ column.setMoveable(false);
+ column.setResizable(false);
+
+ columnFormat = new IFormattingStyles[names.length];
+ for(int i=0; i<names.length; i++) {
+ column = new TableColumn(table, SWT.LEFT);
+ column.setText(names[i]);
+ column.pack();
+ column.setMoveable(true);
+
+ columnFormat[i] = new StringFormatter();
+ }
+
+ table.setMenu(this.initMenus());
+
+ table.addListener(SWT.MouseDown, new Listener() {
+ public void handleEvent(Event event) {
+ clickLocation.x = event.x;
+ clickLocation.y = event.y;
+ }
+ });
+ handleUpdateEvent();
+ }
+
+ public Menu initMenus() {
+ Menu menu = new Menu(table.getShell(), SWT.POP_UP);
+ menu.addMenuListener(new MainMenuListener());
+
+ Menu formatMenu = new Menu(menu);
+ MenuItem item = new MenuItem(menu, SWT.CASCADE);
+ item.setText(Localization.getString("DataGrid.FormatAs"));
+ item.setMenu(formatMenu);
+
+ //if(dataSet instanceof IFilteredDataSet) {
+ filterMenu = new Menu(menu);
+ item = new MenuItem(menu, SWT.CASCADE);
+ item.setText(Localization.getString("DataGrid.AddFilter"));
+ item.addSelectionListener(new AddFilterSelection());
+
+ item = new MenuItem(menu, SWT.CASCADE);
+ item.setText(Localization.getString("DataGrid.RemoveFilter"));
+ item.setMenu(filterMenu);
+
+ IDataSetFilter[] filters = filteredDataSet.getFilters();
+ if(null != filters) {
+ for(int i=0; i<filters.length; i++) {
+ item = new MenuItem(filterMenu, SWT.CASCADE);
+ item.setText(AvailableFilterTypes.getFilterName(filters[i].getID()));
+ item.setData(filters[i]);
+ item.addSelectionListener(new RemoveFilterSelection());
+ }
+ }
+ //}
+
+ item = new MenuItem(menu, SWT.CHECK);
+ item.setText(Localization.getString("DataGrid.ManualyResize"));
+ item.addSelectionListener(new MenuManualyResizedSelection());
+
+ for(int i=0; i<IFormattingStyles.FORMAT_TITLES.length; i++) {
+ item = new MenuItem(formatMenu, SWT.RADIO);
+ item.setText(IFormattingStyles.FORMAT_TITLES[i]);
+ item.addSelectionListener(new MenuFormatSelection());
+ }
+
+ formatMenu.addMenuListener(new FormatMenuListener());
+ return menu;
+ }
+
+ private int getSelectedColumn() {
+ TableColumn[] cols = table.getColumns();
+ int location = 0;
+ for(int i=0; i<cols.length; i++)
+ if(clickLocation.x > location && clickLocation.x < (location+=cols[i].getWidth()))
+ return i;
+
+ return cols.length-1;
+ }
+
+ public class MainMenuListener implements MenuListener {
+ public void menuHidden(MenuEvent e) {}
+
+ public void menuShown(MenuEvent e) {
+ MenuItem item = ((Menu)e.widget).getItem(1);
+ item.setSelection(manualResize);
+ }
+ }
+
+ public class MenuManualyResizedSelection implements SelectionListener {
+ public void widgetSelected(SelectionEvent e) {
+ manualResize = !manualResize;
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ }
+
+ public class AddFilterSelection implements SelectionListener {
+ public void widgetSelected(SelectionEvent e) {
+ SelectFilterWizard wizard = new SelectFilterWizard(dataSet.getTitles());
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ wizard.init(workbench, null);
+ WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard);
+ dialog.create();
+ dialog.open();
+
+ IDataSetFilter filter = wizard.getFilter();
+ wizard.dispose();
+
+ if(null != filter) {
+ filteredDataSet.addFilter(filter);
+ table.removeAll();
+ handleUpdateEvent();
+
+ MenuItem item = new MenuItem(filterMenu, SWT.CASCADE);
+ item.setText(AvailableFilterTypes.getFilterName(filter.getID()));
+ item.setData(filter);
+ item.addSelectionListener(new RemoveFilterSelection());
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ }
+
+ public class RemoveFilterSelection implements SelectionListener {
+ public void widgetSelected(SelectionEvent e) {
+ IDataSetFilter idsf = (IDataSetFilter)((MenuItem)e.widget).getData();
+ e.widget.dispose();
+
+ if(filteredDataSet.removeFilter(idsf)) {
+ table.removeAll();
+ handleUpdateEvent();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ }
+
+ public class FormatMenuListener implements MenuListener {
+ public void menuHidden(MenuEvent e) {}
+
+ public void menuShown(MenuEvent e) {
+ MenuItem[] items = ((Menu)e.widget).getItems();
+ boolean doubleValid = false, longValid = false;
+ String itemText;
+
+ int selectedCol = Math.max(1, getSelectedColumn());
+
+ for(int i=0; i<items.length; i++)
+ items[i].setSelection(false);
+ items[columnFormat[selectedCol-1].getFormat()].setSelection(true);
+
+ itemText = dataSet.getRow(0)[selectedCol-1].toString();
+ items[IFormattingStyles.UNFORMATED].setEnabled(true);
+ items[IFormattingStyles.STRING].setEnabled(true);
+
+ try {
+ Double.parseDouble(itemText);
+ doubleValid = true;
+
+ try {
+ Long.parseLong(itemText);
+ longValid = true;
+ } catch(NumberFormatException nfe2) {}
+ } catch(NumberFormatException nfe) {}
+
+ items[IFormattingStyles.DOUBLE].setEnabled(doubleValid);
+ items[IFormattingStyles.HEX].setEnabled(longValid);
+ items[IFormattingStyles.OCTAL].setEnabled(longValid);
+ items[IFormattingStyles.BINARY].setEnabled(longValid);
+ items[IFormattingStyles.DATE].setEnabled(longValid);
+ }
+ }
+
+ public class MenuFormatSelection implements SelectionListener {
+ public void widgetSelected(SelectionEvent e) {
+ int format = IFormattingStyles.UNFORMATED;
+ int column = Math.max(1, getSelectedColumn());
+ int i;
+ for(i=0; i<IFormattingStyles.FORMAT_TITLES.length; i++)
+ if(IFormattingStyles.FORMAT_TITLES[i].equals(((MenuItem)e.getSource()).getText()))
+ format = i;
+
+ Object[] data = dataSet.getColumn(column-1);
+ columnFormat[column-1].setFormat(format);
+ for(i=0; i<table.getItemCount(); i++)
+ table.getItem(i).setText(column, columnFormat[column-1].format(data[i].toString()));
+ table.redraw();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ }
+
+ public void handleUpdateEvent() {
+ if(table.isDisposed()) return;
+
+ table.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ TableItem item;
+ int startLocation, endLocation = filteredDataSet.getRowCount();
+
+ if(FULL_UPDATE == (style & FULL_UPDATE)) {
+ //Remove extra items so save memory.
+ removedItems += table.getItemCount();
+ table.removeAll();
+ startLocation = 0;
+ } else {
+ startLocation = table.getItemCount()+removedItems;
+ }
+
+ //Add all the new items to the table
+ Object[] os;
+ for(int j,i=startLocation; i<endLocation; i++) {
+ item = new TableItem(table, SWT.NONE);
+ os = filteredDataSet.getRow(i);
+
+ item.setText(0, "" + i);
+ for(j=0; j<os.length; j++)
+ item.setText(j+1, columnFormat[j].format(os[j].toString()));
+ }
+
+ if(FULL_UPDATE != (style & FULL_UPDATE)) {
+ //Remove extra items so save memory.
+ if(table.getItemCount() > prefs.getInt(GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS)) {
+ int items = table.getItemCount()-prefs.getInt(GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS);
+ table.remove(0, items-1);
+ removedItems += items;
+ }
+ }
+
+ //Resize the columns
+ TableColumn col = table.getColumn(0);
+ col.pack();
+ if(!manualResize) {
+ TableColumn[] cols = table.getColumns();
+ for(int i=1; i<cols.length; i++)
+ cols[i].pack();
+ }
+ //Use if we want to set focus to newly added item
+ if(prefs.getBoolean(GraphingAPIPreferenceConstants.P_JUMP_NEW_TABLE_ENTRY))
+ table.showItem(table.getItem(table.getItemCount()-1));
+ }
+ });
+ }
+
+ public void dispose() {
+ dataSet = null;
+ table.dispose();
+ table = null;
+ clickLocation = null;
+ columnFormat = null;
+ }
+
+ protected IDataSet dataSet;
+ protected IFilteredDataSet filteredDataSet;
+ protected IFormattingStyles columnFormat[];
+ protected int removedItems;
+ protected Table table;
+ protected Point clickLocation;
+ protected IPreferenceStore prefs;
+ protected boolean manualResize;
+ protected Menu filterMenu;
+ protected int style;
+
+ public static final int NONE = 0;
+ public static final int FULL_UPDATE = 1;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/AChart.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/AChart.java
new file mode 100644
index 0000000000..ba04aae690
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/AChart.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs;
+
+import java.util.LinkedList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.IGraphColorConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters.IAdapter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphCanvas;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphComposite;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphLabel;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphLegend;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IUpdateListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.widgets.Button;
+
+
+
+public abstract class AChart extends GraphCanvas implements IGraph, IUpdateListener {
+ public AChart(GraphComposite parent, int style, String title, IAdapter adapt) {
+ super(parent, style);
+ adapter = adapt;
+
+ elementList = new LinkedList[adapt.getSeriesCount()];
+ for(int i=0; i<elementList.length; i++)
+ elementList[i] = new LinkedList<Object>();
+
+ createLegend();
+ createTitle(title);
+
+ this.addPaintListener(paintListener);
+
+ parent.addCheckOption(Localization.getString("AChart.Title"), titleListener);
+ parent.addCheckOption(Localization.getString("AChart.Legend"), legendListener);
+ }
+
+ protected void createTitle(String title) {
+ this.title = new GraphLabel(this, title, this, 0.1f, SWT.BOLD);
+ }
+
+ protected void createLegend() {
+ String[] labels = adapter.getLabels();
+ String[] labels2 = new String[labels.length-1];
+ Color[] colors = new Color[labels2.length];
+
+ for(int i=0; i<labels2.length; i++) {
+ labels2[i] = labels[i+1];
+ colors[i] = new Color(this.getDisplay(), IGraphColorConstants.COLORS[i]);
+ }
+
+ legend = new GraphLegend(this, labels2, colors);
+ }
+
+ protected void paintAll(GC gc) {
+ paintElementList(gc);
+ if(showLegend && legend != null)
+ legend.paint(gc);
+ if(showTitle && title != null)
+ title.paint(gc);
+ }
+
+ public void dispose() {
+ this.removePaintListener(paintListener);
+ parent.removeCheckOption(Localization.getString("AChart.Title"));
+ parent.removeCheckOption(Localization.getString("AChart.Legend"));
+
+ legendListener = null;
+ titleListener = null;
+
+ super.dispose();
+ }
+
+ /*
+ * Listeners are below:
+ * paintListener - A PaintListener for making sure everything is drawn
+ * titleListener - A SelectionListener for the title button
+ * legendListener - A SelectionListener for the legend checkbox
+ */
+ private final PaintListener paintListener = new PaintListener() {
+ public void paintControl(PaintEvent e) {
+ paintAll(e.gc);
+ }
+ };
+
+ private SelectionListener titleListener = new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ public void widgetSelected(SelectionEvent e) {
+ showTitle = ((Button)e.getSource()).getSelection();
+ repaint();
+ }
+ };
+
+ private SelectionListener legendListener = new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ public void widgetSelected(SelectionEvent e) {
+ showLegend = ((Button)e.getSource()).getSelection();
+ repaint();
+ }
+ };
+
+ public abstract boolean isMultiGraph();
+ public abstract void handleUpdateEvent();
+ public abstract void paintElementList(GC gc);
+
+ protected GraphComposite parent;
+ protected GraphLegend legend;
+ protected GraphLabel title;
+ @SuppressWarnings("unchecked")
+ protected LinkedList[] elementList;
+
+ public boolean showTitle, showLegend;
+
+ private IAdapter adapter;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/AGraph.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/AGraph.java
new file mode 100644
index 0000000000..dbf2519d47
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/AGraph.java
@@ -0,0 +1,241 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs;
+
+import java.util.LinkedList;
+
+import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
+import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.IGraphColorConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters.IAdapter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.DataPoint;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.GraphingAPIUIPlugin;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences.GraphingAPIPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphAxis;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphAxis2;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphComposite;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Button;
+
+
+
+public abstract class AGraph extends AChart implements IGraph {
+ public AGraph(GraphComposite parent, int style, String title, IAdapter adapt) {
+ super(parent, style, title, adapt);
+ adapter = adapt;
+ axes = new LinkedList<GraphAxis>();
+
+ IPreferenceStore store = GraphingAPIUIPlugin.getDefault().getPreferenceStore();
+ xSeriesTicks = store.getInt(GraphingAPIPreferenceConstants.P_X_SERIES_TICKS);
+ ySeriesTicks = store.getInt(GraphingAPIPreferenceConstants.P_Y_SERIES_TICKS);
+ maxItems = store.getInt(GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS);
+ viewableItems = store.getInt(GraphingAPIPreferenceConstants.P_VIEWABLE_DATA_ITEMS);
+
+ createAxis(Localization.getString("AGraph.xAxis"), xSeriesTicks, GraphAxis.HORIZONTAL);
+ createAxis(Localization.getString("AGraph.yAxis"), ySeriesTicks, GraphAxis.VERTICAL);
+
+ GraphingAPIUIPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(propertyChangeListener);
+
+ parent.addCheckOption(Localization.getString("AGraph.GridLines"), gridListener);
+ if(adapter.getSeriesCount() > 1)
+ parent.addCheckOption(Localization.getString("AGraph.Normalize"), normalizeListener);
+ }
+
+ protected void createAxis(String title, int tickCount, int style) {
+ axes.add(new GraphAxis(this, title, tickCount, style));
+ }
+
+ protected void createAxis2(String title, int tickCount, int style) {
+ axes.add(new GraphAxis2(this, title, tickCount, style, this.axisColor));
+ }
+
+ //******************************************************Please remove
+ public Rectangle getArea(int items) {
+ int uBound = elementList[0].size();
+ int lBound = (uBound > items) ? (uBound-items) : 0;
+
+ int maxX = Integer.MIN_VALUE;
+ int minX = Integer.MAX_VALUE;
+ int maxY = Integer.MIN_VALUE;
+ int minY = Integer.MAX_VALUE;
+
+ DataPoint p;
+ Object o;
+
+ //System.out.println("defaults:" + minX + " " + minY + " " + maxX + " " + maxY);
+
+ for(int j=0; j<elementList.length; j++) {
+ for(int i=lBound; i<uBound; i++) {
+ o = elementList[j].get(i);
+ p = (DataPoint)o;
+ if(p.x < minX) minX = (int)p.x;
+ if(p.x > maxX) maxX = (int)p.x;
+ if(p.y < minY) minY = (int)p.y;
+ if(p.y > maxY) maxY = (int)p.y;
+ }
+ }
+
+ //This is to attempt to keep the data series a constant width apart
+ //if(uBound < viewableItems && adapter instanceof ScrollAdapter)
+ //minX = maxX - (int)(((maxX-minX)/(uBound-1.0))*(viewableItems-1));
+
+
+ return new Rectangle(minX, minY, maxX-minX, maxY-minY);
+ }
+
+ private synchronized void rebound() {
+ getDisplay().syncExec(new Runnable() {
+ boolean stop = false;
+ public void run() {
+ if(stop) return;
+ try {
+ setGlobalArea(getArea(maxItems));
+ setLocalArea(getArea(viewableItems));
+ } catch (Exception e) {
+ stop = true;
+ }
+ }
+ });
+ }
+
+ public synchronized void repaint() {
+ rebound();
+ super.repaint();
+ }
+ //*******************************************************End remove
+
+
+ /**
+ * Sets the category axis that is displayed to the axis belonging to the input series index.
+ * @param series Series to display the axis for.
+ */
+ public void addSeriesAxis(int series) {
+ if(selectedSeries != (series+1)) {
+ removeSeriesAxis();
+ seriesAxis = new GraphAxis2(this, Localization.getString("AGraph.SeriesAxis"), ySeriesTicks,
+ GraphAxis2.ALIGN_RIGHT |
+ GraphAxis2.HIDE_GRID_LINES |
+ GraphAxis2.UNNORMALIZED |
+ GraphAxis2.HIDE_TITLE,
+ new Color(this.getDisplay(), IGraphColorConstants.COLORS[series]));
+ selectedSeries = series+1;
+ axes.add(seriesAxis);
+ this.repaint();
+ }
+ }
+
+ /**
+ * Removes the series axis from the graph.
+ */
+ public void removeSeriesAxis() {
+ if(null != seriesAxis) {
+ axes.remove(seriesAxis);
+ seriesAxis = null;
+ selectedSeries = -1;
+ this.repaint();
+ }
+ }
+
+ protected void paintAll(GC gc) {
+ for(int i = 0; i < axes.size(); i++)
+ ((GraphAxis)axes.get(i)).paint(gc);
+ super.paintAll(gc);
+ }
+
+ public void dispose() {
+ GraphingAPIUIPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(propertyChangeListener);
+
+ parent.removeCheckOption(Localization.getString("AGraph.Normalize"));
+ parent.removeCheckOption(Localization.getString("AGraph.GridLines"));
+
+ normalizeListener = null;
+ gridListener = null;
+
+ parent = null;
+
+ super.dispose();
+ }
+
+ /*
+ * Listeners are below:
+ * gridListener - A SelectionListener for the Grid checkbox
+ * normalizeListener - A SelectionListener for the normalization checkbox
+ * propertyChangeListener - Detects changes in user preferences and applies them
+ */
+ private final IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ IPreferenceStore store = GraphingAPIUIPlugin.getDefault().getPreferenceStore();
+ if(event.getProperty().equals(GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS))
+ maxItems = store.getInt(GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS);
+ else if(event.getProperty().equals(GraphingAPIPreferenceConstants.P_VIEWABLE_DATA_ITEMS))
+ viewableItems = store.getInt(GraphingAPIPreferenceConstants.P_VIEWABLE_DATA_ITEMS);
+ else if(event.getProperty().equals(GraphingAPIPreferenceConstants.P_X_SERIES_TICKS)) {
+ xSeriesTicks = store.getInt(GraphingAPIPreferenceConstants.P_X_SERIES_TICKS);
+ GraphAxis a;
+ for(int i=0; i<axes.size(); i++) {
+ a = ((GraphAxis)axes.get(i));
+ if(GraphAxis.HORIZONTAL == a.getType())
+ a.setTickCount(xSeriesTicks);
+ }
+ } else if(event.getProperty().equals(GraphingAPIPreferenceConstants.P_Y_SERIES_TICKS)) {
+ ySeriesTicks = store.getInt(GraphingAPIPreferenceConstants.P_Y_SERIES_TICKS);
+ GraphAxis a;
+ for(int i=0; i<axes.size(); i++) {
+ a = ((GraphAxis)axes.get(i));
+ if(GraphAxis.VERTICAL == a.getType())
+ a.setTickCount(ySeriesTicks);
+ }
+ } else if(event.getProperty().equals(GraphingAPIPreferenceConstants.P_SHOW_GRID_LINES))
+ showGrid = store.getBoolean(GraphingAPIPreferenceConstants.P_SHOW_GRID_LINES);
+
+ repaint();
+ }
+ };
+
+ private SelectionListener gridListener = new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ public void widgetSelected(SelectionEvent e) {
+ showGrid = ((Button)e.getSource()).getSelection();
+ repaint();
+ }
+ };
+
+ private SelectionListener normalizeListener = new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ public void widgetSelected(SelectionEvent e) {
+ normalize = ((Button)e.getSource()).getSelection();
+ if(!normalize) removeSeriesAxis();
+ handleUpdateEvent();
+ }
+ };
+
+ protected LinkedList<GraphAxis> axes;
+
+ private IAdapter adapter;
+
+ protected static int xSeriesTicks;
+ protected static int ySeriesTicks;
+ protected static int maxItems;
+ protected static int viewableItems;
+ protected int removedItems;
+
+ public boolean showGrid, normalize;
+
+ protected int selectedSeries;
+ protected GraphAxis seriesAxis;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/BarGraph.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/BarGraph.java
new file mode 100644
index 0000000000..8a8358717a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/BarGraph.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.IGraphColorConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters.BlockAdapter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters.IAdapter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.DataPoint;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphComposite;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+
+
+
+/**
+ * A Bar Graph implementation for the Graphing system.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ */
+public class BarGraph extends AGraph implements IBlockGraph, IScrollGraph {
+ /**
+ * Default constructor for the bar graph.
+ * @param title Title of the graph.
+ * @param style Style code to use.
+ * @param adapt Dataset Adapter for the graph.
+ */
+ public BarGraph(GraphComposite parent, int style, String title, IAdapter adapter) {
+ super(parent, style, title, adapter);
+ this.adapter = adapter;
+ fullUpdate = (adapter instanceof BlockAdapter) ? true : false;
+ handleUpdateEvent();
+ }
+
+ /**
+ * Paints all of the data elements to the screen
+ */
+ @SuppressWarnings("unchecked")
+ public void paintElementList(GC gc) {
+ DataPoint[] points = new DataPoint[0];
+
+ Color temp = gc.getForeground();
+ Color temp1 = gc.getBackground();
+
+ Color c;
+ Color c1;
+
+ double xSize = super.getSize().x - (super.getXPadding()<<1);
+ xSize /= (super.getLocalWidth()+1);
+ xSize /= (elementList.length);
+ double ySize = super.getSize().y - (super.getYPadding()<<1);
+ ySize /= (super.getLocalHeight());
+
+ double px, py;
+ double pw=0, ph;
+
+ for(int j=0; j<elementList.length; j++) {
+ points = (DataPoint[])elementList[j].toArray(points);
+
+ c = new Color(getDisplay(), IGraphColorConstants.COLORS[j]);
+ c1 = new Color(getDisplay(), c.getRed()>>1, c.getGreen()>>1, c.getBlue()>>1);
+ gc.setForeground(c);
+ gc.setBackground(c1);
+ double width = WIDTH_PERCENT;
+ for(int i=0; i<points.length; i++) {
+ px = super.getLocation().x + (((points[i].x * (elementList.length))-super.getLocalXMin()) * xSize) + super.getXPadding();
+ px = px + ((j - elementList.length/2) * (xSize * width));
+ pw = (xSize * width);
+
+ py = super.getSize().y - super.getYPadding();
+ ph = ((super.getLocalYMax() - points[i].y) * ySize) + super.getYPadding()-py;
+ //System.out.println("rectangle area:" + j + " " + px + " " + pw + " " + py + " " + ph + " " + points[i].x + " " + points[i].y );
+ gc.fillGradientRectangle((int)(px), (int)py, (int)pw, (int)ph, true);
+ }
+ }
+
+ gc.setForeground(temp);
+ gc.setBackground(temp1);
+ }
+
+ public boolean isMultiGraph() {
+ return adapter.getSeriesCount() > 0;
+ }
+
+ /**
+ * Handles an update notification for new data in the Data Set. Causes the graph to add
+ * all new samples to the graph, and then repaint itself.
+ */
+ public void handleUpdateEvent() {
+ if(null == adapter) return;
+
+ this.getDisplay().syncExec(new Runnable() {
+ @SuppressWarnings("unchecked")
+ public void run() {
+ Object[][] data;
+ if(fullUpdate) {
+ for(int i=0; i<elementList.length; i++)
+ elementList[i].clear();
+ data = adapter.getData();
+ } else
+ data = adapter.getData(removedItems, adapter.getRecordCount());
+
+ if(normalize) {
+ double max;
+ for(int j,i=0; i<adapter.getSeriesCount(); i++) {
+ elementList[i].clear(); //TODO: Only temparary
+ max = adapter.getYSeriesMax(i, removedItems, adapter.getRecordCount()).doubleValue() / 100;
+ for(j=0; j<data.length; j++) {
+ elementList[i].add(new DataPoint(adapter instanceof BlockAdapter ? j : NumberType.obj2num(data[j][0]).doubleValue(),
+ NumberType.obj2num(data[j][i+1]).doubleValue() / max));
+ }
+ }
+ } else {
+ for(int j,i=0; i<adapter.getSeriesCount(); i++) {
+ elementList[i].clear(); //TODO: Only temparary
+ for(j=0; j<data.length; j++) {
+ elementList[i].add(new DataPoint(adapter instanceof BlockAdapter ? j : NumberType.obj2num(data[j][0]).doubleValue(),
+ NumberType.obj2num(data[j][i+1]).doubleValue()));
+ }
+ }
+ }
+ }
+ });
+ this.repaint();
+ }
+
+ private IAdapter adapter;
+ private boolean fullUpdate;
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.bargraph";
+ private static final double WIDTH_PERCENT = 0.8;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IBlockGraph.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IBlockGraph.java
new file mode 100644
index 0000000000..50b4f7d209
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IBlockGraph.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs;
+
+public interface IBlockGraph extends IGraph {
+
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IGraph.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IGraph.java
new file mode 100644
index 0000000000..7de3c6ad70
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IGraph.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IUpdateListener;
+import org.eclipse.swt.graphics.Color;
+
+
+
+public interface IGraph extends IUpdateListener {
+ public boolean isMultiGraph();
+ public void repaint();
+ public void dispose();
+ public void setBackground(Color c);
+ public void setForeground(Color c);
+ public void setLayoutData(Object layout);
+ public void setScale(double scale);
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IScrollGraph.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IScrollGraph.java
new file mode 100644
index 0000000000..00b30a3e38
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/IScrollGraph.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs;
+
+public interface IScrollGraph extends IGraph {
+
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/LineGraph.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/LineGraph.java
new file mode 100644
index 0000000000..247fc7f13d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/LineGraph.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.IGraphColorConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters.ScrollAdapter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.DataPoint;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphComposite;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+
+
+
+/**
+ * A line graph implementation for the graphing system.
+ * @author Ryan Morse
+ * @author Henry Hughes
+ */
+public class LineGraph extends AGraph implements IScrollGraph {
+ /**
+ * Default constructor for LineGraph. Simply invokes the constructor from <code>ScatterGraph</code>
+ * and fires the Update Event when its done, causing the graph to draw itself.
+ */
+ public LineGraph(GraphComposite parent, int style, String title, ScrollAdapter adapter) {
+ super(parent, style, title, adapter);
+ this.adapter = adapter;
+ handleUpdateEvent();
+ }
+
+ @SuppressWarnings("unchecked")
+ public void paintElementList(GC gc) {
+ DataPoint[] points = new DataPoint[0];
+
+ Color temp = gc.getForeground();
+ Color c;
+
+ double xSize = super.getSize().x - (super.getXPadding()<<1);
+ xSize /= (super.getLocalWidth());
+ double ySize = super.getSize().y - (super.getYPadding()<<1);
+ ySize /= (super.getLocalHeight());
+
+ double px, py;
+ double px2, py2;
+
+ for(int j=0; j<elementList.length; j++) {
+ points = (DataPoint[])elementList[j].toArray(points);
+ c = new Color(getDisplay(), IGraphColorConstants.COLORS[j]);
+ gc.setForeground(c);
+
+ px2 = 0;
+ py2 = super.getSize().y - super.getYPadding();
+ for(int i=0; i<points.length; i++) {
+ px = (points[i].x-super.getLocalXMin());
+ px *= xSize;
+ px += super.getXPadding();
+
+ py = super.getLocalYMax() - points[i].y;
+ py *= ySize;
+ py += super.getYPadding();
+
+ gc.drawLine((int)px, (int)py, (int)px2, (int)py2);
+ px2 = px;
+ py2 = py;
+ }
+ }
+
+ gc.setForeground(temp);
+ }
+
+ public boolean isMultiGraph() {
+ return adapter.getSeriesCount() > 0;
+ }
+
+ /**
+ * Updates the graph when the <code>DataSet</code> has more data, adding the new samples to the graph.
+ */
+ public void handleUpdateEvent() {
+ if(null == adapter) return;
+
+ this.getDisplay().syncExec(new Runnable() {
+ @SuppressWarnings("unchecked")
+ public void run() {
+ Object[][] data = adapter.getData(removedItems, adapter.getRecordCount());
+ if(normalize) {
+ double max;
+ for(int j,i=0; i<adapter.getSeriesCount(); i++) {
+ elementList[i].clear(); //TODO: Only temparary
+ max = adapter.getYSeriesMax(i, removedItems, adapter.getRecordCount()).doubleValue() / 100;
+ for(j=0; j<data.length; j++) {
+ elementList[i].add(new DataPoint(NumberType.obj2num(data[j][0]).doubleValue(),
+ NumberType.obj2num(data[j][i+1]).doubleValue() / max));
+ }
+ }
+ } else {
+ for(int j,i=0; i<adapter.getSeriesCount(); i++) {
+ elementList[i].clear(); //TODO: Only temparary
+ for(j=0; j<data.length; j++) {
+ elementList[i].add(new DataPoint(NumberType.obj2num(data[j][0]).doubleValue(),
+ NumberType.obj2num(data[j][i+1]).doubleValue()));
+ }
+ }
+ }
+ }
+ });
+ this.repaint();
+ }
+
+ private ScrollAdapter adapter;
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.linegraph";
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/PieChart.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/PieChart.java
new file mode 100644
index 0000000000..866c660dee
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/PieChart.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.IGraphColorConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters.BlockAdapter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphComposite;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphLegend;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+
+
+
+public class PieChart extends AChart implements IBlockGraph {
+ public PieChart(GraphComposite parent, int style, String title, BlockAdapter adapt) {
+ super(parent, style, title, adapt);
+ adapter = adapt;
+ handleUpdateEvent();
+ }
+
+ private void updateLegend() {
+ Object [][] l = adapter.getData();
+ String [] labels = new String[adapter.getRecordCount()];
+ Color[] colors = new Color[labels.length];
+
+ for(int i=0; i<labels.length; i++) {
+ labels[i] = l[i][0].toString();
+ colors[i] = new Color(this.getDisplay(), IGraphColorConstants.COLORS[i]);
+ }
+
+ legend = new GraphLegend(this, labels, colors);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void paintElementList(GC gc) {
+ updateLegend(); //Make sure legend has current keys
+ Color temp = gc.getForeground();
+ Color temp1 = gc.getBackground();
+ Color c;
+
+ int pw = Math.min(super.getSize().x - (super.getXPadding()<<1), super.getSize().y - (super.getYPadding()<<1));
+ int px = (super.getSize().x - super.getXPadding() - pw)>>1;
+ int py = (super.getSize().y - super.getYPadding() - pw)>>1;
+
+ int angle1, angle0 = 0;
+ Number[] points = new Number[0];
+ points = (Number[])elementList[0].toArray(points);
+ for(int i=0; i<points.length; i++) {
+ c = new Color(getDisplay(), IGraphColorConstants.COLORS[i]);
+ gc.setForeground(c);
+ gc.setBackground(c);
+ angle1 = (int)((MAX_ANGLE*(points[i].doubleValue()/sum))+0.51);
+ gc.fillArc(px, py, pw, pw, angle0, angle1);
+ angle0 += angle1;
+ }
+
+ //If there is no data to display draw a crossed out circle
+ if(0 == points.length) {
+ gc.drawArc(px, py, pw, pw, 0, 360);
+ gc.drawLine(px, py, px+pw, py+pw);
+ gc.drawLine(px, py+pw, px+pw, py);
+ }
+
+ gc.setForeground(temp);
+ gc.setBackground(temp1);
+ }
+
+ public boolean isMultiGraph() {
+ return false;
+ }
+
+ public void handleUpdateEvent() {
+ if(null == adapter) return;
+
+ this.getDisplay().syncExec(new Runnable() {
+ @SuppressWarnings("unchecked")
+ public void run() {
+ Object[][] data;
+ elementList[0].clear();
+ data = adapter.getData();
+
+ Number n;
+ sum = 0;
+ for(int i=0; i<data.length; i++) {
+ n = NumberType.obj2num(data[i][1]);
+ elementList[0].add(n);
+ sum += n.doubleValue();
+ }
+ }
+ });
+ this.repaint();
+ }
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.piechart";
+ private BlockAdapter adapter;
+ private double sum;
+ private static final int MAX_ANGLE = 360;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/ScatterGraph.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/ScatterGraph.java
new file mode 100644
index 0000000000..d91c400b1b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/graphs/ScatterGraph.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.IGraphColorConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters.ScrollAdapter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.DataPoint;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.NumberType;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphComposite;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+
+
+
+/**
+ * A generic scatter plot implementation.
+ * @author Ryan Morse
+ * @author Henry Hughes
+ */
+public class ScatterGraph extends AGraph implements IScrollGraph {
+ /**
+ * Default constructor for ScatterGraph. Simply invokes the constructor from <code>Graph</code>
+ * and fires the Update Event when its done, causing the graph to draw itself.
+ */
+ public ScatterGraph(GraphComposite parent, int style, String title, ScrollAdapter adapter) {
+ super(parent, style, title, adapter);
+ this.adapter = adapter;
+ handleUpdateEvent();
+ }
+
+ @SuppressWarnings("unchecked")
+ public void paintElementList(GC gc) {
+ DataPoint[] points = new DataPoint[0];
+
+ Color temp = gc.getForeground();
+ Color temp1 = gc.getBackground();
+ Color c;
+
+ double xSize = super.getSize().x - (super.getXPadding()<<1);
+ xSize /= (super.getLocalWidth());
+ double ySize = super.getSize().y - (super.getYPadding()<<1);
+ ySize /= (super.getLocalHeight());
+
+ double px, py;
+
+ for(int j=0; j<elementList.length; j++) {
+ points = (DataPoint[])elementList[j].toArray(points);
+
+ c = new Color(getDisplay(), IGraphColorConstants.COLORS[j]);
+ gc.setForeground(c);
+ gc.setBackground(c);
+
+ for(int i=0; i<points.length; i++) {
+ px = (points[i].x-super.getLocalXMin());
+ px *= xSize;
+ px += super.getXPadding() - (DIAMETER>>1);
+
+ py = super.getLocalYMax() - points[i].y;
+ py *= ySize;
+ py += super.getYPadding() - (DIAMETER>>1);
+
+ gc.fillOval((int)px, (int)py, DIAMETER, DIAMETER);
+ }
+ }
+
+ gc.setForeground(temp);
+ gc.setBackground(temp1);
+ }
+
+ public boolean isMultiGraph() {
+ return adapter.getSeriesCount() > 0;
+ }
+
+ /**
+ * Updates the graph when the <code>IDataSet</code> has more data, adding the new samples to the graph.
+ */
+ public void handleUpdateEvent() {
+ if(null == adapter) return;
+
+ this.getDisplay().syncExec(new Runnable() {
+ @SuppressWarnings("unchecked")
+ public void run() {
+ Object[][] data = adapter.getData(removedItems, adapter.getRecordCount());
+
+ if(normalize) {
+ double max;
+ for(int j,i=0; i<adapter.getSeriesCount(); i++) {
+ elementList[i].clear(); //TODO: Only temparary
+ max = adapter.getYSeriesMax(i, removedItems, adapter.getRecordCount()).doubleValue() / 100;
+ for(j=0; j<data.length; j++) {
+ elementList[i].add(new DataPoint(NumberType.obj2num(data[j][0]).doubleValue(),
+ NumberType.obj2num(data[j][i+1]).doubleValue() / max));
+ }
+ }
+ } else {
+ for(int j,i=0; i<adapter.getSeriesCount(); i++) {
+ elementList[i].clear(); //TODO: Only temparary
+ for(j=0; j<data.length; j++) {
+ elementList[i].add(new DataPoint(NumberType.obj2num(data[j][0]).doubleValue(),
+ NumberType.obj2num(data[j][i+1]).doubleValue()));
+ }
+ }
+ }
+ }
+ });
+ this.repaint();
+ }
+
+ private ScrollAdapter adapter;
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.scattergraph";
+ private static final int DIAMETER = 5;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/GraphingAPIUIPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/GraphingAPIUIPlugin.java
new file mode 100644
index 0000000000..55ac08ed41
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/GraphingAPIUIPlugin.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal;
+
+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 GraphingAPIUIPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static GraphingAPIUIPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public GraphingAPIUIPlugin() {
+ 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 GraphingAPIUIPlugin 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.graphingapi.ui", path);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/Localization.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/Localization.java
new file mode 100644
index 0000000000..70eea68919
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/Localization.java
@@ -0,0 +1,21 @@
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Localization {
+ private static final String BUNDLE_NAME = "org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.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.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/localization.properties
new file mode 100644
index 0000000000..aef74faf23
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/internal/localization.properties
@@ -0,0 +1,142 @@
+#DataDisplay
+DataGrid.Row=Row
+DataGrid.FormatAs=Format as...
+DataGrid.AddFilter=Add filter...
+DataGrid.RemoveFilter=Remove filter...
+DataGrid.ManualyResize=Manualy Resize
+
+#Graphs
+AChart.Title=Title
+AChart.Legend=Legend
+
+AGraph.xAxis=x-axis
+AGraph.yAxis=y-axis
+AGraph.GridLines=Grid Lines
+AGraph.Normalize=Normalize
+AGraph.SeriesAxis=series axis
+
+#Preferences
+GraphingAPIPreferencePage.GraphDisplayPreferences=GraphingAPI Details
+
+GraphPreferencePage.GraphDisplayPreferences=Basic preferences for graph display.
+GraphPreferencePage.ShowGridLines=&Show grid lines:
+GraphPreferencePage.MaxDataItems=&Max data items:
+GraphPreferencePage.ViewableDataItems=&Viewable data items:
+GraphPreferencePage.XSeriesTicks=&X series ticks:
+GraphPreferencePage.YSeriesTicks=&Y series ticks:
+
+DataTablePreferencePage.GraphDisplayPreferences=Basic preferences for graph display.
+DataTablePreferencePage.JumpNewestEntry=&Jump to newest entry:
+DataTablePreferencePage.AutoResizeColumns=&Auto resize columns:
+DataTablePreferencePage.MaxDataItems=&Max data items:
+
+#Wigets
+GraphAxis.Kilo=K
+GraphAxis.Mega=M
+GraphAxis.Giga=G
+GraphAxis.Tera=T
+GraphAxis.Peta=P
+GraphAxis.Exa=E
+GraphAxis.Zetta=Z
+GraphAxis.Yotta=Y
+
+GraphLegend.Legend=Legend
+
+GraphComposite.ScaleValue=x
+
+#Wizards.DataSet
+DataSetFactory.RowDataSet=Row Data Set
+DataSetFactory.TableDataSet=Table Data Set
+DataSetFactory.RowDataSetDescription=Script outputs simple rows of values.\n\n
+DataSetFactory.DataSetExample=ie:\n
+DataSetFactory.DataSetHeader=Col1\tCol2\tCol3\n
+DataSetFactory.TableDataSetDescription=Script periodicaly outputs preformated tables of the values\n\n
+
+DataSetWizard.CreateDataSet=Create Data Set
+
+ParsingWizardPage.NumberOfColumns=Number of Columns:
+ParsingWizardPage.RegularExpression=Regular Expression:
+ParsingWizardPage.Title=Title:
+ParsingWizardPage.Delimiter=Delimiter:
+
+SelectDataSetWizardPage.SelectDataSetType=Select Data Set Type
+
+SelectTableParsingWizardPage.SelectTableDataSetParsing=Select Table Data Set Parsing
+SelectTableParsingWizardPage.TableDelimiter=Table Delimiter:
+
+SelectRowParsingWizardPage.SelectRowDataSetParsing=Select Row Data Set Parsing
+
+#Wizards.Filter
+AvailableFilterTypes.MatchFilter=Match Filter
+AvailableFilterTypes.RangeFilter=Range Filter
+AvailableFilterTypes.SortFilter=Sort Filter
+AvailableFilterTypes.UniqueFilter=Unique Filter
+AvailableFilterTypes.MatchFilterDescription=This filter removes everything from the data set where the selected column's value does not match the chosen value.
+AvailableFilterTypes.RangeFilterDescription=This filter will remove everying that is not included in the selected range of values.
+AvailableFilterTypes.SortFilterDescription=This filter will sort the entire data set based on the selected column. No data will be removed.
+AvailableFilterTypes.UniqueFilterDescription=This filter will remove all merge all entries in the data set that share a common value in the selected column. Data for the removed rows will be aggregated together based on the chosed aggregation method.
+
+AggregateFactory.AverageAggregate=Average Aggregate
+AggregateFactory.CountAggregate=Count Aggregate
+AggregateFactory.MaxAggregate=Max Aggregate
+AggregateFactory.MinAggregate=Min Aggregate
+AggregateFactory.SumAggregate=Sum Aggregate
+AggregateFactory.AverageDescription=This aggregate will return the average of all of the items consolidated.
+AggregateFactory.CountDescription=This aggregate will return the number of items consolidated.
+AggregateFactory.MaxDescription=This aggregate will return the maximum value of all the items consolidated.
+AggregateFactory.MinDescription=This aggregate will return the minimum value of all the items consolidated.
+AggregateFactory.SumDescription=This aggregate will return the sum of all of the items consolidated.
+
+MatchFilterWizardPage.CreateMatchFilter=Create Match Filter
+MatchFilterWizardPage.Column=Column:
+MatchFilterWizardPage.CompareTo=String to compare to:
+MatchFilterWizardPage.KeepMatching=Keep Matching
+MatchFilterWizardPage.RemoveMatching=Remove Matching
+
+RangeFilterWizardPage.CreateRangeFilter=Create Range Filter
+RangeFilterWizardPage.Column=Column:
+RangeFilterWizardPage.LowerBound=Lower bound:
+RangeFilterWizardPage.UpperBound=Upper bound:
+RangeFilterWizardPage.InsideBounds=Inside Bounds
+RangeFilterWizardPage.OutsideBounds=Outside Bounds
+RangeFilterWizardPage.Inclusive=Inclusive
+
+SelectFilterWizard.CreateFilter=Create Filter
+
+SelectFilterWizardPage.SelectFilter=Select Filter
+
+SortFilterWizardPage.CreateSortFilter=Create Sort Filter
+SortFilterWizardPage.Column=Column:
+SortFilterWizardPage.Ascending=Ascending
+SortFilterWizardPage.Descending=Descending
+
+UniqueFilterWizardPage.CreateUniqueFilter=Create Unique Filter
+UniqueFilterWizardPage.Column=Column:
+UniqueFilterWizardPage.Aggregate=Aggregate:
+
+
+#Wizards.Graph
+GraphFactory.BarGraph=Bar Graph
+GraphFactory.PieChart=Pie Chart
+GraphFactory.ScatterGraph=Scatter Graph
+GraphFactory.LineGraph=Line Graph
+GraphFactory.LineDescription=This is a simple line graph of a single set of data. Each (x,y) pair will be pltted a a single dot and connected with a solid line on the graph.
+GraphFactory.BarDescription=This is a histagram of data. One series represents the categories and the other represents the value assigned to that category.
+GraphFactory.PieDescription=This is a pie chart
+GraphFactory.ScatterDescription=This is a simple plot of one series of data vs another set. Each (x,y) pair will be plotted as a single dot on the graph.
+
+SelectGraphWizard.CreateGraph=Create Graph
+
+SelectGraphWizardPage.SelectGraph=Select Graph
+
+SelectSeriesWizardPage.Title=Title:
+SelectSeriesWizardPage.XSeries=X Series:
+SelectSeriesWizardPage.RowID=Row ID
+SelectSeriesWizardPage.YSeries=Y Series
+SelectSeriesWizardPage.SelectSeries=Select Series
+SelectSeriesWizardPage.TitleNotSet=Title not set
+SelectSeriesWizardPage.KeyFilter=Key filter:
+SelectSeriesWizardPage.KeyNotSet=Key not set
+SelectSeriesWizardPage.NA=NA
+SelectSeriesWizardPage.UseHistoricalData=Use historical data?
+SelectSeriesWizardPage.SeriesNotSelected=Series not selected, or share the same selection \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/DataTablePreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/DataTablePreferencePage.java
new file mode 100644
index 0000000000..da84a634cc
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/DataTablePreferencePage.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.GraphingAPIUIPlugin;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences.GraphingAPIPreferenceConstants;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+
+public class DataTablePreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public DataTablePreferencePage() {
+ super(GRID);
+ setPreferenceStore(GraphingAPIUIPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("DataTablePreferencePage.GraphDisplayPreferences"));
+ }
+
+ public void createFieldEditors() {
+ addField(new BooleanFieldEditor(
+ GraphingAPIPreferenceConstants.P_JUMP_NEW_TABLE_ENTRY,
+ Localization.getString("DataTablePreferencePage.JumpNewestEntry"),
+ getFieldEditorParent()));
+
+ addField(new BooleanFieldEditor(
+ GraphingAPIPreferenceConstants.P_AUTO_RESIZE,
+ Localization.getString("DataTablePreferencePage.AutoResizeColumns"),
+ getFieldEditorParent()));
+
+ addField(
+ new IntegerFieldEditor(
+ GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS,
+ Localization.getString("DataTablePreferencePage.MaxDataItems"),
+ getFieldEditorParent()));
+ }
+
+ public void init(IWorkbench workbench) {}
+
+ public void dispose() {
+ super.dispose();
+ }
+}
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphPreferencePage.java
new file mode 100644
index 0000000000..e4d4f1962d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphPreferencePage.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.GraphingAPIUIPlugin;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences.GraphingAPIPreferenceConstants;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+
+public class GraphPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public GraphPreferencePage() {
+ super(GRID);
+ setPreferenceStore(GraphingAPIUIPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("GraphPreferencePage.GraphDisplayPreferences"));
+ }
+
+ public void createFieldEditors() {
+ addField(new BooleanFieldEditor(
+ GraphingAPIPreferenceConstants.P_SHOW_GRID_LINES,
+ Localization.getString("GraphPreferencePage.ShowGridLines"),
+ getFieldEditorParent()));
+
+ addField(
+ new IntegerFieldEditor(
+ GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS,
+ Localization.getString("GraphPreferencePage.MaxDataItems"),
+ getFieldEditorParent()));
+
+ addField(
+ new IntegerFieldEditor(
+ GraphingAPIPreferenceConstants.P_VIEWABLE_DATA_ITEMS,
+ Localization.getString("GraphPreferencePage.ViewableDataItems"),
+ getFieldEditorParent()));
+
+ addField(
+ new IntegerFieldEditor(
+ GraphingAPIPreferenceConstants.P_X_SERIES_TICKS,
+ Localization.getString("GraphPreferencePage.XSeriesTicks"),
+ getFieldEditorParent()));
+
+ addField(
+ new IntegerFieldEditor(
+ GraphingAPIPreferenceConstants.P_Y_SERIES_TICKS,
+ Localization.getString("GraphPreferencePage.YSeriesTicks"),
+ getFieldEditorParent()));
+ }
+
+ public void init(IWorkbench workbench) {}
+
+ public void dispose() {
+ super.dispose();
+ }
+}
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphingAPIPreferenceConstants.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphingAPIPreferenceConstants.java
new file mode 100644
index 0000000000..0f7af298ae
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphingAPIPreferenceConstants.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences;
+
+public class GraphingAPIPreferenceConstants {
+ //graphing.datatable
+ public static final String P_JUMP_NEW_TABLE_ENTRY = "JumpNewTableEntry";
+ public static final String P_AUTO_RESIZE = "AutoResizeColumns";
+
+ //graphing.graph
+ public static final String P_SHOW_GRID_LINES = "ShowGridLines";
+ public static final String P_MAX_DATA_ITEMS = "MaxDataItems";
+ public static final String P_VIEWABLE_DATA_ITEMS = "ViewableDataItems";
+ public static final String P_X_SERIES_TICKS = "XSeriesTicks";
+ public static final String P_Y_SERIES_TICKS = "YSeriesTicks";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphingAPIPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphingAPIPreferencePage.java
new file mode 100644
index 0000000000..c162c5b5fe
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/GraphingAPIPreferencePage.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.GraphingAPIUIPlugin;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+
+public class GraphingAPIPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public GraphingAPIPreferencePage() {
+ super(GRID);
+ setPreferenceStore(GraphingAPIUIPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("GraphingAPIPreferencePage.GraphDisplayPreferences"));
+ }
+
+ public void createFieldEditors() {
+ }
+
+ public void init(IWorkbench workbench) {}
+
+ public void dispose() {
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/PreferenceInitializer.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/PreferenceInitializer.java
new file mode 100644
index 0000000000..5b3f025a4a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/preferences/PreferenceInitializer.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.GraphingAPIUIPlugin;
+
+
+
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = GraphingAPIUIPlugin.getDefault().getPreferenceStore();
+
+ store.setDefault(GraphingAPIPreferenceConstants.P_SHOW_GRID_LINES, true);
+ store.setDefault(GraphingAPIPreferenceConstants.P_AUTO_RESIZE, true);
+ store.setDefault(GraphingAPIPreferenceConstants.P_JUMP_NEW_TABLE_ENTRY, false);
+ store.setDefault(GraphingAPIPreferenceConstants.P_VIEWABLE_DATA_ITEMS, 100);
+ store.setDefault(GraphingAPIPreferenceConstants.P_MAX_DATA_ITEMS, 250);
+ store.setDefault(GraphingAPIPreferenceConstants.P_X_SERIES_TICKS, 8);
+ store.setDefault(GraphingAPIPreferenceConstants.P_Y_SERIES_TICKS, 4);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphAxis.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphAxis.java
new file mode 100644
index 0000000000..9714b789e4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphAxis.java
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets;
+
+import java.text.DecimalFormat;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.AGraph;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+
+
+
+/**
+ * The Axis primitive, used to draw gridlines and axes on graphs.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ */
+public class GraphAxis implements IGraphPrimitive {
+ public GraphAxis(AGraph graph, String title, int tickCount, int type) {
+ this.graph = graph;
+ this.type = type&1; //Ensure type matches one of the possible values
+ this.tickCount = tickCount;
+ this.title = title;
+ this.color = graph.axisColor;
+ }
+
+ public void setTickCount(int count) {
+ tickCount = count;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public boolean isVisible() {
+ return true;
+ }
+
+ /**
+ * Determines if the given point is inside this axis' bounds.
+ */
+ public boolean isUnder(Point loc) {
+ if(type==VERTICAL && loc.x < graph.getXPadding() ||
+ type==HORIZONTAL && loc.y > graph.getSize().y-graph.getYPadding())
+ return true;
+ return false;
+ }
+
+ public void calculateBounds() {
+ x1 = graph.getXPadding();
+ y2 = graph.getSize().y-graph.getYPadding();
+ locationX = graph.getXPadding();
+ tickAmount = 0;
+
+ if(type == HORIZONTAL) {
+ locationY = graph.getYPadding();
+ y1 = graph.getSize().y-graph.getYPadding();
+ x2 = graph.getSize().x-graph.getXPadding();
+ x2a = (int)locationX;
+ y2a = graph.getSize().y-graph.getYPadding();
+
+ widthX = graph.getSize().x - (graph.getXPadding()<<1);
+ widthY = 0;
+ tickIncrament = ((graph.getLocalXMax()-graph.getLocalXMin())/(double)tickCount);
+ range = graph.getLocalXMax() - graph.getLocalXMin();
+ localMin = graph.getLocalXMin();
+ } else {
+ locationY = graph.getSize().y - graph.getYPadding();
+ y1 = graph.getYPadding();
+ x2 = graph.getXPadding();
+ x2a = graph.getSize().x-graph.getXPadding();
+ y2a = (int)locationY;
+
+ widthX = 0;
+ widthY = graph.getSize().y - (graph.getYPadding()<<1);
+ tickIncrament = ((graph.getLocalYMax()-graph.getLocalYMin())/(double)tickCount);
+ range = graph.getLocalYMax() - graph.getLocalYMin();
+ localMin = graph.getLocalYMin();
+ }
+ }
+
+ /**
+ * Calculates the width, in pixels, of the input string.
+ * @param gc GC to use for the calculation.
+ * @param s String to calculate.
+ * @return Width of the string in pixels.
+ */
+ protected int stringWidth(GC gc, String s) {
+ int width = 0;
+ for(int i=0; i<s.length(); i++)
+ width += gc.getCharWidth(s.charAt(i));
+
+ return width;
+ }
+
+ /**
+ * Draws the grid line for the given coordinates if grid lines are enabled.
+ */
+ protected void drawGridLine(GC gc, int x1, int y1, int x2, int y2) {
+ if(graph.showGrid) {
+ gc.setLineStyle(SWT.LINE_DOT);
+ gc.drawLine(x1,y1,x2,y2);
+ }
+ }
+
+ /**
+ * Graphs the tick at the given location. Places the given string near the tick.
+ */
+ protected void drawTick(GC gc, int x, int y, String val) {
+ gc.setLineStyle(SWT.LINE_SOLID);
+ int strWidth = stringWidth(gc, val);
+ int strHeight = gc.getFontMetrics().getHeight();
+ gc.drawLine(x, y, x+((HORIZONTAL==type) ? 0 : strWidth), y+((HORIZONTAL==type) ? -strHeight : 0));
+
+ x -= (strWidth>>1);
+ if(x < 0)
+ x = 0;
+ else if(x > graph.getSize().x-strWidth)
+ x = graph.getSize().x-strWidth;
+
+ y -= (strHeight>>1);
+ if(y < 0)
+ y = 0;
+ else if(y > graph.getSize().y-strHeight)
+ y = graph.getSize().y-strHeight;
+ gc.drawText(val, x, y);
+ }
+
+ protected void drawTitle(GC gc) {
+ //TODO: Implement this function. Has to rotate text for vertical bars
+ //http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/Rotateandflipanimage.htm
+ }
+
+ /**
+ * Converts units on the input value using SI prefixes (1 million becomes 1M, etc)
+ */
+ protected String getLabel(double val, int range) {
+ int metric = 0;
+ String pattern=".0";
+ range /= tickCount;
+ while(val > 1000) {
+ val /= 1000;
+ metric++;
+
+ range /= 10;
+ if(range < 1)
+ pattern += "0";
+ }
+
+ DecimalFormat format = new DecimalFormat(pattern);
+ return format.format(val) + PREFIXES[metric];
+ }
+
+ public void paint(GC gc) {
+ calculateBounds();
+
+ Color foreground = gc.getForeground();
+ gc.setForeground(color);
+
+ gc.drawLine(x1, y1, x2, y2);
+ drawTitle(gc);
+ for(int i=0; i<=tickCount; i++) {
+ drawGridLine(gc, (int)locationX, (int)locationY, (int)x2a, (int)y2a);
+ drawTick(gc, (int)locationX, (int)y2a, getLabel(localMin+tickAmount, range));
+
+ locationX += (widthX/(double)tickCount);
+ x2a += (widthX/(double)tickCount);
+ locationY -= (widthY/(double)tickCount);
+ y2a -= (widthY/(double)tickCount);
+ tickAmount += tickIncrament;
+
+ }
+ gc.setForeground(foreground);
+ }
+
+ public static final int VERTICAL = 0;
+ public static final int HORIZONTAL = 1;
+ //kilo, mega, giga, tera, peta, exa, zetta, yotta
+ protected static final String[] PREFIXES = { "", Localization.getString("GraphAxis.Kilo"), Localization.getString("GraphAxis.Mega"), Localization.getString("GraphAxis.Giga"), Localization.getString("GraphAxis.Tera"), Localization.getString("GraphAxis.Peta"), Localization.getString("GraphAxis.Exa"), Localization.getString("GraphAxis.Zetta"), Localization.getString("GraphAxis.Yotta") } ;
+
+ protected int type;
+ protected int tickCount;
+ protected final AGraph graph;
+ protected Color color;
+ @SuppressWarnings("unused")
+ private String title;
+
+ protected int x1, y1, x2, y2;
+ protected int widthX, widthY, range, localMin;
+ protected double locationX, locationY, x2a, y2a, tickAmount, tickIncrament;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphAxis2.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphAxis2.java
new file mode 100644
index 0000000000..07233ecb5a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphAxis2.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.AGraph;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+
+
+
+/**
+ * An extension to GraphAxis.
+ * @author Ryan Morse
+ */
+public class GraphAxis2 extends GraphAxis implements IGraphPrimitive {
+ public GraphAxis2(AGraph graph, String title, int tickCount, int type, Color color) {
+ super(graph, title, tickCount, type&1);
+ this.type = type;
+ this.color = color;
+ }
+
+ public void calculateBounds() {
+ x1 = graph.getXPadding();
+ y1 = graph.getYPadding();
+ x2 = graph.getSize().x-graph.getXPadding();
+ y2 = graph.getSize().y-graph.getYPadding();
+ locationX = graph.getXPadding();
+ locationY = graph.getSize().y - graph.getYPadding();
+ tickAmount = 0;
+
+ switch(type&1) {
+ case VERTICAL:
+ widthX = 0;
+ widthY = graph.getSize().y - (graph.getYPadding()<<1);
+ tickIncrament = ((graph.getLocalYMax()-graph.getLocalYMin())/(double)tickCount);
+ range = graph.getLocalYMax() - graph.getLocalYMin();
+ localMin = graph.getLocalYMin();
+ break;
+ case HORIZONTAL:
+ widthX = graph.getSize().x - (graph.getXPadding()<<1);
+ widthY = 0;
+ tickIncrament = ((graph.getLocalXMax()-graph.getLocalXMin())/(double)tickCount);
+ range = graph.getLocalXMax() - graph.getLocalXMin();
+ localMin = graph.getLocalXMin();
+ break;
+ }
+
+ switch(type&3) {
+ case ALIGN_BOTTOM:
+ locationY = graph.getYPadding();
+ y1 = graph.getSize().y-graph.getYPadding();
+ y2a = graph.getSize().y - graph.getYPadding();
+ x2a = (int)locationX;
+ break;
+ case ALIGN_TOP:
+ y2 = graph.getYPadding();
+ y2a = graph.getYPadding();
+ x2a = (int)locationX;
+ break;
+ case ALIGN_LEFT:
+ x2 = graph.getXPadding();
+ y2a = (int)locationY;
+ x2a = graph.getSize().x-graph.getXPadding();
+ break;
+ case ALIGN_RIGHT:
+ locationX = graph.getSize().x-graph.getXPadding();
+ x1 = graph.getSize().x-graph.getXPadding();
+ y2a = (int)locationY;
+ x2a = graph.getXPadding();
+ break;
+ }
+ }
+
+ protected void drawGridLine(GC gc, int x1, int y1, int x2, int y2) {
+ if(HIDE_GRID_LINES != (HIDE_GRID_LINES&type))
+ super.drawGridLine(gc, x1, y1, x2, y2);
+ }
+
+ protected void drawTick(GC gc, int x, int y, String val) {
+ if(HIDE_TICKS != (HIDE_TICKS&type))
+ super.drawTick(gc, x, y, val);
+ }
+
+ protected void drawTitle(GC gc) {
+ if(HIDE_TITLE != (HIDE_TITLE&type))
+ super.drawTitle(gc);
+ }
+ /*TODO: This should be reimplemented for viewing true values when normalized
+ protected String getLabel(double val, int range) {
+ if(UNNORMALIZED == (UNNORMALIZED&type))
+ val = graph.unscaleValue(val);
+
+ return super.getLabel(val, range);
+ }
+ */
+ public static final int ALIGN_LEFT = VERTICAL; //0
+ public static final int ALIGN_TOP = HORIZONTAL; //1
+ public static final int ALIGN_RIGHT = VERTICAL | 2; //2
+ public static final int ALIGN_BOTTOM = HORIZONTAL | 2; //3
+
+ public static final int HIDE_GRID_LINES = 4;
+ public static final int HIDE_TITLE = 8;
+ public static final int HIDE_TICKS = 16;
+ public static final int UNNORMALIZED = 32;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphCanvas.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphCanvas.java
new file mode 100644
index 0000000000..b7ffcd0edf
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphCanvas.java
@@ -0,0 +1,256 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ScrollBar;
+
+/**
+ * The Graph Canvas class provides a Canvas type object that renders IGraphPrimitive objects on itself.
+ * It is an implementation of the IWidgetContainer interface and can be used by Graph Primitives to scale
+ * themselves.
+ *
+ * This class is the parent class of the entire Graph system, all of the decendents from Graph are
+ * based upon this class.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ * @see org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.Graph
+ *
+ */
+public class GraphCanvas extends Canvas {
+ /**
+ * The default constructor for GraphCanvas. Creates a canvas of the appropriate size, then
+ * sets the internal area rectangles, the internal padding and scaling levels, enables scrolling,
+ * and sets the default axis color.
+ * @param parent Parent composite for this canvas.
+ * @param style SWT Style flags for this canvas (use SWT.NONE)
+ */
+ public GraphCanvas(Composite parent, int style) {
+ super(parent, style | SWT.V_SCROLL | SWT.H_SCROLL);
+
+ globalArea = new Rectangle(0, 0, 0, 0);
+ localArea = new Rectangle(0, 0, 0, 0);
+
+ xpad = 10;
+ ypad = 10;
+ scale = 1.0;
+ autoScroll = true;
+
+ axisColor = parent.getDisplay().getSystemColor(SWT.COLOR_GRAY);
+
+ hBar = this.getHorizontalBar();
+ vBar = this.getVerticalBar();
+ hBar.addListener (SWT.Selection, new Listener () {
+ public void handleEvent (Event e) {
+ if(hBar.getSelection()+hBar.getThumb() == hBar.getMaximum())
+ autoScroll = true;
+ else
+ autoScroll = false;
+
+ setLocalArea(new Rectangle(hBar.getSelection(), localArea.y, localArea.width, localArea.height), true);
+ redraw();
+ }
+ });
+
+ vBar.addListener (SWT.Selection, new Listener () {
+ public void handleEvent (Event e) {
+ autoScroll = false;
+
+ setLocalArea(new Rectangle(localArea.x, vBar.getMaximum()-(vBar.getSelection()+vBar.getThumb())+vBar.getMinimum(), localArea.width, localArea.height), true);
+ redraw();
+ }
+ });
+
+ }
+ /**
+ * An accessor to set both the X and Y padding widths simultaneously.
+ * @param xpad X padding width.
+ * @param ypad Y padding width.
+ */
+ public void setPadding(int xpad, int ypad) {
+ setXPadding(xpad);
+ setYPadding(ypad);
+ }
+ /**
+ * An accessor to set the X padding width. Padding is defined as pixels inside the bounds
+ * of the drawable area that are left blank when rendering the graph. Valid values are integers
+ * greater than 0. The canvas will silently ignore requests to set the padding width to <=0.
+ * @param xpad New X padding value.
+ */
+ public void setXPadding(int xpad) { this.xpad = xpad > 0 ? xpad : this.xpad; }
+ /**
+ * An accessor to set the Y padding width. Padding is defined as pixels inside the bounds
+ * of the drawable area that are left blank when rendering the graph. Valid values are integers
+ * greater than 0. The canvas will silently ignore requests to set the padding width to <=0.
+ * @param xpad New Y padding value.
+ */
+ public void setYPadding(int ypad) { this.ypad = ypad > 0 ? ypad : this.ypad; }
+ /**
+ * Returns the current X padding value.
+ * @return The X padding width value, in pixels.
+ */
+ public int getXPadding() { return xpad; }
+ /**
+ * Returns the current Y padding value.
+ * @return The Y padding width value, in pixels.
+ */
+ public int getYPadding() { return ypad; }
+
+ /**
+ * The repaint method is called when the graph is out of date and needs to be redrawn. This is an
+ * abstraction method around <code>Canvas.redraw</code> that synchronously executes the request
+ * on the display thread, blocking the calling thread until the repaint is completed.
+ */
+ public synchronized void repaint() {
+ getDisplay().syncExec(new Runnable() {
+ boolean stop = false;
+ public void run() {
+ if(stop) return;
+ try {
+ redraw();
+ } catch (Exception e) {
+ stop = true;
+ }
+ }
+ });
+ }
+
+ /**
+ * Returns the size of the graphing area of the canvas.
+ */
+ public Point getSize() {
+ Point p = new Point(super.getSize().x, super.getSize().y);
+ p.x -= vBar.getSize().x+5;
+ p.y -= hBar.getSize().y+5;
+ return p;
+ }
+
+ /**
+ * Returns the actual bounding area of the canvas, including the width of the scroll bars.
+ */
+ public Point getTrueSize() {
+ return super.getSize();
+ }
+
+ /**
+ * Sets the scaling value for the canvas. This causes graph primitive sizes to change.
+ * The default scaling value is 1.0, and the larger the scaling value, the larger the graph area's
+ * numerical bounds are. For example, if the graph was set from 0 &lt; x &lt; 10, and the scaling value
+ * is reset to 2.0, the new X range is from 0 &lt; x &lt 20.
+ * @param s The new scaling value.
+ */
+ public void setScale(double s) {
+ scale = s;
+ setLocalArea(localArea, true);
+
+ redraw();
+ }
+
+ /**
+ * Resets the canvas size to the specified area.
+ */
+ public void setGlobalArea(Rectangle area) {
+ globalArea = area;
+
+ hBar.setMinimum(getGlobalXMin());
+ hBar.setMaximum (getGlobalXMax());
+ vBar.setMinimum(getGlobalYMin());
+ vBar.setMaximum (getGlobalYMax());
+ }
+
+ /**
+ * Sets the size of the graphing area to the specified area.
+ */
+ public void setLocalArea(Rectangle area) {
+ setLocalArea(area, false);
+ }
+
+ public void setLocalArea(Rectangle area, boolean force) {
+ if(autoScroll || force) {
+ localArea = area;
+
+ hBar.setThumb (getLocalWidth());
+ vBar.setThumb (getLocalHeight());
+
+ hBar.setIncrement(getLocalWidth()>>3);
+ hBar.setPageIncrement(getLocalWidth());
+ vBar.setIncrement(getLocalHeight()>>3);
+ vBar.setPageIncrement(getLocalHeight());
+ }
+ if(autoScroll) {
+ hBar.setSelection(hBar.getMaximum());
+ vBar.setSelection(getGlobalYMax() - Math.min(getLocalYMax(), getGlobalYMax()) + getGlobalYMin());
+ }
+ }
+
+ public int getGlobalXMin() {
+ return globalArea.x;
+ }
+
+ public int getLocalXMin() {
+ return localArea.x;
+ }
+
+ public int getGlobalXMax() {
+ return globalArea.x+globalArea.width;
+ }
+
+ public int getLocalXMax() {
+ return getLocalXMin() + getLocalWidth();
+ }
+
+ public int getGlobalYMin() {
+ return globalArea.y;
+ }
+
+ public int getLocalYMin() {
+ return localArea.y;
+ }
+
+ public int getGlobalYMax() {
+ return globalArea.y+globalArea.height;
+ }
+
+ public int getLocalYMax() {
+ return getLocalYMin() + getLocalHeight();
+ }
+
+ public int getGlobalWidth() {
+ return globalArea.width;
+ }
+
+ public int getLocalWidth() {
+ return (int)(localArea.width / scale);
+ }
+
+ public int getGlobalHeight() {
+ return globalArea.height;
+ }
+
+ public int getLocalHeight() {
+ return (int)(localArea.height / scale);
+ }
+
+ protected Color axisColor;
+ private int xpad, ypad;
+ private ScrollBar hBar, vBar;
+ private Rectangle globalArea, localArea;
+ private boolean autoScroll;
+ private double scale;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphComposite.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphComposite.java
new file mode 100644
index 0000000000..f4d74e1217
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphComposite.java
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.GraphData;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.IGraph;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.graph.GraphFactory;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Scale;
+
+
+
+/**
+ * A Composite type to contain a Graph object.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ */
+public class GraphComposite extends Composite {
+ /**
+ * The default constructor: creates an internal composite for the Graph to render on, asks GraphFactory
+ * to create the graph from the given GraphData and DataSet, then initializes all buttons and listeners.
+ */
+ public GraphComposite(Composite parent, int style, GraphData gd, IDataSet ds) {
+ super(parent, style);
+ FormLayout layout = new FormLayout();
+ layout.marginWidth = 5;
+ layout.marginHeight = 5;
+ this.setLayout(layout);
+ checkOptions = new ArrayList<Button>();
+
+ label = new Label(this, SWT.HORIZONTAL | SWT.CENTER);
+ scale = scales[7];
+ label.setText(scale + Localization.getString("GraphComposite.ScaleValue"));
+ FormData data = new FormData();
+ data.top = new FormAttachment(0,0);
+ data.right = new FormAttachment(100, 0);
+ data.width = 40;
+ label.setLayoutData(data);
+
+ zoomScale = new Scale(this,SWT.VERTICAL | SWT.BORDER);
+ zoomScale.setMinimum(0);
+ zoomScale.setMaximum(14);
+ zoomScale.setIncrement(1);
+ zoomScale.setPageIncrement(1);
+ zoomScale.setSelection(7);
+ data = new FormData();
+ data.top = new FormAttachment(label, 10);
+ data.bottom = new FormAttachment(100, 5);
+ data.right = new FormAttachment(100,-10);
+ zoomScale.setLayoutData(data);
+
+ graph = GraphFactory.createGraph(this, gd, ds);
+ data = new FormData();
+ data.top = new FormAttachment(0,0);
+ data.bottom = new FormAttachment(100,0);
+ data.right = new FormAttachment(label,-10);
+ data.left = new FormAttachment(0,0);
+ graph.setLayoutData(data);
+
+ graph.setBackground(this.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
+ graph.setForeground(this.getDisplay().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
+ this.setBackground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+ zoomScale.addSelectionListener(scaleListener);
+ }
+
+ /**
+ * Toggles sidebar visible or not visible.
+ * @param withSidebar Enables or disables the sidebar.
+ */
+ public void configure(boolean withSidebar) {
+ sidebarVisible = withSidebar;
+
+ for(int i=0; i<checkOptions.size(); i++)
+ ((Button)checkOptions.get(i)).setVisible(sidebarVisible);
+
+ zoomScale.setVisible(sidebarVisible);
+ label.setVisible(sidebarVisible);
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(0,0);
+ data.bottom = new FormAttachment(100,0);
+ data.left = new FormAttachment(0,0);
+ data.right = (withSidebar ? new FormAttachment(label,-10) : new FormAttachment(100, 0));
+ graph.setLayoutData(data);
+
+ layout(true, true);
+ }
+
+ public void addCheckOption(String title, SelectionListener listener) {
+ Button b = new Button(this, SWT.CHECK);
+ b.setText(title);
+
+ Button old = null;
+ if(checkOptions.size() > 0)
+ old = (Button)checkOptions.get(checkOptions.size()-1);
+
+ FormData data = new FormData();
+ data.bottom = (null != old) ? new FormAttachment(old,0) : new FormAttachment(100, 0);
+ data.right = new FormAttachment(100,0);
+ data.width = 85;
+ b.setLayoutData(data);
+ b.addSelectionListener(listener);
+
+ checkOptions.add(b);
+
+ if(checkOptions.size() == 1) {
+ ((FormData)label.getLayoutData()).right = new FormAttachment(b, 0);
+ ((FormData)zoomScale.getLayoutData()).right = new FormAttachment(b, 0);
+ }
+ }
+
+ public void removeCheckOption(String title) {
+ Button b;
+ for(int i=0; i<checkOptions.size(); i++) {
+ b = (Button)checkOptions.get(i);
+ if(b.getText().equals(title)) {
+ checkOptions.remove(b);
+
+ if(checkOptions.size() == 0)
+ ((FormData)label.getLayoutData()).right = new FormAttachment(100, 0);
+
+ return;
+ }
+ }
+ }
+
+ /**
+ * Returns the graph that is rendering to this composite.
+ */
+ public IGraph getGraph() {
+ return graph;
+ }
+
+ /**
+ * Returns the current sidebar visibility state.
+ */
+ public boolean isSidebarVisible() {
+ return sidebarVisible;
+ }
+
+ /**
+ * Dispose is overriden in order to dispose of the listeners attached to this Composite on disposal.
+ */
+ public void dispose() {
+ scaleListener = null;
+
+ if(null != graph) graph.dispose();
+ graph = null;
+
+ if(null != zoomScale) zoomScale.dispose();
+ zoomScale = null;
+
+ if(null != label) label.dispose();
+ label = null;
+ super.dispose();
+ }
+
+ /*
+ * Listeners are below:
+ * scaleListener - detects movement in the Scale widget and rescales the graph on change
+ * titleListener - A SelectionListener for the title button
+ * legendListener - A SelectionListener for the legend checkbox
+ * gridListener - A SelectionListener for the Grid checkbox
+ * normalizeListener - A SelectionListener for the normalization checkbox
+ * propertyChangeListener - Detects changes in user preferences and applies them
+ */
+ private SelectionListener scaleListener = new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ Scale scaler = (Scale) e.widget;
+ int index = scaler.getSelection();
+ if(scale != scales[index]) {
+ scale = scales[index];
+ label.setText(scale + Localization.getString("GraphComposite.ScaleValue"));
+ graph.setScale(scale);
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ };
+
+ private boolean sidebarVisible = true;
+ private IGraph graph;
+ private Scale zoomScale;
+ public double scale;
+ private static final double[] scales = { .0625, .125, .25, .33 , .5, .66, .8, 1.0, 1.25, 1.5, 2, 3, 4, 8, 16 };
+ private Label label;
+
+ private ArrayList<Button> checkOptions;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphLabel.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphLabel.java
new file mode 100644
index 0000000000..6d20382ac8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphLabel.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * The GraphLabel primitive is used to draw a string of text at an arbitrary point on the graph.
+ * @author Ryan Morse
+ *
+ */
+public class GraphLabel implements IGraphPrimitive {
+ public GraphLabel(GraphCanvas canvas, String title, Point center, float size, int style) {
+ this.canvas = canvas;
+ this.title = title;
+ this.center = center;
+ this.size = size;
+ this.style = style;
+ this.parent = null;
+ }
+
+ public GraphLabel(GraphCanvas canvas, String title, Point center, int size, int style) {
+ this(canvas, title, center, (float)size, style);
+ }
+
+ public GraphLabel(GraphCanvas canvas, String title, Composite parent, float size, int style) {
+ this(canvas, title, parent.getSize(), size, style);
+ this.parent = parent;
+ }
+
+ public GraphLabel(GraphCanvas canvas, String title, Composite parent, int size, int style) {
+ this(canvas, title, parent, (float)size, style);
+ }
+
+ public int calculateSize(GC gc) {
+ int width = 0;
+ for (int i=0; i<title.length(); i++)
+ width += gc.getCharWidth(title.charAt(i));
+ return width;
+ }
+
+ public void calculateBounds() {
+ if(null != parent) {
+ Point size = parent.getSize();
+ x = (size.x - width)>>1;
+ y = parent.getBounds().y;
+ } else {
+ x = center.x - (width>>1);
+ y = center.y - (height>>1);
+ }
+ }
+
+ public boolean isVisible() {
+ return true;
+ }
+
+ public boolean isUnder(Point loc) {
+ if(loc.x >= x && loc.y >= y && loc.x <= x+width && loc.y <=y+height)
+ return true;
+ return false;
+ }
+
+ public void paint(GC gc) {
+ if(staticSize)
+ gc.setFont(new Font(canvas.getDisplay(), "Times", (int)size, style));
+ else
+ gc.setFont(new Font(canvas.getDisplay(), "Times", (int)(canvas.getSize().y * size), style));
+
+ width = calculateSize(gc);
+ height = gc.getFontMetrics().getHeight();
+ calculateBounds();
+
+ Color temp = gc.getForeground();
+ gc.setForeground(canvas.axisColor);
+ gc.drawText(title, x, y);
+
+ gc.setForeground(temp);
+ }
+
+ private GraphCanvas canvas;
+ private String title;
+ private int width;
+ private int height;
+ private Point center;
+ private Composite parent;
+
+ private int x, y;
+ private float size;
+ private int style;
+ private boolean staticSize;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphLegend.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphLegend.java
new file mode 100644
index 0000000000..178b169d4e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/GraphLegend.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+
+
+
+/**
+ * A legend primitive for the Graphing system. Used to display a list of
+ * all the series that are on this graph, and to change the current axis on a
+ * normalized multi-series graph.
+ * @author Jeff Briggs
+ * @author Ryan Morse
+ */
+public class GraphLegend implements IGraphPrimitive {
+ public GraphLegend(GraphCanvas graph, String[] keysPassed, Color[] colorsPassed) {
+ this.graph = graph;
+ colors = colorsPassed;
+ keys = keysPassed;
+ bounds = new Rectangle[keys.length];
+
+ width = 0;
+ height = 0;
+ }
+
+ public boolean isVisible() {
+ return true;
+ }
+
+ public void calculateBounds() {
+ x = graph.getSize().x - width;
+ y = 0;
+ }
+
+ private void getSize(GC gc) {
+ textHeight = gc.getFontMetrics().getHeight();
+ height = textHeight * (keys.length + 1) + (BORDER<<1);
+
+ for (int i=0; i<TITLE.length(); i++)
+ width += gc.getCharWidth(TITLE.charAt(i));
+
+ int currWidth;
+ for(int i=0; i<keys.length; i++) {
+ currWidth = 0;
+ for (int j=0; j<keys[i].length(); j++)
+ currWidth += gc.getCharWidth(keys[i].charAt(j));
+
+ if (currWidth > width)
+ width = currWidth;
+ }
+ width += BOX_SIZE + 3*BORDER;
+ }
+
+ public boolean isUnder(Point loc) {
+ if(loc.x >=x && loc.y >= y && loc.x <= x+width && loc.y <= y+height)
+ return true;
+ return false;
+ }
+
+ public void paint(GC gc) {
+ if(width == 0 || height ==0)
+ getSize(gc);
+ calculateBounds();
+
+ Color temp = gc.getForeground();
+ gc.setForeground(graph.axisColor);
+ gc.drawRectangle(x, y, width, height);
+ gc.fillRectangle(x+1, y+1, width-1, height-1);
+ gc.drawText(TITLE, x+BORDER, y+BORDER);
+
+ for (int i=0; i<keys.length; i++) {
+ gc.setForeground(colors[i]);
+
+ bounds[i] = new Rectangle(x+BORDER, y+BORDER+((i+1)*textHeight), BOX_SIZE, BOX_SIZE);
+ gc.fillGradientRectangle(bounds[i].x, bounds[i].y, BOX_SIZE, BOX_SIZE, true);
+
+ gc.setForeground(graph.axisColor);
+ gc.drawText(keys[i], x+(BORDER<<1)+BOX_SIZE, bounds[i].y);
+ }
+
+ gc.setForeground(temp);
+ }
+
+ private final GraphCanvas graph;
+ private int x, y, width, height, textHeight;
+
+ private String[] keys;
+ private Color[] colors;
+ private Rectangle[] bounds;
+
+ private static final int BORDER = 5;
+ private static final int BOX_SIZE = 15;
+ private static final String TITLE = Localization.getString("GraphLegend.Legend");
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/IGraphPrimitive.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/IGraphPrimitive.java
new file mode 100644
index 0000000000..64b950004d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/widgets/IGraphPrimitive.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets;
+
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+
+/**
+ * Graphing Primitive Interface, defines the basic mechanism through which graph objects are drawn
+ * to a Graph type.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ *
+ */
+public interface IGraphPrimitive {
+ /**
+ * Paint method, called by the Graph object to paint the graph.
+ * @param gc GC object to render with.
+ */
+ public void paint(GC gc);
+
+ /**
+ * CalculateBounds method, called by the Graph object when the graph's bounds changed (say
+ * if a data sample was added) in order to allow the primitives to update their locations.
+ *
+ * The behavior of this method is entirely left up to the primitive author, but it is ideally
+ * used to take care of location and bounds calculations for graph objects, rather than performing
+ * such calculations during the paint method.
+ */
+ public void calculateBounds();
+
+ /**
+ * This method determines if the graph primitive is currently shown on the Graph surface.
+ * @return True if the primitive is currently displayed on the graph surface.
+ */
+ public boolean isVisible();
+
+ /**
+ * This method determines if the primitive covers the given point. If the point is inside the
+ * bounds of the graph primitive, the point is defined as isUnder=true.
+ * @param loc Location to test.
+ * @return True if the location is inside the bounds of the primitive.
+ */
+ public boolean isUnder(Point loc);
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/DataSetFactory.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/DataSetFactory.java
new file mode 100644
index 0000000000..c98213c927
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/DataSetFactory.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset;
+
+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.datasets.IFilteredDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.FilteredRowDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowParser;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.FilteredTableDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.TableDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.TableParser;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.datadisplay.DataGrid;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IMemento;
+
+
+
+public final class DataSetFactory {
+ public static IDataSet createDataSet(String id, String[] labels) {
+ if(id.equals(RowDataSet.ID))
+ return new RowDataSet(labels);
+ else if(id.equals(TableDataSet.ID))
+ return new TableDataSet(labels);
+ return null;
+ }
+
+ public static IFilteredDataSet createFilteredDataSet(String id, String[] labels) {
+ if(id.equals(RowDataSet.ID))
+ return new FilteredRowDataSet(labels);
+ else if(id.equals(TableDataSet.ID))
+ return new FilteredTableDataSet(labels);
+ return new FilteredRowDataSet(labels);
+ }
+
+ public static IFilteredDataSet createFilteredDataSet(IDataSet set) {
+ if(set instanceof RowDataSet)
+ return new FilteredRowDataSet((RowDataSet)set);
+ else if(set instanceof TableDataSet)
+ return new FilteredTableDataSet((TableDataSet)set);
+ return null;
+ }
+
+ public static String[] getIDs() {
+ return ids;
+ }
+
+ public static String getName(String id) {
+ int index = getIndex(id);
+ if(index >= 0)
+ return names[index];
+ return null;
+ }
+
+ public static String getDescription(String id) {
+ int index = getIndex(id);
+ if(index >= 0)
+ return descriptions[index];
+ return null;
+ }
+
+ public static ParsingWizardPage getParsingWizardPage(String id) {
+ ParsingWizardPage page = null;
+
+ int index = getIndex(id);
+ if(index >=0 && index < dataSetWizards.length)
+ return dataSetWizards[index];
+
+ return page;
+ }
+
+ public static IDataSetParser createParserXML(String id, IMemento source) {
+ if(id.equals(ids[0]))
+ return new RowParser(source);
+ else if(id.equals(ids[1]))
+ return new TableParser(source);
+
+ return null;
+ }
+
+ public static DataGrid getDataGrid(Composite composite, IDataSet set) {
+ if(set instanceof RowDataSet)
+ return new DataGrid(composite, (RowDataSet)set, DataGrid.NONE);
+ else if(set instanceof TableDataSet)
+ return new DataGrid(composite, (TableDataSet)set, DataGrid.FULL_UPDATE);
+
+ return null;
+ }
+
+ private static int getIndex(String id) {
+ for(int i=0; i<ids.length; i++)
+ if(id.equals(ids[i]))
+ return i;
+ return -1;
+ }
+
+ private static final String[] ids = {
+ RowDataSet.ID,
+ TableDataSet.ID
+ };
+
+ private static final String[] names = {
+ Localization.getString("DataSetFactory.RowDataSet"),
+ Localization.getString("DataSetFactory.TableDataSet")
+ };
+
+ private static final String[] descriptions = {
+ Localization.getString("DataSetFactory.RowDataSetDescription") +
+ Localization.getString("DataSetFactory.DataSetExample") +
+ Localization.getString("DataSetFactory.DataSetHeader") +
+ "1305 2309 4233\n" +
+ "2322 3234 4223\n" +
+ "2321 3123 4533\n" +
+ "2343 2931 4423\n" +
+ "1356 2984 3850\n",
+
+ Localization.getString("DataSetFactory.TableDataSetDescription") +
+ Localization.getString("DataSetFactory.DataSetExample") +
+ Localization.getString("DataSetFactory.DataSetHeader") +
+ "2322 3232 3453\n" +
+ "2321 3123 4533\n" +
+ "2145 2135 5921\n" +
+ "-------------------\n" +
+ Localization.getString("DataSetFactory.DataSetHeader") +
+ "2343 2931 4423\n" +
+ "2234 2723 5233\n" +
+ "3215 3565 4922\n" +
+ "-------------------\n"
+ };
+
+ private static final ParsingWizardPage[] dataSetWizards = new ParsingWizardPage[] {
+ new SelectRowParsingWizardPage(),
+ new SelectTableParsingWizardPage()
+ };
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/DataSetWizard.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/DataSetWizard.java
new file mode 100644
index 0000000000..c667b11219
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/DataSetWizard.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.eclipse.jface.dialogs.IPageChangedListener;
+import org.eclipse.jface.dialogs.PageChangedEvent;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
+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.ui.internal.Localization;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.XMLMemento;
+
+
+
+public class DataSetWizard extends Wizard implements INewWizard {
+ public DataSetWizard(File metaFile, String scriptFile) {
+ this.metaFile = metaFile;
+ this.scriptFile = scriptFile;
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {}
+
+ public void addPages() {
+ setWindowTitle(Localization.getString("DataSetWizard.CreateDataSet"));
+ dataSetPage = new SelectDataSetWizardPage();
+ addPage(dataSetPage);
+
+ String[] ids = DataSetFactory.getIDs();
+ parsingPages = new ParsingWizardPage[ids.length];
+ for(int i=0; i<ids.length; i++) {
+ parsingPages[i] = DataSetFactory.getParsingWizardPage(ids[i]);
+ addPage(parsingPages[i]);
+ }
+
+ ((WizardDialog)getContainer()).addPageChangedListener(pageListener);
+ }
+
+ public boolean canFinish() {
+ IWizardPage page = this.getContainer().getCurrentPage();
+ if((null != dataSet) && (null != parser) && (page instanceof ParsingWizardPage))
+ return true;
+ return false;
+ }
+
+ public boolean performCancel() {
+ parser = null;
+ dataSet = null;
+ return true;
+ }
+
+ public boolean performFinish() {
+ writeParsingExpression();
+ return true;
+ }
+
+ public IDataSetParser getParser() {
+ return parser;
+ }
+
+ public IDataSet getDataSet() {
+ return dataSet;
+ }
+
+ private boolean writeParsingExpression() {
+ XMLMemento data = copyExisting();
+ if(null == data)
+ data = XMLMemento.createWriteRoot(IDataSetParser.XMLDataSetSettings);
+
+ try {
+ IMemento child = data.createChild(IDataSetParser.XMLFile, scriptFile);
+
+ saveColumns(child, dataSet.getTitles());
+ parser.saveXML(child);
+
+ FileWriter writer = new FileWriter(metaFile);
+ data.save(writer);
+ writer.close();
+ } catch(FileNotFoundException fnfe) {
+ return false;
+ } catch(Exception e) {
+ return false;
+ }
+
+ return true;
+ }
+
+ protected XMLMemento copyExisting() {
+ XMLMemento data = null;
+ try {
+ FileReader reader = new FileReader(metaFile);
+ if(!reader.ready())
+ return null;
+
+ data = XMLMemento.createReadRoot(reader, IDataSetParser.XMLDataSetSettings);
+ IMemento[] children = data.getChildren(IDataSetParser.XMLFile);
+
+ data = XMLMemento.createWriteRoot(IDataSetParser.XMLDataSetSettings);
+
+ IMemento child;
+ String dataSetID;
+ for(int i=0; i<children.length; i++) {
+ if(!scriptFile.equals(children[i].getID())) {
+ child = data.createChild(IDataSetParser.XMLFile, children[i].getID());
+ dataSetID = children[i].getString(IDataSetParser.XMLdataset);
+ child.putString(IDataSetParser.XMLdataset, dataSetID);
+
+ DataSetFactory.getParsingWizardPage(dataSetID).copyExisting(children[i], child);
+ }
+ }
+ } catch(FileNotFoundException fnfe) {
+ } catch(IOException ioe) {
+ } catch(WorkbenchException we) {}
+
+ return data;
+ }
+
+ protected boolean saveColumns(IMemento target, String[] columns) {
+ IMemento child;
+ for(int i=0; i<columns.length; i++) {
+ child = target.createChild(IDataSetParser.XMLColumn);
+ child.putString(IDataSetParser.XMLname, columns[i]);
+ }
+ return true;
+ }
+
+ protected boolean openFile() {
+ try {
+ if (!metaFile.exists())
+ metaFile.createNewFile();
+ } catch(IOException ioe) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public void dispose() {
+ if(null != getContainer())
+ ((WizardDialog)getContainer()).removePageChangedListener(pageListener);
+ if(null != dataSetPage)
+ dataSetPage.dispose();
+ if(null != parsingPages) {
+ for(int i=0; i<parsingPages.length; i++) {
+ if(null != parsingPages[i]) {
+ parsingPages[i].dispose();
+ parsingPages[i] = null;
+ }
+ }
+ parsingPages = null;
+ }
+ }
+
+ private IPageChangedListener pageListener = new IPageChangedListener() {
+ public void pageChanged(PageChangedEvent e) {
+ if(e.getSelectedPage() instanceof ParsingWizardPage) {
+ ((ParsingWizardPage)e.getSelectedPage()).checkComplete();
+ getContainer().updateButtons();
+ }
+ }
+ };
+
+ private SelectDataSetWizardPage dataSetPage;
+
+ private ParsingWizardPage[] parsingPages;
+ public String scriptFile;
+ public File metaFile;
+ public IDataSet dataSet;
+ public IDataSetParser parser;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/ParsingWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/ParsingWizardPage.java
new file mode 100644
index 0000000000..8c8a8e3da3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/ParsingWizardPage.java
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IMemento;
+
+
+
+public abstract class ParsingWizardPage extends WizardPage {
+ public ParsingWizardPage(String title) {
+ super(title);
+ }
+
+ public void createControl(Composite parent) {
+ wizard = (DataSetWizard)super.getWizard();
+ }
+
+ protected void createColumnSelector(Composite parent) {
+ Label lblSeries = new Label(parent, SWT.NONE);
+ lblSeries.setText(Localization.getString("ParsingWizardPage.NumberOfColumns"));
+ lblSeries.setBounds(0, 5, 120, 25);
+
+ txtSeries = new Text(parent, SWT.BORDER);
+ txtSeries.setBounds(125, 0, 100, 25);
+ txtSeries.setText("2"); //$NON-NLS-1$
+ txtSeries.setTextLimit(2);
+ txtSeries.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ if(!"".equals(txtSeries.getText().trim())) {
+ displayTextBoxes();
+ refreshRegEx();
+ }
+ }
+ });
+ txtSeries.addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ if(('0' > e.character || '9' < e.character) && 31 < e.character && 127 > e.character)
+ e.doit = false;
+ }
+
+ public void keyReleased(KeyEvent e) {}
+ });
+
+
+ Label lblRegExTitle = new Label(parent, SWT.NONE);
+ lblRegExTitle.setText(Localization.getString("ParsingWizardPage.RegularExpression"));
+ lblRegExTitle.setBounds(5, 325, 150, 20);
+
+ lblRegEx = new Label(parent, SWT.NONE);
+ lblRegEx.setBounds(155, 325, 300, 20);
+
+
+ Label lblTitle = new Label(parent, SWT.NONE);
+ lblTitle.setText(Localization.getString("ParsingWizardPage.Title"));
+ lblTitle.setBounds(0, 45, 150, 25);
+ Label lblExpr = new Label(parent, SWT.NONE);
+ lblExpr.setText(Localization.getString("ParsingWizardPage.RegularExpression"));
+ lblExpr.setBounds(160, 45, 150, 25);
+ Label lblSpace = new Label(parent, SWT.NONE);
+ lblSpace.setText(Localization.getString("ParsingWizardPage.Delimiter"));
+ lblSpace.setBounds(310, 45, 150, 25);
+
+ ScrolledComposite sc1 = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ sc1.setBounds(0, 70, 475, 250);
+ cmpTextFields = new Composite(sc1, SWT.NONE);
+ sc1.setContent(cmpTextFields);
+
+ txtRegExpr = new Text[MAX_SERIES*COLUMNS];
+ for(int i=0; i<txtRegExpr.length; i++) {
+ txtRegExpr[i] = new Text(cmpTextFields, SWT.BORDER);
+ txtRegExpr[i].setBounds(150*(i%COLUMNS), 30*(i/COLUMNS), 140, 25);
+
+ if(2 == i%COLUMNS)
+ txtRegExpr[i].setText("\\D+");
+ else if(1 == i%COLUMNS)
+ txtRegExpr[i].setText("\\d+");
+ }
+
+ readParsingExpression();
+
+ //Do this after readingParsingExpressions so events arn't fired
+ for(int i=0; i<txtRegExpr.length; i++) {
+ if(0 != i%COLUMNS)
+ txtRegExpr[i].addModifyListener(regExListener);
+ else
+ txtRegExpr[i].addModifyListener(textListener);
+ }
+
+ displayTextBoxes();
+ refreshRegEx();
+ }
+
+ private void displayTextBoxes() {
+ int series = Integer.parseInt(txtSeries.getText());
+ if(series > MAX_SERIES) {
+ txtSeries.setText("" +MAX_SERIES);
+ return;
+ }
+ cmpTextFields.setSize(450, series * 30);
+ series *= COLUMNS;
+
+ for(int i=0; i<txtRegExpr.length; i++) {
+ if(i < series)
+ txtRegExpr[i].setVisible(true);
+ else
+ txtRegExpr[i].setVisible(false);
+ }
+ }
+
+ private void refreshRegEx() {
+ int series = Integer.parseInt(txtSeries.getText());
+ series *= COLUMNS;
+ StringBuilder s = new StringBuilder();
+ for(int i=0; i<series; i++)
+ if(0 != i%COLUMNS)
+ s.append(txtRegExpr[i].getText());
+ lblRegEx.setText(s.toString());
+ }
+
+ public boolean canFlipToNextPage() {
+ return false;
+ }
+
+ public void dispose() {
+ if(null != txtRegExpr) {
+ for(int i=0; i<txtRegExpr.length; i++) {
+ if(null != txtRegExpr[i]) {
+ if(0 != i%COLUMNS)
+ txtRegExpr[i].removeModifyListener(regExListener);
+ else
+ txtRegExpr[i].removeModifyListener(textListener);
+ txtRegExpr[i].dispose();
+ }
+ txtRegExpr[i] = null;
+ }
+ txtRegExpr = null;
+ }
+ super.dispose();
+ }
+
+ public boolean checkComplete() {
+ int series = Integer.parseInt(txtSeries.getText());
+ labels = new String[series];
+ regEx = new String[series*(COLUMNS-1)];
+
+ for(int i=0, j=0, k=0; i<(series*COLUMNS); i++) {
+ if("".equals(txtRegExpr[i].getText())) {
+ regEx = null;
+ wizard.parser = null;
+ wizard.dataSet = null;
+ return false;
+ }
+
+ if(0 == i%COLUMNS) {
+ labels[j] = txtRegExpr[i].getText();
+ j++;
+ } else {
+ regEx[k] = txtRegExpr[i].getText();
+ k++;
+ }
+ }
+ return true;
+ }
+
+ abstract boolean readParsingExpression();
+ abstract void copyExisting(IMemento oldMeta, IMemento newMeta);
+
+ protected class TextModifyListener implements ModifyListener {
+ public void modifyText(ModifyEvent e) {
+ checkComplete();
+ wizard.getContainer().updateButtons();
+ }
+ }
+
+ private class RegExModifyListener extends TextModifyListener {
+ public void modifyText(ModifyEvent e) {
+ super.modifyText(e);
+ refreshRegEx();
+ }
+ }
+
+ protected ModifyListener textListener = new TextModifyListener();
+ protected ModifyListener regExListener = new RegExModifyListener();
+
+ protected DataSetWizard wizard;
+ public static final int COLUMNS = 3;
+ private static final int MAX_SERIES = 24;
+
+ protected Text txtSeries;
+ protected Text[] txtRegExpr;
+ protected Label lblRegEx;
+ private Composite cmpTextFields;
+
+ protected String[] labels;
+ protected String[] regEx;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectDataSetWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectDataSetWizardPage.java
new file mode 100644
index 0000000000..4cb8e712ef
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectDataSetWizardPage.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset;
+
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+
+
+
+public class SelectDataSetWizardPage extends WizardPage {
+ public SelectDataSetWizardPage() {
+ super("selectDataSetType");
+ setTitle(Localization.getString("SelectDataSetWizardPage.SelectDataSetType"));
+ dataSetID = "";
+ btnDataSets = null;
+ }
+
+ public void createControl(Composite parent) {
+ wizard = (DataSetWizard)super.getWizard();
+
+ Composite comp = new Composite(parent, SWT.NULL);
+ comp.setLayout(new FormLayout());
+ FormData data1 = new FormData();
+ data1.left = new FormAttachment(0, 0);
+ data1.top = new FormAttachment(0, 0);
+ data1.right = new FormAttachment(40, 0);
+ data1.bottom = new FormAttachment(100, 0);
+
+ Composite cmpFilterOpts = new Composite(comp, SWT.NONE);
+ cmpFilterOpts.setLayoutData(data1);
+ ColumnLayout colLayout = new ColumnLayout();
+ colLayout.maxNumColumns = 1;
+ cmpFilterOpts.setLayout(colLayout);
+
+ String[] ids = DataSetFactory.getIDs();
+ btnDataSets = new Button[ids.length];
+ for(int i=0; i<btnDataSets.length; i++) {
+ btnDataSets[i] = new Button(cmpFilterOpts, SWT.NONE);
+ btnDataSets[i].setText(DataSetFactory.getName(ids[i]));
+ btnDataSets[i].addSelectionListener(buttonListener);
+ btnDataSets[i].setData(ids[i]);
+ }
+
+ FormData data2 = new FormData();
+ data2.left = new FormAttachment(cmpFilterOpts);
+ data2.top = new FormAttachment(0, 0);
+ data2.right = new FormAttachment(100, 0);
+ data2.bottom = new FormAttachment(100, 0);
+
+ lblDesc = new Label(comp, SWT.WRAP);
+ lblDesc.setLayoutData(data2);
+
+ setControl(comp);
+ }
+
+ public boolean canFlipToNextPage() {
+ return (dataSetID.length() > 0);
+ }
+
+ public IWizardPage getNextPage() {
+ return DataSetFactory.getParsingWizardPage(dataSetID);
+ }
+
+ public void dispose() {
+ super.dispose();
+ if(null != btnDataSets)
+ for(int i=0; i<btnDataSets.length; i++) {
+ btnDataSets[i].removeSelectionListener(buttonListener);
+ btnDataSets[i].dispose();
+ btnDataSets[i] = null;
+ }
+ btnDataSets = null;
+ lblDesc = null;
+ }
+
+ private SelectionListener buttonListener = new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {}
+
+ public void widgetSelected(SelectionEvent e) {
+ if(e.widget instanceof Button) {
+ Button target = (Button)e.widget;
+
+ for(int i=0; i<btnDataSets.length; i++) {
+ if(target == btnDataSets[i]) {
+ dataSetID = btnDataSets[i].getData().toString();
+ lblDesc.setText(DataSetFactory.getName(dataSetID) + "\n\n" +
+ DataSetFactory.getDescription(dataSetID));
+ wizard.getContainer().updateButtons();
+ }
+ }
+ }
+ }
+ };
+
+ private Button[] btnDataSets;
+ private Label lblDesc;
+ private String dataSetID;
+ private DataSetWizard wizard;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectRowParsingWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectRowParsingWizardPage.java
new file mode 100644
index 0000000000..4db4b481c5
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectRowParsingWizardPage.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset;
+
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.regex.PatternSyntaxException;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSetParser;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.row.RowParser;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.XMLMemento;
+
+
+
+public class SelectRowParsingWizardPage extends ParsingWizardPage {
+ public SelectRowParsingWizardPage() {
+ super("selectRowDataSetParsing");
+ setTitle(Localization.getString("SelectRowParsingWizardPage.SelectRowDataSetParsing"));
+ }
+
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+
+ Composite comp = new Composite(parent, SWT.NONE);
+ createColumnSelector(comp);
+
+ setControl(comp);
+ }
+
+ protected boolean readParsingExpression() {
+ if(null == wizard.metaFile && !wizard.openFile())
+ return false;
+
+ try {
+ FileReader reader = new FileReader(wizard.metaFile);
+
+ if(!reader.ready())
+ return false;
+
+ XMLMemento data = XMLMemento.createReadRoot(reader, IDataSetParser.XMLDataSetSettings);
+
+ IMemento[] children = data.getChildren(IDataSetParser.XMLFile);
+ int i;
+ for(i=0; i<children.length; i++) {
+ if(children[i].getID().equals(wizard.scriptFile))
+ break;
+ }
+
+ if(i>=children.length) //Didn't find file
+ return false;
+
+ if(0 != children[i].getString(IDataSetParser.XMLdataset).compareTo(RowDataSet.ID))
+ return false;
+
+ IMemento[] children2 = children[i].getChildren(IDataSetParser.XMLColumn);
+ txtSeries.setText("" + children2.length);
+ for(int j=0; j<children2.length; j++)
+ txtRegExpr[j*COLUMNS].setText(children2[j].getString(IDataSetParser.XMLname));
+
+ children2 = children[i].getChildren(IDataSetParser.XMLSeries);
+ txtSeries.setText("" + children2.length);
+ for(int j=0; j<children2.length; j++) {
+ txtRegExpr[j*COLUMNS+1].setText(children2[j].getString(IDataSetParser.XMLparsingExpression));
+ txtRegExpr[j*COLUMNS+2].setText(children2[j].getString(IDataSetParser.XMLparsingSpacer));
+ }
+
+ reader.close();
+ } catch(FileNotFoundException fnfe) {
+ return false;
+ } catch(WorkbenchException we) {
+ return false;
+ } catch(IOException ioe) {
+ return false;
+ }
+
+ return true;
+ }
+
+ protected void copyExisting(IMemento oldMeta, IMemento newMeta) {
+ IMemento[] children = oldMeta.getChildren(IDataSetParser.XMLColumn);
+ IMemento child;
+ for(int j=0; j<children.length; j++) {
+ child = newMeta.createChild(IDataSetParser.XMLColumn);
+ child.putString(IDataSetParser.XMLname, children[j].getString(IDataSetParser.XMLname));
+ }
+ children = oldMeta.getChildren(IDataSetParser.XMLSeries);
+ for(int j=0; j<children.length; j++) {
+ child = newMeta.createChild(IDataSetParser.XMLSeries);
+ child.putString(IDataSetParser.XMLparsingExpression, children[j].getString(IDataSetParser.XMLparsingExpression));
+ child.putString(IDataSetParser.XMLparsingSpacer, children[j].getString(IDataSetParser.XMLparsingSpacer));
+ }
+ }
+
+ public boolean checkComplete() {
+ if(super.checkComplete()) {
+ try {
+ wizard.parser = new RowParser(regEx);
+ wizard.dataSet = DataSetFactory.createDataSet(RowDataSet.ID, labels);
+ return true;
+ } catch(PatternSyntaxException pse) {}
+ }
+ wizard.parser = null;
+ wizard.dataSet = null;
+ return false;
+ }
+
+ public void dispose() {
+ super.dispose();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectTableParsingWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectTableParsingWizardPage.java
new file mode 100644
index 0000000000..d2270c2650
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/dataset/SelectTableParsingWizardPage.java
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset;
+
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.regex.PatternSyntaxException;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSetParser;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.TableDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.table.TableParser;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.XMLMemento;
+
+
+
+public class SelectTableParsingWizardPage extends ParsingWizardPage {
+ public SelectTableParsingWizardPage() {
+ super("selectTableDataSetParsing");
+ setTitle(Localization.getString("SelectTableParsingWizardPage.SelectTableDataSetParsing"));
+ }
+
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+
+ Composite comp = new Composite(parent, SWT.NONE);
+ Label l = new Label(comp, SWT.NONE);
+ l.setText(Localization.getString("SelectTableParsingWizardPage.TableDelimiter"));
+ l.setBounds(5, 350, 150, 25);
+ txtDelim = new Text(comp, SWT.SINGLE | SWT.BORDER);
+
+ createColumnSelector(comp);
+
+ txtDelim.setBounds(160, 350, 200, 25);
+ txtDelim.addModifyListener(textListener);
+
+ setControl(comp);
+ }
+
+ protected boolean readParsingExpression() {
+ if(null == wizard.metaFile && !wizard.openFile())
+ return false;
+
+ try {
+ FileReader reader = new FileReader(wizard.metaFile);
+
+ if(!reader.ready())
+ return false;
+
+ XMLMemento data = XMLMemento.createReadRoot(reader, IDataSetParser.XMLDataSetSettings);
+
+ IMemento[] children = data.getChildren(IDataSetParser.XMLFile);
+ int i;
+ for(i=0; i<children.length; i++) {
+ if(children[i].getID().equals(wizard.scriptFile))
+ break;
+ }
+
+ if(i>=children.length) //Didn't find file
+ return false;
+
+ if(0 != children[i].getString(IDataSetParser.XMLdataset).compareTo(TableDataSet.ID))
+ return false;
+
+ IMemento[] children2 = children[i].getChildren(IDataSetParser.XMLColumn);
+ txtSeries.setText("" + children2.length);
+ for(int j=0; j<children2.length; j++)
+ txtRegExpr[j*COLUMNS].setText(children2[j].getString(IDataSetParser.XMLname));
+
+ children2 = children[i].getChildren(IDataSetParser.XMLSeries);
+ txtSeries.setText("" + children2.length);
+ for(int j=0; j<children2.length; j++) {
+ txtRegExpr[j*COLUMNS+1].setText(children2[j].getString(IDataSetParser.XMLparsingExpression));
+ txtRegExpr[j*COLUMNS+2].setText(children2[j].getString(IDataSetParser.XMLparsingSpacer));
+ }
+ txtDelim.setText(children[i].getChild(IDataSetParser.XMLDelimiter).getString(IDataSetParser.XMLparsingExpression));
+
+ reader.close();
+ } catch(FileNotFoundException fnfe) {
+ return false;
+ } catch(WorkbenchException we) {
+ return false;
+ } catch(IOException ioe) {
+ return false;
+ }
+
+ return true;
+ }
+
+ protected void copyExisting(IMemento oldMeta, IMemento newMeta) {
+ IMemento[] children = oldMeta.getChildren(IDataSetParser.XMLColumn);
+ IMemento child;
+ for(int j=0; j<children.length; j++) {
+ child = newMeta.createChild(IDataSetParser.XMLColumn);
+ child.putString(IDataSetParser.XMLname, children[j].getString(IDataSetParser.XMLname));
+ }
+ children = oldMeta.getChildren(IDataSetParser.XMLSeries);
+ for(int j=0; j<children.length; j++) {
+ child = newMeta.createChild(IDataSetParser.XMLSeries);
+ child.putString(IDataSetParser.XMLparsingExpression, children[j].getString(IDataSetParser.XMLparsingExpression));
+ child.putString(IDataSetParser.XMLparsingSpacer, children[j].getString(IDataSetParser.XMLparsingSpacer));
+ }
+ newMeta.createChild(IDataSetParser.XMLDelimiter).putString(IDataSetParser.XMLparsingExpression, oldMeta.getChild(IDataSetParser.XMLDelimiter).getString(IDataSetParser.XMLparsingExpression));
+ }
+
+ public boolean checkComplete() {
+ if(super.checkComplete() && txtDelim.getText().length() > 0) {
+ try {
+ wizard.parser = new TableParser(regEx, txtDelim.getText());
+ wizard.dataSet = DataSetFactory.createDataSet(TableDataSet.ID, labels);
+ return true;
+ } catch(PatternSyntaxException pse) {}
+ }
+ wizard.parser = null;
+ wizard.dataSet = null;
+ return false;
+ }
+
+ public void dispose() {
+ super.dispose();
+ if(null != txtDelim) {
+ txtDelim.removeModifyListener(textListener);
+ txtDelim.dispose();
+ txtDelim = null;
+ }
+ }
+
+ protected Text txtDelim;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/AggregateFactory.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/AggregateFactory.java
new file mode 100644
index 0000000000..687dc2a56e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/AggregateFactory.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter;
+
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.AverageAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.CountAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.IDataAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.MaxAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.MinAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.aggregates.SumAggregate;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+
+
+
+public final class AggregateFactory {
+ private static final String[] aggregateNames = new String[] {
+ Localization.getString("AggregateFactory.AverageAggregate"),
+ Localization.getString("AggregateFactory.CountAggregate"),
+ Localization.getString("AggregateFactory.MaxAggregate"),
+ Localization.getString("AggregateFactory.MinAggregate"),
+ Localization.getString("AggregateFactory.SumAggregate")
+ };
+
+ private static final String[] aggregateDescriptions = new String[] {
+ Localization.getString("AggregateFactory.AverageDescription"),
+ Localization.getString("AggregateFactory.CountDescription"),
+ Localization.getString("AggregateFactory.MaxDescription"),
+ Localization.getString("AggregateFactory.MinDescription"),
+ Localization.getString("AggregateFactory.SumDescription")
+ };
+
+ public static final String[] aggregateIDs = new String[] {
+ AverageAggregate.ID,
+ CountAggregate.ID,
+ MaxAggregate.ID,
+ MinAggregate.ID,
+ SumAggregate.ID
+ };
+
+ public static String getAggregateName(String id) {
+ int index = getIndex(id);
+ if(index >= 0)
+ return aggregateNames[index];
+ return null;
+ }
+
+ public static String getAggregateDescription(String id) {
+ int index = getIndex(id);
+ if(index >= 0)
+ return aggregateDescriptions[index];
+ return null;
+ }
+
+ private static int getIndex(String id) {
+ for(int i=0; i< aggregateIDs.length; i++)
+ if(id.equals(aggregateIDs[i]))
+ return i;
+
+ return -1;
+ }
+
+ public static final IDataAggregate createAggregate(String id) {
+ switch(getIndex(id)) {
+ case 0:
+ return new AverageAggregate();
+ case 1:
+ return new CountAggregate();
+ case 2:
+ return new MaxAggregate();
+ case 3:
+ return new MinAggregate();
+ case 4:
+ return new SumAggregate();
+ }
+ return null;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/AvailableFilterTypes.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/AvailableFilterTypes.java
new file mode 100644
index 0000000000..4065aaeadc
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/AvailableFilterTypes.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.IDataSetFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.MatchFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.RangeFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.SortFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.UniqueFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.ui.IMemento;
+
+
+
+public final class AvailableFilterTypes {
+ private static final String[] filterNames = new String[] {
+ Localization.getString("AvailableFilterTypes.MatchFilter"),
+ Localization.getString("AvailableFilterTypes.RangeFilter"),
+ Localization.getString("AvailableFilterTypes.SortFilter"),
+ Localization.getString("AvailableFilterTypes.UniqueFilter")
+ };
+
+ private static final String[] filterDescriptions = new String[] {
+ Localization.getString("AvailableFilterTypes.MatchFilterDescription"),
+ Localization.getString("AvailableFilterTypes.RangeFilterDescription"),
+ Localization.getString("AvailableFilterTypes.SortFilterDescription"),
+ Localization.getString("AvailableFilterTypes.UniqueFilterDescription")
+ };
+
+ private static final FilterWizardPage[] filterWizards = new FilterWizardPage[] {
+ new MatchFilterWizardPage(),
+ new RangeFilterWizardPage(),
+ new SortFilterWizardPage(),
+ new UniqueFilterWizardPage()
+ };
+
+ public static final String[] filterIDs = new String[] {
+ MatchFilter.ID,
+ RangeFilter.ID,
+ SortFilter.ID,
+ UniqueFilter.ID
+ };
+
+ public static FilterWizardPage getFilterWizardPage(String id) {
+ FilterWizardPage page = null;
+
+ int index = getIndex(id);
+ if(index >=0 && index < filterWizards.length)
+ return filterWizards[index];
+
+ return page;
+ }
+
+ public static String getFilterName(String id) {
+ int index = getIndex(id);
+ if(index >= 0)
+ return filterNames[index];
+ return null;
+ }
+
+ public static String getFilterDescription(String id) {
+ int index = getIndex(id);
+ if(index >= 0)
+ return filterDescriptions[index];
+ return null;
+ }
+
+ public static IDataSetFilter getDataSetFilter(IMemento xml) {
+ String id = xml.getID();
+ int column = xml.getInteger("column").intValue();
+ int style;
+
+ switch(getIndex(id)) {
+ case 0:
+ String val = xml.getString("value");
+ style = xml.getInteger("style").intValue();
+ return new MatchFilter(column, val, style);
+ case 1:
+ style = xml.getInteger("style").intValue();
+ String l = xml.getString("low");
+ String h = xml.getString("high");
+
+ Number low, high;
+ if(l.contains("."))
+ low = new Double(Double.parseDouble(l));
+ else
+ low = new Long(Long.parseLong(l));
+ if(h.contains("."))
+ high = new Double(Double.parseDouble(h));
+ else
+ high = new Long(Long.parseLong(h));
+
+ return new RangeFilter(column, low, high, style);
+ case 2:
+ style = xml.getInteger("style").intValue();
+ return new SortFilter(column, style);
+ case 3:
+ String agg = xml.getString("aggregate");
+ style = xml.getInteger("style").intValue();
+ return new UniqueFilter(column, AggregateFactory.createAggregate(agg), style);
+ }
+ return null;
+ }
+
+ private static int getIndex(String id) {
+ for(int i=0; i< filterIDs.length; i++)
+ if(id.equals(filterIDs[i]))
+ return i;
+
+ return -1;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/FilterWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/FilterWizardPage.java
new file mode 100644
index 0000000000..0d00d49b75
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/FilterWizardPage.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+
+public abstract class FilterWizardPage extends WizardPage {
+ public FilterWizardPage(String title) {
+ super("selectFilterOptions");
+ setTitle(title);
+ }
+
+ public void createControl(Composite parent) {
+ wizard = (SelectFilterWizard)super.getWizard();
+ }
+
+ public boolean canFlipToNextPage() {
+ return false;
+ }
+
+ abstract void createFilter();
+
+ public void dispose() {
+ wizard = null;
+ super.dispose();
+ }
+
+ protected final SelectionListener selectionListener = new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {}
+
+ public void widgetSelected(SelectionEvent e) {
+ createFilter();
+ wizard.getContainer().updateButtons();
+ }
+ };
+
+ protected final ModifyListener modifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ createFilter();
+ wizard.getContainer().updateButtons();
+ }
+ };
+
+ protected SelectFilterWizard wizard;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/MatchFilterWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/MatchFilterWizardPage.java
new file mode 100644
index 0000000000..c72abf694a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/MatchFilterWizardPage.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.MatchFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+
+
+
+public class MatchFilterWizardPage extends FilterWizardPage {
+ public MatchFilterWizardPage() {
+ super("selectFilterOptions");
+ setTitle(Localization.getString("MatchFilterWizardPage.CreateMatchFilter"));
+ }
+
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+
+ Composite comp = new Composite(parent, SWT.NULL);
+ comp.setLayout(new FormLayout());
+ FormData data1 = new FormData();
+ data1.left = new FormAttachment(0, 0);
+ data1.top = new FormAttachment(0, 0);
+ data1.right = new FormAttachment(40, 0);
+ data1.bottom = new FormAttachment(100, 0);
+
+ Composite cmpFilterOpts = new Composite(comp, SWT.NONE);
+ cmpFilterOpts.setLayoutData(data1);
+ ColumnLayout colLayout = new ColumnLayout();
+ colLayout.maxNumColumns = 1;
+ cmpFilterOpts.setLayout(colLayout);
+
+ //Column
+ Label lblColumn = new Label(cmpFilterOpts, SWT.NONE);
+ lblColumn.setText(Localization.getString("MatchFilterWizardPage.Column"));
+ cboColumn = new Combo(cmpFilterOpts, SWT.DROP_DOWN);
+ cboColumn.addSelectionListener(selectionListener);
+ for(int i=0; i<wizard.series.length; i++)
+ cboColumn.add(wizard.series[i]);
+
+ new Label(cmpFilterOpts, SWT.NONE); //Spacer
+
+ //String to compare to
+ Label lblCompare = new Label(cmpFilterOpts, SWT.NONE);
+ lblCompare.setText(Localization.getString("MatchFilterWizardPage.CompareTo"));
+ txtCompare = new Text(cmpFilterOpts, SWT.BORDER);
+ txtCompare.addModifyListener(modifyListener);
+
+ new Label(cmpFilterOpts, SWT.NONE); //Spacer
+
+ //Style
+ radKeepMatch = new Button(cmpFilterOpts, SWT.RADIO);
+ radKeepMatch.setText(Localization.getString("MatchFilterWizardPage.KeepMatching"));
+ radKeepMatch.addSelectionListener(selectionListener);
+ radKeepMatch.setSelection(true);
+ radRemoveMatch = new Button(cmpFilterOpts, SWT.RADIO);
+ radRemoveMatch.setText(Localization.getString("MatchFilterWizardPage.RemoveMatching"));
+ radRemoveMatch.addSelectionListener(selectionListener);
+
+ setControl(comp);
+ }
+
+ public boolean canFlipToNextPage() {
+ return false;
+ }
+
+ protected void createFilter() {
+ int selected = cboColumn.getSelectionIndex();
+ String compare = txtCompare.getText().trim();
+ int style = (radKeepMatch.getSelection() ? MatchFilter.KEEP_MATCHING : MatchFilter.REMOVE_MATCHING);
+ if(selected >=0 && selected < cboColumn.getItemCount()) {
+ if(compare.length() > 0)
+ wizard.filter = new MatchFilter(selected, compare, style);
+ }
+ }
+
+ public void dispose() {
+ if(null != txtCompare) {
+ txtCompare.removeModifyListener(modifyListener);
+ txtCompare.dispose();
+ txtCompare = null;
+ }
+
+ if(null != cboColumn) {
+ cboColumn.removeSelectionListener(selectionListener);
+ cboColumn.dispose();
+ cboColumn = null;
+ }
+
+ if(null != radKeepMatch) {
+ radKeepMatch.removeSelectionListener(selectionListener);
+ radKeepMatch.dispose();
+ radKeepMatch = null;
+ }
+
+ if(null != radRemoveMatch) {
+ radRemoveMatch.removeSelectionListener(selectionListener);
+ radRemoveMatch.dispose();
+ radRemoveMatch = null;
+ }
+
+ super.dispose();
+ }
+
+ private Combo cboColumn;
+ private Text txtCompare;
+ private Button radKeepMatch, radRemoveMatch;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/RangeFilterWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/RangeFilterWizardPage.java
new file mode 100644
index 0000000000..7bc9622a0c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/RangeFilterWizardPage.java
@@ -0,0 +1,175 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.RangeFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+
+
+
+public class RangeFilterWizardPage extends FilterWizardPage {
+ public RangeFilterWizardPage() {
+ super("selectFilterOptions");
+ setTitle(Localization.getString("RangeFilterWizardPage.CreateRangeFilter"));
+ }
+
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+
+ Composite comp = new Composite(parent, SWT.NULL);
+ comp.setLayout(new FormLayout());
+ FormData data1 = new FormData();
+ data1.left = new FormAttachment(0, 0);
+ data1.top = new FormAttachment(0, 0);
+ data1.right = new FormAttachment(40, 0);
+ data1.bottom = new FormAttachment(100, 0);
+
+ Composite cmpFilterOpts = new Composite(comp, SWT.NONE);
+ cmpFilterOpts.setLayoutData(data1);
+ ColumnLayout colLayout = new ColumnLayout();
+ colLayout.maxNumColumns = 1;
+ cmpFilterOpts.setLayout(colLayout);
+
+ //Column
+ Label lblColumn = new Label(cmpFilterOpts, SWT.NONE);
+ lblColumn.setText(Localization.getString("RangeFilterWizardPage.Column"));
+ cboColumn = new Combo(cmpFilterOpts, SWT.DROP_DOWN);
+ cboColumn.addSelectionListener(selectionListener);
+ for(int i=0; i<wizard.series.length; i++)
+ cboColumn.add(wizard.series[i]);
+
+ new Label(cmpFilterOpts, SWT.NONE); //Spacer
+
+ //Low
+ Label lblLow = new Label(cmpFilterOpts, SWT.NONE);
+ lblLow.setText(Localization.getString("RangeFilterWizardPage.LowerBound"));
+ txtLow = new Text(cmpFilterOpts, SWT.BORDER);
+ txtLow.addModifyListener(modifyListener);
+ txtLow.addKeyListener(numberKeyListener);
+
+ new Label(cmpFilterOpts, SWT.NONE); //Spacer
+
+ //High
+ Label lblHigh = new Label(cmpFilterOpts, SWT.NONE);
+ lblHigh.setText(Localization.getString("RangeFilterWizardPage.UpperBound"));
+ txtHigh = new Text(cmpFilterOpts, SWT.BORDER);
+ txtHigh.addModifyListener(modifyListener);
+ txtHigh.addKeyListener(numberKeyListener);
+
+ new Label(cmpFilterOpts, SWT.NONE); //Spacer
+
+ //Style
+ radInside = new Button(cmpFilterOpts, SWT.RADIO);
+ radInside.setText(Localization.getString("RangeFilterWizardPage.InsideBounds"));
+ radInside.addSelectionListener(selectionListener);
+ radInside.setSelection(true);
+ radOutside = new Button(cmpFilterOpts, SWT.RADIO);
+ radOutside.setText(Localization.getString("RangeFilterWizardPage.OutsideBounds"));
+ radOutside.addSelectionListener(selectionListener);
+
+ chkInclusive = new Button(cmpFilterOpts, SWT.CHECK);
+ chkInclusive.setText(Localization.getString("RangeFilterWizardPage.Inclusive"));
+
+ setControl(comp);
+ }
+
+ public boolean canFlipToNextPage() {
+ return false;
+ }
+
+ protected void createFilter() {
+ int selected = cboColumn.getSelectionIndex();
+
+ try {
+ double high = Double.parseDouble(txtHigh.getText().trim());
+ double low = Double.parseDouble(txtLow.getText().trim());
+ int style = (radInside.getSelection() ? RangeFilter.INSIDE_BOUNDS : RangeFilter.OUTSIDE_BOUNDS);
+ if(chkInclusive.getSelection())
+ style |= RangeFilter.INCLUSIVE;
+
+ if(selected >=0 && selected < cboColumn.getItemCount()) {
+ if(low <= high)
+ wizard.filter = new RangeFilter(selected, new Double(low), new Double(high), style);
+ }
+ } catch(NumberFormatException nfe) {}
+ }
+
+ public void dispose() {
+ super.dispose();
+ if(null != cboColumn) {
+ cboColumn.removeSelectionListener(selectionListener);
+ cboColumn.dispose();
+ cboColumn = null;
+ }
+
+ if(null != txtLow) {
+ txtLow.removeModifyListener(modifyListener);
+ txtLow.removeKeyListener(numberKeyListener);
+ txtLow.dispose();
+ txtLow = null;
+ }
+
+ if(null != txtHigh) {
+ txtHigh.removeModifyListener(modifyListener);
+ txtHigh.removeKeyListener(numberKeyListener);
+ txtHigh.dispose();
+ txtHigh = null;
+ }
+
+ if(null != chkInclusive) {
+ chkInclusive.removeSelectionListener(selectionListener);
+ chkInclusive.dispose();
+ chkInclusive = null;
+ }
+
+ if(null != radInside) {
+ radInside.removeSelectionListener(selectionListener);
+ radInside.dispose();
+ radInside = null;
+ }
+
+ if(null != radOutside) {
+ radOutside.removeSelectionListener(selectionListener);
+ radOutside.dispose();
+ radOutside = null;
+ }
+ }
+
+ private final KeyListener numberKeyListener = new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ if((e.character >= ' ' && e.character <= '~')
+ && (e.character > '9' || e.character < '0'))
+ e.doit = false;
+ if(e.character == '.' && !((Text)e.widget).getText().contains("."))
+ e.doit = true;
+ }
+
+ public void keyReleased(KeyEvent e) {}
+ };
+
+ private Combo cboColumn;
+ private Text txtLow, txtHigh;
+ private Button chkInclusive;
+ private Button radInside, radOutside;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SelectFilterWizard.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SelectFilterWizard.java
new file mode 100644
index 0000000000..1419731e88
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SelectFilterWizard.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.IDataSetFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+
+
+public class SelectFilterWizard extends Wizard implements INewWizard {
+ public SelectFilterWizard(String[] series) {
+ filter = null;
+ this.series = series;
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ }
+
+ public void addPages() {
+ setWindowTitle(Localization.getString("SelectFilterWizard.CreateFilter"));
+ selectFilterPage = new SelectFilterWizardPage();
+ addPage(selectFilterPage);
+
+ filterOptionsPages = new FilterWizardPage[AvailableFilterTypes.filterIDs.length];
+ for(int i=0; i<AvailableFilterTypes.filterIDs.length; i++) {
+ filterOptionsPages[i] = AvailableFilterTypes.getFilterWizardPage(AvailableFilterTypes.filterIDs[i]);
+ addPage(filterOptionsPages[i]);
+ }
+ }
+
+ public boolean canFinish() {
+ IWizardPage page = this.getContainer().getCurrentPage();
+ if((null != filter) && (page instanceof FilterWizardPage))
+ return true;
+ return false;
+ }
+
+ public boolean performCancel() {
+ return true;
+ }
+
+ public boolean performFinish() {
+ return true;
+ }
+
+ public IDataSetFilter getFilter() {
+ return filter;
+ }
+
+ public void dispose() {
+ if(null != selectFilterPage)
+ selectFilterPage.dispose();
+ selectFilterPage = null;
+ if(null != filterOptionsPages) {
+ for(int i=0; i<filterOptionsPages.length; i++) {
+ filterOptionsPages[i].dispose();
+ filterOptionsPages[i] = null;
+ }
+ }
+ filterOptionsPages = null;
+ series = null;
+
+ super.dispose();
+ }
+
+ private SelectFilterWizardPage selectFilterPage;
+ private FilterWizardPage[] filterOptionsPages;
+ public String[] series;
+
+ public IDataSetFilter filter;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SelectFilterWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SelectFilterWizardPage.java
new file mode 100644
index 0000000000..b2234bedd1
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SelectFilterWizardPage.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter;
+
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+
+
+
+public class SelectFilterWizardPage extends WizardPage {
+ public SelectFilterWizardPage() {
+ super("selectFilter");
+ setTitle(Localization.getString("SelectFilterWizardPage.SelectFilter"));
+ filterID = "";
+ btnFilters = null;
+ buttonListener = new ButtonSelectionListener();
+ }
+
+ public void createControl(Composite parent) {
+ wizard = (SelectFilterWizard)super.getWizard();
+
+ Composite comp = new Composite(parent, SWT.NULL);
+ comp.setLayout(new FormLayout());
+ FormData data1 = new FormData();
+ data1.left = new FormAttachment(0, 0);
+ data1.top = new FormAttachment(0, 0);
+ data1.right = new FormAttachment(40, 0);
+ data1.bottom = new FormAttachment(100, 0);
+
+ Composite cmpFilterOpts = new Composite(comp, SWT.NONE);
+ cmpFilterOpts.setLayoutData(data1);
+ ColumnLayout colLayout = new ColumnLayout();
+ colLayout.maxNumColumns = 1;
+ cmpFilterOpts.setLayout(colLayout);
+
+ btnFilters = new Button[AvailableFilterTypes.filterIDs.length];
+ for(int i=0; i<btnFilters.length; i++) {
+ btnFilters[i] = new Button(cmpFilterOpts, SWT.NONE);
+ btnFilters[i].setText(AvailableFilterTypes.getFilterName(AvailableFilterTypes.filterIDs[i]));
+ btnFilters[i].addSelectionListener(buttonListener);
+ btnFilters[i].setData(AvailableFilterTypes.filterIDs[i]);
+ }
+
+ FormData data2 = new FormData();
+ data2.left = new FormAttachment(cmpFilterOpts);
+ data2.top = new FormAttachment(0, 0);
+ data2.right = new FormAttachment(100, 0);
+ data2.bottom = new FormAttachment(100, 0);
+
+ lblDesc = new Label(comp, SWT.WRAP);
+ lblDesc.setLayoutData(data2);
+ setControl(comp);
+ }
+
+ public IWizardPage getNextPage() {
+ return AvailableFilterTypes.getFilterWizardPage(filterID);
+ }
+
+ public boolean canFlipToNextPage() {
+ return (filterID.length() > 0);
+ }
+
+ public void dispose() {
+ super.dispose();
+ if(null != btnFilters)
+ for(int i=0; i<btnFilters.length; i++) {
+ btnFilters[i].removeSelectionListener(buttonListener);
+ btnFilters[i].dispose();
+ btnFilters[i] = null;
+ }
+ btnFilters = null;
+ lblDesc = null;
+ }
+
+ private class ButtonSelectionListener implements SelectionListener {
+ public void widgetDefaultSelected(SelectionEvent e) {}
+
+ public void widgetSelected(SelectionEvent e) {
+ if(e.widget instanceof Button) {
+ Button target = (Button)e.widget;
+
+ for(int i=0; i<btnFilters.length; i++) {
+ if(target == btnFilters[i]) {
+ filterID = btnFilters[i].getData().toString();
+ lblDesc.setText(AvailableFilterTypes.getFilterName(filterID) + "\n\n" +
+ AvailableFilterTypes.getFilterDescription(filterID));
+ wizard.getContainer().updateButtons();
+ }
+ }
+ }
+ }
+ }
+
+ private Button[] btnFilters;
+ private Label lblDesc;
+ private String filterID;
+ private SelectFilterWizard wizard;
+ private ButtonSelectionListener buttonListener;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SortFilterWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SortFilterWizardPage.java
new file mode 100644
index 0000000000..666c7364f1
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/SortFilterWizardPage.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.SortFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+
+
+
+public class SortFilterWizardPage extends FilterWizardPage {
+ public SortFilterWizardPage() {
+ super("selectFilterOptions");
+ setTitle(Localization.getString("SortFilterWizardPage.CreateSortFilter"));
+ }
+
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+
+ Composite comp = new Composite(parent, SWT.NULL);
+ comp.setLayout(new FormLayout());
+ FormData data1 = new FormData();
+ data1.left = new FormAttachment(0, 0);
+ data1.top = new FormAttachment(0, 0);
+ data1.right = new FormAttachment(40, 0);
+ data1.bottom = new FormAttachment(100, 0);
+
+ Composite cmpFilterOpts = new Composite(comp, SWT.NONE);
+ cmpFilterOpts.setLayoutData(data1);
+ ColumnLayout colLayout = new ColumnLayout();
+ colLayout.maxNumColumns = 1;
+ cmpFilterOpts.setLayout(colLayout);
+
+ //Column
+ Label lblColumn = new Label(cmpFilterOpts, SWT.NONE);
+ lblColumn.setText(Localization.getString("SortFilterWizardPage.Column"));
+ cboColumn = new Combo(cmpFilterOpts, SWT.DROP_DOWN);
+ cboColumn.addSelectionListener(selectionListener);
+ for(int i=0; i<wizard.series.length; i++)
+ cboColumn.add(wizard.series[i]);
+
+ new Label(cmpFilterOpts, SWT.NONE); //Spacer
+
+ //Style
+ radAscending = new Button(cmpFilterOpts, SWT.RADIO);
+ radAscending.setText(Localization.getString("SortFilterWizardPage.Ascending"));
+ radAscending.addSelectionListener(selectionListener);
+ radAscending.setSelection(true);
+ radDescending = new Button(cmpFilterOpts, SWT.RADIO);
+ radDescending.setText(Localization.getString("SortFilterWizardPage.Descending"));
+ radDescending.addSelectionListener(selectionListener);
+
+ setControl(comp);
+ }
+
+ public boolean canFlipToNextPage() {
+ return false;
+ }
+
+ protected void createFilter() {
+ int selected = cboColumn.getSelectionIndex();
+ int style = (radAscending.getSelection() ? SortFilter.ASCENDING : SortFilter.DESCENDING);
+ if(selected >=0 && selected < cboColumn.getItemCount())
+ wizard.filter = new SortFilter(selected, style);
+ }
+
+ public void dispose() {
+ if(null != cboColumn) {
+ cboColumn.removeSelectionListener(selectionListener);
+ cboColumn.dispose();
+ cboColumn = null;
+ }
+
+ if(null != radAscending) {
+ radAscending.removeSelectionListener(selectionListener);
+ radAscending.dispose();
+ radAscending = null;
+ }
+
+ if(null != radDescending) {
+ radDescending.removeSelectionListener(selectionListener);
+ radDescending.dispose();
+ radDescending = null;
+ }
+
+ super.dispose();
+ }
+
+ private Combo cboColumn;
+ private Button radAscending, radDescending;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/UniqueFilterWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/UniqueFilterWizardPage.java
new file mode 100644
index 0000000000..2fdac8eaf1
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/filter/UniqueFilterWizardPage.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.filter;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.filters.UniqueFilter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+
+
+
+public class UniqueFilterWizardPage extends FilterWizardPage {
+ public UniqueFilterWizardPage() {
+ super("selectFilterOptions");
+ setTitle(Localization.getString("UniqueFilterWizardPage.CreateUniqueFilter"));
+ aggregateID = "";
+ }
+
+ public void createControl(Composite parent) {
+ super.createControl(parent);
+
+ Composite comp = new Composite(parent, SWT.NULL);
+ comp.setLayout(new FormLayout());
+ FormData data1 = new FormData();
+ data1.left = new FormAttachment(0, 0);
+ data1.top = new FormAttachment(0, 0);
+ data1.right = new FormAttachment(40, 0);
+ data1.bottom = new FormAttachment(100, 0);
+
+ Composite cmpFilterOpts = new Composite(comp, SWT.NONE);
+ cmpFilterOpts.setLayoutData(data1);
+ ColumnLayout colLayout = new ColumnLayout();
+ colLayout.maxNumColumns = 1;
+ cmpFilterOpts.setLayout(colLayout);
+
+ //Column
+ Label lblColumn = new Label(cmpFilterOpts, SWT.NONE);
+ lblColumn.setText(Localization.getString("UniqueFilterWizardPage.Column"));
+ cboColumn = new Combo(cmpFilterOpts, SWT.DROP_DOWN);
+ cboColumn.addSelectionListener(selectionListener);
+ for(int i=0; i<wizard.series.length; i++)
+ cboColumn.add(wizard.series[i]);
+
+ new Label(cmpFilterOpts, SWT.NONE); //Spacer
+
+ //String to compare to
+ Label lblAggregate = new Label(cmpFilterOpts, SWT.NONE);
+ lblAggregate.setText(Localization.getString("UniqueFilterWizardPage.Aggregate"));
+
+ btnAggregates = new Button[AggregateFactory.aggregateIDs.length];
+ for(int i=0; i<btnAggregates.length; i++) {
+ btnAggregates[i] = new Button(cmpFilterOpts, SWT.NONE);
+ btnAggregates[i].setText(AggregateFactory.getAggregateName(AggregateFactory.aggregateIDs[i]));
+ btnAggregates[i].addSelectionListener(btnSelectionListener);
+ btnAggregates[i].setData(AggregateFactory.aggregateIDs[i]);
+ }
+
+ FormData data2 = new FormData();
+ data2.left = new FormAttachment(cmpFilterOpts);
+ data2.top = new FormAttachment(0, 0);
+ data2.right = new FormAttachment(100, 0);
+ data2.bottom = new FormAttachment(100, 0);
+
+ lblDesc = new Label(comp, SWT.WRAP);
+ lblDesc.setLayoutData(data2);
+ setControl(comp);
+ }
+
+ public boolean canFlipToNextPage() {
+ return false;
+ }
+
+ protected void createFilter() {
+ int selected = cboColumn.getSelectionIndex();
+ int style = 0;
+ if(selected >=0 && selected < cboColumn.getItemCount()) {
+ if(null != aggregateID && aggregateID.length() > 0)
+ ((SelectFilterWizard)super.getWizard()).filter = new UniqueFilter(selected, AggregateFactory.createAggregate(aggregateID), style);
+ }
+ }
+
+ public void dispose() {
+ if(null != cboColumn) {
+ cboColumn.removeSelectionListener(selectionListener);
+ cboColumn.dispose();
+ cboColumn = null;
+ }
+
+ if(null != lblDesc)
+ lblDesc.dispose();
+ lblDesc = null;
+
+ if(null != btnAggregates) {
+ for(int i=0; i<btnAggregates.length; i++) {
+ btnAggregates[i].removeSelectionListener(btnSelectionListener);
+ btnAggregates[i].dispose();
+ btnAggregates[i] = null;
+ }
+ btnAggregates = null;
+ }
+
+ aggregateID = null;
+
+ super.dispose();
+ }
+
+ private final SelectionListener btnSelectionListener = new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {}
+
+ public void widgetSelected(SelectionEvent e) {
+ if(e.widget instanceof Button) {
+ Button target = (Button)e.widget;
+
+ for(int i=0; i<btnAggregates.length; i++) {
+ if(target == btnAggregates[i]) {
+ lblDesc.setText(AggregateFactory.getAggregateName(btnAggregates[i].getData().toString()) + "\n\n" +
+ AggregateFactory.getAggregateDescription(btnAggregates[i].getData().toString()));
+ aggregateID = btnAggregates[i].getData().toString();
+ createFilter();
+ wizard.getContainer().updateButtons();
+ }
+ }
+ }
+ }
+ };
+
+ private Combo cboColumn;
+ private Button[] btnAggregates;
+ private Label lblDesc;
+ private String aggregateID;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/GraphFactory.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/GraphFactory.java
new file mode 100644
index 0000000000..a61836e0ed
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/GraphFactory.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.graph;
+
+import java.util.LinkedList;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters.BlockAdapter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.adapters.ScrollAdapter;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IBlockDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IHistoricalDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.GraphData;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.BarGraph;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.IGraph;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.LineGraph;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.PieChart;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.graphs.ScatterGraph;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.GraphingAPIUIPlugin;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.widgets.GraphComposite;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+
+
+
+public final class GraphFactory {
+ private static final String[] graphNames = new String[] {
+ Localization.getString("GraphFactory.ScatterGraph"),
+ Localization.getString("GraphFactory.LineGraph"),
+ Localization.getString("GraphFactory.BarGraph"),
+ Localization.getString("GraphFactory.PieChart")
+ };
+
+ private static final String[] graphDescriptions = new String[] {
+ Localization.getString("GraphFactory.ScatterDescription"),
+ Localization.getString("GraphFactory.LineDescription"),
+ Localization.getString("GraphFactory.BarDescription"),
+ Localization.getString("GraphFactory.PieDescription")
+ };
+
+ private static final Image[] graphImages = new Image[] {
+ GraphingAPIUIPlugin.getImageDescriptor("icons/graphs/ScatterGraph.gif").createImage(),
+ GraphingAPIUIPlugin.getImageDescriptor("icons/graphs/LineGraph.gif").createImage(),
+ GraphingAPIUIPlugin.getImageDescriptor("icons/graphs/BarGraph.gif").createImage(),
+ GraphingAPIUIPlugin.getImageDescriptor("icons/graphs/PieChart.gif").createImage()
+ };
+
+ private static final String[] graphIDs = new String[] {
+ ScatterGraph.ID,
+ LineGraph.ID,
+ BarGraph.ID,
+ PieChart.ID
+ };
+
+ public static String[] getAvailableGraphs(IDataSet data) {
+ LinkedList<String> ids = new LinkedList<String>();
+ if(data instanceof IHistoricalDataSet) {
+ ids.add(ScatterGraph.ID);
+ ids.add(LineGraph.ID);
+ ids.add(BarGraph.ID);
+ }
+ if(data instanceof IBlockDataSet) {
+ if(!ids.contains(BarGraph.ID))
+ ids.add(BarGraph.ID);
+ ids.add(PieChart.ID);
+ }
+
+ String[] id = new String[0];
+ return (String[])ids.toArray(id);
+ }
+
+ public static String getGraphName(String id) {
+ int index = getIndex(id);
+ if(index >= 0)
+ return graphNames[index];
+ return null;
+ }
+
+ public static String getGraphDescription(String id) {
+ int index = getIndex(id);
+ if(index >= 0)
+ return graphDescriptions[index];
+ return null;
+ }
+
+ public static Image getGraphImage(String id) {
+ int index = getIndex(id);
+ if(index >= 0)
+ return graphImages[index];
+ return null;
+ }
+
+ public static boolean isMultiGraph(String id) {
+ if(id.equals(PieChart.ID))
+ return false;
+ return true;
+ }
+
+ public static boolean isKeyRequired(String graphID, IDataSet data) {
+ switch(getIndex(graphID)) {
+ case 0:
+ case 1:
+ if(data instanceof IBlockDataSet) //Has to be IHistoricalDataSet
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ public static boolean isKeyOptional(String graphID, IDataSet data) {
+ switch(getIndex(graphID)) {
+ case 2:
+ if(data instanceof IBlockDataSet) //Has to be IHistoricalDataSet
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ public static final IGraph createGraph(GraphComposite comp, GraphData gd, IDataSet data) {
+ IGraph g = null;
+ switch(getIndex(gd.graphID)) {
+ case 0:
+ g = new ScatterGraph(comp, SWT.NONE, gd.title, new ScrollAdapter((IHistoricalDataSet)data, gd.xSeries, gd.ySeries, gd.key));
+ break;
+ case 1:
+ g = new LineGraph(comp, SWT.NONE, gd.title, new ScrollAdapter((IHistoricalDataSet)data, gd.xSeries, gd.ySeries, gd.key));
+ break;
+ case 2:
+ if(!(data instanceof IBlockDataSet) || (null != gd.key))
+ g = new BarGraph(comp, SWT.NONE, gd.title, new ScrollAdapter((IHistoricalDataSet)data, gd.xSeries, gd.ySeries, gd.key));
+ else
+ g = new BarGraph(comp, SWT.NONE, gd.title, new BlockAdapter((IBlockDataSet)data, gd.xSeries, gd.ySeries));
+ break;
+ case 3:
+ g = new PieChart(comp, SWT.NONE, gd.title, new BlockAdapter((IBlockDataSet)data, gd.xSeries, gd.ySeries));
+ break;
+ }
+ return g;
+ }
+
+ private static int getIndex(String id) {
+ for(int i=0; i<graphIDs.length; i++)
+ if(id.equals(graphIDs[i]))
+ return i;
+ return -1;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/GraphModel.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/GraphModel.java
new file mode 100644
index 0000000000..2fd002ca39
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/GraphModel.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.graph;
+
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.GraphData;
+
+public class GraphModel {
+ public GraphModel(IDataSet d) {
+ graph = new GraphData();
+ graph.graphID = "";
+ graph.title = "";
+ graph.xSeries = -1;
+ graph.ySeries = null;
+ data = d;
+ }
+
+ public void destroy() {
+ graph = null;
+ }
+
+ public GraphData getGraphData() {
+ return graph;
+ }
+
+ public IDataSet getDataSet() {
+ return data;
+ }
+
+ public String[] getSeries() {
+ return data.getTitles();
+ }
+
+ public String getGraphID() {
+ return graph.graphID;
+ }
+
+ public int getXSeries() {
+ return graph.xSeries;
+ }
+
+ public int[] getYSeries() {
+ return graph.ySeries;
+ }
+
+ public void setTitle(String title) {
+ graph.title = title;
+ }
+
+ public void setKey(String key) {
+ graph.key = key;
+ }
+
+ public void setGraph(String g) {
+ graph.graphID = g;
+ }
+
+ public void setXSeries(int x) {
+ graph.xSeries = x;
+ }
+
+ public void setYSeries(int[] y) {
+ graph.ySeries = y;
+ }
+
+ public boolean isGraphSet() {
+ return ("" != graph.graphID);
+ }
+
+ public boolean isSeriesSet() {
+ return ((-1 <= graph.xSeries) && (null != graph.ySeries) && graph.ySeries.length > 0);
+ }
+
+ public boolean isTitleSet() {
+ return !("".equals(graph.title));
+ }
+
+ private GraphData graph;
+ private IDataSet data;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectGraphWizard.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectGraphWizard.java
new file mode 100644
index 0000000000..c12861f363
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectGraphWizard.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.graph;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets.IDataSet;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures.GraphData;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+
+
+public class SelectGraphWizard extends Wizard implements INewWizard {
+ public SelectGraphWizard(IDataSet data) {
+ model = new GraphModel(data);
+ }
+
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ }
+
+ public void addPages() {
+ setWindowTitle(Localization.getString("SelectGraphWizard.CreateGraph"));
+ selectGraphPage = new SelectGraphWizardPage();
+ addPage(selectGraphPage);
+ selectSeriesPage = new SelectSeriesWizardPage();
+ addPage(selectSeriesPage);
+ }
+
+ public boolean canFinish() {
+ if (this.getContainer().getCurrentPage() == selectSeriesPage &&
+ selectSeriesPage.isPageComplete())
+ return true;
+ return false;
+ }
+
+ public boolean performCancel() {
+ model.destroy();
+ return true;
+ }
+
+ public boolean performFinish() {
+ return true;
+ }
+
+ public GraphData getGraphData() {
+ return model.getGraphData();
+ }
+
+ public void dispose() {
+ if(null != selectGraphPage)
+ selectGraphPage.dispose();
+ if(null != selectSeriesPage)
+ selectSeriesPage.dispose();
+ super.dispose();
+ }
+
+ public SelectGraphWizardPage selectGraphPage;
+ public SelectSeriesWizardPage selectSeriesPage;
+ public GraphModel model;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectGraphWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectGraphWizardPage.java
new file mode 100644
index 0000000000..c9e314a48b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectGraphWizardPage.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.graph;
+
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+
+
+
+
+public class SelectGraphWizardPage extends WizardPage implements Listener {
+ public SelectGraphWizardPage() {
+ super("selectGraph");
+ setTitle(Localization.getString("SelectGraphWizardPage.SelectGraph"));
+ btnGraphs = null;
+ }
+
+ public void createControl(Composite parent) {
+ wizard = (SelectGraphWizard)getWizard();
+
+ Composite comp = new Composite(parent, SWT.NULL);
+ comp.setLayout(new FormLayout());
+ FormData data1 = new FormData();
+ data1.left = new FormAttachment(0, 0);
+ data1.top = new FormAttachment(0, 0);
+ data1.right = new FormAttachment(40, 0);
+ data1.bottom = new FormAttachment(100, 0);
+
+ Composite cmpGraphOpts = new Composite(comp, SWT.NONE);
+ cmpGraphOpts.setLayoutData(data1);
+ ColumnLayout colLayout = new ColumnLayout();
+ colLayout.maxNumColumns = 1;
+ cmpGraphOpts.setLayout(colLayout);
+
+ String[] graphIDs = GraphFactory.getAvailableGraphs(wizard.model.getDataSet());
+ btnGraphs = new Button[graphIDs.length];
+ for(int i=0; i<btnGraphs.length; i++) {
+ btnGraphs[i] = new Button(cmpGraphOpts, SWT.NONE);
+ //btnGraphs[i].setText(GraphTypeConstants.getGraphName(graphIDs[i]));
+ btnGraphs[i].setImage(GraphFactory.getGraphImage(graphIDs[i]));
+ btnGraphs[i].addListener(SWT.Selection, this);
+ btnGraphs[i].setData(graphIDs[i]);
+ }
+
+ FormData data2 = new FormData();
+ data2.left = new FormAttachment(cmpGraphOpts);
+ data2.top = new FormAttachment(0, 0);
+ data2.right = new FormAttachment(100, 0);
+ data2.bottom = new FormAttachment(100, 0);
+
+ lblDesc = new Label(comp, SWT.WRAP);
+ lblDesc.setLayoutData(data2);
+ setControl(comp);
+ }
+
+ public void handleEvent(Event event) {
+ if(event.widget instanceof Button) {
+ Button target = (Button)event.widget;
+
+ for(int i=0; i<btnGraphs.length; i++)
+ if(target == btnGraphs[i]) {
+ lblDesc.setText(GraphFactory.getGraphName(btnGraphs[i].getData().toString()) + "\n\n" +
+ GraphFactory.getGraphDescription(btnGraphs[i].getData().toString()));
+ saveDataToModel(btnGraphs[i].getData().toString());
+ wizard.getContainer().updateButtons();
+ }
+ }
+ }
+
+ public IWizardPage getNextPage() {
+ return wizard.selectSeriesPage;
+ }
+
+ public boolean canFlipToNextPage() {
+ return wizard.model.isGraphSet();
+ }
+
+ private void saveDataToModel(String selected) {
+ GraphModel model = wizard.model;
+ model.setGraph(selected);
+ wizard.selectSeriesPage.setKeyEnablement(
+ GraphFactory.isKeyRequired(model.getGraphID(), model.getDataSet()),
+ GraphFactory.isKeyOptional(model.getGraphID(), model.getDataSet()));
+ }
+
+ public void dispose() {
+ super.dispose();
+ if(null != btnGraphs)
+ for(int i=0; i<btnGraphs.length; i++)
+ btnGraphs[i] = null;
+ btnGraphs = null;
+ lblDesc = null;
+ }
+
+ private Button[] btnGraphs;
+ private Label lblDesc;
+ private SelectGraphWizard wizard;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectSeriesWizardPage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectSeriesWizardPage.java
new file mode 100644
index 0000000000..9664490e8f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/ui/graphingapi/ui/wizards/graph/SelectSeriesWizardPage.java
@@ -0,0 +1,328 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.graph;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.internal.Localization;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+
+
+
+
+public class SelectSeriesWizardPage extends WizardPage {
+ public SelectSeriesWizardPage() {
+ super("selectSeries");
+ setTitle(Localization.getString("SelectSeriesWizardPage.SelectSeries"));
+ }
+
+ public void createControl(Composite parent) {
+ model = ((SelectGraphWizard)super.getWizard()).model;
+
+ //Set the layout data
+ Composite comp = new Composite(parent, SWT.NULL);
+ comp.setLayout(new FormLayout());
+ FormData data1 = new FormData();
+ data1.left = new FormAttachment(0, 0);
+ data1.top = new FormAttachment(0, 0);
+ data1.right = new FormAttachment(40, 0);
+ data1.bottom = new FormAttachment(100, 0);
+
+ //Add the title wigets
+ Label lblTitle = new Label(comp, SWT.NONE);
+ lblTitle.setText(Localization.getString("SelectSeriesWizardPage.Title"));
+ txtTitle = new Text(comp, SWT.BORDER);
+ txtTitle.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ getWizard().getContainer().updateButtons();
+ if(txtTitle.getText().length() == 0) {
+ setErrorMessage(Localization.getString("SelectSeriesWizardPage.TitleNotSet"));
+ setMessage(null);
+ } else {
+ setErrorMessage(null);
+ setMessage("");
+ }
+ }
+ });
+ data1 = new FormData();
+ data1.left = new FormAttachment(0,0);
+ data1.top = new FormAttachment(0,0);
+ data1.width = 200;
+ lblTitle.setLayoutData(data1);
+
+ data1 = new FormData();
+ data1.left = new FormAttachment(0,0);
+ data1.top = new FormAttachment(lblTitle,0);
+ data1.width = 200;
+ txtTitle.setLayoutData(data1);
+
+
+ //Add the data series widgets
+ data1 = new FormData();
+ data1.left = new FormAttachment(0, 0);
+ data1.top = new FormAttachment(txtTitle, 20);
+ data1.right = new FormAttachment(40, 0);
+ data1.bottom = new FormAttachment(100, 0);
+
+ Composite cmpGraphOpts = new Composite(comp, SWT.NONE);
+ cmpGraphOpts.setLayoutData(data1);
+ ColumnLayout colLayout = new ColumnLayout();
+ colLayout.maxNumColumns = 1;
+ cmpGraphOpts.setLayout(colLayout);
+
+ String[] labels = model.getSeries();
+
+ cboYItems = new Combo[labels.length];
+ lblYItems = new Label[cboYItems.length];
+
+ Label lblXItem = new Label(cmpGraphOpts, SWT.NONE);
+ lblXItem.setText(Localization.getString("SelectSeriesWizardPage.XSeries"));
+ cboXItem = new Combo(cmpGraphOpts, SWT.DROP_DOWN);
+ cboXItem.addSelectionListener(new ComboSelectionListener());
+ cboXItem.add(Localization.getString("SelectSeriesWizardPage.RowID"));
+ cboXItem.select(0);
+
+ new Label(cmpGraphOpts, SWT.NONE); //Spacer
+
+ for(int i=0; i<cboYItems.length; i++) {
+ lblYItems[i] = new Label(cmpGraphOpts, SWT.NONE);
+ lblYItems[i].setText(Localization.getString("SelectSeriesWizardPage.YSeries") + i + ":");
+ cboYItems[i] = new Combo(cmpGraphOpts, SWT.DROP_DOWN);
+ cboYItems[i].addSelectionListener(new ComboSelectionListener());
+
+ if(i>0) {
+ cboYItems[i].add(Localization.getString("SelectSeriesWizardPage.NA"));
+ cboYItems[i].select(0);
+ cboYItems[i].setVisible(false);
+ lblYItems[i].setVisible(false);
+ }
+ }
+
+ for(int j,i=0; i<labels.length; i++) {
+ cboXItem.add(labels[i]);
+ for(j=0; j<lblYItems.length; j++)
+ cboYItems[j].add(labels[i]);
+ }
+
+
+ //Add the key filter wigets
+ btnKey = new Button(comp, SWT.CHECK);
+ btnKey.setText(Localization.getString("SelectSeriesWizardPage.UseHistoricalData"));
+ btnKey.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {}
+ public void widgetSelected(SelectionEvent e) {
+ txtKey.setEnabled(btnKey.getSelection());
+ }
+ });
+
+ data1 = new FormData();
+ data1.left = new FormAttachment(cmpGraphOpts, 20);
+ data1.top = new FormAttachment(txtTitle, 0);
+ data1.right = new FormAttachment(100, 0);
+ btnKey.setLayoutData(data1);
+
+ lblKey = new Label(comp, SWT.NONE);
+ lblKey.setText(Localization.getString("SelectSeriesWizardPage.KeyFilter"));
+ txtKey = new Text(comp, SWT.BORDER);
+
+ if(null != txtKey) {
+ txtKey.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ getWizard().getContainer().updateButtons();
+ if(txtTitle.getText().length() == 0) {
+ setErrorMessage(Localization.getString("SelectSeriesWizardPage.KeyNotSet"));
+ setMessage(null);
+ } else {
+ setErrorMessage(null);
+ setMessage(""); //$NON-NLS-1$
+ }
+ }
+ });
+ }
+
+ data1 = new FormData();
+ data1.left = new FormAttachment(cmpGraphOpts, 20);
+ data1.top = new FormAttachment(btnKey, 0);
+ data1.right = new FormAttachment(80, 0);
+ lblKey.setLayoutData(data1);
+
+ data1 = new FormData();
+ data1.left = new FormAttachment(cmpGraphOpts, 20);
+ data1.top = new FormAttachment(lblKey, 2);
+ data1.right = new FormAttachment(80, 0);
+ txtKey.setLayoutData(data1);
+
+ //Make comp visible
+ setControl(comp);
+ }
+
+ public void setKeyEnablement(boolean required, boolean optional) {
+ btnKey.setVisible(optional);
+ txtKey.setVisible(required || optional);
+ lblKey.setVisible(required || optional);
+ txtKey.setEnabled(required);
+ }
+
+ public boolean canFlipToNextPage() {
+ return false;
+ }
+
+ public boolean isPageComplete() {
+ return saveDataToModel();
+ }
+
+ private boolean saveDataToModel() {
+ if(isSeriesUnique()) {
+ model.setTitle(txtTitle.getText());
+
+ if(null != txtKey && txtKey.isEnabled())
+ model.setKey(txtKey.getText());
+ else
+ model.setKey(null);
+
+ model.setXSeries(cboXItem.getSelectionIndex()-1);
+
+ int i, count;
+ for(i=1, count=1; i<cboYItems.length; i++)
+ if(cboYItems[i].isVisible() && 0 != cboYItems[i].getSelectionIndex())
+ count++;
+
+ int[] ySeries = new int[count];
+ ySeries[0] = cboYItems[0].getSelectionIndex();
+ for(i=1; i<count; i++)
+ ySeries[i] = cboYItems[i].getSelectionIndex()-1;
+ model.setYSeries(ySeries);
+ return true;
+ }
+ return false;
+ }
+
+ private boolean isSeriesUnique() {
+ if("".equals(txtTitle.getText().trim()))
+ return false;
+ if(null != txtKey && txtKey.isEnabled() && txtKey.getText().length() <= 0)
+ return false;
+
+ for(int j,i=0; i<cboYItems.length; i++) {
+ if(cboYItems[i].isVisible()) {
+ for(j=i+1; j<cboYItems.length; j++) {
+ if(cboYItems[j].isVisible()) {
+ if(0 > cboYItems[i].getSelectionIndex())
+ return false;
+ else if(0 > cboYItems[j].getSelectionIndex())
+ return false;
+ else if(cboYItems[i].getItem(cboYItems[i].getSelectionIndex()).equals(cboYItems[j].getItem(cboYItems[j].getSelectionIndex()))) {
+ return false;
+ }
+ }
+ }
+ if(0 > cboYItems[i].getSelectionIndex())
+ return false;
+ else if(0 > cboXItem.getSelectionIndex())
+ return false;
+ else if(cboYItems[i].getItem(cboYItems[i].getSelectionIndex()).equals(cboXItem.getItem(cboXItem.getSelectionIndex()))) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public void dispose() {
+ super.dispose();
+ if(null != txtTitle)
+ txtTitle.dispose();
+ txtTitle = null;
+
+ if(null != txtKey)
+ txtKey.dispose();
+ txtKey = null;
+ if(null != btnKey)
+ btnKey.dispose();
+ btnKey = null;
+ if(null != lblKey)
+ lblKey.dispose();
+ lblKey = null;
+
+ if(null != cboXItem)
+ cboXItem.dispose();
+ cboXItem = null;
+ if(null != cboYItems) {
+ for(int i=0; i<cboYItems.length; i++) {
+ if(null != cboYItems[i])
+ cboYItems[i].dispose();
+ cboYItems[i] = null;
+ if(null != lblYItems[i])
+ lblYItems[i].dispose();
+ lblYItems[i] = null;
+ }
+ }
+ cboYItems = null;
+ lblYItems = null;
+ model = null;
+ }
+
+ private class ComboSelectionListener implements SelectionListener {
+ public void widgetDefaultSelected(SelectionEvent e) {}
+
+ public void widgetSelected(SelectionEvent e) {
+ if(!cboXItem.equals(e.getSource())) {
+ boolean setVisible = true;
+ if(GraphFactory.isMultiGraph(model.getGraphID())) {
+ for(int i=1; i<cboYItems.length; i++) {
+ cboYItems[i].setVisible(setVisible);
+ lblYItems[i].setVisible(setVisible);
+ if(cboYItems[i].getSelectionIndex() > 0 && cboYItems[i].isVisible())
+ setVisible = true;
+ else
+ setVisible = false;
+ }
+ }
+ }
+
+ if(!isSeriesUnique()) {
+ setErrorMessage(Localization.getString("SelectSeriesWizardPage.SeriesNotSelected"));
+ setMessage(null);
+ } else {
+ setErrorMessage(null);
+ setMessage("");
+ }
+ if(txtTitle.getText().length() == 0) {
+ setErrorMessage(Localization.getString("SelectSeriesWizardPage.TitleNotSet"));
+ setMessage(null);
+ }
+
+ getWizard().getContainer().updateButtons();
+ }
+ }
+
+ private Text txtTitle; //TODO: Move this to another page once graphs get more detail
+ private Text txtKey;
+ private Button btnKey;
+ private Label lblKey;
+ private Combo cboXItem;
+ private Combo[] cboYItems;
+ private Label[] lblYItems;
+ private GraphModel model;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/.classpath
new file mode 100644
index 0000000000..afa4693114
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="lib" path="/home/anithra/eclipse/plugins/emma.jar"/>
+ <classpathentry kind="lib" path="/home/anithra/eclipse/plugins/emma_ant.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/.project
new file mode 100644
index 0000000000..31fb9428f6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.ide.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/ChangeLog
new file mode 100644
index 0000000000..da858530a0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/ChangeLog
@@ -0,0 +1,21 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * .classpath: New file.
+ * .project: New file.
+ * build.properties: New file.
+ * META-INF/MANIFEST.MF: New file.
+ * src/com/ibm/ras/systemtap/ide/structures: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/ide/test/AllTests.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/ide/test/IDESessionSettingsTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/StapErrorParserTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/TreeSettingsTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtapgui/ide:
+ \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..0f8d140153
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.ide.tests
+Bundle-Version: 0.3.0.qualifier
+Bundle-Vendor: Eclipse
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.ide.tests.IDEPlugin
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Import-Package: junit.framework,
+ org.eclipse.linuxtools.systemtap.ui.ide,
+ org.eclipse.linuxtools.systemtap.ui.ide.actions,
+ org.eclipse.linuxtools.systemtap.ui.ide.structures,
+ org.eclipse.linuxtools.systemtap.ui.structures
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/build.properties
new file mode 100644
index 0000000000..34d2e4d2da
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/AllTests.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/AllTests.java
new file mode 100644
index 0000000000..1fea18d50a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/AllTests.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.test;
+
+import org.eclipse.linuxtools.systemtap.ui.ide.test.structures.StapErrorParserTest;
+import org.eclipse.linuxtools.systemtap.ui.ide.test.structures.TreeSettingsTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.eclipse.linuxtools.systemtap.ui.ide.test");
+
+ //Root
+ suite.addTestSuite(IDESessionSettingsTest.class);
+
+ //Structures
+ suite.addTestSuite(StapErrorParserTest.class);
+ suite.addTestSuite(TreeSettingsTest.class);
+
+ return suite;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/IDESessionSettingsTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/IDESessionSettingsTest.java
new file mode 100644
index 0000000000..727ae689df
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/IDESessionSettingsTest.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.test;
+
+import junit.framework.TestCase;
+
+public class IDESessionSettingsTest extends TestCase {
+
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/StapErrorParserTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/StapErrorParserTest.java
new file mode 100644
index 0000000000..f4ddd74967
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/StapErrorParserTest.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.test.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.ide.structures.StapErrorParser;
+
+import junit.framework.TestCase;
+
+public class StapErrorParserTest extends TestCase {
+
+ public static void main(String[] args) {
+ }
+
+ public StapErrorParserTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testStapErrorParser() {
+ String[][] output;
+
+ StapErrorParser parser = new StapErrorParser();
+
+ output = parser.parseOutput(null);
+ assertNull(output);
+
+ output = parser.parseOutput("");
+ assertNotNull(output);
+ assertEquals(0, output.length);
+
+ output = parser.parseOutput("this shouldn't have anything");
+ assertNotNull(output);
+ assertEquals(0, output.length);
+
+ output = parser.parseOutput("parse error: expected identifier or '*' \n" +
+ "saw: operator '{' at /home/morser/test.stp:14:7 \n" +
+ "1 parse error(s). \n" +
+ "Pass 1: parse failed. Try again with more '-v' (verbose) options.");
+ assertNotNull(output);
+ assertEquals(1, output.length);
+ assertTrue("parse error:".equals(output[0][0]));
+ assertTrue(output[0][3].startsWith("14"));
+
+ output = parser.parseOutput("semantic error: probe_615 with type mismatch for identifier 'flags' at /home/morser/test.stp:22:6: string vs. long \n" +
+ "semantic error: probe_615 with type mismatch for identifier 'mode' at /home/morser/test.stp:23:6: string vs. long \n" +
+ "semantic error: probe_615 with type mismatch for identifier 'f' at /home/morser/test.stp:25:6: string vs. long \n" +
+ "Pass 2: analysis failed. Try again with more '-v' (verbose) options.");
+ assertNotNull(output);
+ assertEquals(3, output.length);
+ assertTrue("semantic error:".equals(output[0][0]));
+ assertTrue(output[0][3].startsWith("22:6"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/TreeSettingsTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/TreeSettingsTest.java
new file mode 100644
index 0000000000..c6fd45b4de
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/TreeSettingsTest.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.test.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.ide.structures.TreeSettings;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+
+import junit.framework.TestCase;
+
+public class TreeSettingsTest extends TestCase {
+
+ public static void main(String[] args) {
+ //Do not preseve what was in the trees beacuse of invalid date
+ }
+
+ public TreeSettingsTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ TreeSettings.setTrees(new TreeNode("func", false), new TreeNode("probe", false));
+ }
+
+ public void testSetTrees() {
+ TreeNode t = new TreeNode("f", false);
+ TreeNode t1 = new TreeNode("as", "as3", false);
+ TreeNode t2 = new TreeNode(null, false);
+ TreeNode t3 = null;
+
+ assertTrue("Set tree fine1", TreeSettings.setTrees(t, t));
+ assertTrue("Set tree fine2", TreeSettings.setTrees(t1, t1));
+ assertTrue("Set tree null obj", TreeSettings.setTrees(t2, t2));
+ assertFalse("Set trees null", TreeSettings.setTrees(t3, t3));
+ assertFalse("Set func null", TreeSettings.setTrees(t3, t));
+ assertFalse("Set probe null", TreeSettings.setTrees(t, t3));
+ }
+
+ public void testGetTreeFileDate() {
+ long d1 = TreeSettings.getTreeFileDate();
+ long d2 = TreeSettings.getTreeFileDate();
+ assertEquals("TreeDate same", d1, d2);
+
+ TreeSettings.setTrees(new TreeNode("f", false), new TreeNode("p", false));
+ d2 = TreeSettings.getTreeFileDate();
+
+ assertTrue("TreeDate changed", d1 < d2);
+ }
+
+ public void testGetFunctionTree() {
+ TreeNode temp;
+ TreeNode t = new TreeNode("f", false);
+ TreeNode t1 = new TreeNode(null, false);
+ TreeNode t2 = new TreeNode(new StringBuilder("asfd"), true);
+
+ TreeSettings.setTrees(t, t);
+ temp = TreeSettings.getFunctionTree();
+ assertEquals("Funcs no children", 0, temp.getChildCount());
+ assertTrue("Funcs object", t.getData().toString().equals(temp.getData().toString()));
+ assertTrue("Funcs display", t.toString().equals(temp.toString()));
+
+ TreeSettings.setTrees(t1, t);
+ temp = TreeSettings.getFunctionTree();
+ assertEquals("Funcs no children", 0, temp.getChildCount());
+ assertEquals("Funcs object", t1.getData(), temp.getData());
+ assertEquals("Funcs display", t1.toString(), temp.toString());
+
+ TreeSettings.setTrees(t2, t);
+ temp = TreeSettings.getFunctionTree();
+ assertEquals("Funcs no children", 0, temp.getChildCount());
+ assertTrue("Funcs object", t2.getData().toString().equals(temp.getData()));
+ assertTrue("Funcs display", t2.toString().equals(temp.toString()));
+
+ t.add(t2);
+ t.add(t1);
+ TreeSettings.setTrees(t, t);
+ temp = TreeSettings.getFunctionTree();
+ assertEquals("Funcs has children", 2, temp.getChildCount());
+ assertTrue("Funcs child object", t2.getData().toString().equals(temp.getChildAt(0).getData()));
+ assertTrue("Funcs child display", t2.toString().equals(temp.getChildAt(0).toString()));
+ }
+
+ public void testGetProbeTree() {
+ TreeNode temp;
+ TreeNode t = new TreeNode("f", false);
+ TreeNode t1 = new TreeNode(null, false);
+ TreeNode t2 = new TreeNode(new StringBuilder("asfd"), true);
+
+ TreeSettings.setTrees(t, t);
+ temp = TreeSettings.getProbeTree();
+ assertEquals("Probs no children", 0, temp.getChildCount());
+ assertTrue("Probs object", t.getData().toString().equals(temp.getData().toString()));
+ assertTrue("Probs display", t.toString().equals(temp.toString()));
+
+ TreeSettings.setTrees(t, t1);
+ temp = TreeSettings.getProbeTree();
+ assertEquals("Probs no children", 0, temp.getChildCount());
+ assertEquals("Probs object", t1.getData(), temp.getData());
+ assertEquals("Probs display", t1.toString(), temp.toString());
+
+ TreeSettings.setTrees(t, t2);
+ temp = TreeSettings.getProbeTree();
+ assertEquals("Probs no children", 0, temp.getChildCount());
+ assertTrue("Probs object", t2.getData().toString().equals(temp.getData()));
+ assertTrue("Probs display", t2.toString().equals(temp.toString()));
+
+ t.add(t2);
+ t.add(t1);
+ TreeSettings.setTrees(t, t);
+ temp = TreeSettings.getProbeTree();
+ assertEquals("Probs has children", 2, temp.getChildCount());
+ assertTrue("Probs child object", t2.getData().toString().equals(temp.getChildAt(0).getData()));
+ assertTrue("Probs child display", t2.toString().equals(temp.getChildAt(0).toString()));
+
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.project
new file mode 100644
index 0000000000..04197af3c8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.ide</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.settings/org.eclipse.jdt.core.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..e72ca5ffff
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Fri Feb 27 18:15:33 IST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/ChangeLog
new file mode 100644
index 0000000000..85265a38f4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/ChangeLog
@@ -0,0 +1,67 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-08-06 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPMetadataSingleton.java (parse):
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * ChangeLog:Replacing all /org/eclipse/linuxtools/systemtap/ui/ide/editors/stp
+ files with Phil's editor code
+ * src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptAction.java (isValidFile):
+ (isValid):
+ (getFilePath):
+ * src/org/eclipse/linuxtools/systemtap/ui/ide/internal/IDEPlugin.java (PLUGIN_ID):
+ (getImageDescriptor):
+ * src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/PreferenceInitializer.java (initializeDefaultPreferences):
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * ChangeLog:Refactoring. Renaming all packages directories from *.systemtapgui.
+
+ 2009-01-19 Alexander Kurtakov <akurtako@redhat.com>
+
+ * .settings/org.eclipse.jdt.core.prefs: Enable more warnings.
+
+2009-01-09 Phil Muldoon <pmuldoon@redhat.com>
+
+ * build.properties: Add completion/ folder to binary
+ build.
+
+2008-12-09 Andrew Overholt <overholt@redhat.com>
+
+ * plugin.xml: Remove erroneous metadata element under <plugin>.
+
+2008-11-03 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Add Bundle-ActivationPolicy.
+
+2008-10-31 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Use plugin.properties.
+ * plugin.properties: Initial checkin.
+
+2008-10-28 Andrew Overholt <overholt@redhat.com>
+
+ Bug #252489
+ * META-INF/MANIFEST.MF: Set BREE to 1.6 (STPMetadataSingleton.parse uses
+ ResourceBundle.containsKey).
+
+2009-09-13 Phil Muldoon <pmuldoon@redhat.com>
+
+ * META-INF/MANIFEST.MF: Update to reflect
+ import specifications.
+ * plugin.xml: Likewise.
+
+2008-09-11 Phil Muldoon <pmuldoon@redhat.com>
+
+ * .classpath: Add.
+
+ * Initial import of Systemtap editor
+ \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..4c828d3890
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/META-INF/MANIFEST.MF
@@ -0,0 +1,35 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: IDE Plug-in
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.ide;singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin
+Bundle-Vendor: Eclipse
+Bundle-Localization: plugin
+Export-Package: org.eclipse.linuxtools.systemtap.ui.ide,
+ org.eclipse.linuxtools.systemtap.ui.ide.actions,
+ org.eclipse.linuxtools.systemtap.ui.ide.structures
+Require-Bundle: org.eclipse.linuxtools.systemtap.ui.logging,
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.linuxtools.systemtap.ui.editor,
+ org.eclipse.linuxtools.systemtap.ui.systemtapgui,
+ org.eclipse.linuxtools.systemtap.ui.consolelog,
+ org.eclipse.linuxtools.systemtap.ui.structures,
+ org.eclipse.core.resources;bundle-version="3.4.1"
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.core.filesystem,
+ org.eclipse.linuxtools.systemtap.ui.graphing,
+ org.eclipse.linuxtools.systemtap.ui.graphing.views,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.datasets,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.structures,
+ org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset,
+ org.eclipse.linuxtools.systemtap.ui.structures,
+ org.eclipse.linuxtools.systemtap.ui.structures.listeners,
+ org.eclipse.linuxtools.systemtap.ui.structures.runnable,
+ org.eclipse.linuxtools.systemtap.ui.structures.ui,
+ org.eclipse.linuxtools.systemtap.ui.structures.validators,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.part
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/build.properties
new file mode 100644
index 0000000000..e3fe0187cf
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/build.properties
@@ -0,0 +1,9 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/,\
+ toc.xml,\
+ documentation/,\
+ plugin.properties
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/completion/stp_completion.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/completion/stp_completion.properties
new file mode 100644
index 0000000000..7221df6aa3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/completion/stp_completion.properties
@@ -0,0 +1,569 @@
+syscall.accept(name:string,sockfd:long,addr_uaddr:long,addrlen_uaddr:long,argstr:string)
+syscall.access(name:string,pathname:string,mode:long,mode_str:string,argstr:string)
+syscall.acct(name:string,filename:string,argstr:string)
+syscall.add_key(name:string,type_uaddr:long,description_auddr:long,payload_uaddr:long,plen:long,ringid:long,argstr:string)
+syscall.adjtimex(name:string,argstr:string)
+syscall.alarm(name:string,seconds:long,argstr:string)
+syscall.arch_prctl(name:string,code:long,addr:long,argstr:string)
+syscall.bdflush(name:string,func:long,data:long,data_str:string,argstr:string)
+syscall.bind(name:string,sockfd:long,my_addr_uaddr:long,addrlen:long,argstr:string)
+syscall.brk(name:string,brk:long,argstr:string)
+syscall.capget(name:string,header_uaddr:long,data_uaddr:long,argstr:string)
+syscall.capset(name:string,header_uaddr:long,data_uaddr:long,argstr:string)
+syscall.chdir(name:string,path:string,argstr:string)
+syscall.chmod(name:string,path:string,mode:long,argstr:string)
+syscall.chown(name:string,path:string,owner:long,group:long,argstr:string)
+syscall.chown16(name:string,path:string,owner:long,group:long,argstr:string)
+syscall.chroot(name:string,path:string,argstr:string)
+syscall.clock_getres(name:string,clk_id:long,clk_id_str:string,res_uaddr:long,argstr:string)
+syscall.clock_gettime(name:string,clk_id:long,clk_id_str:string,argstr:string)
+syscall.clock_nanosleep(name:string,flag_str:string,argstr:string)
+syscall.clock_settime(name:string,clk_id:long,clk_id_str:string,tp_uaddr:long,argstr:string)
+syscall.close(name:string,fd:long,argstr:string)
+syscall.compat_adjtimex(name:string,argstr:string)
+syscall.compat_clock_nanosleep(name:string,flag_str:string,argstr:string)
+syscall.compat_execve(name:string,filename:string,args:string,argstr:string)
+syscall.compat_futex(name:string,futex_uaddr:long,op:long,val:long,utime_uaddr:long,uaddr2_uaddr:long,val3:long,argstr:string)
+syscall.compat_futimesat(name:string,dirfd:long,filename_uaddr:long,filename:string,tvp_uaddr:long,argstr:string)
+syscall.compat_getitimer(name:string,which:long,value_uaddr:long,argstr:string)
+syscall.compat_io_setup(name:string,maxevents:long,ctxp_uaddr:long,argstr:string)
+syscall.compat_io_submit(name:string,ctx_id:long,nr:long,iocbpp_uaddr:long,argstr:string)
+syscall.compat_nanosleep(name:string,req_uaddr:long,rem_uaddr:long,argstr:string)
+syscall.compat_ppoll(name:string,argstr:string)
+syscall.compat_pselect6(name:string,argstr:string)
+syscall.compat_pselect7a(name:string,argstr:string)
+syscall.compat_select(name:string,n:long,readfds_uaddr:long,writefds_uaddr:long,exceptfds_uaddr:long,timeout_uaddr:long,argstr:string)
+syscall.compat_setitimer(name:string,which:long,value_uaddr:long,ovalue_uaddr:long,argstr:string)
+syscall.compat_signalfd(name:string,argstr:string)
+syscall.compat_sys_msgctl(name:string,argstr:string)
+syscall.compat_sys_msgrcv(name:string,argstr:string)
+syscall.compat_sys_msgsnd(name:string,argstr:string)
+syscall.compat_sys_recvmsg(name:string,s:long,msg_uaddr:long,flags:long,argstr:string)
+syscall.compat_sys_semctl(name:string,argstr:string)
+syscall.compat_sys_semtimedop(name:string,semid:long,sops_uaddr:long,nsops:long,timeout_uaddr:long,argstr:string)
+syscall.compat_sys_sendmsg(name:string,s:long,msg_uaddr:long,flags:long,argstr:string)
+syscall.compat_sys_shmat(name:string,first:long,second:long,third:long,uptr_uaddr:long,argstr:string)
+syscall.compat_sys_shmctl(name:string,first:long,second:long,uptr_uaddr:long,argstr:string)
+syscall.compat_sys_utimes(name:string,filename:string,argstr:string)
+syscall.compat_utime(name:string,filename_uaddr:long,filename:string,buf_uaddr:long,actime:long,modtime:long,argstr:string)
+syscall.compat_utimensat(name:string,argstr:string)
+syscall.compat_vmsplice(name:string,argstr:string)
+syscall.connect(name:string,sockfd:long,serv_addr_uaddr:long,addrlen:long,argstr:string)
+syscall.creat(name:string,mode:long,pathname:string,argstr:string)
+syscall.delete_module(name:string,name_user:string,flags:long,argstr:string)
+syscall.dup(name:string,oldfd:long,argstr:string)
+syscall.dup2(name:string,oldfd:long,newfd:long,argstr:string)
+syscall.epoll_create(name:string,size:long,argstr:string)
+syscall.epoll_ctl(name:string,epfd:long,op:long,op_str:string,fd:long,event_uaddr:long,argstr:string)
+syscall.epoll_pwait(name:string,argstr:string)
+syscall.epoll_wait(name:string,epfd:long,events_uaddr:long,maxevents:long,timeout:long,argstr:string)
+syscall.eventfd(name:string,argstr:string)
+syscall.execve(name:string,filename:string,args:string,argstr:string)
+syscall.exit(name:string,status:long,argstr:string)
+syscall.exit_group(name:string,status:long,argstr:string)
+syscall.faccessat(name:string,dfd:long,dfd_str:string,filename:long,filename_str:string,mode:long,mode_str:string,argstr:string)
+syscall.fadvise64(name:string,fs:long,offset:long,len:long,advice:long,argstr:string)
+syscall.fadvise64_64(name:string,fs:long,offset:long,len:long,advice:long,argstr:string)
+syscall.fchdir(name:string,fd:long,argstr:string)
+syscall.fchmod(name:string,fildes:long,mode:long,argstr:string)
+syscall.fchmodat(name:string,dfd:long,dfd_str:string,filename:long,filename_str:string,mode:long,argstr:string)
+syscall.fchown(name:string,fd:long,owner:long,group:long,argstr:string)
+syscall.fchown16(name:string,fd:long,owner:long,group:long,argstr:string)
+syscall.fchownat(name:string,dfd:long,dfd_str:string,filename:long,filename_str:string,user:long,group:long,flag:long,flag_str:string,argstr:string)
+syscall.fcntl(name:string,fd:long,cmd:long,cmd_str:string,arg:long,argstr:string)
+syscall.fdatasync(name:string,fd:long,argstr:string)
+syscall.fgetxattr(name:string,filedes:long,name2:string,value_uaddr:long,size:long,argstr:string)
+syscall.flistxattr(name:string,filedes:long,list_uaddr:long,size:long,argstr:string)
+syscall.flock(name:string,fd:long,operation:long,argstr:string)
+syscall.fork(clone_flags:long,stack_start:long,regs:long,stack_size:long,parent_tid_uaddr:long,child_tid_uaddr:long,name:string,argstr:string)
+syscall.fremovexattr(name:string,filedes:long,name_uaddr:long,argstr:string)
+syscall.fsetxattr(name:string,filedes:long,name2:string,value_uaddr:long,size:long,flags:long,argstr:string)
+syscall.fstat(name:string,filedes:long,buf_uaddr:long,argstr:string)
+syscall.fstatat(name:string,dirfd:long,path:string,buf_uaddr:long,argstr:string)
+syscall.fstatfs(name:string,fd:long,buf_uaddr:long,argstr:string)
+syscall.fstatfs64(name:string,fd:long,sz:long,buf_uaddr:long,argstr:string)
+syscall.fsync(name:string,fd:long,argstr:string)
+syscall.ftruncate(name:string,fd:long,length:long,argstr:string)
+syscall.futex(name:string,futex_uaddr:long,op:long,val:long,utime_uaddr:long,uaddr2_uaddr:long,val3:long,argstr:string)
+syscall.futimesat(name:string,dirfd:long,filename_uaddr:long,filename:string,tvp_uaddr:long,argstr:string)
+syscall.get_mempolicy(name:string,policy_uaddr:long,nmask_uaddr:long,maxnode:long,addr:long,flags:long,argstr:string)
+syscall.getcwd(name:string,buf_uaddr:long,size:long,argstr:string)
+syscall.getdents(name:string,fd:long,dirp_uaddr:long,count:long,argstr:string)
+syscall.getegid(name:string,argstr:string)
+syscall.geteuid(name:string,argstr:string)
+syscall.getgid(name:string,argstr:string)
+syscall.getgroups(name:string,size:long,list_uaddr:long,argstr:string)
+syscall.gethostname(name:string,name_uaddr:long,len:long,argstr:string)
+syscall.getitimer(name:string,which:long,value_uaddr:long,argstr:string)
+syscall.getpeername(name:string,s:long,name_uaddr:long,namelen_uaddr:long,argstr:string)
+syscall.getpgid(name:string,pid:long,argstr:string)
+syscall.getpgrp(name:string,argstr:string)
+syscall.getpid(name:string,argstr:string)
+syscall.getppid(name:string,argstr:string)
+syscall.getpriority(name:string,which:long,who:long,argstr:string)
+syscall.getresgid(name:string,rgid_uaddr:long,egid_uaddr:long,sgid_uaddr:long,argstr:string)
+syscall.getresuid(name:string,ruid_uaddr:long,euid_uaddr:long,suid_uaddr:long,argstr:string)
+syscall.getrlimit(name:string,resource:long,rlim_uaddr:long,argstr:string)
+syscall.getrusage(name:string,who:long,who_str:string,usage_uaddr:long,argstr:string)
+syscall.getsid(name:string,pid:long,argstr:string)
+syscall.getsockname(name:string,s:long,name_uaddr:long,namelen_uaddr:long,argstr:string)
+syscall.getsockopt(name:string,fd:long,level:long,level_str:string,optname:long,optname_str:string,optval_uaddr:long,optlen_uaddr:long,argstr:string)
+syscall.gettid(name:string,argstr:string)
+syscall.gettimeofday(name:string,tv_uaddr:long,tz_uaddr:long,argstr:string)
+syscall.getuid(name:string,argstr:string)
+syscall.getxattr(name:string,path:string,name2:string,value_uaddr:long,size:long,argstr:string)
+syscall.init_module(name:string,umod_uaddr:long,len:long,uargs:string,argstr:string)
+syscall.inotify_add_watch(name:string,fd:long,mask:long,path_uaddr:long,path:string,argstr:string)
+syscall.inotify_init(name:string,argstr:string)
+syscall.inotify_rm_watch(name:string,fd:long,wd:long,argstr:string)
+syscall.io_cancel(name:string,ctx_id:long,iocb_uaddr:long,result_uaddr:long,argstr:string)
+syscall.io_destroy(name:string,ctx:long,argstr:string)
+syscall.io_getevents(name:string,ctx_id:long,min_nr:long,nr:long,events_uaddr:long,timeout_uaddr:long,timestr:string,argstr:string)
+syscall.io_setup(name:string,maxevents:long,ctxp_uaddr:long,argstr:string)
+syscall.io_submit(name:string,ctx_id:long,nr:long,iocbpp_uaddr:long,argstr:string)
+syscall.ioctl(name:string,fd:long,request:long,argp:long,argstr:string)
+syscall.ioperm(name:string,from:long,num:long,turn_on:long,argstr:string)
+syscall.iopl(name:string,level:long,argstr:string)
+syscall.ioprio_get(name:string,which:long,who:long,argstr:string)
+syscall.ioprio_set(name:string,which:long,who:long,ioprio:long,argstr:string)
+syscall.kexec_load(name:string,entry:long,nr_segments:long,segments_uaddr:long,flags:long,argstr:string)
+syscall.keyctl(name:string,argstr:string)
+syscall.kill(name:string,pid:long,sig:long,argstr:string)
+syscall.lchown(name:string,path:string,owner:long,group:long,argstr:string)
+syscall.lchown16(name:string,path:string,owner:long,group:long,argstr:string)
+syscall.lgetxattr(name:string,path:string,name2:string,value_uaddr:long,size:long,argstr:string)
+syscall.link(name:string,oldpath:string,newpath:string,argstr:string)
+syscall.linkat(name:string,olddfd:long,olddfd_str:string,oldname:long,oldname_str:string,newdfd:long,newdfd_str:string,newname:long,newname_str:string,flags:long,flags_str:string,argstr:string)
+syscall.listen(name:string,sockfd:long,backlog:long,argstr:string)
+syscall.listxattr(name:string,list_uaddr:long,size:long,path_uaddr:long,path:string,argstr:string)
+syscall.llistxattr(name:string,list_uaddr:long,size:long,path_uaddr:long,path:string,argstr:string)
+syscall.llseek(name:string,fd:long,offset_high:long,offset_low:long,result_uaddr:long,whence:long,whence_str:string,argstr:string)
+syscall.lookup_dcookie(name:string,cookie:long,buffer_uaddr:long,len:long,argstr:string)
+syscall.lremovexattr(name:string,name_uaddr:long,name2:string,path_uaddr:long,path:string,argstr:string)
+syscall.lseek(name:string,fildes:long,offset:long,whence:long,whence_str:string,argstr:string)
+syscall.lsetxattr(name:string,path_uaddr:long,path:string,name_uaddr:long,name_str:string,value_uaddr:long,size:long,flags:long,argstr:string)
+syscall.lstat(name:string,path:string,buf_uaddr:long,argstr:string)
+syscall.madvise(name:string,start:long,length:long,advice:long,advice_str:string,argstr:string)
+syscall.mbind(name:string,start:long,len:long,mode:long,nmask_uaddr:long,maxnode:long,flags:long,argstr:string)
+syscall.migrate_pages(name:string,argstr:string)
+syscall.mincore(name:string,start:long,length:long,vec_uaddr:long,argstr:string)
+syscall.mkdir(name:string,pathname_uaddr:long,pathname:string,mode:long,argstr:string)
+syscall.mkdirat(name:string,dirfd:long,pathname:string,mode:long,argstr:string)
+syscall.mknod(name:string,pathname:string,mode:long,dev:long,argstr:string)
+syscall.mknodat(name:string,dfd:long,dfd_str:string,filename:long,filename_str:string,mode:long,mode_str:string,dev:long,argstr:string)
+syscall.mlock(name:string,addr:long,len:long,argstr:string)
+syscall.mlockall(name:string,flags:long,argstr:string)
+syscall.mmap(name:string,start:long,len:long,prot:long,flags:long,fd:long,offset:long,argstr:string)
+syscall.mmap2(name:string,argstr:string)
+syscall.mmap32(name:string,argstr:string)
+syscall.modify_ldt(name:string,func:long,ptr_uaddr:long,bytecount:long,argstr:string)
+syscall.mount(name:string,source:string,target:string,filesystemtype:string,mountflags:long,mountflags_str:string,data:string,argstr:string)
+syscall.move_pages(name:string,argstr:string)
+syscall.mprotect(name:string,addr:long,len:long,prot:long,prot_str:string,argstr:string)
+syscall.mq_getsetattr(name:string,mqdes:long,u_mqstat_uaddr:long,u_omqstat_uaddr:long,argstr:string)
+syscall.mq_notify(name:string,mqdes:long,notification_uaddr:long,argstr:string)
+syscall.mq_open(name:string,name_uaddr:long,filename:string,mode:long,u_attr_uaddr:long,oflag:long,argstr:string)
+syscall.mq_timedreceive(name:string,mqdes:long,msg_ptr_uaddr:long,msg_len:long,msg_prio_uaddr:long,abs_timout_uaddr:long,argstr:string)
+syscall.mq_timedsend(name:string,mqdes:long,msg_ptr_uaddr:long,msg_len:long,msg_prio:long,abs_timeout_uaddr:long,argstr:string)
+syscall.mq_unlink(name:string,u_name_uaddr:long,u_name:string,argstr:string)
+syscall.mremap(name:string,old_address:long,old_size:long,new_size:long,flags:long,new_address:long,argstr:string)
+syscall.msgctl(name:string,msqid:long,cmd:long,buf_uaddr:long,argstr:string)
+syscall.msgget(name:string,key:long,msgflg:long,msgflg_str:string,argstr:string)
+syscall.msgrcv(name:string,msqid:long,msgp_uaddr:long,msgsz:long,msgtyp:long,msgflg:long,argstr:string)
+syscall.msgsnd(name:string,msqid:long,msgp_uaddr:long,msgsz:long,msgflg:long,argstr:string)
+syscall.msync(name:string,start:long,length:long,flags:long,argstr:string)
+syscall.munlock(name:string,addr:long,len:long,argstr:string)
+syscall.munlockall(name:string,argstr:string)
+syscall.munmap(name:string,start:long,length:long,argstr:string)
+syscall.nanosleep(name:string,req_uaddr:long,rem_uaddr:long,argstr:string)
+syscall.nfsservctl(name:string,cmd:long,argp_uaddr:long,resp_uaddr:long,argstr:string)
+syscall.ni_syscall(name:string,argstr:string)
+syscall.nice(name:string,inc:long,argstr:string)
+syscall.open(name:string,filename:string,flags:long,mode:long,argstr:string)
+syscall.openat(name:string,filename:string,flags:long,mode:long,argstr:string)
+syscall.pause(name:string,argstr:string)
+syscall.personality(name:string,persona:long,argstr:string)
+syscall.pipe(name:string,argstr:string)
+syscall.pipe32(name:string,argstr:string)
+syscall.pivot_root(name:string,new_root_str:string,old_root_str:string,argstr:string)
+syscall.poll(name:string,ufds_uaddr:long,nfds:long,timeout:long,argstr:string)
+syscall.ppoll(name:string,argstr:string)
+syscall.prctl(name:string,option:long,arg2:long,arg3:long,arg4:long,arg5:long,argstr:string)
+syscall.pread(name:string,fd:long,buf_uaddr:long,count:long,offset:long,argstr:string)
+syscall.pselect6(name:string,argstr:string)
+syscall.pselect7(name:string,argstr:string)
+syscall.ptrace(name:string,request:long,pid:long,addr:long,data:long,argstr:string)
+syscall.pwrite(name:string,fd:long,buf_uaddr:long,count:long,offset:long,argstr:string)
+syscall.quotactl(name:string,cmd:long,cmd_str:string,special:long,special_str:string,id:long,addr_uaddr:long,argstr:string)
+syscall.read(name:string,fd:long,buf_uaddr:long,count:long,argstr:string)
+syscall.readahead(name:string,fd:long,offset:long,count:long,argstr:string)
+syscall.readdir(name:string,argstr:string)
+syscall.readlink(name:string,path:string,buf_uaddr:long,bufsiz:long,argstr:string)
+syscall.readlinkat(name:string,dfd:long,buf_uaddr:long,bufsiz:long,path:string,argstr:string)
+syscall.readv(name:string,vector_uaddr:long,count:long,fd:long,argstr:string)
+syscall.reboot(name:string,magic:long,magic_str:string,magic2:long,magic2_str:string,flag:long,flag_str:string,arg_uaddr:long,argstr:string)
+syscall.recv(name:string,s:long,buf_uaddr:long,len:long,flags:long,flags_str:string,argstr:string)
+syscall.recvfrom(name:string,s:long,buf_uaddr:long,len:long,flags:long,flags_str:string,addr_uaddr:long,addrlen_uaddr:long,argstr:string)
+syscall.recvmsg(name:string,s:long,msg_uaddr:long,flags:long,flags_str:string,argstr:string)
+syscall.remap_file_pages(name:string,start:long,size:long,prot:long,pgoff:long,flags:long,argstr:string)
+syscall.removexattr(name:string,name_str:string,path:string,argstr:string)
+syscall.rename(name:string,oldpath:string,newpath:string,argstr:string)
+syscall.renameat(name:string,olddfd:long,olddfd_str:string,oldname:long,oldname_str:string,newdfd:long,newdfd_str:string,newname:long,newname_str:string,argstr:string)
+syscall.request_key(name:string,type_uaddr:long,description_uaddr:long,callout_info_uaddr:long,destringid:long,argstr:string)
+syscall.restart_syscall(name:string,argstr:string)
+syscall.rmdir(name:string,pathname:string,argstr:string)
+syscall.rt_sigaction(name:string,sig:long,act_uaddr:long,oact_uaddr:long,sigsetsize:long,argstr:string)
+syscall.rt_sigaction32(name:string,sig:long,act_uaddr:long,oact_uaddr:long,sigsetsize:long,argstr:string)
+syscall.rt_sigpending(name:string,set_uaddr:long,sigsetsize:long,argstr:string)
+syscall.rt_sigprocmask(name:string,how:long,how_str:string,set_uaddr:long,oldset_uaddr:long,argstr:string)
+syscall.rt_sigqueueinfo(name:string,pid:long,sig:long,uinfo_uaddr:long,argstr:string)
+syscall.rt_sigreturn(name:string,argstr:string)
+syscall.rt_sigsuspend(name:string,argstr:string)
+syscall.rt_sigtimedwait(name:string,uthese_uaddr:long,uinfo_uaddr:long,uts_uaddr:long,sigsetsize:long,argstr:string)
+syscall.sched_get_priority_max(name:string,policy:long,argstr:string)
+syscall.sched_get_priority_min(name:string,policy:long,argstr:string)
+syscall.sched_getaffinity(name:string,pid:long,len:long,mask_uaddr:long,argstr:string)
+syscall.sched_getparam(name:string,pid:long,p_uaddr:long,argstr:string)
+syscall.sched_getscheduler(name:string,pid:long,argstr:string)
+syscall.sched_rr_get_interval(name:string,pid:long,tp_uaddr:long,argstr:string)
+syscall.sched_setaffinity(name:string,pid:long,len:long,mask_uaddr:long,argstr:string)
+syscall.sched_setparam(name:string,pid:long,p_uaddr:long,argstr:string)
+syscall.sched_setscheduler(name:string,pid:long,policy:long,policy_str:string,p_uaddr:long,argstr:string)
+syscall.sched_yield(name:string,argstr:string)
+syscall.select(name:string,n:long,readfds_uaddr:long,writefds_uaddr:long,exceptfds_uaddr:long,timeout_uaddr:long,argstr:string)
+syscall.semctl(name:string,semid:long,semnum:long,cmd:long,argstr:string)
+syscall.semget(name:string,key:long,nsems:long,semflg:long,argstr:string)
+syscall.semop(name:string,semid:long,tsops_uaddr:long,nsops:long,argstr:string)
+syscall.semtimedop(name:string,semid:long,sops_uaddr:long,nsops:long,timeout_uaddr:long,argstr:string)
+syscall.send(name:string,s:long,buf_uaddr:long,len:long,flags:long,flags_str:string,argstr:string)
+syscall.sendfile(name:string,out_fd:long,in_fd:long,offset_uaddr:long,count:long,argstr:string)
+syscall.sendmsg(name:string,s:long,msg_uaddr:long,flags:long,flags_str:string,argstr:string)
+syscall.sendto(name:string,s:long,buf_uaddr:long,len:long,flags:long,flags_str:string,to_uaddr:long,tolen:long,argstr:string)
+syscall.set_mempolicy(name:string,mode:long,nmask_uaddr:long,maxnode:long,argstr:string)
+syscall.set_tid_address(name:string,tidptr_uaddr:long,argstr:string)
+syscall.setdomainname(name:string,hostname_uaddr:long,len:long,argstr:string)
+syscall.setfsgid(name:string,fsgid:long,argstr:string)
+syscall.setfsuid(name:string,fsuid:long,argstr:string)
+syscall.setgid(name:string,gid:long,argstr:string)
+syscall.setgroups(name:string,size:long,list_uaddr:long,argstr:string)
+syscall.sethostname(name:string,hostname_uaddr:long,name_str:string,len:long,argstr:string)
+syscall.setitimer(name:string,which:long,value_uaddr:long,ovalue_uaddr:long,argstr:string)
+syscall.setpgid(name:string,pid:long,pgid:long,argstr:string)
+syscall.setpriority(name:string,which:long,which_str:string,who:long,prio:long,argstr:string)
+syscall.setregid(name:string,rgid:long,egid:long,argstr:string)
+syscall.setregid16(name:string,rgid:long,egid:long,argstr:string)
+syscall.setresgid(name:string,rgid:long,egid:long,sgid:long,argstr:string)
+syscall.setresgid16(name:string,rgid:long,egid:long,sgid:long,argstr:string)
+syscall.setresuid(name:string,ruid:long,euid:long,suid:long,argstr:string)
+syscall.setresuid16(name:string,ruid:long,euid:long,suid:long,argstr:string)
+syscall.setreuid(name:string,ruid:long,euid:long,argstr:string)
+syscall.setreuid16(name:string,ruid:long,euid:long,argstr:string)
+syscall.setrlimit(name:string,resource:long,rlim_uaddr:long,argstr:string)
+syscall.setsid(name:string,argstr:string)
+syscall.setsockopt(name:string,fd:long,level:long,level_str:string,optname:long,optname_str:string,optval_uaddr:long,optlen:long,argstr:string)
+syscall.settimeofday(name:string,tv_uaddr:long,tz_uaddr:long,argstr:string)
+syscall.settimeofday32(name:string,tv_uaddr:long,tz_uaddr:long,argstr:string)
+syscall.setuid(name:string,uid:long,argstr:string)
+syscall.setxattr(name:string,path_uaddr:long,path:string,name_uaddr:long,name_str:string,value_uaddr:long,size:long,flags:long,argstr:string)
+syscall.sgetmask(name:string,argstr:string)
+syscall.shmat(name:string,shmid:long,shmaddr_uaddr:long,shmflg:long,argstr:string)
+syscall.shmctl(name:string,shmid:long,cmd:long,buf_uaddr:long,argstr:string)
+syscall.shmdt(name:string,shmaddr_uaddr:long,argstr:string)
+syscall.shmget(name:string,key:long,size:long,shmflg:long,argstr:string)
+syscall.shutdown(name:string,s:long,how:long,how_str:string,argstr:string)
+syscall.sigaction32(name:string,sig:long,act_uaddr:long,oact_uaddr:long,argstr:string)
+syscall.sigaltstack(name:string,uss_uaddr:long,uoss_uaddr:long,regs_uaddr:long,argstr:string)
+syscall.signal(name:string,sig:long,handler:long,argstr:string)
+syscall.signalfd(name:string,argstr:string)
+syscall.sigpending(name:string,argstr:string)
+syscall.sigprocmask(name:string,how:long,how_str:string,set_uaddr:long,oldset_uaddr:long,argstr:string)
+syscall.sigreturn(name:string,argstr:string)
+syscall.sigsuspend(name:string,argstr:string)
+syscall.socket(name:string,family:long,type:long,protocol:long,argstr:string)
+syscall.socketpair(name:string,family:long,type:long,protocol:long,sv_uaddr:long,argstr:string)
+syscall.splice(name:string,argstr:string)
+syscall.ssetmask(name:string,newmask:long,argstr:string)
+syscall.stat(name:string,filename_uaddr:long,filename:string,buf_uaddr:long,argstr:string)
+syscall.statfs(name:string,buf_uaddr:long,path:string,argstr:string)
+syscall.statfs64(name:string,sz:long,buf_uaddr:long,path:string,argstr:string)
+syscall.stime(name:string,t_uaddr:long,argstr:string)
+syscall.swapoff(name:string,path:string,argstr:string)
+syscall.swapon(name:string,path:string,swapflags:long,argstr:string)
+syscall.symlink(name:string,oldpath:string,newpath:string,argstr:string)
+syscall.symlinkat(name:string,oldname:long,oldname_str:string,newdfd:long,newdfd_str:string,newname:long,newname_str:string,argstr:string)
+syscall.sync(name:string,argstr:string)
+syscall.sysctl(name:string,argstr:string)
+syscall.sysctl32(name:string,argstr:string)
+syscall.sysfs(name:string,option:long,arg1:long,arg2:long,argstr:string)
+syscall.sysinfo(name:string,info_uaddr:long,argstr:string)
+syscall.syslog(name:string,type:long,bufp_uaddr:long,len:long,argstr:string)
+syscall.tee(name:string,argstr:string)
+syscall.tgkill(name:string,tgid:long,pid:long,sig:long,argstr:string)
+syscall.time(name:string,t_uaddr:long,argstr:string)
+syscall.timer_create(name:string,clockid:long,clockid_str:string,evp_uaddr:long,timerid_uaddr:long,argstr:string)
+syscall.timer_delete(name:string,timerid:long,argstr:string)
+syscall.timer_getoverrun(name:string,timerid:long,argstr:string)
+syscall.timer_gettime(name:string,timerid:long,value_uaddr:long,argstr:string)
+syscall.timer_settime(name:string,timerid:long,flags:long,value_uaddr:long,ovalue_uaddr:long,argstr:string)
+syscall.times(name:string,argstr:string)
+syscall.tkill(name:string,pid:long,sig:long,argstr:string)
+syscall.truncate(name:string,path_uaddr:long,path:string,length:long,argstr:string)
+syscall.umask(name:string,mask:long,argstr:string)
+syscall.umount(name:string,target:string,flags:long,flags_str:string,argstr:string)
+syscall.uname(name:string,argstr:string)
+syscall.unlink(name:string,pathname_uaddr:long,pathname:string,argstr:string)
+syscall.unlinkat(name:string,dfd:long,dfd_str:string,pathname:long,pathname_str:string,flag:long,flag_str:string,argstr:string)
+syscall.unshare(name:string,unshare_flags:long,argstr:string)
+syscall.uselib(name:string,library_uaddr:long,library:string,argstr:string)
+syscall.ustat(name:string,dev:long,ubuf_uaddr:long,argstr:string)
+syscall.ustat32(name:string,dev:long,argstr:string)
+syscall.utime(name:string,filename_uaddr:long,filename:string,buf_uaddr:long,actime:long,modtime:long,argstr:string)
+syscall.utimensat(name:string,argstr:string)
+syscall.utimes(name:string,filename_uaddr:long,filename:string,tvp_uaddr:long,argstr:string)
+syscall.vhangup(name:string,argstr:string)
+syscall.vm86_warning(name:string)
+syscall.vmsplice(name:string,argstr:string)
+syscall.wait4(name:string,pid:long,status_uaddr:long,options:long,options_str:string,rusage_uaddr:long,argstr:string)
+syscall.waitid(name:string,pid:long,which:long,which_str:string,infop_uaddr:long,options:long,options_str:string,rusage_uaddr:long,argstr:string)
+syscall.write(name:string,fd:long,buf_uaddr:long,count:long,argstr:string)
+syscall.writev(name:string,vector_uaddr:long,count:long,fd:long,argstr:string)
+signal.check_ignored(sig_pid:long,pid_name:string,sig:long,sig_name:string)
+signal.checkperm(sig:long,task:long,sinfo:long,name:string,sig_name:string,sig_pid:long,pid_name:string,si_code:string)
+signal.do_action(sig:long,sigact_addr:long,oldsigact_addr:long,sa_handler:long,sa_mask:long)
+signal.flush(task:long,sig_pid:long,pid_name:string)
+signal.force_segv(sig_pid:long,pid_name:string,sig:long,sig_name:string)
+signal.handle(sig:unknown,sig_name:string,sinfo:long,sig_code:long,ka_addr:unknown,oldset_addr:unknown,regs:unknown,sig_mode:string)
+signal.pending(sigset_add:long,sigset_size:long)
+signal.procmask(how:long,sigset_addr:long,oldsigset_addr:long,sigset:long)
+signal.send(name:string,sig:long,task:long,sinfo:long,shared:long,send2queue:long,sig_name:string,sig_pid:long,pid_name:string,si_code:string)
+signal.send_sig_queue(sig:long,sig_name:string,sig_pid:long,pid_name:string,sigqueue_addr:long)
+signal.syskill(name:string,pid:long,sig:long,argstr:string,sig_name:string)
+signal.systgkill(name:string,tgid:long,pid:long,sig:long,argstr:string,sig_name:string)
+signal.systkill(name:string,pid:long,sig:long,argstr:string,sig_name:string)
+signal.wakeup(sig_pid:long,pid_name:string,resume:long,state_mask:string)
+begin(-1))
+netdev.receive(dev_name:string,length:long,protocol:long,truesize:long)
+netdev.transmit(dev_name:string,length:long,protocol:long,truesize:long)
+ioblock.end(devname:string,ino:long,bytes_done:long,error:long,sector:long,flags:long,rw:long,vcnt:long,idx:long,phys_segments:long,hw_segments:long,size:long)
+ioblock.request(devname:string,ino:long,sector:long,flags:long,rw:long,vcnt:long,idx:long,phys_segments:long,hw_segments:long,size:long,bdev:long,bdev_contains:long,p_start_sect:long)
+ioscheduler.elv_add_request(elevator_name:string,disk_major:long,disk_minor:long,req:long,req_flags:long)
+ioscheduler.elv_completed_request(elevator_name:string,disk_major:long,disk_minor:long,req:long,req_flags:long)
+ioscheduler.elv_next_request(elevator_name:string)
+nd_syscall.accept(name:string,sockfd:long,addr_uaddr:long,addrlen_uaddr:long,argstr:string)
+nd_syscall.access(name:string,pathname:string,mode:long,mode_str:string,argstr:string)
+nd_syscall.acct(name:string,filename:string,argstr:string)
+nd_syscall.add_key(name:string,type_uaddr:long,description_uaddr:long,payload_uaddr:long,plen:long,ringid:long,argstr:string)
+nd_syscall.adjtimex(name:string,argstr:string)
+nd_syscall.alarm(name:string,seconds:long,argstr:string)
+nd_syscall.bdflush(name:string,func:long,data:long,data_str:string,argstr:string)
+nd_syscall.bind(name:string,sockfd:long,my_addr_uaddr:long,addrlen:long,argstr:string)
+nd_syscall.brk(name:string,brk:long,argstr:string)
+nd_syscall.capget(name:string,header_uaddr:long,data_uaddr:long,argstr:string)
+nd_syscall.capset(name:string,header_uaddr:long,data_uaddr:long,argstr:string)
+nd_syscall.chdir(name:string,path:string,argstr:string)
+nd_syscall.chmod(name:string,path:string,mode:long,argstr:string)
+nd_syscall.chown(name:string,path:string,owner:long,group:long,argstr:string)
+nd_syscall.chown16(name:string,path:string,owner:long,group:long,argstr:string)
+nd_syscall.chroot(name:string,path:string,argstr:string)
+nd_syscall.clock_getres(name:string,clk_id:long,clk_id_str:string,res_uaddr:long,argstr:string)
+nd_syscall.clock_gettime(name:string,clk_id:long,clk_id_str:string,argstr:string)
+nd_syscall.clock_nanosleep(name:string,flags:long,flag_str:string,argstr:string)
+nd_syscall.clock_settime(name:string,clk_id:long,clk_id_str:string,tp_uaddr:long,argstr:string)
+nd_syscall.close(name:string,fd:long,argstr:string)
+nd_syscall.compat_adjtimex(name:string,argstr:string)
+nd_syscall.compat_clock_nanosleep(name:string,flags:long,flag_str:string,argstr:string)
+nd_syscall.compat_execve(name:string,filename:string,args:string,argstr:string)
+nd_syscall.compat_futex(name:string,futex_uaddr:long,op:long,val:long,utime_uaddr:long,uaddr2_uaddr:long,val3:long,argstr:string)
+nd_syscall.compat_futimesat(name:string,dirfd:long,filename_uaddr:long,filename:string,tvp_uaddr:long,argstr:string)
+nd_syscall.compat_getitimer(name:string,which:long,value_uaddr:long,argstr:string)
+nd_syscall.compat_io_setup(name:string,maxevents:long,ctxp_uaddr:long,argstr:string)
+nd_syscall.compat_io_submit(name:string,ctx_id:long,nr:long,iocbpp_uaddr:long,argstr:string)
+nd_syscall.compat_sys_msgctl(name:string,argstr:string)
+nd_syscall.compat_sys_msgrcv(name:string,argstr:string)
+nd_syscall.compat_sys_msgsnd(name:string,argstr:string)
+nd_syscall.connect(name:string,sockfd:long,serv_addr_uaddr:long,addrlen:long,argstr:string)
+nd_syscall.creat(name:string,mode:long,pathname:string,argstr:string)
+nd_syscall.delete_module(name:string,name_user:string,flags:long,argstr:string)
+nd_syscall.dup(name:string,old_fd:long,argstr:string)
+nd_syscall.dup2(name:string,oldfd:long,newfd:long,argstr:string)
+nd_syscall.epoll_create(name:string,size:long,argstr:string)
+nd_syscall.epoll_ctl(name:string,epfd:long,op:long,op_str:string,fd:long,event_uaddr:long,argstr:string)
+nd_syscall.epoll_pwait(name:string,argstr:string)
+nd_syscall.epoll_wait(name:string,epfd:long,events_uaddr:long,maxevents:long,timeout:long,argstr:string)
+nd_syscall.eventfd(name:string,argstr:string)
+nd_syscall.execve(name:string,filename:string,args:string,argstr:string)
+nd_syscall.exit(name:string,status:long,argstr:string)
+nd_syscall.exit_group(name:string,status:long,argstr:string)
+nd_syscall.fadvise64(name:string,fs:long,offset:long,len:long,advice:long,argstr:string)
+nd_syscall.fadvise64_64(name:string,fs:long,offset:long,len:long,advice:long,argstr:string)
+nd_syscall.fchdir(name:string,fd:long,argstr:string)
+nd_syscall.fchmod(name:string,fildes:long,mode:long,argstr:string)
+nd_syscall.fchown(name:string,fd:long,owner:long,group:long,argstr:string)
+nd_syscall.fchown16(name:string,fd:long,owner:long,group:long,argstr:string)
+nd_syscall.fcntl(name:string,fd:long,cmd:long,cmd_str:string,arg:long,argstr:string)
+nd_syscall.fdatasync(name:string,fd:long,argstr:string)
+nd_syscall.fgetxattr(name:string,filedes:long,name2:string,value_uaddr:long,size:long,argstr:string)
+nd_syscall.flistxattr(name:string,filedes:long,list_uaddr:long,size:long,argstr:string)
+nd_syscall.flock(name:string,fd:long,operation:long,argstr:string)
+nd_syscall.fork(clone_flags:long,stack_start:long,regs:long,stack_size:long,parent_tid_uaddr:long,child_tid_uaddr:long,name:string,argstr:string)
+nd_syscall.fremovexattr(name:string,filedes:long,name_uaddr:long,argstr:string)
+nd_syscall.fsetxattr(name:string,filedes:long,name2:string,value_uaddr:long,size:long,flags:long,argstr:string)
+nd_syscall.fstat(name:string,filedes:long,buf_uaddr:long,argstr:string)
+nd_syscall.fstatat(name:string,dirfd:long,path:string,buf_uaddr:long,argstr:string)
+nd_syscall.fstatfs(name:string,fd:long,buf_uaddr:long,argstr:string)
+nd_syscall.fstatfs64(name:string,fd:long,sz:long,buf_uaddr:long,argstr:string)
+nd_syscall.fsync(name:string,fd:long,argstr:string)
+nd_syscall.ftruncate(name:string,fd:long,length:long,argstr:string)
+nd_syscall.futex(name:string,futex_uaddr:long,op:long,val:long,utime_uaddr:long,uaddr2_uaddr:long,val3:long,argstr:string)
+nd_syscall.futimesat(name:string,dirfd:long,filename_uaddr:long,filename:string,tvp_uaddr:long,argstr:string)
+nd_syscall.get_mempolicy(name:string,policy_uaddr:long,nmask_uaddr:long,maxnode:long,addr:long,flags:long,argstr:string)
+nd_syscall.getcwd(name:string,buf_uaddr:long,size:long,argstr:string)
+nd_syscall.getdents(name:string,fd:long,dirp_uaddr:long,count:long,argstr:string)
+nd_syscall.getegid(name:string,argstr:string)
+nd_syscall.geteuid(name:string,argstr:string)
+nd_syscall.getgid(name:string,argstr:string)
+nd_syscall.getgroups(name:string,size:long,list_uaddr:long,argstr:string)
+nd_syscall.gethostname(name:string,name_uaddr:long,len:long,argstr:string)
+nd_syscall.getitimer(name:string,which:long,value_uaddr:long,argstr:string)
+nd_syscall.getpeername(name:string,s:long,name_uaddr:long,namelen_uaddr:long,argstr:string)
+nd_syscall.getpgid(name:string,pid:long,argstr:string)
+nd_syscall.getpgrp(name:string,argstr:string)
+nd_syscall.getpid(name:string,argstr:string)
+nd_syscall.getppid(name:string,argstr:string)
+nd_syscall.getpriority(name:string,which:long,who:long,argstr:string)
+nd_syscall.getresgid(name:string,rgid_uaddr:long,egid_uaddr:long,sgid_uaddr:long,argstr:string)
+nd_syscall.getresuid(name:string,ruid_uaddr:long,euid_uaddr:long,suid_uaddr:long,argstr:string)
+nd_syscall.getrlimit(name:string,resource:long,rlim_uaddr:long,argstr:string)
+nd_syscall.getrusage(name:string,who:long,who_str:string,usage_uaddr:long,argstr:string)
+nd_syscall.getsid(name:string,pid:long,argstr:string)
+nd_syscall.getsockname(name:string,s:long,name_uaddr:long,namelen_uaddr:long,argstr:string)
+nd_syscall.getsockopt(name:string,fd:long,level:long,level_str:string,optname:long,optname_str:string,optval_uaddr:long,optlen_uaddr:long,argstr:string)
+nd_syscall.gettid(name:string,argstr:string)
+nd_syscall.gettimeofday(name:string,tv_uaddr:long,tz_uaddr:long,argstr:string)
+nd_syscall.getuid(name:string,argstr:string)
+nd_syscall.getxattr(name:string,path:string,name2:string,value_uaddr:long,size:long,argstr:string)
+nd_syscall.init_module(name:string,umod_uaddr:long,len:long,uargs:string,argstr:string)
+nd_syscall.inotify_add_watch(name:string,fd:long,path_uaddr:long,path:string,mask:long,argstr:string)
+nd_syscall.inotify_init(name:string,argstr:string)
+nd_syscall.inotify_rm_watch(name:string,fd:long,wd:long,argstr:string)
+nd_syscall.io_cancel(name:string,ctx_id:long,iocb_uaddr:long,result_uaddr:long,argstr:string)
+nd_syscall.io_destroy(name:string,ctx:long,argstr:string)
+nd_syscall.io_getevents(name:string,ctx_id:long,min_nr:long,nr:long,events_uaddr:long,timeout_uaddr:long,timestr:string,argstr:string)
+nd_syscall.io_setup(name:string,maxevents:long,ctxp_uaddr:long,argstr:string)
+nd_syscall.io_submit(name:string,ctx_id:long,nr:long,iocbpp_uaddr:long,argstr:string)
+nd_syscall.ioctl(name:string,fd:long,request:long,argp:long,argstr:string)
+nd_syscall.ioperm(name:string,from:long,num:long,turn_on:long,argstr:string)
+nd_syscall.ioprio_get(name:string,which:long,who:long,argstr:string)
+nd_syscall.ioprio_set(name:string,which:long,who:long,ioprio:long,argstr:string)
+nd_syscall.kexec_load(name:string,entry:long,nr_segments:long,segments_uaddr:long,flags:long,argstr:string)
+nd_syscall.keyctl(name:string,argstr:string)
+nd_syscall.kill(name:string,pid:long,sig:long,argstr:string)
+nd_syscall.lchown(name:string,path:string,owner:long,group:long,argstr:string)
+nd_syscall.lchown16(name:string,path:string,owner:long,group:long,argstr:string)
+nd_syscall.lgetxattr(name:string,path:string,name2:string,value_uaddr:long,size:long,argstr:string)
+nd_syscall.link(name:string,oldpath:string,newpath:string,argstr:string)
+nd_syscall.listen(name:string,sockfd:long,backlog:long,argstr:string)
+nd_syscall.listxattr(name:string,path_uaddr:long,path:string,list_uaddr:long,size:long,argstr:string)
+nd_syscall.llistxattr(name:string,path_uaddr:long,path:string,list_uaddr:long,size:long,argstr:string)
+nd_syscall.llseek(name:string,fd:long,offset_high:long,offset_low:long,result_uaddr:long,whence:long,whence_str:string,argstr:string)
+nd_syscall.lookup_dcookie(name:string,cookie:long,buffer_uaddr:long,len:long,argstr:string)
+nd_syscall.lremovexattr(name:string,path_uaddr:long,path:string,name_uaddr:long,name2:string,argstr:string)
+nd_syscall.lseek(name:string,fildes:long,offset:long,whence:long,whence_str:string,argstr:string)
+nd_syscall.lsetxattr(name:string,path_uaddr:long,path:string,name_uaddr:long,name_str:string,value_uaddr:long,size:long,flags:long,argstr:string)
+nd_syscall.lstat(name:string,path:string,buf_uaddr:long,argstr:string)
+nd_syscall.madvise(name:string,start:long,length:long,advice:long,advice_str:string,argstr:string)
+nd_syscall.mbind(name:string,start:long,len:long,mode:long,nmask_uaddr:long,maxnode:long,flags:long,argstr:string)
+nd_syscall.migrate_pages(name:string,argstr:string)
+nd_syscall.mincore(name:string,start:long,length:long,vec_uaddr:long,argstr:string)
+nd_syscall.mkdir(name:string,pathname_uaddr:long,pathname:string,mode:long,argstr:string)
+nd_syscall.mkdirat(name:string,dirfd:long,pathname:string,mode:long,argstr:string)
+nd_syscall.mknod(name:string,pathname:string,mode:long,dev:long,argstr:string)
+nd_syscall.mlock(name:string,addr:long,len:long,argstr:string)
+nd_syscall.mlockall(name:string,flags:long,argstr:string)
+nd_syscall.modify_ldt(name:string,func:long,ptr_uaddr:long,bytecount:long,argstr:string)
+nd_syscall.mount(name:string,source:string,target:string,filesystemtype:string,mountflags:long,mountflags_str:string,data:string,argstr:string)
+nd_syscall.move_pages(name:string,argstr:string)
+nd_syscall.mprotect(name:string,addr:long,len:long,prot:long,prot_str:string,argstr:string)
+nd_syscall.mq_getsetattr(name:string,mqdes:long,u_mqstat_uaddr:long,u_omqstat_uaddr:long,argstr:string)
+nd_syscall.mq_notify(name:string,mqdes:long,notification_uaddr:long,argstr:string)
+nd_syscall.mq_open(name:string,name_uaddr:long,filename:string,mode:long,u_attr_uaddr:long,oflag:long,argstr:string)
+nd_syscall.mq_timedreceive(name:string,mqdes:long,msg_ptr_uaddr:long,msg_len:long,msg_prio_uaddr:long,abs_timout_uaddr:long,argstr:string)
+nd_syscall.mq_timedsend(name:string,mqdes:long,msg_ptr_uaddr:long,msg_len:long,msg_prio:long,abs_timeout_uaddr:long,argstr:string)
+nd_syscall.mq_unlink(name:string,u_name_uaddr:long,u_name:string,argstr:string)
+nd_syscall.mremap(name:string,old_address:long,old_size:long,new_size:long,flags:long,new_address:long,argstr:string)
+nd_syscall.msgctl(name:string,msqid:long,cmd:long,buf_uaddr:long,argstr:string)
+nd_syscall.msgget(name:string,key:long,msgflg:long,msgflg_str:string,argstr:string)
+nd_syscall.msgrcv(name:string,msqid:long,msgp_uaddr:long,msgsz:long,msgtyp:long,msgflg:long,argstr:string)
+nd_syscall.msgsnd(name:string,msqid:long,msgp_uaddr:long,msgsz:long,msgflg:long,argstr:string)
+nd_syscall.msync(name:string,start:long,length:long,flags:long,argstr:string)
+nd_syscall.munlock(name:string,addr:long,len:long,argstr:string)
+nd_syscall.munlockall(name:string,argstr:string)
+nd_syscall.munmap(name:string,start:long,length:long,argstr:string)
+vm.brk(address:long,length:long)
+vm.mmap(address:unknown,length:unknown)
+vm.munmap(address:long,length:long)
+vm.oom_kill(task:long)
+vm.pagefault(write_access:long,address:long)
+vm.write_shared(address:long)
+nfsd.close(filename:string,name:string,argstr:string)
+nfsd.commit(fh:string,count:long,offset:long,flag:long,name:string,argstr:string,size:long,units:string)
+nfsd.create(fh:string,filelen:long,filename:string,type:long,iap_valid:long,iap_mode:long,name:string,argstr:string)
+nfsd.createv3(fh:string,filelen:long,filename:string,iap_valid:long,iap_mode:long,truncp:long,verfier:long,createmode:long,name:string,argstr:string)
+nfsd.dispatch(client_ip:long,proto:long,version:long,xid:long,prog:long,proc:long,name:string,argstr:string)
+nfsd.entries(fh:string,access:long,type:long,name:string,argstr:string)
+nfsd.lookup(fh:string,filelen:long,filename:string,name:string,argstr:string)
+nfsd.open(fh:string,access:long,type:long,name:string,argstr:string)
+nfsd.read(fh:string,file:long,count:long,offset:long,vec:long,vlen:long,name:string,argstr:string,size:long,units:string)
+nfsd.rename(fh:string,tfh:string,filelen:long,filename:string,tlen:long,tname:string,name:string,argstr:string)
+nfsd.return(name:string,retstr:string)
+nfsd.unlink(fh:string,filelen:long,filename:string,type:long,name:string,argstr:string)
+nfsd.write(fh:string,file:long,count:long,offset:long,vec:long,vlen:long,name:string,argstr:string,size:long,units:string)
+process.begin)
+process.create(task:long,new_pid:long)
+process.end)
+process.exec(filename:string)
+process.exec_complete(errno:long,success:long)
+process.exit(code:long)
+process.release(task:long,pid:long)
+process.start)
+process.syscall)
+sunrpc.entry(name:string,progname:string,prog:long,vers:long,authflavor:long,servername:string,prot:long,port:long,argstr:string)
+sunrpc.return(name:string,retstr:string)
+scheduler.balance)
+scheduler.cpu_off(task_prev:unknown,task_next:unknown,idle:long)
+scheduler.cpu_on(task_prev:long,idle:long)
+scheduler.ctxswitch(prev_pid:unknown,next_pid:unknown,prev_task:unknown,next_task:unknown,prevtsk_state:unknown)
+scheduler.migrate(task:long,cpu_from:long,cpu_to:long)
+scheduler.tick(idle:long)
+scsi.iocompleted(host_no:long,channel:long,lun:long,dev_id:long,device_state:long,data_direction:long,req_addr:long,goodbytes:long)
+scsi.iodispatching(host_no:long,channel:long,lun:long,dev_id:long,device_state:long,data_direction:long,request_buffer:long,request_bufflen:long,req_addr:long)
+scsi.iodone(host_no:long,channel:long,lun:long,dev_id:long,device_state:long,data_direction:long,req_addr:long,scsi_timer_pending:long)
+scsi.ioentry(disk_major:long,disk_minor:long,device_state:long,req_addr:long)
+socket.aio_read(name:string,_sock:long,size:long,protocol:long,family:long,state:long,flags:long,type:long)
+socket.aio_write(name:string,_sock:long,size:long,protocol:long,family:long,state:long,flags:long,type:long)
+socket.close(name:string,protocol:long,family:long,state:long,flags:long,type:long)
+socket.create(name:string,protocol:long,family:long,type:long,requester:long)
+socket.receive(_dwarf_tvar_tid:long,_dwarf_tvar_sock_16_tmp:long,_dwarf_tvar_sock_17_tmp:long,_dwarf_tvar_sock_18_tmp:long,_dwarf_tvar_sock_19_tmp:long,_dwarf_tvar_sock_20_tmp:long,name:string,size:long,protocol:long,family:long,state:long,flags:long,type:long,success:long)
+socket.recvmsg(name:string,size:long,protocol:long,family:long,state:long,flags:long,type:long)
+socket.send(_dwarf_tvar_tid:long,_dwarf_tvar_sock_32_tmp:long,_dwarf_tvar_sock_33_tmp:long,_dwarf_tvar_sock_34_tmp:long,_dwarf_tvar_sock_35_tmp:long,_dwarf_tvar_sock_36_tmp:long,name:string,size:long,protocol:long,family:long,state:long,flags:long,type:long,success:long)
+socket.sendmsg(name:string,size:long,protocol:long,family:long,state:long,flags:long,type:long)
+kernel.function("sock_recvmsg@net/socket.c:649")(_dwarf_tvar_tid:long)
+kernel.function("sock_aio_read@net/socket.c:750")(_dwarf_tvar_tid:long)
+kernel.function("sock_sendmsg@net/socket.c:566")(_dwarf_tvar_tid:long)
+kernel.function("sock_aio_write@net/socket.c:792")(_dwarf_tvar_tid:long)
+begin(-1001)(num:long)
+end(idx0:string)
+tcp.disconnect(name:string,sock:long,flags:long)
+tcp.recvmsg(name:string,sock:long,size:long)
+tcp.sendmsg(name:string,sock:long,size:long)
+tcp.setsockopt(name:string,sock:long,level:long,optname:long,optstr:string,optlen:long)
+udp.disconnect(name:string,sock:long,flags:long)
+udp.recvmsg(name:string,sock:long,size:long)
+udp.sendmsg(name:string,sock:long,size:long)
+generic.fop.aio_read(file:long,dev:long,devname:string,ino:long,pos:long,count:long,buf:long,name:string,argstr:string,size:long,units:string)
+generic.fop.aio_write(file:long,dev:long,devname:string,ino:long,pos:long,count:long,buf:long,name:string,argstr:string,size:long,units:string)
+generic.fop.llseek(dev:long,devname:string,ino:long,file:long,offset:long,origin:long,maxbyte:long,name:string,argstr:string)
+generic.fop.mmap(file:long,dev:long,devname:string,ino:long,vm_start:long,vm_end:long,vm_flags:long,name:string,argstr:string)
+generic.fop.open(dev:long,devname:string,ino:long,filename:string,flag:long,size:long,name:string,argstr:string)
+generic.fop.splice_read(dev:long,devname:string,ino:long,file:long,len:long,flags:long,name:string,argstr:string,size:long,units:string)
+generic.fop.splice_write(dev:long,devname:string,ino:long,file:long,len:long,flags:long,name:string,argstr:string,size:long,units:string)
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/concepts.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/concepts.html
new file mode 100644
index 0000000000..fbd0152454
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/concepts.html
@@ -0,0 +1,16 @@
+<a href="../toc.html">Table of Contents</a>
+
+<h2>
+Concepts
+</h2>
+
+This section of the IDE User Guide covers conceptual topics of the application; the major
+components, what they do, and how how you interact with them.
+
+<ol>
+<li><a href="systemtapPerspectives.html">SystemTap Perspectives</a></li>
+<li><a href="stpEditor.html">STP Editor</a></li>
+<li><a href="functionBrowser.html">Function Browser</a></li>
+<li><a href="kernelBrowser.html">Kernel Browser</a></li>
+<li><a href="probeAliasBrowser.html">Probe Alias Browser</a></li>
+</ol> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/functionBrowser.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/functionBrowser.html
new file mode 100644
index 0000000000..d71d2c99fe
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/functionBrowser.html
@@ -0,0 +1,17 @@
+<a href="../toc.html">Table of Contents</a> > <a href="concepts.html">Concepts</a>
+
+<h2>
+Function Browser
+</h2>
+
+The Funtion Browser lists all of the functions that are defined in the tapset library. Functions are grouped by the file that they are defined. Each listed function has an icon that corrisponds to its return type.
+
+<ul>
+<li><img src="images/var_str.gif"> String</li>
+<li><img src="images/var_long.gif"> Long</li>
+<li><img src="images/var_void.gif"> Void</li>
+</ul>
+
+If you double click on any function a call to that function will be added to the active editor at the current cursor location. Also if you right click on a function and click "View Definition" the tapset file where the function is defined will be opened.<br><br>
+
+<br><img src="images/Function.png"><br><br> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/Editor.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/Editor.png
new file mode 100644
index 0000000000..1c04a068f5
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/Editor.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/Function.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/Function.png
new file mode 100644
index 0000000000..a4b6cf3409
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/Function.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/KernelSource.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/KernelSource.png
new file mode 100644
index 0000000000..4fe0917b55
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/KernelSource.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/ProbeAlias.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/ProbeAlias.png
new file mode 100644
index 0000000000..5aa3836dbb
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/ProbeAlias.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_long.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_long.gif
new file mode 100644
index 0000000000..678467f2d8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_long.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_str.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_str.gif
new file mode 100644
index 0000000000..4f4907c3d6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_str.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_unk.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_unk.gif
new file mode 100644
index 0000000000..10abf0dfad
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_unk.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_void.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_void.gif
new file mode 100644
index 0000000000..c804bbb947
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/images/var_void.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/kernelBrowser.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/kernelBrowser.html
new file mode 100644
index 0000000000..5153a016f0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/kernelBrowser.html
@@ -0,0 +1,9 @@
+<a href="../toc.html">Table of Contents</a> > <a href="concepts.html">Concepts</a>
+
+<h2>
+Kernel Source Browser
+</h2>
+
+The Kernel Source Browser is used to display the kernel tree. This provides you with a quick way to locate places to add probes. Any file in the Kernel Source tree can be opened by double clicking on it. This will open up the selected file in the Editor view. You can then double click on the ruler next to any line that you wish to probe. If SystemTap can probe that line a probe point will be inserted at the end of the script you were most recently working on. If the line can't be probed, an error message will be displayed.<br><br>
+
+<br><img src="images/KernelSource.png"><br><br> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/probeAliasBrowser.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/probeAliasBrowser.html
new file mode 100644
index 0000000000..34dd752fa5
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/probeAliasBrowser.html
@@ -0,0 +1,17 @@
+<a href="../toc.html">Table of Contents</a> > <a href="concepts.html">Concepts</a>
+
+<h2>
+Probe Alias Browser
+</h2>
+
+The Probe Alias Browser lists all of the probe aliases that are defined in the tapset library. Probes are grouped based on their type. In addition to the list of probes, each probe lists all of the variables that it has access to. Each variable is listed with an icon that represents its type. Types are as follows:
+
+<ul>
+<li><img src="images/var_str.gif"> String</li>
+<li><img src="images/var_long.gif"> Long</li>
+<li><img src="images/var_unk.gif"> Unknown</li>
+</ul>
+
+If you double click on any probe alias, probe point will be added to the end of the active editor. Also if you right click on a probe and click "View Definition" the tapset file where the probe is defined will be opened.<br><br>
+
+<br><img src="images/ProbeAlias.png"><br><br>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/stpEditor.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/stpEditor.html
new file mode 100644
index 0000000000..5d61d56dd9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/stpEditor.html
@@ -0,0 +1,13 @@
+<a href="../toc.html">Table of Contents</a> > <a href="concepts.html">Concepts</a>
+
+<h2>
+STP Editor
+</h2>
+
+This editor is the most commonly used; it is used for the authoring and editing of Systemtap scripts. It is invoked when the user starts a new file or opens a file with the .stp extension. It provides syntax highlighting, code completion, and run support.<br><br>
+
+<img src="images/Editor.png"><br><br>
+
+
+See also: <a href="../reference/menus.html">IDE Perspective Menus</a>,
+<a href="../reference/exampleScripts.html">Example Scripts</a>, <a href="../reference/toolbars.html">Toolbars</a>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/systemtapPerspectives.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/systemtapPerspectives.html
new file mode 100644
index 0000000000..dedb6ff80f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/concepts/systemtapPerspectives.html
@@ -0,0 +1,23 @@
+<a href="../toc.html">Table of Contents</a> > <a href="concepts.html">Concepts</a>
+
+<h2>
+SystemTap Perspectives
+</h2>
+
+SystemTap has three perspectives built into it, each with its own purpose.
+
+<ol>
+<li><img src="../reference/images/toolbars/ide.png"> <b>IDE Perspective</b> - This will be the primary perspective for SystemTap script writers. It contains
+the <a href="stpEditor.html">editor</a>, <a href="functionBrowser.html">Function Browser</a>,
+<a href="kernelBrowser.html">Kernel Browser</a>, <a href="probeAliasBrowser.html">Probe Alias Browser</a>,
+and <a href="../reference/viewsAndEditors.html#console">console/error log</a>. The IDE Perspective contains
+the features necessary to <a href="">run SystemTap scripts</a> and the syntax highlighting and code
+completion features to facilitate efficient development.</li>
+<li><img src="../reference/images/toolbars/graphing.png"> <b>Graphing Perspective</b> - This perspective is invoked when the user calls the Run /w Chart option.
+It defaults to showing a data table containing the script results and is capable of producing six different
+chart types: Line Graph, Multi-Line Graph, Bar Graph, Multi-Bar Graph, Scatter Graph, and Multi-Scatter
+Graph.</li>
+<li><img src="../reference/images/toolbars/dash.png"><b>Dashboard Perspective</b> - This perspective will be capable of storing meta-data related to
+each graph such as filters, aggregates, and display options in addition to showing a "dashboard" interface
+with multiple graphs updating simultaneously. It is currently still under development.</li>
+</ol> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial.html
new file mode 100644
index 0000000000..f3995f196c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial.html
@@ -0,0 +1,15 @@
+<a href="../toc.html">Table of Contents</a> > <a href="gettingStarted.html">Getting Started</a>
+
+<h2>
+IDE Tutorial
+</h2>
+
+The IDE Perspective is a powerful portion of the SystemTap GUI that focuses on writing and editing
+SystemTap scripts. This tutorial consists of three lessons to guide first users through writing and
+running scripts and to illustrate features along the way.<br><br>
+
+<a href="IDETutorial/lesson1.html">Lesson 1: Getting Started</a><br><br>
+
+<a href="IDETutorial/lesson2.html">Lesson 2: Writing Your First Script</a><br><br>
+
+<a href="IDETutorial/lesson3.html">Lesson 3: Running Your Script</a><br><br> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/chartbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/chartbox1.png
new file mode 100644
index 0000000000..0008258b2b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/chartbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/editor.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/editor.png
new file mode 100644
index 0000000000..5103ada3a4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/editor.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/graph.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/graph.png
new file mode 100644
index 0000000000..4b1b57f3e0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/graph.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/graphics.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/graphics.png
new file mode 100644
index 0000000000..91034b6395
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/graphics.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/newfile.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/newfile.png
new file mode 100644
index 0000000000..9b23dec081
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/newfile.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/output.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/output.png
new file mode 100644
index 0000000000..7a869a4c47
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/images/output.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson1.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson1.html
new file mode 100644
index 0000000000..e5b204bbae
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson1.html
@@ -0,0 +1,30 @@
+<a href="../../toc.html">Table of Contents</a> > <a href="../gettingStarted.html">Getting Started</a> > <a href="../IDETutorial.html">IDE Tutorial</a>
+
+<h2>
+IDE Tutorial, Lesson One: Getting Started
+</h2>
+
+In this tutorial we will orient you with IDE Perspective and its functions. At this point we assume
+that you are able to run Systemtap GUI and are unfamiliar with how to procede. If you cannot yet start
+the application, please refer to our <a href="../installation.html">section on installation</a>.
+<b>NOTE:</b> If this is the first time opening the IDE Perspective it will take a while to load as it has to
+parse everything in the tapsets. <br><br>
+
+The IDE Perspective's purpose is to allow the user to create, view, and edit Systemtap scripts. There are
+other editors built in (plain text and the C editor), however, they ultimately exist to facilitate the
+writing of Systemtap scripts.<br><br>
+
+In this lesson we will open a new Systemtap script file to familiarize ourselves with the IDE Perspective.
+Start by opening the <u>F</u>ile menu and selecting <u>O</u>pen. A dialogue box will pop up and request the
+location of the file you want to open. We've included a folder called "examples" right in the tar ball. You
+may chose any of them to use; in this tutorial we will open top.stp. Go ahead and open the file.
+
+<br><br><img src="images/editor.png"><br><br>
+
+You'll see the file is loaded into the editor pane of Systemtap GUI. You'll also noticed different colored
+text. Systemtap GUI supports syntax highlighting for the ease of the writer. Feel free to edit the file.<br><br>
+
+At this point proceed to <a href="lesson2.html">Lesson 2</a> if you wish to learn how to write your
+own script file or <a href="lesson3.html">Lesson 3</a> if you wish to run this one.<br><br>
+
+<a href="../IDETutorial.html>Back to Tutorial Contents</a> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson2.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson2.html
new file mode 100644
index 0000000000..deea0b8561
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson2.html
@@ -0,0 +1,70 @@
+<a href="../../toc.html">Table of Contents</a> > <a href="../gettingStarted.html">Getting Started</a> > <a href="../IDETutorial.html">IDE Tutorial</a>
+
+<h2>
+IDE Tutorial, Lesson Two: Writing Your First Script
+</h2>
+
+In this tutorial we will guide you through the process of writing your first Systemtap script. It is
+strongly recommended that you review the <a href="http://sourceware.org/systemtap/tutorial/">
+Systemtap website's tutorial</a> for up-to-date information on the latest version of Systemtap.<br><br>
+
+Start by selecting <u>F</u>ile-><u>N</u>ew. Specify a file name of your choosing, but be sure that it
+ends with an .stp extension. Click ok. Your blank script should be present in the editor pane.<br><br>
+
+<img src="images/newfile.png"><br><br>
+
+<pre>Now type/copy the following:
+
+<code>
+ global read, write, start
+
+ probe begin {
+ start = gettimeofday_s()
+ }
+ probe syscall.write {
+ write += count
+ }
+
+ probe timer.ms(1000) {
+ printf("%d\t%d\t%d\n", (gettimeofday_s()-start), read, write)
+ read=0
+ write=0
+ }
+</code></pre>
+
+Now to demonstrate the functionality of the Probe Alias browser we will have you complete the read probe
+yourself. Start by opening the syscall folder in the Probe Alias browser. If you do not have any content
+in the browser you are experiencing a problem with Systemtap installation and should refer to our
+<a href="./installation.html">installation help</a>. Ensure your cursor is located at the end of the file.
+Now scroll down and double click the read probe alias. Systemtap GUI will insert the skeleton probe at the
+point at which your cursor is at, and should look similar to the following:
+
+<pre><code>
+probe syscall.read
+{
+ /*
+ * available variables on this probe:
+ * argstr, buf_uaddr, count, fd, name
+ */
+
+}
+</code></pre>
+
+Now insert the following line into the syscall.read probe:<br>
+
+<pre><code>read += count</code></pre>
+
+You may remove the comment (/* ... */) if you wish.<br><br>
+
+This will count the number of bytes read and written each second and print it out. The begin probe executes
+first, by getting the time of day. The read and write probes increment each time the function is called. The
+timer probe prints the information every second. If you typed the script in manually you may have noticed
+that the editor provides code completion for probe aliasi. If you did not, type "syscall.". You'll see a
+box come up that you may use to select an item to complete your probe alias.<br><br>
+
+In <a href="lesson3.html">Lesson 3</a> you will learn how to run Systemtap scripts in the IDE Perspective.<br><br>
+
+<a href="../IDETutorial.html>Back to Tutorial Contents</a>
+
+
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson3.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson3.html
new file mode 100644
index 0000000000..bb628313cb
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/IDETutorial/lesson3.html
@@ -0,0 +1,59 @@
+<a href="../../toc.html">Table of Contents</a> > <a href="../gettingStarted.html">Getting Started</a> > <a href="../IDETutorial.html">IDE Tutorial</a>
+
+<h2>
+IDE Tutorial, Lesson Three: Running Your Script
+</h2>
+
+In this lesson we will cover running your script. You may use either the example script you opened in Lesson
+1 or the script you wrote in Lesson two. Select <u>R</u>un-><u>R</u>un. Enter the remote server details. You should receive output in the console
+similar to the following, which shows the reads and write per second. If you do not, please refer to
+<a href="crap.html">troubleshooting</a>.<br><br>
+
+<img src="images/output.png"><br><br>
+
+Now we will demonstrate running Systemtap scripts with graphs. In order to run the chart example you'll
+need to use the code provided in <a href="lesson2.html">Lesson 2</a>. To do this select
+<b><u>R</u>un->Run w/ <u>C</u>hart</b>. This feature will prompt the user for the number of columns for the chart, in addition to
+their titles and regular expressions. The regular expressions are used to parse the console output for
+the script and determine the values of each column at a certain sample point. The combined regular
+expression is shown at the bottom of the dialogue box.
+
+<br><img src="images/chartbox1.png"><br><br></li>
+
+For this example enter the following:<br>
+
+<pre> Columns: 3
+
+ TITLE REGULAR EXPRESSION DELIMITER
+ Time \d+ .* \D+
+ Read \d+ .* \D+
+ Write \d+ .* \D+
+</pre><br>
+
+The title fields simply display the associated string in the column's header. After clicking OK the
+script will prompt you for details regarding the Remote Server. Provide the ip address of the remote server
+that is running the systemtapgui Server or the Data Management Daemon. The port is by default 22462. Enter
+a username and password.This will give the application permissions to run your script on the remote machine.
+You have the option of saving your password as well, however be warned this is currently NOT encrypted so this
+convenience runs at a risk. The username is also used to transfer the file to the remote system using SCP. If the
+same machine is used as both the server and the client enter 'localhost' for the Host field.
+When the script is executed the application will switch into the Graphing perspective. A Data View chart is
+populated with live data, in addition to the output in the console. <br><br>
+You should see a screen similar to the following:<br><br>
+
+<img src="images/graphics.png"><br><br>
+
+You will see that the data table poplulates from live data parsed from the console. Now we'll make a
+graph to briefly illustrate the Graphing perspective. Click the Create Graph button next to bring up the
+Select Chart dialogue.Select line graph. You will be prompted to select a column of the X series and Y
+series; select "Time" and "Write" respectively. After you click ok you should see the line graph as follows:<br><br>
+
+<img src="images/graph.png"><br><br>
+
+Note that the multiple series graphs (Multi-Line, Multi-Bar, and Multi-Scatter) will request two Y series, Y1
+and Y2. In the case of our example, these would be "Read" and "Write". Each series will be assigned a different
+color value for the purposes of differentiation and will be plotted both in respect to the specified X series.<
+
+Those are the basics behind running a script in Systemtap GUI.<br><br>
+
+<a href="../IDETutorial.html>Back to Tutorial Contents</a> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/gettingStarted.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/gettingStarted.html
new file mode 100644
index 0000000000..7d2bb6b088
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/gettingstarted/gettingStarted.html
@@ -0,0 +1,22 @@
+<a href="../toc.html">Table of Contents</a>
+
+<h2>
+Getting Started
+</h2>
+
+Systemtap GUI is a tool being developed to assist in writing SystemTap scripts and viewing kernel performance.
+
+Systemtap scripts can be used to insert probes into the Linux kernel, where they can monitor various system activities and provide information back based on what is going on. The goal of the Systemtap GUI project is to provide three things. The first is an IDE to assist Systemtap scripts. Secondly, a data collection and graphical display that users can use to visually see what is happening in the kernel. Finally, a dashboard with an number of precanned scripts for users to use without having to write their own scripts.
+
+The current code drop comes with the IDE Perspective and the Graphical Perspective. Subsequent installments will include updates to these features as well as the Dashboard perspective.
+
+<ol>
+<li><a href="IDETutorial.html">IDE Tutorial</a>
+<ul>
+<li><a href="IDETutorial/lesson1.html">Lesson 1: Getting Started</a></li>
+<li><a href="IDETutorial/lesson2.html">Lesson 2: Writing Your First Script</a></li>
+<li><a href="IDETutorial/lesson3.html">Lesson 3: Running Your Script</a></li>
+</ul>
+</li>
+</ol>
+</li>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/exampleScripts.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/exampleScripts.html
new file mode 100644
index 0000000000..19185a763d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/exampleScripts.html
@@ -0,0 +1,174 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Example SystemTap Scripts
+</h2>
+
+What follows is a few SystemTap Scripts that you may use in SystemTap GUI, taken from and linked to
+<a href="http://sourceware.org/systemtap/documentation.html">http://sourceware.org/systemtap/documentation.html</a>
+
+<br><br>There is also a
+<a href="http://sourceware.org/systemtap/examples/demo_script.txt">description of the examples</a>.
+
+<h3>
+top.stp - Prints the top 20 system calls (<a href="http://sourceware.org/systemtap/examples/top.stp">online source</a>)
+</h3>
+
+<code><pre>
+#!/usr/bin/env stap
+#
+# This script continuously lists the top 20 systemcalls on the system
+#
+
+global syscalls
+
+function print_top () {
+ cnt=0
+ log ("SYSCALL\t\t\t\tCOUNT")
+ foreach ([name] in syscalls-) {
+ printf("%-20s\t\t%5d\n",name, syscalls[name])
+ if (cnt++ == 20)
+ break
+ }
+ printf("--------------------------------------\n")
+ delete syscalls
+}
+
+probe kernel.function("sys_*") {
+ syscalls[probefunc()]++
+}
+
+# print top syscalls every 5 seconds
+probe timer.ms(5000) {
+ print_top ()
+</pre></code>
+
+
+<h3>
+prof.stp - Simple profiling (<a href="http://sourceware.org/systemtap/examples/prof.stp">online source</a>)
+</h3>
+
+<code><pre>
+#!/usr/bin/env stap
+
+# This is an example of profiling a specific command or pid.
+# It works by recording the time when a system call is entered
+# exited.
+
+# Usage: prof.stp -c "top -n5"
+# Will start up "top" and after 5 iterations, will exit.
+#
+# Usage: prof.stp -x 3323
+# Will profile pid 3323 until it ^c is hit.
+#
+
+probe kernel.function("sys_*") {
+ if (target() == tid())
+ calltime[tid()] = gettimeofday_us()
+}
+
+probe kernel.function("sys_*").return {
+ if (target() != tid()) next
+ now = gettimeofday_us()
+ c = calltime[tid()]
+ if (!c) next
+ ttime[probefunc()] <<< now - c
+ delete calltime[tid()]
+}
+
+probe end {
+ printf("\n")
+ foreach (x in ttime)
+ printf("%-20s\tcalls:%6d\tavg time (ms):%5d\ttotal(ms):%7d\n",
+ x, @count(ttime[x]), @avg(ttime[x]), @sum(ttime[x]))
+}
+
+global calltime, ttime
+</pre></code>
+
+
+<h3>
+keyhack.stp - Modifying variables in the kernel. (<a href="http://sourceware.org/systemtap/examples/keyhack.stp">online source</a>)
+</h3>
+
+<code><pre>
+#! /usr/bin/env stap
+
+# This is not useful, but it demonstrates that
+# Systemtap can modify variables in a running kernel.
+
+# Usage: ./keyhack.stp -g
+
+probe kernel.function("kbd_event") {
+ # Changes 'm' to 'b' .
+ if ($event_code == 50) $event_code = 48
+}
+
+probe end {
+ printf("\nDONE\n")
+}
+</code></pre>
+
+
+<h3>
+kmalloc.stp - Statistics example. (<a href="http://sourceware.org/systemtap/examples/kmalloc.stp">online source</a>)
+</h3>
+
+<code><pre>
+#! /usr/bin/env stap
+
+# Using statistics to examine kernel memory allocations
+
+global kmalloc
+
+probe kernel.function("__kmalloc") {
+ kmalloc <<< $size
+}
+
+# Exit after 10 seconds
+probe timer.ms(10000) { exit () }
+
+probe end {
+ printf("Count: %d allocations\n", @count(kmalloc))
+ printf("Sum: %d Kbytes\n", @sum(kmalloc)/1000)
+ printf("Average: %d bytes\n", @avg(kmalloc))
+ printf("Min: %d bytes\n", @min(kmalloc))
+ printf("Max: %d bytes\n", @max(kmalloc))
+ print("\nAllocations by size in bytes\n")
+ print(@hist_log(kmalloc))
+}
+</code></pre>
+
+
+<h3>
+kmalloc2.stp - Example using arrays of statistics. (<a href="http://sourceware.org/systemtap/examples/kmalloc2.stp">online source</a>)
+</h3>
+
+<code><pre>
+#! /usr/bin/env stap
+
+# Using statistics and maps to examine kernel memory allocations
+
+global kmalloc
+
+probe kernel.function("__kmalloc") {
+ kmalloc[execname()] <<< $size
+}
+
+# Exit after 10 seconds
+probe timer.ms(10000) { exit () }
+
+probe end {
+ foreach ([name] in kmalloc) {
+ printf("Allocations for %s\n", name)
+ printf("Count: %d allocations\n", @count(kmalloc[name]))
+ printf("Sum: %d Kbytes\n", @sum(kmalloc[name])/1000)
+ printf("Average: %d bytes\n", @avg(kmalloc[name]))
+ printf("Min: %d bytes\n", @min(kmalloc[name]))
+ printf("Max: %d bytes\n", @max(kmalloc[name]))
+ print("\nAllocations by size in bytes\n")
+ print(@hist_log(kmalloc[name]))
+ printf("-------------------------------------------------------\n\n");
+ }
+}
+</code></pre> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/frequentlyAskedQuestions.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/frequentlyAskedQuestions.html
new file mode 100644
index 0000000000..e2326e7337
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/frequentlyAskedQuestions.html
@@ -0,0 +1,29 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Frequently Asked Questions
+</h2>
+
+This section details frequently asked questions relating to the IDE Perspective.<br><br>
+
+<b>
+Where can I find information regarding the Systemtap scripting language?
+</b><br><br>
+
+A: The best place to look for up to date information regarding Systemtap itself is its <A HREF="http://sourceware.org/systemtap/documentation.html">homepage.</A>
+<br><br><br>
+
+<b>
+How do I run a script once I've written it?
+</b><br><br>
+
+A: There are different options as far as running your Systemtap script. Please visit the <a href="menus.html#run">Run menu section</a> to learn more about the four ways of running Systemtap scripts.<br><br>
+<br><br><br>
+
+<b>
+Why does the application seem to hang when switchign to the IDE Perspective?
+</b><br><br>
+
+A: If this is the first time you are trying to open the IDE perspective, or have recently gotten a new version of SystemTap this is expected. In order to generate a full list of all of the available probes, and functions the GUI has to run the stap command. If there are tapsets that do not run correctly using the 'stap -up2' comamnd this takes a long time. In order to build as complete a list as possible it will use a binary filtering algorithm to figure out which tapset function is broken and generate data for all of the others.
+<br><br><br>
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/Console.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/Console.png
new file mode 100644
index 0000000000..350a87e416
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/Console.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/ErrorLog.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/ErrorLog.png
new file mode 100644
index 0000000000..396397b552
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/ErrorLog.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/chartbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/chartbox1.png
new file mode 100644
index 0000000000..0008258b2b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/chartbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/consolebox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/consolebox1.png
new file mode 100644
index 0000000000..4ef123c9fd
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/consolebox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/findbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/findbox1.png
new file mode 100644
index 0000000000..fbb1195e55
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/findbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/gotobox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/gotobox1.png
new file mode 100644
index 0000000000..3a6faae06b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/gotobox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/importbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/importbox1.png
new file mode 100644
index 0000000000..050eb82f9a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/importbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/newbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/newbox1.png
new file mode 100644
index 0000000000..ced1f3fac8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/newbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/openbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/openbox1.png
new file mode 100644
index 0000000000..3155183cf4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/openbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/optionsbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/optionsbox1.png
new file mode 100644
index 0000000000..0ee82f163f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/optionsbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/passbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/passbox1.png
new file mode 100644
index 0000000000..f8d6dca709
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/passbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/preferencesbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/preferencesbox1.png
new file mode 100644
index 0000000000..31b0cbc9f1
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/preferencesbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/viewbox1.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/viewbox1.png
new file mode 100644
index 0000000000..348b354600
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/menu/viewbox1.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/dash.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/dash.png
new file mode 100644
index 0000000000..4e1dc2ee25
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/dash.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/graphing.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/graphing.png
new file mode 100644
index 0000000000..adfa0c2943
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/graphing.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/ide.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/ide.png
new file mode 100644
index 0000000000..43dacebd97
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/ide.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/import_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/import_wiz.gif
new file mode 100644
index 0000000000..d38085ad9c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/import_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/new_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/new_wiz.gif
new file mode 100644
index 0000000000..7aea894d0b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/new_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/open_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/open_wiz.gif
new file mode 100644
index 0000000000..51e703b1b9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/open_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_chart.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_chart.gif
new file mode 100644
index 0000000000..b7f03d5679
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_chart.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_exc.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_exc.gif
new file mode 100644
index 0000000000..57f410224c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_exc.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_tool.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_tool.gif
new file mode 100644
index 0000000000..8fa2ef50f8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/run_tool.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/stop_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/stop_obj.gif
new file mode 100644
index 0000000000..dc47edf069
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/images/toolbars/stop_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/menus.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/menus.html
new file mode 100644
index 0000000000..0accc78023
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/menus.html
@@ -0,0 +1,105 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Graphics Perspective Menus
+</h2>
+
+What follows is a comprehension list of the menu options available within the IDE Perspective of Systemtap GUI.
+
+
+<h3>
+<u>F</u>ile
+</h3>
+<ul>
+<li><b><u>N</u>ew File</b> - This option will bring up a dialog to create a new file. You may specify any location. Files ending in a .stp or .c extension will have syntax highlighting and code completion features as appropriate. (Shortcut: Crtl+L)<br><img src="images/menu/newbox1.png"><br><br></li>
+<li><b><u>O</u>pen File</b> - This option will bring up a dialog to select a file to open. Once a file is selected it will open in the editor window. (Shortcut: Crtl+O)<br><img src="images/menu/openbox1.png"><br><br></li>
+<li><b><u>C</u>lose</b> - This option closes the file in the editor pane that currently has the focus. (Shortcut: Crtl+F4)</li>
+<li><b>C<u>l</u>ose All</b> - This option closes all files in the editor pane. (Shortcut: Shift+Crtl+F4)</li>
+<li><b><u>S</u>ave</b> - This option saves the file that currently has the focus. (Shortcut: Crtl+S)</li>
+<li><b>Save <u>A</u>s</b> - This option prompts the user for a new location and file name and saves the file that currently has the focus under that new name and location.</li>
+<li><b>Sav<u>e</u> All</b> - This option saves all files currently open in the editor pane. (Shortcut: Shift+Crtl+S)</li>
+<li><b>Rever<u>t</u></b> - This option discards changes to the file currently under the focus replaces it with the last saved version.</li>
+<li><b><u>P</u>rint</b> - This option prints the file in the editor pane currently holding the focus. (Shortcut: Crtl+P)</li>
+<li><b><u>E</u>xport Script</b> - This option prompts the user to enter metadata associated with the Systemtap script to be exported and used in the Dashboard perspective. See the <a href="../tasks/creatingModules.html">Creating Modules task guide</a> for instructions.</li>
+<li><b><u>I</u>mport Tapset</b> - This option allows you to include additional tapset directories when you run a script. (Shortcut: Crtl+I)<br><img src="images/menu/importbox1.png"><br><br></li>
+<li><b>E<u>x</u>it</b> - Exits Systemtap GUI.
+</ul>
+
+
+<h3>
+<u>E</u>dit
+</h3>
+<ul>
+<li><b><u>U</u>ndo</b> - Undos the previous editor related action. (Shortcut: Crtl+Z)</li>
+<li><b><u>R</u>edo</b> - Redos the previous editor related action removed by Undo. (Shortcut: Crtl+Y)</li>
+<li><b>Cu<u>t</u></b> - Removes the selected text from the editor pane and places it in the clipboard. (Shortcut: Shift+Delete, Ctrl+X)</li>
+<li><b><u>C</u>opy</b> - Copies the selected text from the editor pane and places it in the clipboard. (Shortcut: Ctrl+Insert, Crtl+C)</li>
+<li><b><u>P</u>aste</b> - Copies the text from the clipboard to the location of the focus in the editor pane. (Shortcut: Shift+Insert, Crtl+V)</li>
+<li><b>Select <u>A</u>ll</b> - Selects all text within the file in the editor that the focus is currently in. (Shortcut: Crtl+A)</li>
+<li><b><u>F</u>ind/Replace</b> - Opens the Find/Replace dialogue in which users may specify a text string to find and/or replace, with options to search forwards or backwards, the entire document or just the selected lines, and whether or not they want the following options:
+<ul>
+<li>Case sensitive</li>
+<li>Wrap Search</li>
+<li>Whole Word</li>
+<li>Incremental</li>
+<li>Regular expressions</li>
+</ul>(Shortcut: Crtl+F)</li><br><img src="images/menu/findbox1.png"><br><br></li>
+<li><b>Find <u>N</u>ext</b> - Finds the next instance of the search string in the direction indicated in the Find/Replace dialogue box. (Shortcut: Crtl+K)</li>
+<li><b>Find Pre<u>v</u>ious</b> - Finds the previous instance of the search string in the direction indicated in the Find/Replace dialogue box. (Shortcut: Shift+Crtl+K)</li>
+<li><b><u>I</u>ncremental Find Next</b> - Finds the next occurrence of the text and updates the selection after each character typed. To use Incremental Find:
+<ol>
+ <li>In the text (or Java) editor, press Ctrl+J or select Edit > Incremental Find Next from the menu bar.</li>
+ <li>The workbench status line displays "Incremental Find:". The editor is now in the Incremental Find mode.</li>
+ <li>As you type, the editor finds the next occurrence of the text and updates the selection after each character typed.</li>
+ <li>Navigate to the next or previous match by pressing Arrow Down or Arrow Up.</li>
+ <li>Undo the last action within the Incremental Find mode by pressing Backspace.</li>
+ <li>You can leave the Incremental Find mode by pressing Esc</li>
+</ol>(Shortcut: Crtl+J)</li>
+<li><b>Incre<u>m</u>ental Find Previous</b> - Operates as illustrated in above bullet but in the reverse. (Shortcut: Shift+Crtl+J)</li>
+<li><b>Select <u>A</u>ll</b> - Selects all the text in the file that currently has the focus. (Shortcut: Ctrl+A)</li>
+<li><b><u>W</u>ord Completion</b> - Completes the string being typed by using the last example typed by the user. (Shortcut: Alt+/)</i>
+</ul>
+
+<h3>
+<u>N</u>avigate
+</h3>
+<ul>
+<li><b><u>F</u>orward</b> - Navigates to the next file in sequence as they were opened in the editor pane. (Shortcut: Alt+Right)</li>
+<li><b><u>B</u>ack</b> - Navigates to the previous file in sequence as they were opened in the editor pane. (Shortcut: Alt+Left)</li>
+<li><b>Last Edit Lo<u>c</u>ation</b> - Moves the focus to the file containing the last known edit. (Shortcut: Crtl+Q)</li>
+<li><b><u>G</u>oto Line...</b> - Moves the focus to the specified line number, with the range of line numbers listed in the dialogue box. (Shortcut: Ctrl+L)<br><img src="images/menu/gotobox1.png"><br><br></li>
+</ul>
+
+<h3>
+<a name="run"><u>R</u>un</a>
+</h3>
+<ul>
+<li><b><u>R</u>un</b> - Available when a Systemtap script is loaded into the editor, this feature runs the script. You will be prompted to enter details of the remote machine running the systemtapgui server.ShortCut(Ctrl+F5)<br><img src="images/menu/consolebox1.png"><br><br></li>
+<li><b><u>R</u>un w/Chart</b> - Available when a Systemtap script is loaded into the editor, this feature will prompt the user for the number of columns for the chart, in addition to their titles and regular expressions. The regular expressions are used to parse the console output for the script and determine the values of each column at a certain sample point. The combined regular expression is shown at the bottom of the dialogue box. The user has the option to use Command Line Options as well. When you click OK you will be prompted to enter the details of the remote machine running the systemtapgui server. When the script is executed the application will switch into the Graphing perspective. A Data View chart is populated with live data, in addition to the output in the console. More information regarding the Graphing perspective is available here.<br><img src="images/menu/chartbox1.png"><br><br></li>
+<li><b><u>S</u>top</b> - This option terminates the script thread associated with whichever script currently has the focus. (Shortcut: Ctrl+F9)</li>
+</ul>
+
+<h3>
+<u>W</u>indow
+</h3>
+<ul>
+<li><b>Open in <u>N</u>ew Window</b> - This option opens a new instance of SystemTap GUI.</li>
+<li><b><u>O</u>pen Perspective</b> - This submenu lists each of the available perspectives to open:
+<ul>
+<li>IDE Perspective</li>
+<li>Graphing Perspective</li>
+<li>Dashboard Perspective</li>
+</ul></li>
+<li><b>Show <u>V</u>iews</b> - This submenus lists each of the available views to open:
+<ul>
+<li>Console</li>
+<li>Error Log</li>
+<li>Functions</li>
+<li>Kernel Source</li>
+<li>Probe Alias</li>
+<li>Other - Lists all views in the application.</li><br><img src="images/menu/viewbox1.png"><br><br>
+</ul></li>
+<li><b><u>P</u>references</b> - Due to the breath of this topic it is covered in another section. Please see <a href="preferences.html">Preferences Help</a>.<br><br></li>
+</ul>
+
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/preferences.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/preferences.html
new file mode 100644
index 0000000000..cb8a709681
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/preferences.html
@@ -0,0 +1,129 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Preferences
+</h2>
+
+This section details each of the options listed under <b><u>W</u>indow-><u>P</u>references</b>. The Preferences dialog is the dialog used to set user preferences. The Preferences dialog pages can be searched using the filter function. To filter by matching the page title, simply type the name of the page you are seeking and the available pages will be presented below. The filter also searches on keywords such as appearance and java.
+
+<ul>
+<li><b>Logging</b>
+<ul>
+<li><b>Enable logging</b> - This option turns on and off the ability to log data from the console.</li>
+<li><b>Logging level</b> - This dropdown box allows you to select one of our levels of logging.
+<ul>
+<li>Debug - A very large quantity of debug information, difficult to identify what you are looking for but extremely exhaustive.</li>
+<li>Info - Displays most information regarding program execution; the default level.</li>
+<li>Critical - Lists only critical errors duration execution.</li>
+<li>Fatal - Lists only fatal errors during execution.</li>
+</ul>
+</li>
+<li><b>Log to</b> - Specifies where you wish the logging to be written:
+<ul>
+<li>Console - Writes the debug information directly to the console.</li>
+<li>File - Write the debug information to a file.</li>
+</ul>
+<li><b>File</b> - The location of the file that logging sends the debug information to.</li>
+</ul>
+<li><b>SystemTap</b> - This section contains options relevent to SystemTap itself.
+<ul>
+<li><b>Remember window state</b> - Preserves the state of the window on exitting SystemTap GUI.
+<li><b>Dashboard Preferences</b> - Preferences relate to the Dashboard Perspective.
+<ul>
+<li>Additional Modules - Provides for the addition of more modules to the Dashboard. Modules are files containing a SystemTap script and associated metadata.</li>
+</ul>
+<li><b>Environment Variables</b> - Allows the user to set specific values to the following environment variables
+<ul>
+<li>LD_LIBRARY_PATH</li>
+<li>PATH</li>
+<li>SYSTEMTAP_TAPSET</li>
+<li>SYSTEMTAP_RUNTIME</li>
+</ul>
+</li>
+<li><b>Graphing</b> - Preferences related to the Graphing Perspective.
+<ul>
+<li><b><u>R</u>efresh Delay (ms)</b> - Milliseconds in between re-painting the graph.</li>
+<li><b>Data Table</b> - Preferences related to the data table.
+<ul>
+<li><u>J</u>ump to the newest entry - Determines whether the scroll bar maintains its location at the newest entry.</li>
+<li><u>A</u>uto resize columns - Determines whether columns automatically resize to the width of the contents or whether they remain placed when moved.</li>
+<li><u>M</u>ax data items - Maximum number of entries that the table shows, though the table itself may have more not visible.</li>
+</ul>
+</li>
+<li><b>Graph</b> - Preferences related to graphs.
+<ul>
+<li><u>S</u>how grid lines - Turns on and off painting of the grid lines.</li>
+<li><u>V</u>iewable data items - Number of maximum samples plotted at any time.</li>
+</ul>
+</ul>
+<li><b>IDE</b> - Preferences when loading the IDE Perspective.
+<ul>
+<li><b>Use stored tapset trees</b> - Loads the stored tapset trees on initialization.</li>
+<li><b>Editor</b> - Preferences related to the editor.
+<ul>
+<li><u>E</u>ditor Background Color - Sets the color painted in the background of the editor pane.</li>
+<li>Show Line <u>N</u>umbers - Option to turn on and off line numbers in the editor pane.
+<li>Code Assist
+<ul>
+<li><u>U</u>se Code Assist - Turns on and off the option to use Code Assist, which is a method that predicts what you are typing based on existing probe aliasi and opens a window that allows you to scroll down and select and/or continue typing for refined results.</li>
+<li>How Code Assist adds code - Method used in Code Assist.
+<ul>
+<li><u>I</u>nsert - Inserts the selected text directly into the cursor point.</li>
+<li><u>O</u>verwrite - Overwrites as you type.</li>
+</ul>
+</li>
+<li>Activation <u>D</u>elay (requires restart) - Delay in milliseconds before the code assist routines attempts to run.
+<li>Activation <u>T</u>rigger - This is the key that actives Code Assist. For SystemTap GUI it is set to the divider between tapset and probe alias.
+</ul>
+</li>
+<li>Syntax Coloring - These options assign color values to identified types within the .stp and .c editors.
+<ul>
+<li>STP editor
+<ul>
+<li><u>D</u>efault Color - Color of normal code.</li>
+<li><u>K</u>eyword Color - Color of keywords.</li>
+<li><u>E</u>mbedded C Color - Color of embedded C code.</li>
+<li><u>E</u>mbedded Color - Color of embedded code.</li>
+<li><u>C</u>omment Color - Color of comments.</li>
+<li><u>T</u>ype Color - Color of items identified as types.</li>
+<li><u>S</u>tring Color - Color of strings.</li>
+</ul>
+</li>
+<li>C editor
+<ul>
+<li><u>D</u>efault Color - Color of normal code.</li>
+<li><u>K</u>eyword Color - Color of keywords.</li>
+<li><u>P</u>reprocessor Color - Color of preprocessor code.</li>
+<li><u>C</u>omment Color - Color of comments.</li>
+<li><u>T</u>ype Color - Color of items identified as types.</li>
+<li><u>S</u>tring Color - Color of strings.</li>
+</ul>
+</li>
+</ul
+</li>
+<li>Typeing - No options available at this time.</li>
+</ul>
+</li>
+<li><b>Path</b>
+<ul>
+<li><u>K</u>ernel Source Directory - Location of the directory that the kernel source code is pulled from.</li>
+<li>Stap - No options available at this time.
+<ul>
+<li>Tapsets - Preferences related to tapsets.
+<ul>
+<li><u>A</u>dditional Tapsets - Allows you to specify additional tapsets scripts to be added in with every script.</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+<li><b>Remote Server</b> - Details regarding the remote machine running the systemtapgui Server
+<ul>
+<li><b>Host Name</b> - IP address of the remote machine</li>
+<li><b>Port</b> - Port used for communication. Default is 22462.</li>
+<li><b>User Name</b> - User name that has sufficient permissions to transfer and run the script on the remote machine. </li>
+<li><b>Password</b> - Password for the above user. </li>
+</ul>
+</ul> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/reference.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/reference.html
new file mode 100644
index 0000000000..fba8de0b13
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/reference.html
@@ -0,0 +1,19 @@
+<a href="../toc.html">Table of Contents</a>
+
+<h2>
+Reference
+</h2>
+
+This section of the IDE User Guild is intended to provide the following resources should you have any
+very specific questions regarding the IDE Perspective in general or one of the options associated with
+it. It also contains example scripts and FAQs.
+
+<ol>
+<li><a href="viewsAndEditors.html">Views and Editors</a></li>
+<li><a href="menus.html">Menus</a></li>
+<li><a href="toolbars.html">Toolbars</a></li>
+<li><a href="preferences.html">Preferences</a></li>
+<li><a href="frequentlyAskedQuestions.html">Frequently Asked Questions</a></li>
+<li><a href="exampleScripts.html">Example SystemTap Scripts</a></li>
+<li><a href="regex.html">Guide to Regular Expressions</a></li>
+</ol>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/regex.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/regex.html
new file mode 100644
index 0000000000..8643733fde
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/regex.html
@@ -0,0 +1,144 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Regex Reference Page
+</h2>
+
+Regular expressions are used in SystemTap GUI to define how the GUI interprets information that it recieves
+from the script file. If the user wishes to change the regular expression during runtime they may do so by
+selecting <b><u>E</u>dit->Modify <u>P</u>arsing Expression</b>.<br><br>
+
+Basic regex (taken from <a href="http://java.sun.com/j2se/1.5.0/docs/api/">http://java.sun.com/j2se/1.5.0/docs/api/</a> ) -
+
+<pre> Summary of regular-expression constructs
+
+Construct Matches
+
+Characters
+x The character x
+\\ The backslash character
+\0n The character with octal value 0n (0 <= n <= 7)
+\0nn The character with octal value 0nn (0 <= n <= 7)
+\0mnn The character with octal value 0mnn (0 <= m <= 3, 0 <= n <= 7)
+\xhh The character with hexadecimal value 0xhh
+\uhhhh The character with hexadecimal value 0xhhhh
+\t The tab character ('\u0009')
+\n The newline (line feed) character ('\u000A')
+\r The carriage-return character ('\u000D')
+\f The form-feed character ('\u000C')
+\a The alert (bell) character ('\u0007')
+\e The escape character ('\u001B')
+\cx The control character corresponding to x
+
+Character classes
+[abc] a, b, or c (simple class)
+[^abc] Any character except a, b, or c (negation)
+[a-zA-Z] a through z or A through Z, inclusive (range)
+[a-d[m-p]] a through d, or m through p: [a-dm-p] (union)
+[a-z&&[def]] d, e, or f (intersection)
+[a-z&&[^bc]] a through z, except for b and c: [ad-z] (subtraction)
+[a-z&&[^m-p]] a through z, and not m through p: [a-lq-z](subtraction)
+
+Predefined character classes
+. Any character (may or may not match line terminators)
+\d A digit: [0-9]
+\D A non-digit: [^0-9]
+\s A whitespace character: [ \t\n\x0B\f\r]
+\S A non-whitespace character: [^\s]
+\w A word character: [a-zA-Z_0-9]
+\W A non-word character: [^\w]
+
+POSIX character classes (US-ASCII only)
+\p{Lower} A lower-case alphabetic character: [a-z]
+\p{Upper} An upper-case alphabetic character:[A-Z]
+\p{ASCII} All ASCII:[\x00-\x7F]
+\p{Alpha} An alphabetic character:[\p{Lower}\p{Upper}]
+\p{Digit} A decimal digit: [0-9]
+\p{Alnum} An alphanumeric character:[\p{Alpha}\p{Digit}]
+\p{Punct} Punctuation: One of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
+\p{Graph} A visible character: [\p{Alnum}\p{Punct}]
+\p{Print} A printable character: [\p{Graph}\x20]
+\p{Blank} A space or a tab: [ \t]
+\p{Cntrl} A control character: [\x00-\x1F\x7F]
+\p{XDigit} A hexadecimal digit: [0-9a-fA-F]
+\p{Space} A whitespace character: [ \t\n\x0B\f\r]
+
+java.lang.Character classes (simple java character type)
+\p{javaLowerCase} Equivalent to java.lang.Character.isLowerCase()
+\p{javaUpperCase} Equivalent to java.lang.Character.isUpperCase()
+\p{javaWhitespace} Equivalent to java.lang.Character.isWhitespace()
+\p{javaMirrored} Equivalent to java.lang.Character.isMirrored()
+
+Classes for Unicode blocks and categories
+\p{InGreek} A character in the Greek block (simple block)
+\p{Lu} An uppercase letter (simple category)
+\p{Sc} A currency symbol
+\P{InGreek} Any character except one in the Greek block (negation)
+[\p{L}&&[^\p{Lu}]] Any letter except an uppercase letter (subtraction)
+
+Boundary matchers
+^ The beginning of a line
+$ The end of a line
+\b A word boundary
+\B A non-word boundary
+\A The beginning of the input
+\G The end of the previous match
+\Z The end of the input but for the final terminator, if any
+\z The end of the input
+
+Greedy quantifiers
+X? X, once or not at all
+X* X, zero or more times
+X+ X, one or more times
+X{n} X, exactly n times
+X{n,} X, at least n times
+X{n,m} X, at least n but not more than m times
+
+Reluctant quantifiers
+X?? X, once or not at all
+X*? X, zero or more times
+X+? X, one or more times
+X{n}? X, exactly n times
+X{n,}? X, at least n times
+X{n,m}? X, at least n but not more than m times
+
+Possessive quantifiers
+X?+ X, once or not at all
+X*+ X, zero or more times
+X++ X, one or more times
+X{n}+ X, exactly n times
+X{n,}+ X, at least n times
+X{n,m}+ X, at least n but not more than m times
+
+Logical operators
+XY X followed by Y
+X|Y Either X or Y
+(X) X, as a capturing group
+
+Back references
+\n Whatever the nth capturing group matched
+
+Quotation
+\ Nothing, but quotes the following character
+\Q Nothing, but quotes all characters until \E
+\E Nothing, but ends quoting started by \Q
+
+Special constructs (non-capturing)
+(?:X) X, as a non-capturing group
+(?idmsux-idmsux) Nothing, but turns match flags on - off
+(?idmsux-idmsux:X) X, as a non-capturing group with the given flags on - off
+(?=X) X, via zero-width positive lookahead
+(?!X) X, via zero-width negative lookahead
+(?<=X) X, via zero-width positive lookbehind
+(?<!X) X, via zero-width negative lookbehind
+(?>X) X, as an independent, non-capturing group
+Match a position that is not a word boundary.
+</pre>
+
+<br>Information regarding regular expressions can be found all over the Internet. A few examples have been listed
+below:<br><br>
+
+<ul>
+<li><a href="http://www.javascriptkit.com/javatutors/redev.shtml">http://www.javascriptkit.com/javatutors/redev.shtml</a></li>
+<li><a href="http://www.zytrax.com/tech/web/regex.htm">http://www.zytrax.com/tech/web/regex.htm</a></li>
+</ul> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/toolbars.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/toolbars.html
new file mode 100644
index 0000000000..6366a2e7a3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/toolbars.html
@@ -0,0 +1,29 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Toolbars
+</h2>
+
+SystemTap GUI currently has two toolbars built in; an Action Bar for file and execution operations and a Perspective Selector to jump to different perspectives.
+
+<h3>
+Action Bar
+</h3>
+
+<ul>
+<li><img src="images/toolbars/new_wiz.gif"> <b>New File</b> - This button will bring up a dialog to create a new file. When you click ok the file will be opened in the editor window.</li>
+<li><img src="images/toolbars/open_wiz.gif"> <b>Open File</b> - This button will bring up a dialog to select a file to open. Once a file is selected it will open in the editor window.</li>
+<li><img src="images/toolbars/import_wiz.gif"> <b>Import Tapset</b> - This button allows you to include additional tapset directories when you run a script.</li>
+<li><img src="images/toolbars/run_exc.gif"> <b>Run Script</b> - This will compile the open script and start running it. All output will be sent to the console. If there is an error in the script the error will be reported in the ErrorLog.</li>
+<li><img src="images/toolbars/run_chart.gif"> <b>Run Script w/Chart</b> - This button is also like the standard Run Script button but will bring up a charting dialog box. Once the formatting expressions have been entered it will change the current perspective to the graphing perspective.</li>
+<li><img src="images/toolbars/stop_obj.gif"> <b>Stop Script</b> - This button will stop the currently active script from running.</li>
+</ul>
+
+<h3>
+Perspective Selector
+</h3>
+
+<ul>
+<li><img src="images/toolbars/ide.png"> <b>IDE Perspective</b> - This button brings you into the IDE Perspective, useful for writing and executing scripts.</li>
+<li><img src="images/toolbars/graphing.png"> <b>Graphing Perspective</b> - This button brings you into the Graphing Perspective, useful for graphing scripts.</li>
+</ul> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/viewsAndEditors.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/viewsAndEditors.html
new file mode 100644
index 0000000000..20a705121e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/reference/viewsAndEditors.html
@@ -0,0 +1,34 @@
+<a href="../toc.html">Table of Contents</a> > <a href="reference.html">Reference</a>
+
+<h2>
+Views and Editors
+</h2>
+
+This section details the views and editor in relation to the IDE Perspective.
+
+<h3>
+Views
+</h3>
+
+The IDE Perspective consists of 5 views and and two editors.<br><br>
+
+<ul>
+<li><b>Probe Alias Browser</b> - A list of all probe aliasi currently available in your version of Systemtap. Covered in detail <a href="../concepts/probeAliasBrowser.html">here</a>.</li>
+<li><b>Function Browser</b> - A list of functions currently supported in your version of Systemtap. Covered in detail <a href="../concepts/functionBrowser.html">here</a>.</li>
+<li><b>Kernel Source Browser</b> - Used to display the kernel tree. Covered in detail <a href="../concepts/kernelBrowser.html">here</a>.</li>
+<a name="console"></a>
+<li><b>Console</b> - The console view is where all of the output from the running script is shown. If more then one script is running at the same time you are able to switch between which console is currently displayed by clicking on the "Display Selected Console" button. The script can halt execution here if the user selects the <b>Stop</b> button. The user also has the option of saving the console output to a file, which can be done by clicking the <b>Save log output</b> button at the top of the console.<br><br><img src="images/Console.png"></li>
+<li><b>Error Log</b> - If the script you tried to run contained errors, this view will become active and display the errors. You can double click on the eror message to jump to the line in the file where the error occured. <img src="images/ErrorLog.png"></li>
+</ul>
+
+<h3>
+Editors
+</h3>
+
+Three editors are available in Systemtap GUI.
+
+<ul>
+<li><b>STP Editor</b> - This editor is the most commonly used; it is used for the authoring and editing of Systemtap scripts. It is invoked when the user starts a new file or opens a file with the .stp extension. It provides syntax highlighting, code completion, and run support.</li>
+<li><b>C Editor</b> - This editor is available for the read only viewing of kernel source. It is invoked when the user opens a file of extension .c. Syntax highlighting is supported in this mode.</li>
+<li><b>Plain Text Editor</b> - A plain text editor is also implemented for the user should they need it.
+</ul>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/creatingSystemtapScripts.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/creatingSystemtapScripts.html
new file mode 100644
index 0000000000..84255eab16
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/creatingSystemtapScripts.html
@@ -0,0 +1,17 @@
+<a href="../toc.html">Table of Contents</a> > <a href="tasks.html">Tasks</a>
+
+<h2>
+Creating SystemTap Scripts
+</h2>
+
+Create a SystemTap script by selecting <b><u>F</u>ile-><u>N</u>ew</b> in the IDE Perspective. You'll be
+prompted to enter a name for the file; <i>make sure that you use a .stp extension or else SystemTap GUI
+will not recognize the file as a SystemTap script and certain editor and run features will not be active.</i>
+Your new file will be open and ready for coding in the Editor pane.<br><br>
+
+A <a href="../gettingstarted/IDETutorial.html">full length tutorial</a> is also provided in the help pages
+for a step by step demo.<br><br>
+
+For advanced SystemTap langauge help please see the SystemTap Development User's
+Guide and <a href="http://sourceware.org/systemtap/documentation.html">the SystemTap website's documentation
+page. \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/addedModule.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/addedModule.png
new file mode 100644
index 0000000000..989dbb5196
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/addedModule.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/exportScript.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/exportScript.png
new file mode 100644
index 0000000000..cee013d18e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/exportScript.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/options.png b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/options.png
new file mode 100644
index 0000000000..999051b3fb
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/images/options.png
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/tasks.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/tasks.html
new file mode 100644
index 0000000000..0317e8cf11
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/tasks.html
@@ -0,0 +1,14 @@
+<a href="../toc.html">Table of Contents</a>
+
+<h2>
+Tasks
+</h2>
+
+This section of the IDE User's Guide contains guides on how to accomplish common tasks in the IDE
+Perspective.<br><br>
+
+<ol>
+<li><a href="creatingSystemtapScripts.html">Creating SystemTap Scripts</a></li>
+<li><a href="usingTheSTPEditor.html">Using the STP Editor</a></li>
+<li><a href="viewingDataCharts.html">Viewing Data Charts</a></li>
+</ol> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/usingTheSTPEditor.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/usingTheSTPEditor.html
new file mode 100644
index 0000000000..beea6abd27
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/usingTheSTPEditor.html
@@ -0,0 +1,30 @@
+<a href="../toc.html">Table of Contents</a> > <a href="tasks.html">Tasks</a>
+
+<h2>
+STP Editor
+</h2>
+
+The STP Editor is used for the authoring and editing of Systemtap scripts. It is invoked when the user
+starts a new file or opens a file with the .stp extension. Using the editor is as easy as setting the focus
+to the editor pane and typing.<br><br>
+
+<img src="../concepts/images/Editor.png"><br><br>
+
+There are certain features within the editor you may want to take advantage of:
+<ul>
+<li>Syntax Highlighting - Certain code items are colored in .stp and .c files based on a set of rules and
+colors. You can turn this on or off and change the colors in <b><u>W</u>indow-><u>P</u>references</b>.</li>
+<li>Code Assist - SystemTap GUI will attempt to finish your probe alias names based on what you have already
+typed. You can then select the appropriate probe alias or continue typing to filter the list down even more.
+You can turn this feature on and off or set the speed on it in <b><u>W</u>indow-><u>P</u>references</b>.</li>
+<li>Run Support - See the <a href="../gettingstarted/IDETutorial/lesson3.html">IDE Tutorial: Lesson 3</a>
+help page on a walk through use of the Run command. The Run command allows scripts to be executed directly
+through SystemTap GUI.</li>
+</ul>
+
+
+
+
+See also: <a href="../reference/menus.html">IDE Perspective Menus</a>,
+<a href="../reference/exampleScripts.html">Example Scripts</a>, <a href="../reference/toolbars.html">Toolbars</a>
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/viewingDataCharts.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/viewingDataCharts.html
new file mode 100644
index 0000000000..5f5b2f1142
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/tasks/viewingDataCharts.html
@@ -0,0 +1,14 @@
+<a href="../toc.html">Table of Contents</a> > <a href="tasks.html">Tasks</a>
+
+<h2>
+Viewing Data Charts
+</h2>
+
+Viewing data charts from a SystemTap script is accomplished by running that script with the
+<b><u>R</u>un-><u>R</u>un w/ Chart</b> option. This is covered in the
+<a href="../gettingstarted/IDETutorial/lesson3.html">IDE Tutorial: Lesson Three</a>. After running a script
+with the chart option, the user is taken into the Graphing Perspective and the Data Table is loaded by
+default. The data table immediately begins populating as it recieves input back through the console from
+the running SystemTap script.<br><br>
+
+<img src="../gettingstarted/IDETutorial/images/graphics.png">
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/toc.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/toc.html
new file mode 100644
index 0000000000..6898898f7b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/html/toc.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Table of Contents</title>
+</head>
+
+<body>
+<h1>Table of Contents</h1>
+
+Welcome to SystemTap GUI help pages. Here you will find wide selection of help pages covering the IDE of
+SystemTap GUI.
+
+<ol>
+<li><a href="gettingstarted/gettingStarted.html">Getting Started</a>
+<ol>
+<li><a href="gettingstarted/IDETutorial.html">IDE Tutorial</a>
+<ul>
+<li><a href="gettingstarted/IDETutorial/lesson1.html">Lesson 1: Getting Started</a></li>
+<li><a href="gettingstarted/IDETutorial/lesson2.html">Lesson 2: Writing Your First Script</a></li>
+<li><a href="gettingstarted/IDETutorial/lesson3.html">Lesson 3: Running Your Script</a></li>
+</ul>
+</li>
+</ol>
+</li>
+<li><a href="concepts/concepts.html">Concepts</a></li>
+<ol>
+<li><a href="concepts/systemtapPerspectives.html">SystemTap Perspectives</a></li>
+<li><a href="concepts/stpEditor.html">STP Editor</a></li>
+<li><a href="concepts/functionBrowser.html">Function Browser</a></li>
+<li><a href="concepts/kernelBrowser.html">Kernel Browser</a></li>
+<li><a href="concepts/probeAliasBrowser.html">Probe Alias Browser</a></li>
+</ol>
+<li><a href="tasks/tasks.html">Tasks</a>
+<ol>
+<li><a href="tasks/creatingSystemtapScripts.html">Creating SystemTap Scripts</a></li>
+<li><a href="tasks/executingScripts.html">Executing Scripts</a></li>
+<li><a href="tasks/viewingDataCharts.html">Viewing Data Charts</a></li>
+<li><a href="tasks/creatingModules.html">Creating Modules</a></li>
+</ol>
+</li>
+<li><a href="reference/reference.html">Reference</li>
+<ol>
+<li><a href="reference/viewsAndEditors.html">Views and Editors</a></li>
+<li><a href="reference/menus.html">Menus</a></li>
+<li><a href="reference/toolbars.html">Toolbars</a></li>
+<li><a href="reference/preferences.html">Preferences</a></li>
+<li><a href="reference/frequentlyAskedQuestions.html">Frequently Asked Questions</a></li>
+<li><a href="reference/exampleScripts.html">Example SystemTap Scripts</a></li>
+<li><a href="reference/regex.html">Guide to Regular Expressions</a></li>
+</ol>
+</body>
+</html> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocconcepts.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocconcepts.xml
new file mode 100644
index 0000000000..81f1229880
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocconcepts.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Concepts" link_to="toc.xml#concepts">
+ <topic label="Systemtap Perspectives" href="documentation/html/concepts/systemtapPerspectives.html" />
+ <topic label="STP Editor" href="documentation/html/concepts/stpEditor.html" />
+ <topic label="Function Browser" href="documentation/html/concepts/functionBrowser.html" />
+ <topic label="Kernel Browser" href="documentation/html/concepts/kernelBrowser.html" />
+ <topic label="Probe Alias Browser" href="documentation/html/concepts/probeAliasBrowser.html" />
+</toc>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocgettingstarted.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocgettingstarted.xml
new file mode 100644
index 0000000000..fe20faa677
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocgettingstarted.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Getting Started" link_to="toc.xml#gettingstarted">
+ <topic label="IDE Tutorial" href="documentation/html/gettingstarted/IDETutorial.html">
+ <topic label="Lesson 1" href="documentation/html/gettingstarted/IDETutorial/lesson1.html" />
+ <topic label="Lesson 2" href="documentation/html/gettingstarted/IDETutorial/lesson2.html" />
+ <topic label="Lesson 3" href="documentation/html/gettingstarted/IDETutorial/lesson3.html" />
+ </topic>
+</toc>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocreference.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocreference.xml
new file mode 100644
index 0000000000..c383d7c89d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/tocreference.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Reference" link_to="toc.xml#reference">
+ <topic label="Views and editors" href="documentation/html/reference/viewsAndEditors.html" />
+ <topic label="Menus" href="documentation/html/reference/menus.html" />
+ <topic label="Toolbars" href="documentation/html/reference/toolbars.html" />
+ <topic label="Preferences" href="documentation/html/reference/preferences.html" />
+ <topic label="Frequently Asked Questions" href="documentation/html/reference/frequentlyAskedQuestions.html" />
+ <topic label="Example SystemTap Scripts" href="documentation/html/reference/exampleScripts.html" />
+</toc>
+
+
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/toctasks.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/toctasks.xml
new file mode 100644
index 0000000000..6f12b5e106
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/documentation/toctasks.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Tasks" link_to="toc.xml#tasks">
+ <topic label="Creating systemtap scripts" href="documentation/html/tasks/creatingSystemtapScripts.html" />
+ <topic label="Using the STP Editor" href="documentation/html/tasks/usingTheSTPEditor.html" />
+ <topic label="Viewing data charts" href="documentation/html/tasks/viewingDataCharts.html" />
+</toc>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/import_wiz.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/import_wiz.gif
new file mode 100644
index 0000000000..d38085ad9c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/import_wiz.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_chart.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_chart.gif
new file mode 100644
index 0000000000..b7f03d5679
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_chart.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_exc.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_exc.gif
new file mode 100644
index 0000000000..57f410224c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_exc.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_tool.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_tool.gif
new file mode 100644
index 0000000000..8fa2ef50f8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/run/run_tool.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/terminate_co.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/terminate_co.gif
new file mode 100644
index 0000000000..dc47edf069
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/actions/terminate_co.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_c.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_c.gif
new file mode 100644
index 0000000000..778bf3d9a8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_c.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_h.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_h.gif
new file mode 100644
index 0000000000..0212fd8e85
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_h.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_stp.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_stp.gif
new file mode 100644
index 0000000000..d7fabc8064
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/files/file_stp.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/file_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/file_obj.gif
new file mode 100644
index 0000000000..7ccc6a7031
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/file_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/fldr_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/fldr_obj.gif
new file mode 100644
index 0000000000..51e703b1b9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/fldr_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/probe_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/probe_obj.gif
new file mode 100644
index 0000000000..da1a16602e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/misc/probe_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/perspective_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/perspective_obj.gif
new file mode 100644
index 0000000000..0aa75fe704
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/perspective_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/sample.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/sample.gif
new file mode 100644
index 0000000000..34fb3c9d8c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/sample.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_long.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_long.gif
new file mode 100644
index 0000000000..678467f2d8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_long.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_str.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_str.gif
new file mode 100644
index 0000000000..4f4907c3d6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_str.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_unk.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_unk.gif
new file mode 100644
index 0000000000..10abf0dfad
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_unk.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_void.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_void.gif
new file mode 100644
index 0000000000..c804bbb947
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/vars/var_void.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/func_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/func_obj.gif
new file mode 100644
index 0000000000..7de61fd84f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/func_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/kernel_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/kernel_obj.gif
new file mode 100644
index 0000000000..131c28da40
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/kernel_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/page_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/page_obj.gif
new file mode 100644
index 0000000000..c1a19e1937
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/page_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/probe_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/probe_obj.gif
new file mode 100644
index 0000000000..ca8a692bef
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/icons/views/probe_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.properties
new file mode 100644
index 0000000000..155df86936
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.properties
@@ -0,0 +1,70 @@
+perspective.ide.name=SystemTap IDE
+
+view.function.name=Function
+view.probe.name=Probe Alias
+view.kernel.name=Kernel Source
+
+editor.stp.name=SystemTap STP Editor
+editor.simple.name=Simple Editor
+editor.c.name=C Editor
+
+preference.ide.name=SystemTap IDE
+preference.editor.name=Editor
+preference.codeAssist.name=Code Assist
+preference.conditionalFilter.name=Conditional Filters
+preference.syntaxColor.name=Syntax Coloring
+preference.typeing.name=Typeing
+preference.path.name=Path
+preference.stap.name=Stap
+preference.stapOptions.name=Stap Options
+preference.tapsets.name=Tapsets
+
+command.import.name=Import Tapset...
+command.import.desc=Import tapset directory
+command.stop.name=Stop
+command.stop.desc=Stop running script
+command.runOptions.name=Run w/Options
+command.runOptions.desc=Run the Script w/Options
+command.run.name=Run
+command.run.desc=Run the Script
+command.insertProbe.name=Insert Probe
+command.insertProbe.desc=Insert this probe
+command.insertFunction.name=Insert Function
+command.insertFunction.desc=Insert this function
+command.runChart.name=Run w/Chart
+command.runChart.desc=Run the Script w/Chart
+command.modifyParsing.name=Modify Parsing Expression
+command.modifyParsing.desc=Modify Parsing Expression
+
+category.file.name=File
+category.file.desc=File
+category.run.name=Run
+category.run.desc=Run
+category.popup.name=View Menu
+category.popup.desc=View Menu
+
+action.import.name=Import Tapset...
+action.import.desc=Import tapset directory
+action.runOptions.name=Run w/Options
+action.runOptions.desc=Run the Script w/Options
+action.run.name=Run
+action.run.desc=Run the Script
+
+action.runChart.name=Run w/Chart
+action.runChart.desc=Run the Script w/Chart
+action.stop.name=Stop
+action.stop.desc=Stop running script
+action.insertProbe.name=Insert Probe
+action.insertProbe.desc=Insert this probe
+action.insertFunction.name=Insert Function
+action.insertFunction.desc=Insert this function
+action.viewDefinition.name=View Definition
+
+
+actionset.file.name=File Action Set
+actionset.run.name=Run Action Set
+
+
+actionset.parsing.name=Parsing Action Set
+action.modifyParsing.name=Modify Parsing Expression
+action.modifyParsing.desc=Modify Parsing Expression
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.xml
new file mode 100644
index 0000000000..b2744310b7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/plugin.xml
@@ -0,0 +1,317 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ name="%perspective.ide.name"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective"
+ icon="icons/perspective_obj.gif"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ name="%view.function.name"
+ allowMultiple="true"
+ icon="icons/views/func_obj.gif"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.views.FunctionBrowserView"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.views.FunctionBrowserView"/>
+ <view
+ name="%view.kernel.name"
+ allowMultiple="true"
+ icon="icons/views/kernel_obj.gif"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.views.KernelBrowserView"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.views.KernelBrowserView"/>
+ <view
+ name="%view.probe.name"
+ allowMultiple="true"
+ icon="icons/views/probe_obj.gif"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="toc.xml"
+ primary="true"/>
+ <toc file="documentation/tocconcepts.xml"/>
+ <toc file="documentation/tocgettingstarted.xml"/>
+ <toc file="documentation/tocreference.xml"/>
+ <toc file="documentation/toctasks.xml"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPEditor"
+ contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
+ default="true"
+ extensions="stp"
+ icon="icons/views/page_obj.gif"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPEditor"
+ name="%editor.stp.name"/>
+ <editor
+ name="%editor.simple.name"
+ id="org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor"
+ class="org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor"
+ icon="icons/views/page_obj.gif"
+ contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
+ default="true"/>
+ <editor
+ name="%editor.c.name"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.editors.c.CEditor"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.editors.c.CEditor"
+ contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
+ icon="icons/views/page_obj.gif"
+ default="false"
+ extensions="c,h,cpp"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="%preference.ide.name"
+ id="com.qualityeclipse.systemtap.prefs.ide"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.preferences.IDEPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.view"/>
+ <page
+ name="%preference.editor.name"
+ id="com.qualityeclipse.systemtap.prefs.ide.editor"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.preferences.EditorPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.ide"/>
+ <page
+ name="%preference.codeAssist.name"
+ id="com.qualityeclipse.systemtap.prefs.ide.codeassist"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.preferences.CodeAssistPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.ide.editor"/>
+ <page
+ name="%preference.conditionalFilter.name"
+ id="com.qualityeclipse.systemtap.prefs.ide.conditionalfilters"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.preferences.ConditionalFilterPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.ide.editor"/>
+ <page
+ name="%preference.syntaxColor.name"
+ id="com.qualityeclipse.systemtap.prefs.ide.syntaxcoloring"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.preferences.SyntaxColoringPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.ide.editor"/>
+ <page
+ name="%preference.typeing.name"
+ id="com.qualityeclipse.systemtap.prefs.ide.typeing"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.preferences.TypeingPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.ide.editor"/>
+ <page
+ name="%preference.path.name"
+ id="com.qualityeclipse.systemtap.prefs.ide.path"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.preferences.PathPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.ide"/>
+ <page
+ name="%preference.stap.name"
+ id="com.qualityeclipse.systemtap.prefs.ide.stap"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.preferences.StapPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.ide"/>
+ <!--page
+ name="%preference.stapOptions.name"
+ id="com.qualityeclipse.systemtap.prefs.ide.stapoptions"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.preferences.StapOptionsPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.view/com.qualityeclipse.systemtap.prefs.ide/com.qualityeclipse.systemtap.prefs.ide.stap"/-->
+ <page
+ name="%preference.tapsets.name"
+ id="com.qualityeclipse.systemtap.prefs.ide.tapsets"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.preferences.TapsetsPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.ide.stap"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.linuxtools.systemtap.ui.ide.preferences.PreferenceInitializer"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ name="%command.import.name"
+ description="%command.import.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.ide.category.file"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.commands.ImportTapset"/>
+ <!--command
+ name="%command.runOptions.name"
+ description="%command.runOptions.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.ide.category.run"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.commands.RunScriptOptions"/-->
+ <command
+ name="%command.run.name"
+ description="%command.run.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.ide.category.run"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.commands.RunScript"/>
+ <command
+ name="%command.runChart.name"
+ description="%command.runChart.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.ide.category.run"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.commands.RunScriptChart"/>
+ <command
+ name="%command.stop.name"
+ description="%command.stop.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.ide.category.run"
+ id="org.eclipse.linuxtools.systemtap.ui.consolelog.commands.StopScript"/>
+
+
+ <command
+ name="%command.insertProbe.name"
+ description="%command.insertProbe.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.ide.category.popup"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.commands.probealiasaction"/>
+ <command
+ name="%command.insertFunction.name"
+ description="%command.insertFunction.desc"
+ categoryId="org.eclipse.linuxtools.systemtap.ui.ide.category.popup"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.commands.functionaction"/>
+
+ <category
+ name="%category.file.name"
+ description="%category.file.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.category.file"/>
+ <category
+ name="%category.run.name"
+ description="%category.run.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.category.run"/>
+ <category
+ name="%category.popup.name"
+ description="%category.popup.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.category.popup"/>
+ </extension>
+
+
+
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ label="%actionset.file.name"
+ visible="false"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.FileActionSet">
+ <action
+ label="%action.import.name"
+ tooltip="%action.import.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.actions.ImportTapset"
+ icon="icons/actions/import_wiz.gif"
+ toolbarPath="org.eclipse.ui.workbench.file/import.ext"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.actions.ImportTapsetAction"
+ definitionId="org.eclipse.linuxtools.systemtap.ui.ide.commands.ImportTapset"
+ style="push"
+ state="false"/>
+ </actionSet>
+ <actionSet
+ label="%actionset.run.name"
+ visible="false"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.RunActionSet">
+ <!--action
+ label="%action.runOptions.name"
+ tooltip="%action.runOptions.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.actions.RunScriptOptions"
+ icon="icons/actions/run/run_tool.gif"
+ toolbarPath="org.eclipse.ui.workbench.file/build.group"
+ menubarPath="launch/wbStart"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.actions.RunScriptOptionsAction"
+ definitionId="org.eclipse.linuxtools.systemtap.ui.ide.commands.RunScriptOptions"
+ style="push"
+ state="false"/-->
+ <action
+ label="%action.run.name"
+ tooltip="%action.run.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.actions.RunScript"
+ icon="icons/actions/run/run_exc.gif"
+ toolbarPath="org.eclipse.ui.workbench.file/build.group"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.actions.RunScriptAction"
+ definitionId="org.eclipse.linuxtools.systemtap.ui.ide.commands.RunScript"
+ style="push"
+ state="false"/>
+ <action
+ label="%action.runChart.name"
+ tooltip="%action.runChart.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.actions.RunScriptChartAction"
+ icon="icons/actions/run/run_chart.gif"
+ toolbarPath="org.eclipse.ui.workbench.file/build.group"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.actions.RunScriptChartAction"
+ definitionId="org.eclipse.linuxtools.systemtap.ui.ide.commands.RunScriptChart"
+ style="push"
+ state="false"/>
+ <action
+ label="%action.stop.name"
+ tooltip="%action.stop.desc"
+ id="org.eclipse.linuxtools.systemtap.ui.consolelog.actions.StopScript"
+ icon="icons/actions/terminate_co.gif"
+ toolbarPath="org.eclipse.ui.workbench.file/stop.ext"
+ class="org.eclipse.linuxtools.systemtap.ui.consolelog.actions.StopScriptAction"
+ definitionId="org.eclipse.linuxtools.systemtap.ui.consolelog.commands.StopScript"
+ style="push"
+ state="false"/>
+ </actionSet>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ adaptable="false"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.definitionMenu"
+ objectClass="org.eclipse.linuxtools.systemtap.ui.structures.TreeDefinitionNode">
+ <action
+ label="%action.viewDefinition.name"
+ class="org.eclipse.linuxtools.systemtap.ui.ide.actions.DefinitionAction"
+ icon="icons/misc/file_obj.gif"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.definitionAction"
+ style="push"/>
+ </objectContribution>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension
+ targetID="org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective">
+ <actionSet id="org.eclipse.linuxtools.systemtap.ui.ide.RunActionSet"/>
+ <actionSet id="org.eclipse.linuxtools.systemtap.ui.editor.FileActionSet"/>
+ <actionSet id="org.eclipse.linuxtools.systemtap.ui.ide.FileActionSet"/>
+
+ </perspectiveExtension>
+ <perspectiveExtension
+ targetID="org.eclipse.linuxtools.systemtap.ui.graphing.GraphingPerspective">
+ <actionSet id="org.eclipse.linuxtools.systemtap.ui.ide.RunActionSet"/>
+ <view
+ ratio="0.40f"
+ relative="org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView"
+ relationship="bottom"
+ id="org.eclipse.ui.console.ConsoleView"/>
+ <viewShortcut id="org.eclipse.ui.console.ConsoleView"/>
+
+ </perspectiveExtension>
+
+ <perspectiveExtension
+ targetID="org.eclipse.linuxtools.systemtap.ui.graphing.GraphingPerspective">
+ <perspectiveShortcut id="org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective"/>
+ </perspectiveExtension>
+ <perspectiveExtension
+ targetID="org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective">
+ <actionSet id="org.eclipse.linuxtools.systemtap.ui.ide.RunActionSet"/>
+ <view
+ ratio="1.00f"
+ relative="org.eclipse.ui.navigator.ProjectExplorer"
+ relationship="left"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView"/>
+ <viewShortcut id="org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView"/>
+ <view
+ ratio="0.33f"
+ relative="org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView"
+ relationship="right"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.views.KernelBrowserView"/>
+ <viewShortcut id="org.eclipse.linuxtools.systemtap.ui.ide.views.KernelBrowserView"/>
+ <view
+ ratio="0.33f"
+ relative="org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView"
+ relationship="left"
+ id="org.eclipse.linuxtools.systemtap.ui.ide.views.FunctionBrowserView"/>
+ <viewShortcut id="org.eclipse.linuxtools.systemtap.ui.ide.views.FunctionBrowserView"/>
+
+ </perspectiveExtension>
+ </extension>
+</plugin>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/IDEPerspective.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/IDEPerspective.java
new file mode 100644
index 0000000000..487b1f5767
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/IDEPerspective.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.views.ErrorView;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.FunctionBrowserView;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.KernelBrowserView;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+import org.eclipse.ui.console.IConsoleConstants;
+
+
+
+/**
+ * The <code>IDEPerspective</code> class defines the layout of the IDE perspective
+ * in the application.
+ * @see org.eclipse.ui.IPerspectiveFactory
+ * @author Ryan Morse
+ */
+public class IDEPerspective implements IPerspectiveFactory {
+ public static String ID = "org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective";
+
+ public void createInitialLayout(IPageLayout layout) {
+ LogManager.logDebug("Start createInitialLayout: layout-" + layout, this);
+ LogManager.logInfo("Initializing", this);
+ String editorArea = layout.getEditorArea();
+ layout.setEditorAreaVisible(true);
+
+ IFolderLayout browsers = layout.createFolder("browsers", IPageLayout.LEFT, 0.25f, editorArea);
+ browsers.addPlaceholder(ProbeAliasBrowserView.ID + ":*");
+
+ browsers.addView(ProbeAliasBrowserView.ID);
+ browsers.addView(FunctionBrowserView.ID);
+ browsers.addView(KernelBrowserView.ID);
+
+ layout.getViewLayout(ProbeAliasBrowserView.ID).setCloseable(false);
+ layout.getViewLayout(FunctionBrowserView.ID).setCloseable(false);
+ layout.getViewLayout(KernelBrowserView.ID).setCloseable(false);
+
+ IFolderLayout output = layout.createFolder("output", IPageLayout.BOTTOM, 0.75f, editorArea);
+ output.addPlaceholder(ErrorView.ID + ":*");
+ output.addView(ErrorView.ID);
+ output.addView(IConsoleConstants.ID_CONSOLE_VIEW);
+
+ layout.getViewLayout(IConsoleConstants.ID_CONSOLE_VIEW).setCloseable(false);
+ layout.getViewLayout(ErrorView.ID).setCloseable(false);
+
+ layout.addShowViewShortcut(ProbeAliasBrowserView.ID);
+ layout.addShowViewShortcut(FunctionBrowserView.ID);
+ layout.addShowViewShortcut(KernelBrowserView.ID);
+ layout.addShowViewShortcut(ErrorView.ID);
+ layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW);
+
+ layout.addPerspectiveShortcut(ID);
+ LogManager.logDebug("End createInitialLayout:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/IDESessionSettings.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/IDESessionSettings.java
new file mode 100644
index 0000000000..8fd15f7331
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/IDESessionSettings.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide;
+
+import org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPEditor;
+
+/**
+ * A simple class that contains information about the current session of the IDE, such as
+ * the path to the tapset libraries, the active SystemTap Script Editor, and if the user
+ * chooses, the user's account password.
+ * @author Ryan Morse
+ */
+public class IDESessionSettings {
+ public static String tapsetLocation = "";
+ public static STPEditor activeSTPEditor = null;
+ public static String password = null;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/DefinitionAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/DefinitionAction.java
new file mode 100644
index 0000000000..e0a3746562
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/DefinitionAction.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.actions;
+
+import org.eclipse.core.runtime.Path;
+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.editor.PathEditorInput;
+import org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPEditor;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeDefinitionNode;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+
+
+/**
+ * This <code>Action</code> is used when the user right clicks on an item in the Tapset Browsers.
+ * Right-clicking on items in the browsers causes a menu item called "Go to definition" to appear,
+ * which fires this action upon selection. The result is that the file containing the definition
+ * for the entity that the user selected is opened in an <code>STPEditor</code> in the current window.
+ * @author Ryan Morse
+ * @see org.eclipse.jface.action.Action
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.views.TapsetBrowserView
+ */
+public class DefinitionAction extends Action implements IObjectActionDelegate, IWorkbenchWindowActionDelegate {
+ private IStructuredSelection selection = null;
+
+ public DefinitionAction() {
+ super();
+ LogManager.logInfo("initialized", this);
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ //LogManager.logDebug("Start/End setActivePart: action-" + action + ", targetPart-" + targetPart, this);
+ }
+
+ /**
+ * The main body of the event. This code gets the filename from the selected entry in the viewer,
+ * then opens a new <code>STPEditor</code> for that file.
+ */
+ public void run(IAction action) {
+ LogManager.logDebug("Start run: action-" + action, this);
+ if(!isEnabled())
+ return;
+ Object o = selection.getFirstElement();
+ if(!(o instanceof TreeDefinitionNode))
+ return;
+ TreeDefinitionNode t = (TreeDefinitionNode)o;
+ String filename = t.getDefinition();
+ Path p = new Path(filename);
+
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ PathEditorInput input = new PathEditorInput(p, window);
+ try {
+ IEditorPart editorPart = window.getActivePage().openEditor(input, STPEditor.ID);
+ STPEditor editor = (STPEditor)editorPart;
+ int line;
+
+ if(t.getData().toString().startsWith("probe"))
+ line = probeFind(t, editor);
+ else
+ line = functionFind(t, editor);
+
+ editor.jumpToLocation(++line, 0);
+ } catch (PartInitException e) {
+ LogManager.logCritical("Exception run: " + e.getMessage(), this);
+ e.printStackTrace();
+ }
+ LogManager.logDebug("End run:", this);
+ }
+
+ /**
+ * Tries to find the line of code that corrisponds to the provided
+ * function node within the file open in the provided editor.
+ * @param t The tree node that we want to look up
+ * @param editor The STPEditor with the file we are searching in
+ * @return int representing the line where the node is defined
+ */
+ private int functionFind(TreeDefinitionNode t, STPEditor editor) {
+ String func = t.toString();
+ func = func.substring(0, func.indexOf('('));
+
+ int line = editor.find("function " + func);
+
+ if(line < 0)
+ line = editor.find(func);
+ return Math.max(line, 0);
+ }
+
+ /**
+ * Tries to find the line of code that corrisponds to the provided
+ * probe node within the file open in the provided editor.
+ * @param t The tree node that we want to look up
+ * @param editor The STPEditor with the file we are searching in
+ * @return int representing the line where the node is defined
+ */
+ private int probeFind(TreeDefinitionNode t, STPEditor editor) {
+ int line = editor.find("probe " + t.toString());
+
+ if(line < 0)
+ line = editor.find(t.getData().toString());
+ if(line < 0)
+ line = editor.find(t.getData().toString().replace(" ", ""));
+ return Math.max(line, 0);
+ }
+
+ /**
+ * Updates <code>selection</code> with the current selection whenever the user changes
+ * the current selection.
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof IStructuredSelection) {
+ LogManager.logDebug("this.selection changed: oldValue: "+ this.selection + " newValue: " + selection, this);
+ this.selection = (IStructuredSelection)selection;
+ Object o = this.selection.getFirstElement();
+ if(o instanceof TreeDefinitionNode)
+ {
+ TreeDefinitionNode t = (TreeDefinitionNode)o;
+ String s = t.getDefinition();
+ if(s != null)
+ setEnabled(true);
+ else
+ setEnabled(false);
+ }
+ else
+ setEnabled(false);
+ } else {
+ this.setEnabled(false);
+ }
+ }
+
+ public void dispose() {
+ LogManager.logInfo("disposing", this);
+ }
+
+ public void init(IWorkbenchWindow window) {}
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/ImportTapsetAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/ImportTapsetAction.java
new file mode 100644
index 0000000000..7e434fe41a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/ImportTapsetAction.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.actions;
+
+import java.io.File;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.DirectoryDialog;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.preferences.IDEPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.FunctionBrowserView;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+
+/**
+ * This <code>Action</code> is used when the user modifies the list of tapset locations.
+ * When it is invoked, the user is presented with a file selection dialog prompting them to
+ * select a location. If the user confirms their selection in this dialog (through the native
+ * widget's method, usually an OK box), the path the user selected is added to the list stored
+ * in preferences that contains tapset locations, and the tapset browsers are told to refresh.
+ * @author Ryan Morse
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.views.TapsetBrowserView
+ */
+public class ImportTapsetAction extends Action implements IWorkbenchWindowActionDelegate {
+ private IWorkbenchWindow fWindow;
+
+ public ImportTapsetAction() {
+ setEnabled(true);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ fWindow= null;
+ }
+
+ public void init(IWorkbenchWindow window) {
+ LogManager.logInfo("Initializing fWindow: " + window, this);
+ fWindow= window;
+ }
+
+ public void run(IAction action) {
+ run();
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
+
+ /**
+ * This method displays the dialog box to the user that prompts for a tapset location.
+ * @return A File representing the directory that the user selected, if the user confirmed, or null otherwise.
+ */
+ private File queryFile() {
+ DirectoryDialog dialog= new DirectoryDialog(fWindow.getShell(), SWT.OPEN);
+ dialog.setText("Import Tapsets"); //$NON-NLS-1$
+ String path= dialog.open();
+ if (path != null && path.length() > 0) {
+ LogManager.logDebug("queryFile: returnVal-" + path, this);
+ return new File(path);
+ }
+ LogManager.logDebug("queryFile: returnVal-null", this);
+ return null;
+ }
+
+ /**
+ * The main body of this event. Prompts the user for a new location using the <code>queryFile</code>
+ * method, then if the return from <code>queryFile</code> is non-null, the path is added to preferences
+ * and the tapset browsers refreshed.
+ */
+ public void run() {
+ LogManager.logDebug("Start run:", this);
+ File file= queryFile();
+ if (file != null) {
+ IPreferenceStore p = IDEPlugin.getDefault().getPreferenceStore();
+ String tapsets = p.getString(IDEPreferenceConstants.P_TAPSETS);
+
+ p.setValue(IDEPreferenceConstants.P_TAPSETS, tapsets + File.pathSeparator + file.getAbsolutePath());
+
+ IViewPart ivp = fWindow.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(FunctionBrowserView.ID);
+ ((FunctionBrowserView)ivp).refresh();
+ ivp = fWindow.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(ProbeAliasBrowserView.ID);
+ ((ProbeAliasBrowserView)ivp).refresh();
+ }
+ LogManager.logDebug("End run:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptAction.java
new file mode 100644
index 0000000000..d98325e5b4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptAction.java
@@ -0,0 +1,345 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.actions;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.URI;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.wizard.ProgressMonitorPart;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.ClientSession;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.Subscription;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.dialogs.SelectServerDialog;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.internal.ConsoleLogPlugin;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.preferences.ConsoleLogPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.ScriptConsole;
+import org.eclipse.linuxtools.systemtap.ui.editor.PathEditorInput;
+import org.eclipse.linuxtools.systemtap.ui.ide.IDESessionSettings;
+import org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPEditor;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.ide.preferences.IDEPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.ide.structures.TapsetLibrary;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences.EnvironmentVariablesPreferencePage;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.ide.FileStoreEditorInput;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+
+
+
+/**
+ * This <code>Action</code> is used to run a SystemTap script that is currently open in the editor.
+ * @author Ryan Morse
+ */
+public class RunScriptAction extends Action implements IWorkbenchWindowActionDelegate {
+ public RunScriptAction() {
+ super();
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ fWindow= null;
+ }
+
+ public void init(IWorkbenchWindow window) {
+ LogManager.logInfo("Initializing fWindow: "+ window, this);
+ fWindow= window;
+
+ }
+
+ public void run(IAction action) {
+ run();
+ }
+
+ /**
+ * The main body of this event. Starts by making sure the current editor is valid to run,
+ * then builds the command line arguments for stap and retrieves the environment variables.
+ * Finally, it gets an instance of <code>ScriptConsole</code> to run the script.
+ */
+ public void run() {
+ LogManager.logDebug("Start run:", this);
+ continueRun = true;
+ if(isValid()) {
+ // String[] script = buildScript();
+ // String[] envVars = getEnvironmentVariables();
+ if(continueRun)
+ {
+ createClientSession();
+ }
+ }
+
+ LogManager.logDebug("End run:", this);
+ }
+
+ /**
+ * Returns the path of the current editor in the window this action is associated with.
+ * @return The string representation of the path of the current file.
+ */
+ protected String getFilePath() {
+ IEditorPart ed = fWindow.getActivePage().getActiveEditor();
+ String filename = null;
+ if (ed.getEditorInput() instanceof FileStoreEditorInput)
+ {
+ URI uri = ((FileStoreEditorInput)ed.getEditorInput()).getURI();
+ IFileStore location = EFS.getLocalFileSystem().getStore(uri);
+ try {
+ filename = location.toLocalFile(EFS.NONE, null).getAbsolutePath();
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ if (ed.getEditorInput() instanceof FileEditorInput)
+ filename = ((FileEditorInput)ed.getEditorInput()).getFile().getFullPath().toString();
+ if (ed.getEditorInput() instanceof PathEditorInput)
+ filename = ((PathEditorInput)ed.getEditorInput()).getPath().toString();
+ return filename;
+ }
+
+ /**
+ * Checks if the current editor is operating on a file that actually exists and can be
+ * used as an argument to stap (as opposed to an unsaved buffer).
+ * @return True if the file is valid.
+ */
+ protected boolean isValid() {
+ IEditorPart ed = fWindow.getActivePage().getActiveEditor();
+ if(isValidFile(ed))
+ {
+ if (ed.getEditorInput() instanceof FileStoreEditorInput)
+ {
+ URI uri = ((FileStoreEditorInput)ed.getEditorInput()).getURI();
+ IFileStore location = EFS.getLocalFileSystem().getStore(uri);
+ try {
+ fileName = location.toLocalFile(EFS.NONE, null).getAbsolutePath();
+ } catch (CoreException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ if (ed.getEditorInput() instanceof FileEditorInput)
+ fileName = ((FileEditorInput)ed.getEditorInput()).getFile().getFullPath().toString();
+ if (ed.getEditorInput() instanceof PathEditorInput)
+ fileName = ((PathEditorInput)ed.getEditorInput()).getPath().toString();
+ if(isValidDirectory(fileName))
+ return true;
+ }
+ return true;
+ }
+
+ private boolean isValidFile(IEditorPart ed) {
+
+ if(null == ed) {
+ String msg = MessageFormat.format(Localization.getString("RunScriptAction.NoScriptFile"), (Object[])null);
+ LogManager.logInfo("Initializing", MessageDialog.class);
+ MessageDialog.openWarning(fWindow.getShell(), Localization.getString("RunScriptAction.Problem"), msg);
+ LogManager.logInfo("Disposing", MessageDialog.class);
+ return false;
+ }
+
+ if(ed.isDirty())
+ ed.doSave(new ProgressMonitorPart(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), new FillLayout()));
+
+ return true;
+ }
+
+ private boolean isValidDirectory(String fileName) {
+ this.fileName = fileName;
+ if(0 == IDESessionSettings.tapsetLocation.trim().length())
+ TapsetLibrary.getTapsetLocation(IDEPlugin.getDefault().getPreferenceStore());
+ if(fileName.contains(IDESessionSettings.tapsetLocation)) {
+ String msg = MessageFormat.format(Localization.getString("RunScriptAction.TapsetDirectoryRun"), (Object[])null);
+ MessageDialog.openWarning(fWindow.getShell(), Localization.getString("RunScriptAction.Error"), msg);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Called by <code>run(IAction)</code> to generate the command line necessary to run the script.
+ * @return The arguments to pass to <code>Runtime.exec</code> to start the stap process on this script.
+ * @see TerminalCommand
+ * @see Runtime#exec(java.lang.String[], java.lang.String[])
+ */
+ protected String[] buildScript() {
+ return buildStandardScript();
+ }
+
+ /**
+ * The command line argument generation method used by <code>RunScriptAction</code>. This generates
+ * a stap command line that includes the tapsets specified in user preferences, a guru mode flag
+ * if necessary, and the path to the script on disk.
+ * @return The command to invoke to start the script running in stap.
+ */
+ protected String[] buildStandardScript() {
+ //FixMe: Take care of this in the next release. For now only the guru mode is sent
+ ArrayList<String> cmdList = new ArrayList<String>();
+ String[] script;
+
+ getImportedTapsets(cmdList);
+
+ if(isGuru())
+ cmdList.add("-g"); //$NON-NLS-1$
+
+ script = finalizeScript(cmdList);
+
+ return script;
+ }
+
+ /**
+ * Adds the tapsets that the user has added in preferences to the input <code>ArrayList</code>
+ * @param cmdList The list to add the user-specified tapset locations to.
+ */
+ protected void getImportedTapsets(ArrayList<String> cmdList) {
+ Preferences pref = IDEPlugin.getDefault().getPluginPreferences();
+ String[] tapsets = pref.getString(IDEPreferenceConstants.P_TAPSETS).split(File.pathSeparator);
+
+ //Get all imported tapsets
+ if(null != tapsets && tapsets.length > 0 && tapsets[0].trim().length() > 0) {
+ for(int i=0; i<tapsets.length; i++) {
+ cmdList.add("-I"); //$NON-NLS-1$
+ cmdList.add(tapsets[i]);
+ }
+ }
+ }
+
+ /**
+ * Checks the current script to determine if guru mode is required in order to run. This is determined
+ * by the presence of embedded C.
+ * @return True if the script contains embedded C code.
+ */
+ protected boolean isGuru() {
+ try {
+ File f = new File(fileName);
+ FileReader fr = new FileReader(f);
+
+ int curr = 0;
+ int prev = 0;
+ boolean front = false;
+ boolean imbedded = false;
+ boolean inLineComment = false;
+ boolean inBlockComment = false;
+ while(-1 != (curr = fr.read())) {
+ if(!inLineComment && !inBlockComment && '%' == prev && '{' == curr)
+ front = true;
+ else if(!inLineComment && !inBlockComment && '%' == prev && '}' == curr && front) {
+ imbedded = true;
+ break;
+ } else if(!inBlockComment && (('/' == prev && '/' == curr) || '#' == curr)) {
+ inLineComment = true;
+ } else if(!inLineComment && '/' == prev && '*' == curr) {
+ inBlockComment = true;
+ } else if('\n' == curr) {
+ inLineComment = false;
+ } else if('*' == prev && '/' == curr) {
+ inBlockComment = false;
+ }
+ prev = curr;
+ }
+ if(imbedded)
+ return true;
+ } catch (FileNotFoundException fnfe) {
+ LogManager.logCritical("FileNotFoundException run: " + fnfe.getMessage(), this);
+ } catch (IOException ie) {
+ LogManager.logCritical("IOException run: " + ie.getMessage(), this);
+ }
+ return false;
+ }
+
+ protected boolean createClientSession()
+ {
+ if (!ClientSession.isConnected())
+ {
+ new SelectServerDialog(fWindow.getShell()).open();
+ }
+ if((ConsoleLogPlugin.getDefault().getPluginPreferences().getBoolean(ConsoleLogPreferenceConstants.CANCELLED))!=true)
+ {
+ subscription = new Subscription(fileName,isGuru());
+ if (ClientSession.isConnected())
+ {
+ console = ScriptConsole.getInstance(fileName, subscription);
+ console.run();
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Produces a <code>String[]</code> from the <code>ArrayList</code> passed in with stap inserted
+ * as the first entry, and the filename as the last entry. Used to convert the arguments generated
+ * earlier in <code>buildStandardScript</code> such as tapset locations and guru mode into an actual
+ * command line argument array that can be passed to <code>Runtime.exec</code>.
+ * @param cmdList The list of arguments for stap for this script
+ * @return An array suitable to pass to <code>Runtime.exec</code> to start stap on this file.
+ */
+ protected String[] finalizeScript(ArrayList<String> cmdList) {
+ String[] script;
+
+ script = new String[cmdList.size() + 2];
+ script[0] = "stap"; //$NON-NLS-1$
+
+ script[script.length-1] = fileName;
+ for(int i=0; i< cmdList.size(); i++) {
+ script[i+1] = cmdList.get(i).toString();
+ }
+ return script;
+ }
+
+ protected String[] getEnvironmentVariables() {
+ return EnvironmentVariablesPreferencePage.getEnvironmentVariables();
+ }
+
+ public void selectionChanged(IAction act, ISelection select) {
+ this.act = act;
+ setEnablement(false);
+ buildEnablementChecks();
+ }
+
+ private void buildEnablementChecks() {
+ if(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() instanceof STPEditor)
+ setEnablement(true);
+ }
+
+ private void setEnablement(boolean enabled) {
+ act.setEnabled(enabled);
+ }
+
+ protected Subscription getSubscription()
+ {
+ return subscription;
+ }
+
+ protected boolean continueRun = true;
+ private String fileName = null;
+ protected IWorkbenchWindow fWindow;
+ private IAction act;
+ protected Subscription subscription;
+ protected int SCRIPT_ID;
+ protected ScriptConsole console;
+
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptChartAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptChartAction.java
new file mode 100644
index 0000000000..23ceb1367a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptChartAction.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.actions;
+
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.linuxtools.systemtap.ui.graphing.GraphingConstants;
+import org.eclipse.linuxtools.systemtap.ui.graphing.GraphingPerspective;
+import org.eclipse.linuxtools.systemtap.ui.graphing.views.GraphSelectorView;
+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.structures.ChartStreamDaemon2;
+import org.eclipse.linuxtools.systemtap.ui.graphingapi.ui.wizards.dataset.DataSetWizard;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+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;
+
+
+
+/**
+ * Action used to run the systemTap script in the active editor. This action will start stap
+ * and send the output to both the <code>ScriptConsole</code> window and a <code>DataSet</code>.
+ * @author Ryan Morse
+ */
+public class RunScriptChartAction extends RunScriptOptionsAction implements IWorkbenchWindowActionDelegate {
+ public RunScriptChartAction() {
+ super();
+ LogManager.logDebug("initialized", this);
+ }
+
+ public void dispose() {
+ LogManager.logDebug("disposed", this);
+ super.dispose();
+ }
+
+ /**
+ * The main body of this event. Starts by making sure the current editor is valid to run,
+ * then builds the command line arguments for stap and retrieves the environment variables.
+ * Next, it gets an instance of <code>ScriptConsole</code> to run the script. Finally, it
+ * Registers a new <code>ChartStreamDaemon2</code> to handle formating the script output
+ * for a <code>DataSet</code>. Once everything is setup, it will attempt to switch to the
+ * Graphing Perspective.
+ */
+ public void run() {
+ LogManager.logDebug("Start run:", this);
+ continueRun = true;
+
+ if(isValid()) {
+ @SuppressWarnings("unused")
+ String[] script = buildScript();
+ @SuppressWarnings("unused")
+ String[] envVars = getEnvironmentVariables();
+
+ if(continueRun) {
+ createClientSession();
+ subscription.addInputStreamListener(new ChartStreamDaemon2(console, dataSet, parser));
+
+ //Change to the graphing perspective
+ try {
+ IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(GraphingPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ IViewPart ivp = p.findView(GraphSelectorView.ID);
+ String name = console.getName();
+ ((GraphSelectorView)ivp).createScriptSet(name.substring(name.lastIndexOf('/')+1), dataSet);
+ } catch(WorkbenchException we) {
+
+ }
+ }
+ }
+
+ LogManager.logDebug("End run:", this);
+ }
+
+ /**
+ * The <code>buildScript</code> method in this class replaces the one in the superclass and calls
+ * <code>buildOptionsScript</code> or <code>buildStandardScript</code> depending on the users
+ * selection of whether to use script options.
+ * @return String[] representing the entire command that needs to be run.
+ */
+ protected String[] buildScript() {
+ String[] script;
+
+ getChartingOptions();
+
+ if(useOptions)
+ script = buildOptionsScript();
+ else
+ script = buildStandardScript();
+
+ return script;
+ }
+
+ /**
+ * This method is used to prompt the user for the parsing expression to be used in generating
+ * the <code>DataSet</code> from the scripts output.
+ */
+ protected void getChartingOptions() {
+ DataSetWizard wizard = new DataSetWizard(GraphingConstants.DataSetMetaData, getFilePath());
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ wizard.init(workbench, null);
+ WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard);
+ dialog.create();
+ dialog.open();
+
+ parser = wizard.getParser();
+ dataSet = wizard.getDataSet();
+
+ if(null == parser || null == dataSet)
+ continueRun = false;
+
+ wizard.dispose();
+ }
+
+ private boolean useOptions = false;
+ private IDataSet dataSet = null;
+ private IDataSetParser parser = null;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptOptionsAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptOptionsAction.java
new file mode 100644
index 0000000000..44cf1bd452
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/RunScriptOptionsAction.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.actions;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.ide.preferences.IDEPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.ide.uistructures.StapSettingsDialog;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+
+
+/**
+ * This class is a decendent of <code>RunScriptAction</code> that allows for additional arguments, specified
+ * by the user, to be passed to stap. Its behavior is very similar to the <code>RunScriptAction</code> action.
+ * @author Ryan Morse
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.actions.RunScriptAction
+ */
+public class RunScriptOptionsAction extends RunScriptAction implements IWorkbenchWindowActionDelegate {
+ public RunScriptOptionsAction() {
+ super();
+ LogManager.logDebug("initialized", this);
+ }
+
+ /**
+ * The <code>buildScript</code> method in this class replaces the one in the superclass and calls
+ * <code>buildOptionsScript</code> rather than the <code>buildStandardScript</code> method called
+ * in the parent code.
+ */
+ protected String[] buildScript() {
+ return buildOptionsScript();
+ }
+
+ /**
+ * This method executes the same code as the <code>buildStandardScript</code> with one change,
+ * being that instead of calling the <code>getImportedTapsets</code> method from the parent class, it
+ * calls the <code>getCommandLineOptions</code> method, which will contain all the information that the
+ * tapset method contained, as well as whatever optional arguments the user specifies.
+ * @return Command line arguments suitable to pass to <code>Runtime.exec</code> in order to run the script as requested
+ * @see RunScriptAction#buildStandardScript()
+ */
+ protected String[] buildOptionsScript() {
+ ArrayList<String> cmdList = new ArrayList<String>();
+ String[] script;
+
+ getImportedTapsets(cmdList);
+
+ if(isGuru())
+ cmdList.add("-g");
+
+ getCommandLineOptions(cmdList);
+
+ script = finalizeScript(cmdList);
+
+ return script;
+ }
+
+ /**
+ * This method prompts the user to select optional command line arguments to use when running this
+ * script, and adds them to the <code>ArrayList</code> passed in.
+ * @param cmdList The <code>ArrayList</code> to add the arguments to.
+ */
+ protected void getCommandLineOptions(ArrayList<String> cmdList) {
+ StapSettingsDialog ssd = new StapSettingsDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+ ssd.open();
+
+ boolean[] cmdOpts = ssd.getStapOpts();
+ String[] cmdOptVals = ssd.getStapOptVals();
+
+ if((null != cmdOpts) && (null != cmdOptVals)) {
+ int i;
+ //Get commandline check options
+ for(i=0; i<cmdOpts.length; i++) {
+ if(cmdOpts[i])
+ cmdList.add(IDEPreferenceConstants.P_STAP[i][0]);
+ }
+
+ //Get rest of commandline options
+ for(i=0; i<cmdOptVals.length; i++) {
+ if(null != cmdOptVals[i] && cmdOptVals[i].trim().length() > 0) {
+ if("-v".equals(IDEPreferenceConstants.P_STAP[i+cmdOpts.length][0])) {
+ cmdList.add("-" + cmdOptVals[i]);
+ } else if("-p NUM".equals(IDEPreferenceConstants.P_STAP[i+cmdOpts.length][0])) {
+ cmdList.add("-p" + cmdOptVals[i]);
+ } else {
+ cmdList.add(IDEPreferenceConstants.P_STAP[i+cmdOpts.length][0].substring(0,2));
+
+ cmdList.add(cmdOptVals[i-cmdOpts.length]);
+ }
+ }
+ }
+ } else
+ continueRun = false;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/TempFileAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/TempFileAction.java
new file mode 100644
index 0000000000..5963c4d6ad
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/TempFileAction.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.actions;
+
+import java.io.IOException;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.linuxtools.systemtap.ui.editor.PathEditorInput;
+import org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective;
+import org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPEditor;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+
+
+/**
+ * This <code>Action</code> creates an editor on a temporary file.
+ * @author Henry Hughes
+ */
+public class TempFileAction extends Action {
+ public void run() {
+ LogManager.logDebug("Start run:", this);
+ IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
+ IWorkbenchWindow main = null;
+ for(int i = 0; i < windows.length; i++) {
+ String s = windows[i].getActivePage().getPerspective().getId();
+ if(s.equals(IDEPerspective.ID))
+ main = windows[i];
+ }
+ if(main == null)
+ return;
+ try {
+ PathEditorInput p = new PathEditorInput();
+ main.getActivePage().openEditor(p, STPEditor.ID);
+ } catch (PartInitException e) {
+ LogManager.logDebug("PartInitException run: " + e.getMessage(), this);
+ } catch(IOException e) {
+ LogManager.logCritical("IOException run: " + e.getMessage(), this);
+ }
+ LogManager.logDebug("End run:", this);
+ }
+
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/FunctionBrowserAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/FunctionBrowserAction.java
new file mode 100644
index 0000000000..ffdb970f6c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/FunctionBrowserAction.java
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.actions.hidden;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.linuxtools.systemtap.ui.editor.actions.file.NewFileAction;
+import org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPEditor;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.FunctionBrowserView;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
+
+
+
+/**
+ * This <code>Action</code> is fired when the user double clicks on an entry in the
+ * IDE's current <code>FunctionBrowserView</code>. The behavior of this <code>Action</code> is
+ * to expand or collapse the function tree if the user clicks on a non-function (say a file containing
+ * functions), or to insert a blank call to the function if the user double clicks on a function
+ * (defined by the clickable property in the <code>TreeNode</code> class, retrieved through
+ * <code>TreeNode.isClickable</code>.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ * @see org.eclipse.linuxtools.systemtap.ui.structures.TreeNode#isClickable()
+ * @see org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor#insertTextAtCurrent(String)
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.actions.hidden.TreeExpandCollapseAction
+ */
+public class FunctionBrowserAction extends Action implements IWorkbenchAction, ISelectionListener {
+ private final IWorkbenchWindow window;
+ private final FunctionBrowserView viewer;
+ private static final String ID = "org.eclipse.linuxtools.systemtap.ui.ide.FunctionAction";
+ private IStructuredSelection selection;
+ private TreeExpandCollapseAction expandAction;
+
+ /**
+ * The Default Constructor. Takes the <code>IWorkbenchWindow</code> that it effects
+ * as well as the <code>FunctionBrowserView</code> that will fire this action.
+ * @param window window effected by this event
+ * @param browser browser that fires this action
+ */
+ public FunctionBrowserAction(IWorkbenchWindow window, FunctionBrowserView browser) {
+ LogManager.logInfo("initialized", this);
+ this.window = window;
+ setId(ID);
+ setActionDefinitionId(ID);
+ setText(Localization.getString("FunctionBrowserAction.Insert"));
+ setToolTipText(Localization.getString("FunctionBrowserAction.InsertFunction"));
+ window.getSelectionService().addSelectionListener(this);
+ viewer = browser;
+ expandAction = new TreeExpandCollapseAction(FunctionBrowserView.class);
+ }
+
+ public void dispose() {
+ window.getSelectionService().removeSelectionListener(this);
+ selection = null;
+ expandAction.dispose();
+ expandAction = null;
+ LogManager.logInfo("disposed", this);
+ }
+
+ /**
+ * Updates <code>selection</code> with the current selection whenever the user changes
+ * the current selection.
+ */
+ public void selectionChanged(IWorkbenchPart part, ISelection incoming) {
+ if (incoming instanceof IStructuredSelection) {
+ LogManager.logDebug("Changing selection", this);
+ selection = (IStructuredSelection) incoming;
+ setEnabled(selection.size() == 1);
+ } else {
+ LogManager.logDebug("Disabling, selection not IStructuredSelection", this);
+ // Other selections, for example containing text or of other kinds.
+ setEnabled(false);
+ }
+ }
+
+ /**
+ * The main action code, invoked when this action is fired. This code checks the current
+ * selection's clickable property, and either invokes the <code>TreeExpandCollapseAction</code> if
+ * the selection is not clickable (i.e. the selection is not a function, but a category of functions),
+ * or it inserts text for a function call to the selected function in the active STPEditor
+ * (creating a new editor if there is not one currently open).
+ */
+ public void run() {
+ LogManager.logDebug("Start run:", this);
+ IWorkbenchPage page = window.getActivePage();
+ ISelection incoming = viewer.getViewer().getSelection();
+ IStructuredSelection selection = (IStructuredSelection)incoming;
+ Object o = selection.getFirstElement();
+ if (o instanceof TreeNode) {
+ TreeNode t = (TreeNode) o;
+ if(t.isClickable()) {
+ IEditorInput input;
+ IEditorPart ed = page.getActiveEditor();
+ if(ed == null) {
+ NewFileAction action = new NewFileAction(page.getWorkbenchWindow());
+ //action.init(page.getWorkbenchWindow());
+ action.run();
+ ed = page.getWorkbenchWindow().getActivePage().getActiveEditor();
+ }
+ input = ed.getEditorInput();
+ //System.out.println("Node " + t.toString() + "claims to be clickable");
+ IEditorPart editor;
+ try {
+ editor = page.openEditor(input, STPEditor.ID);
+
+ if(editor instanceof STPEditor) {
+ STPEditor stpeditor = (STPEditor)editor;
+ //build the string
+ String s = t.toString() + "\n";
+ stpeditor.insertTextAtCurrent(s);
+
+ }
+ } catch (PartInitException e) {
+ LogManager.logCritical("PartInitException run: " + e.getMessage(), this);
+ }
+ } else {
+ expandAction.run();
+ }
+ }
+ LogManager.logDebug("End run:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/KernelSourceAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/KernelSourceAction.java
new file mode 100644
index 0000000000..30e610f8f2
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/KernelSourceAction.java
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.actions.hidden;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.linuxtools.systemtap.ui.editor.PathEditorInput;
+import org.eclipse.linuxtools.systemtap.ui.ide.IDESessionSettings;
+import org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPEditor;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.KernelBrowserView;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorRegistry;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
+
+
+
+import java.io.File;
+
+/**
+ * This <code>Action</code> is raised by <code>KernelBrowserView</code> whenever the user selects
+ * an item in the view (usually by double clicking). This <code>Action</code> either passes
+ * the event on to <code>TreeExpandCollapseAction</code> if the selection is not clickable, or
+ * it opens a new CEditor for the file selected if the selection is clickable.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.editors.c.CEditor
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.actions.hidden.TreeExpandCollapseAction
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.views.KernelBrowserView
+ */
+public class KernelSourceAction extends Action implements ISelectionListener, IWorkbenchAction {
+ private final IWorkbenchWindow window;
+ public final static String ID = "org.eclipse.linuxtools.systemtap.ui.ide.KBAction";
+ private KernelBrowserView viewer;
+ private IStructuredSelection selection;
+ private TreeExpandCollapseAction expandAction;
+
+ /**
+ * The default constructor for the <code>KernelSourceAction</code>. Takes the window that it affects
+ * and the <code>KernelBrowserView</code> that will fire the event as arguments.
+ * @param window The <code>IWorkbenchWindow</code> that the action operates on.
+ * @param browser The <code>KernelBrowserView</code> that fires this action.
+ */
+ public KernelSourceAction(IWorkbenchWindow window, KernelBrowserView browser) {
+ LogManager.logDebug("Start KernelSourceAction: window-" + window + ", browser-" + browser, this);
+ LogManager.logInfo("Initializing", this);
+ this.window = window;
+ setId(ID);
+ setActionDefinitionId(ID);
+ setText(Localization.getString("KernelSourceAction.Insert"));
+ setToolTipText(Localization.getString("KernelSourceAction.InsertSelectedFunction"));
+ window.getSelectionService().addSelectionListener(this);
+ viewer = browser;
+ expandAction = new TreeExpandCollapseAction(KernelBrowserView.class);
+ LogManager.logDebug("End KernelSourceAction:", this);
+ }
+
+ /**
+ * Updates <code>selection</code> with the current selection whenever the user changes
+ * the current selection.
+ */
+ public void selectionChanged(IWorkbenchPart part, ISelection incoming) {
+ if (incoming instanceof IStructuredSelection) {
+ LogManager.logDebug("Changing selection", this);
+ selection = (IStructuredSelection) incoming;
+ setEnabled(selection.size() == 1);
+ } else {
+ LogManager.logDebug("Disabling, selection not IStructuredSelection", this);
+ // Other selections, for example containing text or of other kinds.
+ setEnabled(false);
+ }
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ window.getSelectionService().removeSelectionListener(this);
+ }
+
+ /**
+ * Creates a <code>PathEditorInput</code> for the file specified.
+ * @param file The <code>File</code> to create an input for.
+ * @return A <code>PathEditorInput</code> that represents the requested file.
+ */
+ private IEditorInput createEditorInput(File file) {
+ IPath location= new Path(file.getAbsolutePath());
+ PathEditorInput input= new PathEditorInput(location, window);
+ LogManager.logDebug("createEditorInput: returnVal-" + input, this);
+ return input;
+ }
+
+ /**
+ * Returns the ID of the editor to use for the requested file. Usually returns
+ * <code>CEditor.ID</code> in this code.
+ * @param file The file to get the ID for.
+ * @return The ID for the editor that handles the requested file type.
+ */
+ private String getEditorId(File file) {
+ IWorkbench workbench= window.getWorkbench();
+ IEditorRegistry editorRegistry= workbench.getEditorRegistry();
+ IEditorDescriptor descriptor= editorRegistry.getDefaultEditor(file.getName());
+ if (descriptor != null) {
+ LogManager.logDebug("getEditorId: returnVal-" + descriptor.getId(), this);
+ return descriptor.getId();
+ }
+ LogManager.logDebug("getEditorId: returnVal-...SimpleEditor", this);
+ return "org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor";
+ }
+
+ /**
+ * The main code body for this action. Causes one of the following to occur:
+ * <ul>
+ * <li>If the selected node is clickable, as specified in <code>TreeNode.isClickable</code>
+ * the browser creates an instance of <code>CEditor</code> on the file specified in the selection
+ * (<code>KernelBrowserView</code>'s tree only marks clickable on files, not folders) and
+ * opens it on the current window</li>
+ * <li>If the selected node is not clickable, the code runs the action specified in
+ * <code>TreeExpandCollapseAction</code></li>
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.editors.c.CEditor
+ * @see TreeNode#isClickable()
+ * @see TreeExpandCollapseAction
+ */
+ public void run() {
+ LogManager.logDebug("Start run", this);
+ IWorkbench wb = PlatformUI.getWorkbench();
+ ISelection incoming = viewer.getViewer().getSelection();
+ IStructuredSelection selection = (IStructuredSelection)incoming;
+ Object o = selection.getFirstElement();
+ if(o instanceof TreeNode) {
+ TreeNode t = (TreeNode)o;
+ if(t.isClickable()) {
+
+ File file = (File)t.getData();
+ if (file != null) {
+ IEditorInput input= createEditorInput(file);
+ String editorId= getEditorId(file);
+ try {
+ IEditorPart editor = wb.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if(editor instanceof STPEditor)
+ IDESessionSettings.activeSTPEditor = (STPEditor)editor;
+ wb.getActiveWorkbenchWindow().getActivePage().openEditor(input, editorId);
+ LogManager.logDebug("Editor opened", this);
+ } catch (PartInitException e) {
+ LogManager.logCritical("PartInitException run: " + e.getMessage(), this);
+ }
+
+ }
+ }
+ else
+ {
+
+ expandAction.run();
+ }
+ }
+ LogManager.logDebug("End run", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/ProbeAliasAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/ProbeAliasAction.java
new file mode 100644
index 0000000000..775ccf77ca
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/ProbeAliasAction.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.actions.hidden;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.linuxtools.systemtap.ui.editor.actions.file.NewFileAction;
+import org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPEditor;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
+
+
+
+/**
+ * This <code>Action</code> is fired when the user selects an item in the <code>ProbeAliasBrowserView</code>.
+ * The action taken is to insert a template probe in the current <code>STPEditor</code>, if available, or to
+ * insert the probe into a new <code>STPEditor</code> if one does not exist.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ * @see org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor#insertText(String)
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView
+ * @see org.eclipse.jface.action.Action
+ */
+public class ProbeAliasAction extends Action implements ISelectionListener, IWorkbenchAction {
+ private final IWorkbenchWindow window;
+ private final ProbeAliasBrowserView viewer;
+ private static final String ID = "org.eclipse.linuxtools.systemtap.ui.ide.ProbeAliasAction";
+ private IStructuredSelection selection;
+
+ /**
+ * The Default Constructor. Takes the <code>IWorkbenchWindow</code> that it effects
+ * as well as the <code>ProbeAliasBrowserView</code> that will fire this action.
+ * @param window window effected by this event
+ * @param view browser that fires this action
+ */
+ public ProbeAliasAction(IWorkbenchWindow window, ProbeAliasBrowserView view) {
+ LogManager.logInfo("initialized", this);
+ this.window = window;
+ setId(ID);
+ setActionDefinitionId(ID);
+ setText(Localization.getString("ProbeAliasAction.Insert"));
+ setToolTipText(Localization.getString("ProbeAliasAction.InsertSelectedProbe"));
+ window.getSelectionService().addSelectionListener(this);
+ viewer = view;
+ }
+
+ /**
+ * Updates <code>selection</code> with the current selection whenever the user changes
+ * the current selection.
+ */
+ public void selectionChanged(IWorkbenchPart part, ISelection incoming) {
+ if (incoming instanceof IStructuredSelection) {
+ LogManager.logDebug("Changing selection", this);
+ selection = (IStructuredSelection) incoming;
+ setEnabled(selection.size() == 1);
+ } else {
+ LogManager.logDebug("Disabling, selection not IStructuredSelection", this);
+ // Other selections, for example containing text or of other kinds.
+ setEnabled(false);
+ }
+ }
+
+ public void dispose() {
+ window.getSelectionService().removeSelectionListener(this);
+ LogManager.logInfo("disposed", this);
+ }
+
+ /**
+ * The main body of the action. This method checks for the current editor, creating one
+ * if there is no active <code>STPEditor</code>, and then inserts a template probe for the
+ * item that the user clicked on.
+ */
+ public void run() {
+ LogManager.logDebug("Start run:", this);
+ IWorkbenchPage page = window.getActivePage();
+ IEditorPart editor = page.getActiveEditor();
+ if(null == editor) {
+ NewFileAction action = new NewFileAction(page.getWorkbenchWindow());
+ //action.init(page.getWorkbenchWindow());
+ action.run();
+ editor = page.getWorkbenchWindow().getActivePage().getActiveEditor();
+ }
+ ISelection incoming = viewer.getViewer().getSelection();
+ IStructuredSelection selection = (IStructuredSelection)incoming;
+ Object o = selection.getFirstElement();
+ if (o instanceof TreeNode) {
+ TreeNode t = (TreeNode) o;
+ if(editor instanceof STPEditor) {
+ STPEditor stpeditor = (STPEditor)editor;
+ //build the string
+ StringBuilder s = new StringBuilder("\nprobe "+ t.toString());
+ if(!t.isClickable())
+ if(0 <t.getChildCount())
+ s.append(".*");
+ else
+ return;
+ s.append("\n{\n");
+ if(t.isClickable() && t.getChildCount() > 0) {
+ s.append("\t/*\n\t * " +
+ Localization.getString("ProbeAliasAction.AvailableVariables") +
+ "\n\t * ");
+ boolean first = true;
+ for(int i = 0; i < t.getChildCount(); i++) {
+ if(first) first = false;
+ else s.append(", ");
+ s.append(t.getChildAt(i).toString());
+ }
+ s.append("\n\t */\n");
+ }
+ s.append("\n}\n");
+ stpeditor.insertText(s.toString());
+ }
+ }
+ LogManager.logDebug("End run:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/TreeExpandCollapseAction.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/TreeExpandCollapseAction.java
new file mode 100644
index 0000000000..8c971c5d84
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/actions/hidden/TreeExpandCollapseAction.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.actions.hidden;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.BrowserView;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.FunctionBrowserView;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.KernelBrowserView;
+import org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
+
+
+/**
+ * This <code>Action</code> expands or collapses the Viewer to the level of the element that the
+ * user selected.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ */
+public class TreeExpandCollapseAction extends Action implements ISelectionListener,IWorkbenchAction {
+ private final IWorkbenchWindow fWindow;
+ private IStructuredSelection selection;
+ @SuppressWarnings("unchecked")
+ private final Class cl;
+
+ /**
+ * The default constructor. Takes a <code>Class</code> representing the viewer that it is to expand
+ * or collapse, as there is only one in the workbench at a time.
+ * @param cls <code>Class</code> of the viewer to expand/collapse
+ */
+ @SuppressWarnings("unchecked")
+ public TreeExpandCollapseAction(Class cls) {
+ super();
+ LogManager.logDebug("Start TreeExpandCollapseAction: cls-" + cls, this);
+ fWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ fWindow.getSelectionService().addSelectionListener(this);
+ cl = cls;
+ LogManager.logDebug("End TreeExpandCollapseAction:", this);
+ }
+
+ /**
+ * Updates <code>selection</code> with the current selection whenever the user changes
+ * the current selection.
+ */
+ public void selectionChanged(IWorkbenchPart part, ISelection incoming) {
+ LogManager.logDebug("Start selectionChanged: part-" + part + ", incoming-" + incoming, this);
+ if (incoming instanceof IStructuredSelection) {
+ selection = (IStructuredSelection) incoming;
+ setEnabled(selection.size() == 1);
+ } else {
+ // Other selections, for example containing text or of other kinds.
+ setEnabled(false);
+ }
+ LogManager.logDebug("End selectionChanged:", this);
+ }
+
+ public void dispose() {
+ LogManager.logDebug("Start dispose:", this);
+ fWindow.getSelectionService().removeSelectionListener(this);
+ LogManager.logDebug("End dispose:", this);
+ }
+
+ /**
+ * The main body of the action. Expands or Collapses the viewer specified at construction to
+ * the level of the current selection.
+ */
+ public void run() {
+ LogManager.logDebug("Start run:", this);
+ if(!(cl.equals(FunctionBrowserView.class) || cl.equals(ProbeAliasBrowserView.class) || cl.equals(KernelBrowserView.class))) {
+ LogManager.logDebug("End run:", this);
+ return;
+ }
+ IViewReference[] references = fWindow.getActivePage().getViewReferences();
+ IViewPart part = null;
+ boolean found = false;
+ for(int i = 0; i < references.length; i++) {
+ part = references[i].getView(false);
+ if(part == null)
+ continue;
+ if(part.getClass().equals(cl)) {
+ found = true;
+ break;
+ }
+ }
+ if(!found) {
+ LogManager.logDebug("End run:", this);
+ return;
+ }
+ if(part == null) {
+ LogManager.logDebug("End run:", this);
+ return;
+ }
+ BrowserView viewer = (BrowserView) part;
+ ISelection incoming = viewer.getViewer().getSelection();
+ IStructuredSelection selection = (IStructuredSelection)incoming;
+ Object o = selection.getFirstElement();
+
+ if(o == null) {
+ LogManager.logDebug("End run:", this);
+ return;
+ }
+
+ Object[] objs = viewer.getViewer().getVisibleExpandedElements();
+ boolean doExpand = true;
+
+ for(int i = 0; i < objs.length; i++)
+ if(objs[i] == o)
+ doExpand = false;
+
+ if(doExpand) {
+ //System.out.println("Attempting to expand at node "+ o.toString());
+ viewer.getViewer().expandToLevel(o,1);
+ } else {
+ //System.out.println("Attempting to collapse at node " + o.toString());
+ viewer.getViewer().collapseToLevel(o,1);
+ }
+ LogManager.logDebug("End run:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/dialogs/ErrorMessage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/dialogs/ErrorMessage.java
new file mode 100644
index 0000000000..c05a22caa8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/dialogs/ErrorMessage.java
@@ -0,0 +1,31 @@
+package org.eclipse.linuxtools.systemtap.ui.ide.dialogs;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Creates and displays an error message box that runs in the UI thread.
+ *
+ */
+public class ErrorMessage {
+ private String title;
+ private String error;
+
+ public ErrorMessage(String title, String error) {
+ this.title = title;
+ this.error = error;
+ }
+
+ public void open() {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ MessageBox messageBox = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_ERROR | SWT.OK);
+ messageBox.setMessage(error);
+ messageBox.setText(title);
+ messageBox.open();
+ } // end run
+ }); // end new Runnable
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CConfiguration.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CConfiguration.java
new file mode 100644
index 0000000000..84f6aec87b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CConfiguration.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.c;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextDoubleClickStrategy;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.presentation.IPresentationReconciler;
+import org.eclipse.jface.text.presentation.PresentationReconciler;
+import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.linuxtools.systemtap.ui.editor.ColorManager;
+import org.eclipse.linuxtools.systemtap.ui.editor.DoubleClickStrategy;
+import org.eclipse.linuxtools.systemtap.ui.editor.NonRuleBasedDamagerRepairer;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.preferences.IDEPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.swt.graphics.RGB;
+
+
+
+/**
+ * Configures an instance of <code>CEditor</code>. This class is responsible for starting
+ * the Syntax highlighting system.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ */
+public class CConfiguration extends SourceViewerConfiguration {
+ private DoubleClickStrategy doubleClickStrategy;
+ private CScanner scanner;
+ private ColorManager colorManager;
+
+ /**
+ * The constructor for the <code>CConfiguration</code> class. Takes as its only parameter
+ * the ColorManager to use for syntax highlighting.
+ * @param colorManager the <code>ColorManager</code> to use for text highlighting
+ */
+ public CConfiguration(ColorManager colorManager) {
+ LogManager.logDebug("Start/End CConfiguration: colorManager-" + colorManager, this);
+ this.colorManager = colorManager;
+ }
+ public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+ LogManager.logDebug("Start/End getConfiguredContentTypes: sourceViewer-" + sourceViewer, this);
+ return new String[] {
+ IDocument.DEFAULT_CONTENT_TYPE,
+ CPartitionScanner.C_COMMENT};
+ }
+ public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer, String contentType) {
+ LogManager.logDebug("Start getDoubleClickStrategy: sourceViewer-" + sourceViewer + ", contentType-" + contentType, this);
+ if (doubleClickStrategy == null)
+ doubleClickStrategy = new DoubleClickStrategy();
+ LogManager.logDebug("End getDoubleClickStrategy: returnVal-" + doubleClickStrategy, this);
+ return doubleClickStrategy;
+ }
+
+ /**
+ * An accessor method for the <code>CScanner</code> associated with this editor. This method is used
+ * in order to dispatch notifications to the <code>CScanner</code> when the color preferences have
+ * been changed. The <code>CEditor</code> class calls this method to get the <code>CScanner</code>
+ * associated with it, and then it reinitializes that <code>CScanner</code> using the
+ * <code>CScanner.initializeScanner</code> method.
+ * @return the instance of the CScanner associated with this instance
+ */
+ protected CScanner getCScanner() {
+ LogManager.logDebug("Start getCScanner:", this);
+ if (scanner == null) {
+ scanner = new CScanner(colorManager);
+ }
+ LogManager.logDebug("End getCScanner: returnVal-" + scanner, this);
+ return scanner;
+ }
+
+ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
+ LogManager.logDebug("Start getPresentationReconciler: sourceViewer-" + sourceViewer, this);
+ PresentationReconciler reconciler = new PresentationReconciler();
+
+ DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getCScanner());
+ reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
+ IPreferenceStore store = IDEPlugin.getDefault().getPreferenceStore();
+ RGB comment = PreferenceConverter.getColor(store, IDEPreferenceConstants.P_C_COMMENT_COLOR);
+ NonRuleBasedDamagerRepairer ndr =
+ new NonRuleBasedDamagerRepairer(
+ new TextAttribute(colorManager.getColor(comment)));
+ reconciler.setDamager(ndr, CPartitionScanner.C_COMMENT);
+ reconciler.setRepairer(ndr, CPartitionScanner.C_COMMENT);
+
+ LogManager.logDebug("End getPresentationReconciler: returnVal-" + reconciler, this);
+ return reconciler;
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CDocumentProvider.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CDocumentProvider.java
new file mode 100644
index 0000000000..023e678240
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CDocumentProvider.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.c;
+
+import org.eclipse.core.runtime.CoreException;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.rules.FastPartitioner;
+import org.eclipse.jface.text.source.AnnotationModel;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.linuxtools.systemtap.ui.editor.SimpleDocumentProvider;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+
+
+
+/**
+ * The DocumentProvider class used when handling documents containing C code.
+ * @see org.eclipse.linuxtools.systemtap.ui.editor.SimpleDocumentProvider
+ * @see org.eclipse.ui.texteditor.AbstractDocumentProvider
+ * @author Henry Hughes
+ * @author Ryan Morse
+ */
+public class CDocumentProvider extends SimpleDocumentProvider {
+ protected void setupDocument(IDocument document) {
+ LogManager.logDebug("Start setupDocument: document-" + document, this);
+ if (document != null) {
+ IDocumentPartitioner partitioner =
+ new FastPartitioner(
+ new CPartitionScanner(),
+ new String[] {CPartitionScanner.C_COMMENT});
+ partitioner.connect(document);
+ document.setDocumentPartitioner(partitioner);
+ }
+ LogManager.logDebug("End setupDocument:", this);
+ }
+
+ protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
+ LogManager.logDebug("Start/End createAnnotationModel: element-" + element, this);
+ return new AnnotationModel();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CEditor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CEditor.java
new file mode 100644
index 0000000000..2ae69b1199
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CEditor.java
@@ -0,0 +1,346 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.c;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
+import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.source.AnnotationRulerColumn;
+import org.eclipse.jface.text.source.CompositeRuler;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.linuxtools.systemtap.ui.editor.*;
+import org.eclipse.linuxtools.systemtap.ui.editor.actions.file.NewFileAction;
+import org.eclipse.linuxtools.systemtap.ui.ide.IDESessionSettings;
+import org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPEditor;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.ide.preferences.IDEPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
+
+
+/**
+ * A text editor for the C language.
+ * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor
+ * @author Henry Hughes
+ * @author Ryan Morse
+ */
+public class CEditor extends AbstractDecoratedTextEditor {
+ private ColorManager colorManager;
+ /**
+ * The handler for doubleclick events on the ruler for this text editor.
+ */
+ private RulerDoubleClickHandler handler = new RulerDoubleClickHandler();
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.ide.editors.c.CEditor";
+
+ /**
+ * The <code>RulerDoubleClickHandler</code> handles double click events on the
+ * ruler for this text editor. It first checks to see if the user clicked on a
+ * comment line, then if they clicked on a line that SystemTap can use as a probe
+ * point, and if the line of code passes both checks, it dispatches an event to the
+ * active STPEditor to insert a code block describing the line of code that the user
+ * clicked on.
+ *
+ * The block of code is sent to the STPEditor only under the following circumstances:
+ * <ul>
+ * <li>The line of code is not blank</li>
+ * <li>If the line of code contains a single-line comment, it must not be the only text on that line</li>
+ * <li>The line of code must not fall within a multiline comment</li>
+ * <li>The line of code must be a line that can be used by SystemTap,
+ * determined by running the following:<br/>
+ * <code>stap -p2 -e 'probe kernel.statement("*@filename:linenumber")'</code><br/>
+ * If <code>stap</code> does not generate errors while running the test command, the
+ * line is assumed valid.</li>
+ * </ul>
+ *
+ * If all of the above are met, the active STPEditor listed in <code>IDESessionSettings</code>
+ * is told to insert a template probe for this line of code using the <code>SimpleEditor.insertText</code> method.
+ * If no the returned STPEditor reference is null, the code opens a new editor.
+ *
+ * @author Henry Hughes
+ * @author Ryan Morse
+ * @see org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor#insertText
+ * @see org.eclipse.linuxtools.systemtap.ui.structures.runnable.Command
+ * @see org.eclipse.swt.events.MouseListener
+ */
+ private class RulerDoubleClickHandler implements MouseListener
+ {
+ /**
+ * The doubleclick event handler method.
+ * @param e The <code>MouseEvent</code> that represents this doubleclick event.
+ */
+ public void mouseDoubleClick(MouseEvent e)
+ {
+ LogManager.logDebug("Start mouseDoubleClick: e-" + e, this);
+ getSite().getShell().setCursor(new Cursor(getSite().getShell().getDisplay(), SWT.CURSOR_WAIT));
+ int lineno = getVerticalRuler().getLineOfLastMouseButtonActivity();
+
+ String s = getSourceViewer().getDocument().get();
+ String[] lines = s.split("\n");
+ String line = lines[lineno].trim();
+ boolean die = false;
+ if("".equals(line)) //eat blank lines
+ die = true;
+ if(line.startsWith("#")) //eat preprocessor directives
+ die = true;
+ if(line.startsWith("//")) //eat C99 comments
+ die = true;
+ if(line.startsWith("/*") && !line.contains("*/") && !line.endsWith("*/")) //try to eat single-line C comments
+ die = true;
+
+ //gogo find comment segments
+ try
+ {
+ ArrayList<Integer> commentChunks = new ArrayList<Integer>();
+ char[] chars = s.toCharArray();
+ int needle = 1;
+ int offset = getSourceViewer().getDocument().getLineOffset(lineno);
+ while (needle < chars.length)
+ {
+ if(chars[needle-1] == '/' && chars[needle] == '*')
+ {
+ commentChunks.add(new Integer(needle));
+ while(needle < chars.length)
+ {
+ if(chars[needle-1] == '*' && chars[needle] == '/')
+ {
+ commentChunks.add(new Integer(needle));
+ needle++;
+ break;
+ }
+ needle++;
+ }
+ }
+ needle++;
+ }
+ for(int i=0, pair, start, end; i < commentChunks.size(); i++)
+ {
+ if(!(((Integer)(commentChunks.get(i))).intValue() < offset))
+ {
+ pair = i - i%2;
+ start = ((Integer)(commentChunks.get(pair))).intValue();
+ end = ((Integer)(commentChunks.get(pair+1))).intValue();
+ if(offset >= start && offset <= end)
+ die=true;
+ }
+ }
+ } catch (Exception excp) {
+ LogManager.logCritical("Exception mouseDoubleClick: " + excp.getMessage(), this);
+ }
+ if(die) {
+ LogManager.logInfo("Initializing", MessageDialog.class);
+ MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ Localization.getString("CEditor.ProbeInsertFailed"),Localization.getString("CEditor.CanNotProbeLine"));
+ LogManager.logInfo("Disposing", MessageDialog.class);
+ } else {
+ IEditorInput in = getEditorInput();
+ if(in instanceof PathEditorInput) {
+ PathEditorInput input = (PathEditorInput)in;
+
+ IPreferenceStore p = IDEPlugin.getDefault().getPreferenceStore();
+ String kernroot = p.getString(IDEPreferenceConstants.P_KERNEL_SOURCE);
+
+ String filepath = input.getPath().toOSString();
+ String kernrelative = filepath.substring(kernroot.length()+1, filepath.length());
+ StringBuffer sb = new StringBuffer();
+
+ sb.append("probe kernel.statement(\"*@"+ kernrelative + ":" + (lineno+1) + "\")");
+
+ /* if(!checkProbe(sb.toString() + "{ }")) {
+ LogManager.logInfo("Initializing", MessageDialog.class);
+ MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ Localization.getString("CEditor.ProbeInsertFailed"),Localization.getString("CEditor.CanNotProbeLine"));
+ LogManager.logInfo("Disposing", MessageDialog.class);
+ } else { */
+ sb.append("\n{\n\t\n}\n");
+ if(null == IDESessionSettings.activeSTPEditor) {
+ NewFileAction action = new NewFileAction();
+ //action.init(input.getMainWindow());
+ action.run();
+ IEditorPart ed = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if(ed instanceof STPEditor)
+ IDESessionSettings.activeSTPEditor = (STPEditor)ed;
+ }
+ STPEditor editor = IDESessionSettings.activeSTPEditor;
+ if(null != editor)
+ editor.insertText(sb.toString());
+ //}
+ }
+ }
+ getSite().getShell().setCursor(null); //Return the cursor to normal
+ LogManager.logDebug("End mouseDoubleClick:", this);
+ }
+
+ public void mouseDown(MouseEvent e) {
+ }
+ public void mouseUp(MouseEvent e) {
+ }
+ }
+
+ /**
+ * Default Constructor for the <code>CEditor</code> class. Creates an instance of the editor which
+ * is not associated with any given input.
+ */
+ public CEditor() {
+ super();
+ LogManager.logDebug("Start CEditor:", this);
+ internal_init();
+ IDEPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(cColorPropertyChangeListener);
+ LogManager.logDebug("End CEditor:", this);
+ }
+ /**
+ * Part of the initialization routine. Creates the <code>ColorManager</code> used by this editor,
+ * sets up the CConfiguration for this editor, and sets the DocumentProvider to a new
+ * <code>CDocumentProvider</code>.
+ * @see org.eclipse.linuxtools.systemtap.ui.editor.ColorManager
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.editors.c.CConfiguration
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.editors.c.CDocumentProvider
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#setDocumentProvider(org.eclipse.ui.texteditor.IDocumentProvider)
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#setSourceViewerConfiguration(org.eclipse.jface.text.source.SourceViewerConfiguration)
+ */
+ protected void internal_init() {
+ LogManager.logDebug("Start internal_init:", this);
+ LogManager.logInfo("Initializing", this);
+ configureInsertMode(SMART_INSERT, false);
+ colorManager = new ColorManager();
+ setSourceViewerConfiguration(new CConfiguration(colorManager));
+ setDocumentProvider(new CDocumentProvider());
+ LogManager.logDebug("End internal_init", this);
+ }
+
+ /**
+ * Runs the probe passed to it as a single-line SystemTap script. Used as a helper method
+ * by the <code>RulerDoubleClickHandler</code> class to check locations in the current file.
+ * @param probe the systemtap probe to test for validity
+ * @return true when the probe is a valid probe
+ */
+ /*private boolean checkProbe(String probe) {
+ LogManager.logDebug("Start checkProbe: probe-" + probe, this);
+ String[] stap = new String[4];
+ stap[0] = "stap";
+ stap[1] = "-p2";
+ stap[2] = "-e";
+ stap[3] = probe;
+ LogManager.logDebug("running " + probe, this);
+
+ Command cmd = new Command(stap, null, null, 0);
+ cmd.start();
+ while(cmd.isRunning()) {
+ try {
+ Thread.sleep(100);
+ } catch(InterruptedException e) {
+ LogManager.logCritical("InterruptedException runStap: " + e.getMessage(), this);
+ }
+ }
+ boolean success = cmd.getReturnValue() == 0;
+ cmd.dispose();
+ LogManager.logDebug("End checkProbe:", this);
+ return success;
+ }*/
+
+ public void dispose() {
+ LogManager.logDebug("Start dispose:", this);
+ LogManager.logInfo("Disposing", this);
+ IDEPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(cColorPropertyChangeListener);
+ colorManager.dispose();
+ super.dispose();
+ LogManager.logDebug("End dispose:", this);
+ }
+
+ protected CompositeRuler createCompositeRuler() {
+ LogManager.logDebug("Start createCompositeRuler:", this);
+ CompositeRuler ruler = new CompositeRuler();
+ AnnotationRulerColumn column = new AnnotationRulerColumn(VERTICAL_RULER_WIDTH, getAnnotationAccess());
+ ruler.addDecorator(0, column);
+
+ if (isLineNumberRulerVisible())
+ ruler.addDecorator(1, createLineNumberRulerColumn());
+ else if (isPrefQuickDiffAlwaysOn())
+ ruler.addDecorator(1, createLineNumberRulerColumn());
+
+ LogManager.logDebug("End createCompositeRuler: returnVal-" + ruler, this);
+ return ruler;
+ }
+
+ public void createPartControl(Composite parent) {
+ LogManager.logDebug("Start createPartControl: parent-" + parent, this);
+ super.createPartControl(parent);
+ IVerticalRuler ruler = this.getVerticalRuler();
+ Control control = ruler.getControl();
+ try {
+ control.addMouseListener(handler);
+ } catch(Exception e) {
+ LogManager.logCritical("Exception createPartControl: " + e.getMessage(), this);
+ }
+ LogManager.logDebug("End createPartControl:", this);
+ }
+
+ /**
+ * Color Preference Change Notification method, called whenever the user has changed preferences
+ * regarding syntax highlighing. This method notifies its internal structures (<code>CScanner</code>,
+ * <code>CConfiguration</code>) that the preferences have changed, and that they need to reconfigure
+ * themselves.
+ */
+ private void notifyColorPrefsChanged()
+ {
+ LogManager.logDebug("Start notifyColorPrefsChanged:", this);
+ SourceViewerConfiguration svc = getSourceViewerConfiguration();
+ if(!(svc instanceof CConfiguration)) {
+ LogManager.logDebug("End notifyColorPrefsChanged:", this);
+ return;
+ }
+ CConfiguration config = (CConfiguration)svc;
+ CScanner scanner = config.getCScanner();
+ scanner.initializeScanner();
+
+ SourceViewer viewer = (SourceViewer)getSourceViewer();
+ viewer.unconfigure();
+ viewer.configure(svc);
+ viewer.invalidateTextPresentation();
+ viewer.refresh();
+ LogManager.logDebug("End notifyColorPrefsChanged:", this);
+ }
+
+ /**
+ * Detects changes in the preferences relating to the C Editor's syntax highlighting, and
+ * fires the <code>notifyColorPrefsChanged</code> method when a change has occured.
+ * @see #notifyColorPrefsChanged()
+ */
+ private final IPropertyChangeListener cColorPropertyChangeListener = new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ LogManager.logDebug("Start propertyChange: event-" + event, this);
+ if(event.getProperty().equals(IDEPreferenceConstants.P_C_COMMENT_COLOR) ||
+ event.getProperty().equals(IDEPreferenceConstants.P_C_DEFAULT_COLOR) ||
+ event.getProperty().equals(IDEPreferenceConstants.P_C_KEYWORD_COLOR) ||
+ event.getProperty().equals(IDEPreferenceConstants.P_C_PREPROCESSOR_COLOR) ||
+ event.getProperty().equals(IDEPreferenceConstants.P_C_STRING_COLOR) ||
+ event.getProperty().equals(IDEPreferenceConstants.P_C_TYPE_COLOR)) {
+ notifyColorPrefsChanged();
+ }
+ LogManager.logDebug("End propertyChange: event-" + event, this);
+ }
+ };
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CPartitionScanner.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CPartitionScanner.java
new file mode 100644
index 0000000000..8a2297b607
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CPartitionScanner.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.c;
+
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.MultiLineRule;
+import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+
+
+/**
+ * This class is the Partition Scanner used by the CEditor. It is responsible for
+ * detecting a multiline C comment and partitioning it to type <code>C_COMMENT</code>
+ * so that the <code>CScanner</code> can highlight multiline comments.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ * @see org.eclipse.jface.text.rules.RuleBasedPartitionScanner
+ */
+public class CPartitionScanner extends RuleBasedPartitionScanner {
+ public final static String C_DEFAULT = "__stp_default";
+ public final static String C_COMMENT = "__stp_comment";
+
+ public CPartitionScanner() {
+ LogManager.logDebug("Start CPartitionScanner:", this);
+ IToken stpComment = new Token(C_COMMENT);
+ IPredicateRule[] rules = new IPredicateRule[1];
+ rules[0] = new MultiLineRule("/*", "*/", stpComment);
+ setPredicateRules(rules);
+ LogManager.logDebug("End CPartitionScanner:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CScanner.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CScanner.java
new file mode 100644
index 0000000000..65153b48d2
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/CScanner.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.c;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.text.TextAttribute;
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.jface.text.rules.*;
+import org.eclipse.linuxtools.systemtap.ui.editor.ColorManager;
+import org.eclipse.linuxtools.systemtap.ui.editor.WhitespaceDetector;
+import org.eclipse.linuxtools.systemtap.ui.editor.WordDetector;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.preferences.IDEPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.RGB;
+
+
+
+/**
+ * This class provides syntax highlighting functionality to <code>CEditor</code>. It uses a simple rule-based
+ * scanning system.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ */
+public class CScanner extends RuleBasedScanner {
+
+ private static String[] fgKeywords= {"auto","break","case","const","continue","default","do","else","extern","for","goto","if","return","signed","sizeof","static","switch","typedef","unsigned","volatile","while" };
+ private static String[] fgTypes= { "char","double","enum","float","int","long","register","short","struct","union","void",
+ "char*","double*","float*","int*","long*","short*","void*","u8","u16","u32","u64",
+ "s8","s16","s32",""};
+ private static String[] fgConstants= { "NULL" };
+ private ColorManager manager;
+ public CScanner(ColorManager manager) {
+ LogManager.logDebug("Start CScanner: manager-" + manager, this);
+ this.manager = manager;
+ initializeScanner();
+ LogManager.logDebug("End CScanner:", this);
+ }
+
+ /**
+ * This method initializes this instance of <code>CScanner</code>, allowing it to be used
+ * for syntax highlighting purposes by the editor.
+ */
+ public void initializeScanner()
+ {
+ LogManager.logDebug("Start initializeScanner:", this);
+ IPreferenceStore store = IDEPlugin.getDefault().getPreferenceStore();
+ RGB cKeyword, cType, cString, cComment, cDefault, cPreprocessor;
+
+ cKeyword = PreferenceConverter.getColor(store, IDEPreferenceConstants.P_C_KEYWORD_COLOR);
+ cType = PreferenceConverter.getColor(store, IDEPreferenceConstants.P_C_TYPE_COLOR);
+ cString = PreferenceConverter.getColor(store, IDEPreferenceConstants.P_C_STRING_COLOR);
+ cComment = PreferenceConverter.getColor(store, IDEPreferenceConstants.P_C_COMMENT_COLOR);
+ cDefault = PreferenceConverter.getColor(store, IDEPreferenceConstants.P_C_DEFAULT_COLOR);
+ cPreprocessor = PreferenceConverter.getColor(store, IDEPreferenceConstants.P_C_PREPROCESSOR_COLOR);
+
+ IToken keyword = new Token(new TextAttribute(manager.getColor(cKeyword), null, SWT.BOLD));
+ IToken type = new Token(new TextAttribute(manager.getColor(cType)));
+ IToken string = new Token(new TextAttribute(manager.getColor(cString)));
+ IToken comment = new Token(new TextAttribute(manager.getColor(cComment)));
+ IToken other = new Token(new TextAttribute(manager.getColor(cDefault)));
+ IToken preprocessor = new Token(new TextAttribute(manager.getColor(cPreprocessor)));
+ /* IToken procInstr =
+ new Token(
+ new TextAttribute(
+ manager.getColor(ICColorConstants.PROC_INSTR)));*/
+
+ List<IRule> rules= new ArrayList<IRule>();
+
+ // Add rules for single line comments.
+ rules.add(new EndOfLineRule("//", comment)); //$NON-NLS-1$
+
+ rules.add(new SingleLineRule("#", " ", preprocessor));
+ // Add rule for strings and character constants.
+ rules.add(new SingleLineRule("\"", "\"", string, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
+ rules.add(new SingleLineRule("'", "'", string, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
+
+ // Add generic whitespace rule.
+ rules.add(new WhitespaceRule(new WhitespaceDetector()));
+
+ // Add word rule for keywords, types, and constants.
+ WordRule wordRule= new WordRule(new WordDetector(), other);
+ for (int i= 0; i < fgKeywords.length; i++)
+ wordRule.addWord(fgKeywords[i], keyword);
+ for (int i= 0; i < fgTypes.length; i++)
+ wordRule.addWord(fgTypes[i], type);
+ for (int i= 0; i < fgConstants.length; i++)
+ wordRule.addWord(fgConstants[i], type);
+ rules.add(wordRule);
+
+ IRule[] result= new IRule[rules.size()];
+ setDefaultReturnToken(other);
+ rules.toArray(result);
+ setRules(result);
+
+ LogManager.logDebug("End initializeScanner:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/ICColorConstants.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/ICColorConstants.java
new file mode 100644
index 0000000000..dc3da06a31
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/c/ICColorConstants.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.c;
+
+import org.eclipse.swt.graphics.RGB;
+
+/**
+ * This interface defines the constant colors that are used for syntax highlighting inside
+ * <code>CEditor</code>
+ * @author Ryan Morse
+ */
+public interface ICColorConstants {
+ RGB COMMENT= new RGB(0, 128, 0);
+ RGB PREPROCESSOR = new RGB(180,56,231);
+ RGB KEYWORD= new RGB(127, 0, 85);
+ RGB TYPE= new RGB(0, 0, 128);
+ RGB STRING= new RGB(0, 0, 255);
+ RGB DEFAULT= new RGB(0, 0, 0);
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPColorConstants.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPColorConstants.java
new file mode 100644
index 0000000000..29e46a2335
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPColorConstants.java
@@ -0,0 +1,24 @@
+/* Copyright (c) 2008 Phil Muldoon <pkmuldoon@picobot.org>.
+ *
+ * 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:
+ * Phil Muldoon <pkmuldoon@picobot.org> - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.stp;
+
+import org.eclipse.swt.graphics.RGB;
+
+public interface STPColorConstants {
+ RGB KEYWORD = new RGB(127, 0, 85);
+ RGB COMMENT = new RGB(63, 127, 95);
+ RGB STP_STRING = new RGB(0, 0, 255);
+ RGB DEFAULT = new RGB(0, 0, 0);
+ RGB EMBEDDED = new RGB (0, 64, 64);
+ RGB EMBEDDEDC = new RGB (0, 64, 64);
+ RGB TYPE= new RGB(0, 0, 128);
+
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPCompletionProcessor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPCompletionProcessor.java
new file mode 100644
index 0000000000..042cb2a7a0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPCompletionProcessor.java
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Phil Muldoon <pkmuldoon@picobot.org>.
+ *
+ * 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:
+ * Phil Muldoon <pkmuldoon@picobot.org> - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.stp;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.CompletionProposal;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+
+class STPCompletionProcessor implements IContentAssistProcessor {
+
+ private final IContextInformation[] NO_CONTEXTS = new IContextInformation[0];
+ private final char[] PROPOSAL_ACTIVATION_CHARS = new char[] { '.' };
+ private ICompletionProposal[] NO_COMPLETIONS = new ICompletionProposal[0];
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int)
+ */
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
+ int offset) {
+
+ IDocument document = viewer.getDocument();
+
+ String prefix;
+ int locationOffset =0;
+
+ // Get completion hint from document
+ try {
+ prefix = completionWord(document, offset);
+ locationOffset = completionReplaceWordLocation(document, offset);
+ } catch (Exception e) {
+ return NO_COMPLETIONS;
+ }
+
+ // If cannot find a place to replace our partial typed completion
+ // with the full one, abort with no completions.
+ if (locationOffset < 0)
+ return NO_COMPLETIONS;
+
+ String[] completionData = STPMetadataSingleton.getCompletionResults(prefix);
+
+ // If cannot find any completions
+ // abort with no completions.
+ if (completionData.length < 1)
+ return NO_COMPLETIONS;
+
+ // Build proposals and submit
+ ICompletionProposal[] result = new ICompletionProposal[completionData.length];
+ for (int i = 0; i < completionData.length; i++)
+ result[i] = new CompletionProposal(
+ completionData[i].substring(offset - locationOffset),
+ offset, 0, completionData[i].length(), null,
+ completionData[i], null, null);
+ return result;
+ }
+
+ /**
+ *
+ * Compute location of completion proposal insertion.
+ *
+ * @param doc - document to insert completion.
+ * @param offset - offset of where completion hint was first generated.
+ * @return - offset into document for completion proposal insertion.
+ * @throws BadLocationException
+ *
+ */
+ private int completionReplaceWordLocation(IDocument doc, int offset)
+ throws BadLocationException {
+ try {
+ for (int n = offset-1; n >= 0; n--) {
+ if (doc.getChar(n) == '.')
+ return n+1;
+ }
+ } catch (BadLocationException e) {
+ throw e;
+ }
+
+ return -1;
+ }
+
+ /**
+ *
+ * Return the word the user wants to submit for completion proposals.
+ *
+ * @param doc - document to insert completion.
+ * @param offset - offset of where completion hint was first generated.
+ * @return - word to generate completion proposals.
+ *
+ * @throws BadLocationException
+ */
+ private String completionWord(IDocument doc, int offset)
+ throws BadLocationException {
+ try {
+ for (int n = offset - 1; n >= 0; n--) {
+ char c = doc.getChar(n);
+ if ((Character.isSpaceChar(c)) || (c == '\n') || (c == '\0')) {
+ String word = doc.get(n + 1, offset - n - 1);
+ if (word.charAt(word.length() - 1) == '.')
+ return word.substring(0, word.length() - 1);
+ else
+ return word;
+ }
+ }
+ } catch (BadLocationException e) {
+ throw e;
+ }
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int)
+ */
+ public IContextInformation[] computeContextInformation(ITextViewer viewer,
+ int offset) {
+ return NO_CONTEXTS;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
+ */
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ return PROPOSAL_ACTIVATION_CHARS;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
+ */
+ public char[] getContextInformationAutoActivationCharacters() {
+ return PROPOSAL_ACTIVATION_CHARS;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
+ */
+ public IContextInformationValidator getContextInformationValidator() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
+ */
+ public String getErrorMessage() {
+ // TODO: When does this trigger?
+ return "Error.";
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPConfiguration.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPConfiguration.java
new file mode 100644
index 0000000000..69b48edbf3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPConfiguration.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Phil Muldoon <pkmuldoon@picobot.org>.
+ *
+ * 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:
+ * Phil Muldoon <pkmuldoon@picobot.org> - initial API and implementation.
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.stp;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextDoubleClickStrategy;
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.presentation.IPresentationReconciler;
+import org.eclipse.jface.text.presentation.PresentationReconciler;
+import org.eclipse.jface.text.reconciler.IReconciler;
+import org.eclipse.jface.text.reconciler.MonoReconciler;
+import org.eclipse.jface.text.rules.DefaultDamagerRepairer;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.linuxtools.systemtap.ui.editor.ColorManager;
+import org.eclipse.linuxtools.systemtap.ui.editor.DoubleClickStrategy;
+
+public class STPConfiguration extends SourceViewerConfiguration {
+
+ private STPElementScanner scanner;
+ private ColorManager colorManager;
+ private STPEditor editor;
+ private DoubleClickStrategy doubleClickStrategy;
+
+ public STPConfiguration(ColorManager colorManager, STPEditor editor) {
+ this.colorManager = colorManager;
+ this.editor = editor;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ @Override
+ public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
+ return new String[] {
+ IDocument.DEFAULT_CONTENT_TYPE,
+ STPPartitionScanner. STP_COMMENT,
+ STPPartitionScanner.STP_STRING};
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ @Override
+ public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
+ ContentAssistant assistant = new ContentAssistant();
+
+ assistant.enableAutoActivation(true);
+ assistant.setAutoActivationDelay(500);
+ assistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
+ assistant
+ .setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
+ IContentAssistProcessor processor = new STPCompletionProcessor();
+ assistant.setContentAssistProcessor(processor,IDocument.DEFAULT_CONTENT_TYPE);
+ assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
+ return assistant;
+ }
+
+ /**
+ * Return the default Element scanner.
+ *
+ * @return default element scanner.
+ */
+ protected STPElementScanner getSTPScanner() {
+ if (scanner == null) {
+ scanner = new STPElementScanner(colorManager);
+ scanner.setDefaultReturnToken(new Token(new TextAttribute(
+ colorManager.getColor(STPColorConstants.DEFAULT))));
+ }
+ return scanner;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getReconciler(org.eclipse.jface.text.source.ISourceViewer)
+ *
+ * Return the reconciler built on the custom Systemtap reconciling strategy that enables code folding for this editor.
+ */
+ @Override
+ public IReconciler getReconciler(ISourceViewer sourceViewer)
+ {
+ STPReconcilingStrategy strategy = new STPReconcilingStrategy();
+ strategy.setEditor(editor);
+ MonoReconciler reconciler = new MonoReconciler(strategy,false);
+ return reconciler;
+ }
+
+ /**
+ * Instantiates and returns a double click strategy object if one does not exist, and returns the
+ * current one if it does.
+ */
+ public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer,String contentType) {
+ if (doubleClickStrategy == null)
+ doubleClickStrategy = new DoubleClickStrategy();
+ return doubleClickStrategy;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ @Override
+ public IPresentationReconciler getPresentationReconciler(
+ ISourceViewer sourceViewer) {
+
+ PresentationReconciler reconciler = new PresentationReconciler();
+
+ DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getSTPScanner());
+ reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
+ reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
+
+ dr = new DefaultDamagerRepairer(getSTPScanner());
+ reconciler.setDamager(dr, STPPartitionScanner.STP_COMMENT);
+ reconciler.setRepairer(dr, STPPartitionScanner.STP_COMMENT);
+
+ dr = new DefaultDamagerRepairer(getSTPScanner());
+ reconciler.setDamager(dr, STPPartitionScanner.STP_STRING);
+ reconciler.setRepairer(dr, STPPartitionScanner.STP_STRING);
+
+ dr = new DefaultDamagerRepairer(getSTPScanner());
+ reconciler.setDamager(dr, STPPartitionScanner.STP_KEYWORD);
+ reconciler.setRepairer(dr, STPPartitionScanner.STP_KEYWORD);
+
+ dr = new DefaultDamagerRepairer(getSTPScanner());
+ reconciler.setDamager(dr, STPPartitionScanner.STP_CONDITIONAL);
+ reconciler.setRepairer(dr, STPPartitionScanner.STP_CONDITIONAL);
+
+ return reconciler;
+ }
+
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPDocumentProvider.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPDocumentProvider.java
new file mode 100644
index 0000000000..2f724a1a7b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPDocumentProvider.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Phil Muldoon <pkmuldoon@picobot.org>.
+ *
+ * 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:
+ * Phil Muldoon <pkmuldoon@picobot.org> - initial API and implementation.
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.stp;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IDocumentPartitioner;
+import org.eclipse.jface.text.rules.FastPartitioner;
+import org.eclipse.jface.text.source.AnnotationModel;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.linuxtools.systemtap.ui.editor.SimpleDocumentProvider;
+import org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPPartitioner;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+
+public class STPDocumentProvider extends SimpleDocumentProvider {
+ private IDocument document;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.TextFileDocumentProvider#getDocument(java.lang.Object)
+ */
+ @Override
+ /*public IDocument getDocument(Object element) {
+ document = super.getDocument(element);
+ if (document != null) {
+ STPPartitioner partitioner = new STPPartitioner(
+ new STPPartitionScanner(),
+ STPPartitionScanner.STP_PARTITION_TYPES);
+
+ partitioner.connect(document, false);
+ if (document.getDocumentPartitioner() == null)
+ document.setDocumentPartitioner(partitioner);
+ }
+ return document;
+ }*/
+
+ protected void setupDocument(IDocument document) {
+ LogManager.logDebug("Start setupDocument: document-" + document, this);
+ if (document != null) {
+ IDocumentPartitioner partitioner =
+ new FastPartitioner(
+ new STPPartitionScanner(),
+ new String[] {
+ STPPartitionScanner.STP_COMMENT});
+ partitioner.connect(document);
+ document.setDocumentPartitioner(partitioner);
+ }
+ LogManager.logDebug("End setupDocument:", this);
+ }
+
+ /**
+ * Instantiates and returns a new AnnotationModel object.
+ */
+ protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
+ LogManager.logDebug("Start/End createAnnotationModel: element-" + element, this);
+ return new AnnotationModel();
+ }
+
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPEditor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPEditor.java
new file mode 100644
index 0000000000..8459da82e3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPEditor.java
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Phil Muldoon <pkmuldoon@picobot.org>.
+ *
+ * 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:
+ * Phil Muldoon <pkmuldoon@picobot.org> - initial API.
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.stp;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.IVerticalRuler;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
+import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel;
+import org.eclipse.jface.text.source.projection.ProjectionSupport;
+import org.eclipse.jface.text.source.projection.ProjectionViewer;
+import org.eclipse.linuxtools.systemtap.ui.editor.ColorManager;
+import org.eclipse.linuxtools.systemtap.ui.editor.SimpleEditor;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.texteditor.ContentAssistAction;
+import org.eclipse.ui.texteditor.ITextEditorActionConstants;
+import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
+
+public class STPEditor extends SimpleEditor {
+
+ private ColorManager colorManager;
+
+ private ProjectionSupport stpProjectionSupport;
+ private Annotation[] stpOldAnnotations;
+ private ProjectionAnnotationModel stpAnnotationModel;
+
+ public STPEditor() {
+ super();
+ URL completionURL = null;
+
+ completionURL = buildCompletionDataLocation("completion/stp_completion.properties");
+ STPMetadataSingleton completionDataStore = STPMetadataSingleton.getInstance();
+
+ if (completionURL != null)
+ completionDataStore.build(completionURL);
+
+ colorManager = new ColorManager();
+ setSourceViewerConfiguration(new STPConfiguration(colorManager,this));
+ setDocumentProvider(new STPDocumentProvider());
+ }
+
+ public void createPartControl(Composite parent)
+ {
+ super.createPartControl(parent);
+ ProjectionViewer viewer =(ProjectionViewer)getSourceViewer();
+ stpProjectionSupport = new ProjectionSupport(viewer,getAnnotationAccess(),getSharedColors());
+ stpProjectionSupport.install();
+ viewer.doOperation(ProjectionViewer.TOGGLE);
+ stpAnnotationModel = viewer.getProjectionAnnotationModel();
+ }
+
+ protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
+
+ ISourceViewer viewer = new ProjectionViewer(parent, ruler,
+ getOverviewRuler(), isOverviewRulerVisible(), styles);
+ getSourceViewerDecorationSupport(viewer);
+ return viewer;
+ }
+
+
+ public void updateFoldingStructure(ArrayList<Position> updatedPositions)
+ {
+ ProjectionAnnotation annotation;
+ Annotation[] updatedAnnotations = new Annotation[updatedPositions.size()];
+ HashMap<ProjectionAnnotation, Position> newAnnotations = new HashMap<ProjectionAnnotation, Position>();
+ for(int i =0;i<updatedPositions.size();i++)
+ {
+ annotation = new ProjectionAnnotation();
+ newAnnotations.put(annotation,updatedPositions.get(i));
+ updatedAnnotations[i]=annotation;
+ }
+ stpAnnotationModel.modifyAnnotations(stpOldAnnotations,newAnnotations,null);
+ stpOldAnnotations = updatedAnnotations;
+ }
+
+ protected void createActions() {
+ Action action = new ContentAssistAction(ResourceBundle.getBundle("org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.strings"), "ContentAssistProposal.", this);
+ String id = ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS;
+ action.setActionDefinitionId(id);
+ setAction("ContentAssistProposal", action);
+ markAsStateDependentAction("ContentAssistProposal", true);
+ super.createActions();
+ }
+
+ public ISourceViewer getMySourceViewer() {
+ return this.getSourceViewer();
+ }
+
+ public void dispose() {
+ colorManager.dispose();
+ super.dispose();
+ }
+
+ protected void editorContextMenuAboutToShow(IMenuManager menu) {
+
+ super.editorContextMenuAboutToShow(menu);
+ addAction(menu, ITextEditorActionConstants.GROUP_EDIT,
+ ITextEditorActionConstants.SHIFT_RIGHT);
+ addAction(menu, ITextEditorActionConstants.GROUP_EDIT,
+ ITextEditorActionConstants.SHIFT_LEFT);
+
+ }
+
+ private URL buildCompletionDataLocation(String completionDataLocation) {
+ URL completionURLLocation = null;
+ try {
+ completionURLLocation = getCompletionURL(completionDataLocation);
+ } catch (IOException e) {
+ completionURLLocation = null;
+ }
+
+ if (completionURLLocation == null) {
+ IDEPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, IDEPlugin.PLUGIN_ID,
+ IStatus.OK, "Cannot locate plug-in location for System Tap completion metadata " +
+ "(completion/stp_completion.properties). Completions are not available.", null));
+ return null;
+ }
+
+ File completionFile = new File(completionURLLocation.getFile());
+ if ((completionFile == null) || (!completionFile.exists()) || (!completionFile.canRead())) {
+ IDEPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, IDEPlugin.PLUGIN_ID,
+ IStatus.OK, "Cannot find System Tap completion metadata at " +completionFile.getPath() +
+ "Completions are not available.", null));
+
+ return null;
+ }
+
+ return completionURLLocation;
+
+ }
+ private URL getCompletionURL(String completionLocation) throws IOException {
+ URL fileURL = null;
+ URL location = IDEPlugin.getDefault().getBundle().getEntry(completionLocation);
+
+ if (location != null)
+ fileURL = FileLocator.toFileURL(location);
+ return fileURL;
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPElementScanner.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPElementScanner.java
new file mode 100644
index 0000000000..719e521ad9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPElementScanner.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Phil Muldoon <pkmuldoon@picobot.org>.
+ *
+ * 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:
+ * Phil Muldoon <pkmuldoon@picobot.org> - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.stp;
+
+
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.BufferedRuleBasedScanner;
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.IWhitespaceDetector;
+import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.rules.MultiLineRule;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+import org.eclipse.jface.text.rules.WordRule;
+import org.eclipse.linuxtools.systemtap.ui.editor.ColorManager;
+import org.eclipse.swt.SWT;
+
+public class STPElementScanner extends BufferedRuleBasedScanner {
+
+ private String[] keywordList= {"probe", "for", "else", "foreach", "exit", "printf", "in", "return",
+ "break", "global", "next", "while", "if", "delete", "#include", "function", "do",
+ "print", "error","log", "printd", "printdln", "println", "sprint", "sprintf", "system", "warn"};
+
+
+// TODO: Not sure if we want these keywords or not. Defer for now.
+// "backtrace", "caller", "caller_addr", "cpu", "egid", "euid", "execname", "gid", "is_return",
+// "pexecname", "pid", "ppid", "tid", "uid", "print_backtrace", "print_regs", "print_stack",
+// "stack_size", "stack_unused", "stack_used", "stp_pid", "target"};
+
+ /**
+ *
+ * Build Element scanner for Syntax Highlighting for Systemtap Editor
+ *
+ * @param manager ColorManager to source highlighting.
+ *
+ */
+ public STPElementScanner(ColorManager manager) {
+ IToken defaultToken = new Token(new TextAttribute(manager
+ .getColor(STPColorConstants.DEFAULT)));
+
+ IToken keywordToken = new Token(new TextAttribute(manager
+ .getColor(STPColorConstants.KEYWORD),null,SWT.BOLD));
+
+ IToken commentToken = new Token(new TextAttribute(manager
+ .getColor(STPColorConstants.COMMENT)));
+
+ IToken stringToken = new Token(new TextAttribute(manager
+ .getColor(STPColorConstants.STP_STRING)));
+
+
+ // Build keyword scanner
+ WordRule keywordsRule = new WordRule(new IWordDetector() {
+
+ public boolean isWordStart(char c) {
+ // probe kernel.function("schedule") is a valid name in
+ // Systemtap, but we do not want to highlight the function
+ // here as a keyword. Same with foo.return and so on.
+ if (c == '.') {
+ return true;
+ }
+
+ return Character.isJavaIdentifierStart(c);
+ }
+
+ public boolean isWordPart(char c) {
+ // Set isWordStart for . rule.
+ if (c == '.') {
+ return true;
+ }
+
+ return Character.isJavaIdentifierPart(c);
+ }
+
+ }, defaultToken, true);
+
+ for (int i=0; i<keywordList.length; i++)
+ keywordsRule.addWord(keywordList[i], keywordToken);
+
+ setRules(new IRule[] {
+ new MultiLineRule("/*", "*/", commentToken),
+ new EndOfLineRule("/*", commentToken),
+ new EndOfLineRule("#", commentToken),
+ new EndOfLineRule("//", commentToken),
+ new EndOfLineRule("#if", defaultToken),
+ new EndOfLineRule("#else", defaultToken),
+ new EndOfLineRule("#endif", defaultToken),
+ new EndOfLineRule("#define", defaultToken),
+ new SingleLineRule("\"", "\"", stringToken, '\\'),
+ new SingleLineRule("'", "'", stringToken, '\\'),
+ keywordsRule,
+ new WhitespaceRule(new IWhitespaceDetector() {
+ public boolean isWhitespace(char c) {
+ return Character.isWhitespace(c);
+ }
+ }),
+ });
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPMetadataSingleton.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPMetadataSingleton.java
new file mode 100644
index 0000000000..48bb3adf4b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPMetadataSingleton.java
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Phil Muldoon <pkmuldoon@picobot.org>.
+ *
+ * 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:
+ * Phil Muldoon <pkmuldoon@picobot.org> - initial API and implementation.
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.stp;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.ResourceBundle;
+
+/**
+ *
+ * Build and hold completion metadata fo Systemtap. This originally is generated from stap coverage data
+ *
+ *
+ */
+
+// TODO: Generate a strategy to determine when meta-data is older than what is currently available. Right now
+// the generation of new meta-data is too slow to do this efficiently.
+public class STPMetadataSingleton {
+
+
+ private static STPMetadataSingleton instance = null;
+ private static HashMap<String, ArrayList<String>> builtMetadata = new HashMap<String, ArrayList<String>>();
+
+ private static boolean barLookups = false;
+
+ // Not a true singleton, but enough for the simplistic purpose
+ // it has to serve.
+ protected STPMetadataSingleton() {
+ }
+
+ public static STPMetadataSingleton getInstance() {
+ if (instance == null) {
+ instance = new STPMetadataSingleton();
+ }
+ return instance;
+ }
+
+ /**
+ * Given the parameter return the completion proposals that best match the data.
+ *
+ * @param match - completion hint.
+ *
+ * @return - completion proposals.
+ *
+ */
+ public static String[] getCompletionResults(String match) {
+
+ ArrayList<String> data = new ArrayList<String>();
+
+ // TODO: Until an error strategy is devised to better inform
+ // the user that there was a problem compiling completions other than
+ // a modal error dialog, or a log message use this.
+ if (barLookups)
+ return new String[] {"No completion data found."};
+
+ // Check to see if the proposal hint included a <tapset>.<partialprobe>
+ // or just a <probe>. (ie syscall. or syscall.re).
+ boolean tapsetAndProbeIncluded = isTapsetAndProbe(match);
+
+ // If the result is a tapset and partial probe, get the tapset, then
+ /// narrow down the list with partial probe matches.
+ if (tapsetAndProbeIncluded) {
+ ArrayList<String> temp = builtMetadata.get(getTapset(match));
+ String probe = getTapsetProbe(match);
+ for (int i=0; i<temp.size(); i++) {
+ if (temp.get(i).startsWith(probe)) {
+ data.add(temp.get(i));
+ }
+ }
+ }
+ // If the result was a <tapset>, return all <probe> matches.
+ else
+ data = builtMetadata.get(match);
+
+ if (data == null)
+ return new String[] {};
+ else
+ return data.toArray(new String[0]);
+ }
+
+ /**
+ *
+ * From the file, read the metadata. The data follows the format of
+ *
+ * <tapset>.<probe>(<parameter list>)
+ *
+ * ie
+ *
+ * tcp.disconnect(name:string,sock:long,flags:long)
+ * @param fileURL
+
+ * @throws IOException
+ *
+ */
+ private void readCompletionMetadata(URL fileURL) throws IOException {
+ try {
+ BufferedReader input = new BufferedReader(new FileReader(new File(fileURL.getFile())));
+ try {
+ String line = null;
+ while ((line = input.readLine()) != null) {
+ String tapset = "";
+ String probe = "";
+ try {
+ tapset = getTapset(line);
+ probe = getTapsetProbe(line);
+ } catch (Exception e) {
+ continue;
+ }
+ ArrayList<String> data = builtMetadata.get(tapset);
+ if (data == null)
+ data = new ArrayList<String>();
+
+ data.add(probe);
+ builtMetadata.put(tapset, data);
+ }
+ } finally {
+ input.close();
+ }
+ } catch (IOException ex) {
+ throw ex;
+ }
+ }
+
+ /**
+ * Given data, decide whether it is comprised of a <tapset>.<probe>
+ * hint, or just a <tapset>.
+ *
+ * @param data - hint data
+ * @return
+ */
+ private static boolean isTapsetAndProbe(String data) {
+ if (data.indexOf('.') >= 0)
+ return true;
+
+ return false;
+ }
+
+ /**
+ * Given data, extract <tapset>
+ *
+ * @param data - hint data
+ * @return
+ */
+ private static String getTapset(String data) {
+ int i = data.indexOf('.');
+ if (i < 0)
+ throw new StringIndexOutOfBoundsException();
+ return data.substring(0, data.indexOf('.'));
+ }
+
+ /**
+ * Given data, extract <probe>
+ *
+ * @param data - hint data
+ * @return
+ */
+ private static String getTapsetProbe(String data) {
+ int i = data.indexOf('.');
+ if (i < 0)
+ throw new StringIndexOutOfBoundsException();
+ return data.substring(data.indexOf('.') + 1, data.length());
+ }
+
+ /**
+ *
+ * Decide whether cached metadata exists on disk.
+ *
+ * @return - whether metadata exists.
+ */
+ private boolean haveMetadata(String location) {
+ File fileExists = new File(location);
+ if ((fileExists.canRead()) && fileExists.exists())
+ return true;
+
+ return false;
+ }
+
+ /**
+ *
+ * Build the metadata from visiting the tapsets in turn and
+ * requesting coverage data from each one.
+ *
+ * @throws FileNotFoundException
+ *
+ */
+ private void buildCompletionMetadata(String location) throws FileNotFoundException {
+ String[] tapsets = { "syscall", "signal", "netdev", "ioblock",
+ "ioscheduler", "nd_syscall", "vm", "nfsd", "process", "sunrpc",
+ "scheduler", "scsi", "socket", "tcp", "udp", "generic.fop" };
+ ArrayList<StringBuffer> processedMetadata = new ArrayList<StringBuffer>();
+ boolean openingBracket = false;
+
+ // Execute each tapset, then convert the output from stdin
+ // to a format more acceptable to completion.
+ for (int i = 0; i < tapsets.length; i++) {
+ StringBuffer[] data = executeSystemTap(tapsets[i]);
+ for (int z = 0; z < data.length; z++) {
+ openingBracket = false;
+ for (int c = 0; c < data[z].length(); c++) {
+ if (data[z].charAt(c) == ' ')
+ if (openingBracket == false) {
+ openingBracket = true;
+ data[z].setCharAt(c, '(');
+ } else {
+ data[z].setCharAt(c, ',');
+ }
+ }
+ data[z].append(')');
+ processedMetadata.add(data[z]);
+ }
+
+ }
+
+ // Output massaged data from stdout to a text file.
+ PrintStream out = null;
+ try {
+ out = new PrintStream(new FileOutputStream(location));
+ } catch (FileNotFoundException e) {
+ throw e;
+ }
+ Iterator<StringBuffer> i = processedMetadata.iterator();
+ while (i.hasNext()) {
+ StringBuffer line = i.next();
+ out.println(line.toString().trim());
+ }
+ out.close();
+ }
+
+ /**
+ *
+ * Execute Systemtap binary, cpature stdout and return.
+ *
+ * @param tapset to request coverage data from.
+ * @return
+ */
+
+ // TODO: This could stand to be completely rewritten to be safer,
+ // and be tolerant of faults. As it is we ship default meta-data
+ // so this should never be executed in the user context. But eventually
+ // an option will be made available to the user to regenerate the data.
+ private StringBuffer[] executeSystemTap(String tapset) {
+
+ ArrayList<StringBuffer> data = new ArrayList<StringBuffer>();
+
+ try {
+ String a;
+ Process p = Runtime.getRuntime().exec(
+ "stap -L " + tapset + ".*");
+ BufferedReader in = new BufferedReader(new InputStreamReader(p
+ .getInputStream()), 5000);
+ while ((a = in.readLine()) != null) {
+ data.add(new StringBuffer(a));
+ }
+ p.waitFor();
+ in.close();
+ } catch (IOException e) {
+ return new StringBuffer[] {};
+ }
+
+ catch (java.lang.InterruptedException ie) {
+ return new StringBuffer[] {};
+ }
+
+ return data.toArray(new StringBuffer[0]);
+ }
+
+ public void parse(ResourceBundle bundle) {
+ System.out.println(System.getProperty("user.pwd"));
+
+ System.out.println(System.getProperties());
+ // System.out.println(bundle.containsKey("syscall"));
+ // System.out.println(bundle.containsKey("syscall."));
+ System.out.println(bundle.getKeys());
+ }
+
+ public void build(URL fileURL) {
+ try {
+// if (!haveMetadata(location))
+// buildCompletionMetadata(location);
+ readCompletionMetadata(fileURL);
+ } catch (IOException e) {
+ barLookups = true;
+ }
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPPartitionScanner.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPPartitionScanner.java
new file mode 100644
index 0000000000..0d9194456f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPPartitionScanner.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Phil Muldoon <pkmuldoon@picobot.org>.
+ *
+ * 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:
+ * Phil Muldoon <pkmuldoon@picobot.org> - initial API and implementation.
+ *******************************************************************************/
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.stp;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.rules.EndOfLineRule;
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.IWordDetector;
+import org.eclipse.jface.text.rules.MultiLineRule;
+import org.eclipse.jface.text.rules.RuleBasedPartitionScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WordRule;
+
+public class STPPartitionScanner extends RuleBasedPartitionScanner {
+ public final static String STP_COMMENT = "__stp_comment";
+ public final static String STP_KEYWORD = "__stp_keyword";
+ public final static String STP_STRING = "__stp_string";
+ public final static String STP_CONDITIONAL = "__stp_conditional";
+
+ public static String[] STP_PARTITION_TYPES = { IDocument.DEFAULT_CONTENT_TYPE,
+ STP_COMMENT, STP_KEYWORD, STP_STRING, STP_CONDITIONAL};
+
+ /**
+ * Detect empty comments
+ */
+ static class EmptyCommentDetector implements IWordDetector {
+ public boolean isWordStart(char c) {
+ return (c == '/');
+ }
+
+ public boolean isWordPart(char c) {
+ return (c == '*' || c == '/');
+ }
+ }
+
+ /**
+ * Cope with the empty comment issue.
+ */
+ static class EmptyCommentRule extends WordRule implements IPredicateRule {
+
+ private IToken fSuccessToken;
+
+ public EmptyCommentRule(IToken successToken) {
+ super(new EmptyCommentDetector());
+ fSuccessToken= successToken;
+ addWord("/**/", fSuccessToken); //$NON-NLS-1$
+ }
+
+ public IToken evaluate(ICharacterScanner scanner, boolean resume) {
+ return evaluate(scanner);
+ }
+
+ public IToken getSuccessToken() {
+ return fSuccessToken;
+ }
+ }
+
+ public STPPartitionScanner() {
+
+ IToken stpComment = new Token(STP_COMMENT);
+ IToken stpString = new Token(STP_STRING);
+ IToken stpConditional = new Token(STP_CONDITIONAL);
+
+ // Add special case word rule.
+ EmptyCommentRule emptyCommentRule= new EmptyCommentRule(stpComment);
+
+ setPredicateRules(new IPredicateRule[] {
+ new MultiLineRule("/*", "*/", stpComment),
+ new EndOfLineRule("/*", stpComment),
+ new EndOfLineRule("#", stpComment),
+ new EndOfLineRule("//", stpComment),
+ emptyCommentRule,
+ new EndOfLineRule("#if", stpConditional),
+ new EndOfLineRule("#else", stpConditional),
+ new EndOfLineRule("#endif", stpConditional),
+ new EndOfLineRule("#define", stpConditional),
+ new SingleLineRule("\"", "\"", stpString, '\\'),
+ new SingleLineRule("'", "'", stpString, '\\'),
+ });
+
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPPartitioner.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPPartitioner.java
new file mode 100644
index 0000000000..3fa549ed82
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPPartitioner.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * 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:
+ * Red Hat - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.stp;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITypedRegion;
+import org.eclipse.jface.text.rules.FastPartitioner;
+import org.eclipse.jface.text.rules.IPartitionTokenScanner;
+
+public class STPPartitioner extends FastPartitioner {
+
+ /**
+ * Straight forward FastPartitioner, with debug output.
+ *
+ * Taken directly from org.eclipse.linuxtools.rpm.ui.editor.SpecFilePartitioner.
+ * No noteworthy alterations so Copyright header and license text untouched.
+ *
+ * @param scanner
+ * @param legalContentTypes
+ */
+ public STPPartitioner(IPartitionTokenScanner scanner, String[] legalContentTypes) {
+ super(scanner, legalContentTypes);
+ }
+
+ @Override
+ public void connect(IDocument document, boolean delayInitialization) {
+ super.connect(document, delayInitialization);
+// printPartitions(document);
+ }
+
+ public void printPartitions(IDocument document) {
+ StringBuffer buffer = new StringBuffer();
+ ITypedRegion[] partitions = computePartitioning(0, document.getLength());
+ for (int i = 0; i < partitions.length; i++) {
+ try {
+ buffer.append("Partition type: "
+ + partitions[i].getType()
+ + ", offset: " + partitions[i].getOffset()
+ + ", length: " + partitions[i].getLength());
+ buffer.append("\n");
+ buffer.append("Text:\n");
+ buffer.append(document.get(partitions[i].getOffset(),
+ partitions[i].getLength()));
+ buffer.append("\n---------------------------------------\n\n\n");
+ } catch (org.eclipse.jface.text.BadLocationException e) {
+ e.printStackTrace();
+ }
+ }
+ System.out.println(buffer);
+ };
+
+}
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java
new file mode 100644
index 0000000000..41a72657c7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java
@@ -0,0 +1,278 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Phil Muldoon <pkmuldoon@picobot.org>.
+ *
+ * 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:
+ * Phil Muldoon <pkmuldoon@picobot.org> - initial API and implementation.
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.editors.stp;
+
+import java.util.ArrayList;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.reconciler.DirtyRegion;
+import org.eclipse.jface.text.reconciler.IReconcilingStrategy;
+import org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ *
+ * Reconciling strategy for Systemtap editor code folding positions. The positional aspects
+ * of document tag discovery should really be placed with a position builder
+ *
+ */
+public class STPReconcilingStrategy implements IReconcilingStrategy,
+ IReconcilingStrategyExtension {
+
+ // Constants
+ protected static final int STP_NO_TAG = 0;
+ protected static final int STP_MULTILINE_COMMENT_TAG = 1;
+ protected static final int STP_PROBE = 2;
+ protected static final int STP_FUNCTION = 3;
+
+ // Next Character Position
+ protected int nextCharPosition = 0;
+
+ // Current tag start
+ protected int currentTagStart = 0;
+
+ // Current tag end
+ protected int currentTagEnd = 0;
+
+ // List of positions
+ protected final ArrayList<Position> documentPositionList = new ArrayList<Position>();
+
+ // The end offset of the range to be scanned *//*
+ protected int endOfDocumentPostion;
+
+ private IDocument currentDocument;
+ private STPEditor currentEditor;
+
+ /**
+ * Sets the current editor.
+ */
+ public void setEditor(STPEditor editor) {
+ this.currentEditor = editor;
+ }
+
+ /**
+ * Sets the current (ie working) document.
+ */
+ public void setDocument(IDocument document) {
+ this.currentDocument = document;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.IRegion)
+ */
+ public void reconcile(IRegion partition) {
+ // Just rebuild the whole document
+ initialReconcile();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.reconciler.IReconcilingStrategy#reconcile(org.eclipse.jface.text.reconciler.DirtyRegion, org.eclipse.jface.text.IRegion)
+ */
+ public void reconcile(DirtyRegion dirtyRegion, IRegion subRegion) {
+ //Just rebuild the whole document
+ initialReconcile();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension#initialReconcile()
+ */
+ public void initialReconcile() {
+ endOfDocumentPostion = currentDocument.getLength();
+ try {
+ calculatePositions();
+ } catch (BadLocationException e) {
+ // Cannot reconcile, return
+ return;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.reconciler.IReconcilingStrategyExtension#setProgressMonitor(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void setProgressMonitor(IProgressMonitor monitor) {
+
+ }
+
+ /**
+ *
+ * From currentDocument, calculate beginning of document
+ * to endOfDocumentPostion to build positions for code folding.
+ *
+ * @throws BadLocationException
+ */
+ private void calculatePositions() throws BadLocationException {
+ // Clear old positions and reset to beginning of document
+ documentPositionList.clear();
+ nextCharPosition = 0;
+
+ // Build the actual document positions
+ buildPositions();
+
+ // Paint the folding annotations in the background.
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ currentEditor.updateFoldingStructure(documentPositionList);
+ }
+ });
+ }
+
+ /**
+ *
+ * Start trying to guess if given char z, what - if any - tag this
+ * begins.
+ *
+ * @param location - location of current position
+ * @return - tag type, if any
+ *
+ * @throws BadLocationException
+ */
+ private int classifyComponent(int location) throws BadLocationException {
+ int deltaLocation = location;
+ char ch = currentDocument.getChar(deltaLocation);
+ switch (ch) {
+ // The 'comment' case.
+ case '/':
+ deltaLocation++;
+ ch = currentDocument.getChar(deltaLocation);
+ if (ch == '*') {
+ currentTagStart = location;
+ deltaLocation++;
+ nextCharPosition = deltaLocation;
+ return STP_MULTILINE_COMMENT_TAG;
+ }
+ break;
+ // The 'probe' case.
+ case 'p':
+ if (isProbe()) {
+ currentTagStart = location;
+ return STP_PROBE;
+ }
+
+ // The 'function' case.
+ case 'f':
+ if (isFunction()) {
+ currentTagStart = location;
+ return STP_FUNCTION;
+ }
+ // No tag, don't fold region.
+ default:
+ break;
+ }
+ return STP_NO_TAG;
+ }
+
+ /**
+ *
+ * Build a list of locations to mark beginning and end of folding regions.
+ *
+ * @throws BadLocationException
+ */
+ private void buildPositions() throws BadLocationException {
+ while (nextCharPosition < endOfDocumentPostion) {
+ switch (classifyComponent(nextCharPosition))
+ {
+ // All of these cases have found the beginning of a tag
+ // to start folding. Each element must now be find
+ // the end of the region it represents.
+ case STP_MULTILINE_COMMENT_TAG:
+ currentTagEnd = findEndOfComment();
+ writePosition(currentTagStart,currentTagEnd);
+ nextCharPosition = currentTagStart + currentTagEnd;
+ break;
+ case STP_PROBE:
+ case STP_FUNCTION:
+ currentTagEnd = findEndOfProbeOrFunction();
+ writePosition(currentTagStart,currentTagEnd);
+ nextCharPosition = currentTagStart + currentTagEnd;
+ break;
+ default:
+ nextCharPosition++;
+ break;
+ }
+ }
+ }
+
+ /**
+ *
+ * Write a Position to the position list.
+ *
+ * @param startOffset - start of position in the document.
+ * @param length - length of position.
+ *
+ */
+ protected void writePosition(int startOffset, int length) {
+ if (length > 0)
+ documentPositionList.add(new Position(startOffset, length));
+ }
+
+ private boolean isProbe() throws BadLocationException {
+ return matchKeyWord("probe");
+ }
+
+ private boolean isFunction() throws BadLocationException {
+ return matchKeyWord("function");
+ }
+
+ private boolean matchKeyWord(String word) throws BadLocationException {
+ StringBuffer keyWord = new StringBuffer();
+ int location = nextCharPosition;
+ while (location < endOfDocumentPostion) {
+ char ch = currentDocument.getChar(location);
+ if ((ch == ' ') || (!Character.isLetter(ch)))
+ break;
+ else
+ keyWord.append(ch);
+ location++;
+ }
+ if (keyWord.toString().compareTo(word) == 0)
+ return true;
+ return false;
+ }
+
+ private int findEndOfProbeOrFunction() throws BadLocationException {
+ int bracketCount = 0;
+ boolean firstBracket = false;
+ char ch;
+
+ while (nextCharPosition < endOfDocumentPostion) {
+ ch = currentDocument.getChar(nextCharPosition);
+ if (ch == '{') {
+ firstBracket = true;
+ bracketCount++;
+ }
+ if (ch == '}')
+ bracketCount--;
+ if ((bracketCount == 0) && (firstBracket))
+ return (nextCharPosition-currentTagStart)+2;
+ nextCharPosition++;
+ }
+ return -1;
+ }
+
+ private int findEndOfComment() throws BadLocationException {
+ while (nextCharPosition < endOfDocumentPostion) {
+ char ch = currentDocument.getChar(nextCharPosition);
+ if (ch == '*') {
+ nextCharPosition++;
+ ch = currentDocument.getChar(nextCharPosition);
+ if (ch == '/')
+ return (nextCharPosition-currentTagStart)+2;
+ }
+ nextCharPosition++;
+ }
+ return -1;
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/strings.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/strings.properties
new file mode 100644
index 0000000000..8767bb5cea
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/editors/stp/strings.properties
@@ -0,0 +1,568 @@
+syscall.accept(name:string,sockfd:long,addr_uaddr:long,addrlen_uaddr:long,argstr:string)
+syscall.access(name:string,pathname:string,mode:long,mode_str:string,argstr:string)
+syscall.acct(name:string,filename:string,argstr:string)
+syscall.add_key(name:string,type_uaddr:long,description_auddr:long,payload_uaddr:long,plen:long,ringid:long,argstr:string)
+syscall.adjtimex(name:string,argstr:string)
+syscall.alarm(name:string,seconds:long,argstr:string)
+syscall.arch_prctl(name:string,code:long,addr:long,argstr:string)
+syscall.bdflush(name:string,func:long,data:long,data_str:string,argstr:string)
+syscall.bind(name:string,sockfd:long,my_addr_uaddr:long,addrlen:long,argstr:string)
+syscall.brk(name:string,brk:long,argstr:string)
+syscall.capget(name:string,header_uaddr:long,data_uaddr:long,argstr:string)
+syscall.capset(name:string,header_uaddr:long,data_uaddr:long,argstr:string)
+syscall.chdir(name:string,path:string,argstr:string)
+syscall.chmod(name:string,path:string,mode:long,argstr:string)
+syscall.chown(name:string,path:string,owner:long,group:long,argstr:string)
+syscall.chown16(name:string,path:string,owner:long,group:long,argstr:string)
+syscall.chroot(name:string,path:string,argstr:string)
+syscall.clock_getres(name:string,clk_id:long,clk_id_str:string,res_uaddr:long,argstr:string)
+syscall.clock_gettime(name:string,clk_id:long,clk_id_str:string,argstr:string)
+syscall.clock_nanosleep(name:string,flag_str:string,argstr:string)
+syscall.clock_settime(name:string,clk_id:long,clk_id_str:string,tp_uaddr:long,argstr:string)
+syscall.close(name:string,fd:long,argstr:string)
+syscall.compat_adjtimex(name:string,argstr:string)
+syscall.compat_clock_nanosleep(name:string,flag_str:string,argstr:string)
+syscall.compat_execve(name:string,filename:string,args:string,argstr:string)
+syscall.compat_futex(name:string,futex_uaddr:long,op:long,val:long,utime_uaddr:long,uaddr2_uaddr:long,val3:long,argstr:string)
+syscall.compat_futimesat(name:string,dirfd:long,filename_uaddr:long,filename:string,tvp_uaddr:long,argstr:string)
+syscall.compat_getitimer(name:string,which:long,value_uaddr:long,argstr:string)
+syscall.compat_io_setup(name:string,maxevents:long,ctxp_uaddr:long,argstr:string)
+syscall.compat_io_submit(name:string,ctx_id:long,nr:long,iocbpp_uaddr:long,argstr:string)
+syscall.compat_nanosleep(name:string,req_uaddr:long,rem_uaddr:long,argstr:string)
+syscall.compat_ppoll(name:string,argstr:string)
+syscall.compat_pselect6(name:string,argstr:string)
+syscall.compat_pselect7a(name:string,argstr:string)
+syscall.compat_select(name:string,n:long,readfds_uaddr:long,writefds_uaddr:long,exceptfds_uaddr:long,timeout_uaddr:long,argstr:string)
+syscall.compat_setitimer(name:string,which:long,value_uaddr:long,ovalue_uaddr:long,argstr:string)
+syscall.compat_signalfd(name:string,argstr:string)
+syscall.compat_sys_msgctl(name:string,argstr:string)
+syscall.compat_sys_msgrcv(name:string,argstr:string)
+syscall.compat_sys_msgsnd(name:string,argstr:string)
+syscall.compat_sys_recvmsg(name:string,s:long,msg_uaddr:long,flags:long,argstr:string)
+syscall.compat_sys_semctl(name:string,argstr:string)
+syscall.compat_sys_semtimedop(name:string,semid:long,sops_uaddr:long,nsops:long,timeout_uaddr:long,argstr:string)
+syscall.compat_sys_sendmsg(name:string,s:long,msg_uaddr:long,flags:long,argstr:string)
+syscall.compat_sys_shmat(name:string,first:long,second:long,third:long,uptr_uaddr:long,argstr:string)
+syscall.compat_sys_shmctl(name:string,first:long,second:long,uptr_uaddr:long,argstr:string)
+syscall.compat_sys_utimes(name:string,filename:string,argstr:string)
+syscall.compat_utime(name:string,filename_uaddr:long,filename:string,buf_uaddr:long,actime:long,modtime:long,argstr:string)
+syscall.compat_utimensat(name:string,argstr:string)
+syscall.compat_vmsplice(name:string,argstr:string)
+syscall.connect(name:string,sockfd:long,serv_addr_uaddr:long,addrlen:long,argstr:string)
+syscall.creat(name:string,mode:long,pathname:string,argstr:string)
+syscall.delete_module(name:string,name_user:string,flags:long,argstr:string)
+syscall.dup(name:string,oldfd:long,argstr:string)
+syscall.dup2(name:string,oldfd:long,newfd:long,argstr:string)
+syscall.epoll_create(name:string,size:long,argstr:string)
+syscall.epoll_ctl(name:string,epfd:long,op:long,op_str:string,fd:long,event_uaddr:long,argstr:string)
+syscall.epoll_pwait(name:string,argstr:string)
+syscall.epoll_wait(name:string,epfd:long,events_uaddr:long,maxevents:long,timeout:long,argstr:string)
+syscall.eventfd(name:string,argstr:string)
+syscall.execve(name:string,filename:string,args:string,argstr:string)
+syscall.exit(name:string,status:long,argstr:string)
+syscall.exit_group(name:string,status:long,argstr:string)
+syscall.faccessat(name:string,dfd:long,dfd_str:string,filename:long,filename_str:string,mode:long,mode_str:string,argstr:string)
+syscall.fadvise64(name:string,fs:long,offset:long,len:long,advice:long,argstr:string)
+syscall.fadvise64_64(name:string,fs:long,offset:long,len:long,advice:long,argstr:string)
+syscall.fchdir(name:string,fd:long,argstr:string)
+syscall.fchmod(name:string,fildes:long,mode:long,argstr:string)
+syscall.fchmodat(name:string,dfd:long,dfd_str:string,filename:long,filename_str:string,mode:long,argstr:string)
+syscall.fchown(name:string,fd:long,owner:long,group:long,argstr:string)
+syscall.fchown16(name:string,fd:long,owner:long,group:long,argstr:string)
+syscall.fchownat(name:string,dfd:long,dfd_str:string,filename:long,filename_str:string,user:long,group:long,flag:long,flag_str:string,argstr:string)
+syscall.fcntl(name:string,fd:long,cmd:long,cmd_str:string,arg:long,argstr:string)
+syscall.fdatasync(name:string,fd:long,argstr:string)
+syscall.fgetxattr(name:string,filedes:long,name2:string,value_uaddr:long,size:long,argstr:string)
+syscall.flistxattr(name:string,filedes:long,list_uaddr:long,size:long,argstr:string)
+syscall.flock(name:string,fd:long,operation:long,argstr:string)
+syscall.fork(clone_flags:long,stack_start:long,regs:long,stack_size:long,parent_tid_uaddr:long,child_tid_uaddr:long,name:string,argstr:string)
+syscall.fremovexattr(name:string,filedes:long,name_uaddr:long,argstr:string)
+syscall.fsetxattr(name:string,filedes:long,name2:string,value_uaddr:long,size:long,flags:long,argstr:string)
+syscall.fstat(name:string,filedes:long,buf_uaddr:long,argstr:string)
+syscall.fstatat(name:string,dirfd:long,path:string,buf_uaddr:long,argstr:string)
+syscall.fstatfs(name:string,fd:long,buf_uaddr:long,argstr:string)
+syscall.fstatfs64(name:string,fd:long,sz:long,buf_uaddr:long,argstr:string)
+syscall.fsync(name:string,fd:long,argstr:string)
+syscall.ftruncate(name:string,fd:long,length:long,argstr:string)
+syscall.futex(name:string,futex_uaddr:long,op:long,val:long,utime_uaddr:long,uaddr2_uaddr:long,val3:long,argstr:string)
+syscall.futimesat(name:string,dirfd:long,filename_uaddr:long,filename:string,tvp_uaddr:long,argstr:string)
+syscall.get_mempolicy(name:string,policy_uaddr:long,nmask_uaddr:long,maxnode:long,addr:long,flags:long,argstr:string)
+syscall.getcwd(name:string,buf_uaddr:long,size:long,argstr:string)
+syscall.getdents(name:string,fd:long,dirp_uaddr:long,count:long,argstr:string)
+syscall.getegid(name:string,argstr:string)
+syscall.geteuid(name:string,argstr:string)
+syscall.getgid(name:string,argstr:string)
+syscall.getgroups(name:string,size:long,list_uaddr:long,argstr:string)
+syscall.gethostname(name:string,name_uaddr:long,len:long,argstr:string)
+syscall.getitimer(name:string,which:long,value_uaddr:long,argstr:string)
+syscall.getpeername(name:string,s:long,name_uaddr:long,namelen_uaddr:long,argstr:string)
+syscall.getpgid(name:string,pid:long,argstr:string)
+syscall.getpgrp(name:string,argstr:string)
+syscall.getpid(name:string,argstr:string)
+syscall.getppid(name:string,argstr:string)
+syscall.getpriority(name:string,which:long,who:long,argstr:string)
+syscall.getresgid(name:string,rgid_uaddr:long,egid_uaddr:long,sgid_uaddr:long,argstr:string)
+syscall.getresuid(name:string,ruid_uaddr:long,euid_uaddr:long,suid_uaddr:long,argstr:string)
+syscall.getrlimit(name:string,resource:long,rlim_uaddr:long,argstr:string)
+syscall.getrusage(name:string,who:long,who_str:string,usage_uaddr:long,argstr:string)
+syscall.getsid(name:string,pid:long,argstr:string)
+syscall.getsockname(name:string,s:long,name_uaddr:long,namelen_uaddr:long,argstr:string)
+syscall.getsockopt(name:string,fd:long,level:long,level_str:string,optname:long,optname_str:string,optval_uaddr:long,optlen_uaddr:long,argstr:string)
+syscall.gettid(name:string,argstr:string)
+syscall.gettimeofday(name:string,tv_uaddr:long,tz_uaddr:long,argstr:string)
+syscall.getuid(name:string,argstr:string)
+syscall.getxattr(name:string,path:string,name2:string,value_uaddr:long,size:long,argstr:string)
+syscall.init_module(name:string,umod_uaddr:long,len:long,uargs:string,argstr:string)
+syscall.inotify_add_watch(name:string,fd:long,mask:long,path_uaddr:long,path:string,argstr:string)
+syscall.inotify_init(name:string,argstr:string)
+syscall.inotify_rm_watch(name:string,fd:long,wd:long,argstr:string)
+syscall.io_cancel(name:string,ctx_id:long,iocb_uaddr:long,result_uaddr:long,argstr:string)
+syscall.io_destroy(name:string,ctx:long,argstr:string)
+syscall.io_getevents(name:string,ctx_id:long,min_nr:long,nr:long,events_uaddr:long,timeout_uaddr:long,timestr:string,argstr:string)
+syscall.io_setup(name:string,maxevents:long,ctxp_uaddr:long,argstr:string)
+syscall.io_submit(name:string,ctx_id:long,nr:long,iocbpp_uaddr:long,argstr:string)
+syscall.ioctl(name:string,fd:long,request:long,argp:long,argstr:string)
+syscall.ioperm(name:string,from:long,num:long,turn_on:long,argstr:string)
+syscall.iopl(name:string,level:long,argstr:string)
+syscall.ioprio_get(name:string,which:long,who:long,argstr:string)
+syscall.ioprio_set(name:string,which:long,who:long,ioprio:long,argstr:string)
+syscall.kexec_load(name:string,entry:long,nr_segments:long,segments_uaddr:long,flags:long,argstr:string)
+syscall.keyctl(name:string,argstr:string)
+syscall.kill(name:string,pid:long,sig:long,argstr:string)
+syscall.lchown(name:string,path:string,owner:long,group:long,argstr:string)
+syscall.lchown16(name:string,path:string,owner:long,group:long,argstr:string)
+syscall.lgetxattr(name:string,path:string,name2:string,value_uaddr:long,size:long,argstr:string)
+syscall.link(name:string,oldpath:string,newpath:string,argstr:string)
+syscall.linkat(name:string,olddfd:long,olddfd_str:string,oldname:long,oldname_str:string,newdfd:long,newdfd_str:string,newname:long,newname_str:string,flags:long,flags_str:string,argstr:string)
+syscall.listen(name:string,sockfd:long,backlog:long,argstr:string)
+syscall.listxattr(name:string,list_uaddr:long,size:long,path_uaddr:long,path:string,argstr:string)
+syscall.llistxattr(name:string,list_uaddr:long,size:long,path_uaddr:long,path:string,argstr:string)
+syscall.llseek(name:string,fd:long,offset_high:long,offset_low:long,result_uaddr:long,whence:long,whence_str:string,argstr:string)
+syscall.lookup_dcookie(name:string,cookie:long,buffer_uaddr:long,len:long,argstr:string)
+syscall.lremovexattr(name:string,name_uaddr:long,name2:string,path_uaddr:long,path:string,argstr:string)
+syscall.lseek(name:string,fildes:long,offset:long,whence:long,whence_str:string,argstr:string)
+syscall.lsetxattr(name:string,path_uaddr:long,path:string,name_uaddr:long,name_str:string,value_uaddr:long,size:long,flags:long,argstr:string)
+syscall.lstat(name:string,path:string,buf_uaddr:long,argstr:string)
+syscall.madvise(name:string,start:long,length:long,advice:long,advice_str:string,argstr:string)
+syscall.mbind(name:string,start:long,len:long,mode:long,nmask_uaddr:long,maxnode:long,flags:long,argstr:string)
+syscall.migrate_pages(name:string,argstr:string)
+syscall.mincore(name:string,start:long,length:long,vec_uaddr:long,argstr:string)
+syscall.mkdir(name:string,pathname_uaddr:long,pathname:string,mode:long,argstr:string)
+syscall.mkdirat(name:string,dirfd:long,pathname:string,mode:long,argstr:string)
+syscall.mknod(name:string,pathname:string,mode:long,dev:long,argstr:string)
+syscall.mknodat(name:string,dfd:long,dfd_str:string,filename:long,filename_str:string,mode:long,mode_str:string,dev:long,argstr:string)
+syscall.mlock(name:string,addr:long,len:long,argstr:string)
+syscall.mlockall(name:string,flags:long,argstr:string)
+syscall.mmap(name:string,start:long,len:long,prot:long,flags:long,fd:long,offset:long,argstr:string)
+syscall.mmap2(name:string,argstr:string)
+syscall.mmap32(name:string,argstr:string)
+syscall.modify_ldt(name:string,func:long,ptr_uaddr:long,bytecount:long,argstr:string)
+syscall.mount(name:string,source:string,target:string,filesystemtype:string,mountflags:long,mountflags_str:string,data:string,argstr:string)
+syscall.move_pages(name:string,argstr:string)
+syscall.mprotect(name:string,addr:long,len:long,prot:long,prot_str:string,argstr:string)
+syscall.mq_getsetattr(name:string,mqdes:long,u_mqstat_uaddr:long,u_omqstat_uaddr:long,argstr:string)
+syscall.mq_notify(name:string,mqdes:long,notification_uaddr:long,argstr:string)
+syscall.mq_open(name:string,name_uaddr:long,filename:string,mode:long,u_attr_uaddr:long,oflag:long,argstr:string)
+syscall.mq_timedreceive(name:string,mqdes:long,msg_ptr_uaddr:long,msg_len:long,msg_prio_uaddr:long,abs_timout_uaddr:long,argstr:string)
+syscall.mq_timedsend(name:string,mqdes:long,msg_ptr_uaddr:long,msg_len:long,msg_prio:long,abs_timeout_uaddr:long,argstr:string)
+syscall.mq_unlink(name:string,u_name_uaddr:long,u_name:string,argstr:string)
+syscall.mremap(name:string,old_address:long,old_size:long,new_size:long,flags:long,new_address:long,argstr:string)
+syscall.msgctl(name:string,msqid:long,cmd:long,buf_uaddr:long,argstr:string)
+syscall.msgget(name:string,key:long,msgflg:long,msgflg_str:string,argstr:string)
+syscall.msgrcv(name:string,msqid:long,msgp_uaddr:long,msgsz:long,msgtyp:long,msgflg:long,argstr:string)
+syscall.msgsnd(name:string,msqid:long,msgp_uaddr:long,msgsz:long,msgflg:long,argstr:string)
+syscall.msync(name:string,start:long,length:long,flags:long,argstr:string)
+syscall.munlock(name:string,addr:long,len:long,argstr:string)
+syscall.munlockall(name:string,argstr:string)
+syscall.munmap(name:string,start:long,length:long,argstr:string)
+syscall.nanosleep(name:string,req_uaddr:long,rem_uaddr:long,argstr:string)
+syscall.nfsservctl(name:string,cmd:long,argp_uaddr:long,resp_uaddr:long,argstr:string)
+syscall.ni_syscall(name:string,argstr:string)
+syscall.nice(name:string,inc:long,argstr:string)
+syscall.open(name:string,filename:string,flags:long,mode:long,argstr:string)
+syscall.openat(name:string,filename:string,flags:long,mode:long,argstr:string)
+syscall.pause(name:string,argstr:string)
+syscall.personality(name:string,persona:long,argstr:string)
+syscall.pipe(name:string,argstr:string)
+syscall.pipe32(name:string,argstr:string)
+syscall.pivot_root(name:string,new_root_str:string,old_root_str:string,argstr:string)
+syscall.poll(name:string,ufds_uaddr:long,nfds:long,timeout:long,argstr:string)
+syscall.ppoll(name:string,argstr:string)
+syscall.prctl(name:string,option:long,arg2:long,arg3:long,arg4:long,arg5:long,argstr:string)
+syscall.pread(name:string,fd:long,buf_uaddr:long,count:long,offset:long,argstr:string)
+syscall.pselect6(name:string,argstr:string)
+syscall.pselect7(name:string,argstr:string)
+syscall.ptrace(name:string,request:long,pid:long,addr:long,data:long,argstr:string)
+syscall.pwrite(name:string,fd:long,buf_uaddr:long,count:long,offset:long,argstr:string)
+syscall.quotactl(name:string,cmd:long,cmd_str:string,special:long,special_str:string,id:long,addr_uaddr:long,argstr:string)
+syscall.read(name:string,fd:long,buf_uaddr:long,count:long,argstr:string)
+syscall.readahead(name:string,fd:long,offset:long,count:long,argstr:string)
+syscall.readdir(name:string,argstr:string)
+syscall.readlink(name:string,path:string,buf_uaddr:long,bufsiz:long,argstr:string)
+syscall.readlinkat(name:string,dfd:long,buf_uaddr:long,bufsiz:long,path:string,argstr:string)
+syscall.readv(name:string,vector_uaddr:long,count:long,fd:long,argstr:string)
+syscall.reboot(name:string,magic:long,magic_str:string,magic2:long,magic2_str:string,flag:long,flag_str:string,arg_uaddr:long,argstr:string)
+syscall.recv(name:string,s:long,buf_uaddr:long,len:long,flags:long,flags_str:string,argstr:string)
+syscall.recvfrom(name:string,s:long,buf_uaddr:long,len:long,flags:long,flags_str:string,addr_uaddr:long,addrlen_uaddr:long,argstr:string)
+syscall.recvmsg(name:string,s:long,msg_uaddr:long,flags:long,flags_str:string,argstr:string)
+syscall.remap_file_pages(name:string,start:long,size:long,prot:long,pgoff:long,flags:long,argstr:string)
+syscall.removexattr(name:string,name_str:string,path:string,argstr:string)
+syscall.rename(name:string,oldpath:string,newpath:string,argstr:string)
+syscall.renameat(name:string,olddfd:long,olddfd_str:string,oldname:long,oldname_str:string,newdfd:long,newdfd_str:string,newname:long,newname_str:string,argstr:string)
+syscall.request_key(name:string,type_uaddr:long,description_uaddr:long,callout_info_uaddr:long,destringid:long,argstr:string)
+syscall.restart_syscall(name:string,argstr:string)
+syscall.rmdir(name:string,pathname:string,argstr:string)
+syscall.rt_sigaction(name:string,sig:long,act_uaddr:long,oact_uaddr:long,sigsetsize:long,argstr:string)
+syscall.rt_sigaction32(name:string,sig:long,act_uaddr:long,oact_uaddr:long,sigsetsize:long,argstr:string)
+syscall.rt_sigpending(name:string,set_uaddr:long,sigsetsize:long,argstr:string)
+syscall.rt_sigprocmask(name:string,how:long,how_str:string,set_uaddr:long,oldset_uaddr:long,argstr:string)
+syscall.rt_sigqueueinfo(name:string,pid:long,sig:long,uinfo_uaddr:long,argstr:string)
+syscall.rt_sigreturn(name:string,argstr:string)
+syscall.rt_sigsuspend(name:string,argstr:string)
+syscall.rt_sigtimedwait(name:string,uthese_uaddr:long,uinfo_uaddr:long,uts_uaddr:long,sigsetsize:long,argstr:string)
+syscall.sched_get_priority_max(name:string,policy:long,argstr:string)
+syscall.sched_get_priority_min(name:string,policy:long,argstr:string)
+syscall.sched_getaffinity(name:string,pid:long,len:long,mask_uaddr:long,argstr:string)
+syscall.sched_getparam(name:string,pid:long,p_uaddr:long,argstr:string)
+syscall.sched_getscheduler(name:string,pid:long,argstr:string)
+syscall.sched_rr_get_interval(name:string,pid:long,tp_uaddr:long,argstr:string)
+syscall.sched_setaffinity(name:string,pid:long,len:long,mask_uaddr:long,argstr:string)
+syscall.sched_setparam(name:string,pid:long,p_uaddr:long,argstr:string)
+syscall.sched_setscheduler(name:string,pid:long,policy:long,policy_str:string,p_uaddr:long,argstr:string)
+syscall.sched_yield(name:string,argstr:string)
+syscall.select(name:string,n:long,readfds_uaddr:long,writefds_uaddr:long,exceptfds_uaddr:long,timeout_uaddr:long,argstr:string)
+syscall.semctl(name:string,semid:long,semnum:long,cmd:long,argstr:string)
+syscall.semget(name:string,key:long,nsems:long,semflg:long,argstr:string)
+syscall.semop(name:string,semid:long,tsops_uaddr:long,nsops:long,argstr:string)
+syscall.semtimedop(name:string,semid:long,sops_uaddr:long,nsops:long,timeout_uaddr:long,argstr:string)
+syscall.send(name:string,s:long,buf_uaddr:long,len:long,flags:long,flags_str:string,argstr:string)
+syscall.sendfile(name:string,out_fd:long,in_fd:long,offset_uaddr:long,count:long,argstr:string)
+syscall.sendmsg(name:string,s:long,msg_uaddr:long,flags:long,flags_str:string,argstr:string)
+syscall.sendto(name:string,s:long,buf_uaddr:long,len:long,flags:long,flags_str:string,to_uaddr:long,tolen:long,argstr:string)
+syscall.set_mempolicy(name:string,mode:long,nmask_uaddr:long,maxnode:long,argstr:string)
+syscall.set_tid_address(name:string,tidptr_uaddr:long,argstr:string)
+syscall.setdomainname(name:string,hostname_uaddr:long,len:long,argstr:string)
+syscall.setfsgid(name:string,fsgid:long,argstr:string)
+syscall.setfsuid(name:string,fsuid:long,argstr:string)
+syscall.setgid(name:string,gid:long,argstr:string)
+syscall.setgroups(name:string,size:long,list_uaddr:long,argstr:string)
+syscall.sethostname(name:string,hostname_uaddr:long,name_str:string,len:long,argstr:string)
+syscall.setitimer(name:string,which:long,value_uaddr:long,ovalue_uaddr:long,argstr:string)
+syscall.setpgid(name:string,pid:long,pgid:long,argstr:string)
+syscall.setpriority(name:string,which:long,which_str:string,who:long,prio:long,argstr:string)
+syscall.setregid(name:string,rgid:long,egid:long,argstr:string)
+syscall.setregid16(name:string,rgid:long,egid:long,argstr:string)
+syscall.setresgid(name:string,rgid:long,egid:long,sgid:long,argstr:string)
+syscall.setresgid16(name:string,rgid:long,egid:long,sgid:long,argstr:string)
+syscall.setresuid(name:string,ruid:long,euid:long,suid:long,argstr:string)
+syscall.setresuid16(name:string,ruid:long,euid:long,suid:long,argstr:string)
+syscall.setreuid(name:string,ruid:long,euid:long,argstr:string)
+syscall.setreuid16(name:string,ruid:long,euid:long,argstr:string)
+syscall.setrlimit(name:string,resource:long,rlim_uaddr:long,argstr:string)
+syscall.setsid(name:string,argstr:string)
+syscall.setsockopt(name:string,fd:long,level:long,level_str:string,optname:long,optname_str:string,optval_uaddr:long,optlen:long,argstr:string)
+syscall.settimeofday(name:string,tv_uaddr:long,tz_uaddr:long,argstr:string)
+syscall.settimeofday32(name:string,tv_uaddr:long,tz_uaddr:long,argstr:string)
+syscall.setuid(name:string,uid:long,argstr:string)
+syscall.setxattr(name:string,path_uaddr:long,path:string,name_uaddr:long,name_str:string,value_uaddr:long,size:long,flags:long,argstr:string)
+syscall.sgetmask(name:string,argstr:string)
+syscall.shmat(name:string,shmid:long,shmaddr_uaddr:long,shmflg:long,argstr:string)
+syscall.shmctl(name:string,shmid:long,cmd:long,buf_uaddr:long,argstr:string)
+syscall.shmdt(name:string,shmaddr_uaddr:long,argstr:string)
+syscall.shmget(name:string,key:long,size:long,shmflg:long,argstr:string)
+syscall.shutdown(name:string,s:long,how:long,how_str:string,argstr:string)
+syscall.sigaction32(name:string,sig:long,act_uaddr:long,oact_uaddr:long,argstr:string)
+syscall.sigaltstack(name:string,uss_uaddr:long,uoss_uaddr:long,regs_uaddr:long,argstr:string)
+syscall.signal(name:string,sig:long,handler:long,argstr:string)
+syscall.signalfd(name:string,argstr:string)
+syscall.sigpending(name:string,argstr:string)
+syscall.sigprocmask(name:string,how:long,how_str:string,set_uaddr:long,oldset_uaddr:long,argstr:string)
+syscall.sigreturn(name:string,argstr:string)
+syscall.sigsuspend(name:string,argstr:string)
+syscall.socket(name:string,family:long,type:long,protocol:long,argstr:string)
+syscall.socketpair(name:string,family:long,type:long,protocol:long,sv_uaddr:long,argstr:string)
+syscall.splice(name:string,argstr:string)
+syscall.ssetmask(name:string,newmask:long,argstr:string)
+syscall.stat(name:string,filename_uaddr:long,filename:string,buf_uaddr:long,argstr:string)
+syscall.statfs(name:string,buf_uaddr:long,path:string,argstr:string)
+syscall.statfs64(name:string,sz:long,buf_uaddr:long,path:string,argstr:string)
+syscall.stime(name:string,t_uaddr:long,argstr:string)
+syscall.swapoff(name:string,path:string,argstr:string)
+syscall.swapon(name:string,path:string,swapflags:long,argstr:string)
+syscall.symlink(name:string,oldpath:string,newpath:string,argstr:string)
+syscall.symlinkat(name:string,oldname:long,oldname_str:string,newdfd:long,newdfd_str:string,newname:long,newname_str:string,argstr:string)
+syscall.sync(name:string,argstr:string)
+syscall.sysctl(name:string,argstr:string)
+syscall.sysctl32(name:string,argstr:string)
+syscall.sysfs(name:string,option:long,arg1:long,arg2:long,argstr:string)
+syscall.sysinfo(name:string,info_uaddr:long,argstr:string)
+syscall.syslog(name:string,type:long,bufp_uaddr:long,len:long,argstr:string)
+syscall.tee(name:string,argstr:string)
+syscall.tgkill(name:string,tgid:long,pid:long,sig:long,argstr:string)
+syscall.time(name:string,t_uaddr:long,argstr:string)
+syscall.timer_create(name:string,clockid:long,clockid_str:string,evp_uaddr:long,timerid_uaddr:long,argstr:string)
+syscall.timer_delete(name:string,timerid:long,argstr:string)
+syscall.timer_getoverrun(name:string,timerid:long,argstr:string)
+syscall.timer_gettime(name:string,timerid:long,value_uaddr:long,argstr:string)
+syscall.timer_settime(name:string,timerid:long,flags:long,value_uaddr:long,ovalue_uaddr:long,argstr:string)
+syscall.times(name:string,argstr:string)
+syscall.tkill(name:string,pid:long,sig:long,argstr:string)
+syscall.truncate(name:string,path_uaddr:long,path:string,length:long,argstr:string)
+syscall.umask(name:string,mask:long,argstr:string)
+syscall.umount(name:string,target:string,flags:long,flags_str:string,argstr:string)
+syscall.uname(name:string,argstr:string)
+syscall.unlink(name:string,pathname_uaddr:long,pathname:string,argstr:string)
+syscall.unlinkat(name:string,dfd:long,dfd_str:string,pathname:long,pathname_str:string,flag:long,flag_str:string,argstr:string)
+syscall.unshare(name:string,unshare_flags:long,argstr:string)
+syscall.uselib(name:string,library_uaddr:long,library:string,argstr:string)
+syscall.ustat(name:string,dev:long,ubuf_uaddr:long,argstr:string)
+syscall.ustat32(name:string,dev:long,argstr:string)
+syscall.utime(name:string,filename_uaddr:long,filename:string,buf_uaddr:long,actime:long,modtime:long,argstr:string)
+syscall.utimensat(name:string,argstr:string)
+syscall.utimes(name:string,filename_uaddr:long,filename:string,tvp_uaddr:long,argstr:string)
+syscall.vhangup(name:string,argstr:string)
+syscall.vm86_warning(name:string)
+syscall.vmsplice(name:string,argstr:string)
+syscall.wait4(name:string,pid:long,status_uaddr:long,options:long,options_str:string,rusage_uaddr:long,argstr:string)
+syscall.waitid(name:string,pid:long,which:long,which_str:string,infop_uaddr:long,options:long,options_str:string,rusage_uaddr:long,argstr:string)
+syscall.write(name:string,fd:long,buf_uaddr:long,count:long,argstr:string)
+syscall.writev(name:string,vector_uaddr:long,count:long,fd:long,argstr:string)
+signal.check_ignored(sig_pid:long,pid_name:string,sig:long,sig_name:string)
+signal.checkperm(sig:long,task:long,sinfo:long,name:string,sig_name:string,sig_pid:long,pid_name:string,si_code:string)
+signal.do_action(sig:long,sigact_addr:long,oldsigact_addr:long,sa_handler:long,sa_mask:long)
+signal.flush(task:long,sig_pid:long,pid_name:string)
+signal.force_segv(sig_pid:long,pid_name:string,sig:long,sig_name:string)
+signal.handle(sig:unknown,sig_name:string,sinfo:long,sig_code:long,ka_addr:unknown,oldset_addr:unknown,regs:unknown,sig_mode:string)
+signal.pending(sigset_add:long,sigset_size:long)
+signal.procmask(how:long,sigset_addr:long,oldsigset_addr:long,sigset:long)
+signal.send(name:string,sig:long,task:long,sinfo:long,shared:long,send2queue:long,sig_name:string,sig_pid:long,pid_name:string,si_code:string)
+signal.send_sig_queue(sig:long,sig_name:string,sig_pid:long,pid_name:string,sigqueue_addr:long)
+signal.syskill(name:string,pid:long,sig:long,argstr:string,sig_name:string)
+signal.systgkill(name:string,tgid:long,pid:long,sig:long,argstr:string,sig_name:string)
+signal.systkill(name:string,pid:long,sig:long,argstr:string,sig_name:string)
+signal.wakeup(sig_pid:long,pid_name:string,resume:long,state_mask:string)
+netdev.receive(dev_name:string,length:long,protocol:long,truesize:long)
+netdev.transmit(dev_name:string,length:long,protocol:long,truesize:long)
+ioblock.end(devname:string,ino:long,bytes_done:long,error:long,sector:long,flags:long,rw:long,vcnt:long,idx:long,phys_segments:long,hw_segments:long,size:long)
+ioblock.request(devname:string,ino:long,sector:long,flags:long,rw:long,vcnt:long,idx:long,phys_segments:long,hw_segments:long,size:long,bdev:long,bdev_contains:long,p_start_sect:long)
+ioscheduler.elv_add_request(elevator_name:string,disk_major:long,disk_minor:long,req:long,req_flags:long)
+ioscheduler.elv_completed_request(elevator_name:string,disk_major:long,disk_minor:long,req:long,req_flags:long)
+ioscheduler.elv_next_request(elevator_name:string)
+nd_syscall.accept(name:string,sockfd:long,addr_uaddr:long,addrlen_uaddr:long,argstr:string)
+nd_syscall.access(name:string,pathname:string,mode:long,mode_str:string,argstr:string)
+nd_syscall.acct(name:string,filename:string,argstr:string)
+nd_syscall.add_key(name:string,type_uaddr:long,description_uaddr:long,payload_uaddr:long,plen:long,ringid:long,argstr:string)
+nd_syscall.adjtimex(name:string,argstr:string)
+nd_syscall.alarm(name:string,seconds:long,argstr:string)
+nd_syscall.bdflush(name:string,func:long,data:long,data_str:string,argstr:string)
+nd_syscall.bind(name:string,sockfd:long,my_addr_uaddr:long,addrlen:long,argstr:string)
+nd_syscall.brk(name:string,brk:long,argstr:string)
+nd_syscall.capget(name:string,header_uaddr:long,data_uaddr:long,argstr:string)
+nd_syscall.capset(name:string,header_uaddr:long,data_uaddr:long,argstr:string)
+nd_syscall.chdir(name:string,path:string,argstr:string)
+nd_syscall.chmod(name:string,path:string,mode:long,argstr:string)
+nd_syscall.chown(name:string,path:string,owner:long,group:long,argstr:string)
+nd_syscall.chown16(name:string,path:string,owner:long,group:long,argstr:string)
+nd_syscall.chroot(name:string,path:string,argstr:string)
+nd_syscall.clock_getres(name:string,clk_id:long,clk_id_str:string,res_uaddr:long,argstr:string)
+nd_syscall.clock_gettime(name:string,clk_id:long,clk_id_str:string,argstr:string)
+nd_syscall.clock_nanosleep(name:string,flags:long,flag_str:string,argstr:string)
+nd_syscall.clock_settime(name:string,clk_id:long,clk_id_str:string,tp_uaddr:long,argstr:string)
+nd_syscall.close(name:string,fd:long,argstr:string)
+nd_syscall.compat_adjtimex(name:string,argstr:string)
+nd_syscall.compat_clock_nanosleep(name:string,flags:long,flag_str:string,argstr:string)
+nd_syscall.compat_execve(name:string,filename:string,args:string,argstr:string)
+nd_syscall.compat_futex(name:string,futex_uaddr:long,op:long,val:long,utime_uaddr:long,uaddr2_uaddr:long,val3:long,argstr:string)
+nd_syscall.compat_futimesat(name:string,dirfd:long,filename_uaddr:long,filename:string,tvp_uaddr:long,argstr:string)
+nd_syscall.compat_getitimer(name:string,which:long,value_uaddr:long,argstr:string)
+nd_syscall.compat_io_setup(name:string,maxevents:long,ctxp_uaddr:long,argstr:string)
+nd_syscall.compat_io_submit(name:string,ctx_id:long,nr:long,iocbpp_uaddr:long,argstr:string)
+nd_syscall.compat_sys_msgctl(name:string,argstr:string)
+nd_syscall.compat_sys_msgrcv(name:string,argstr:string)
+nd_syscall.compat_sys_msgsnd(name:string,argstr:string)
+nd_syscall.connect(name:string,sockfd:long,serv_addr_uaddr:long,addrlen:long,argstr:string)
+nd_syscall.creat(name:string,mode:long,pathname:string,argstr:string)
+nd_syscall.delete_module(name:string,name_user:string,flags:long,argstr:string)
+nd_syscall.dup(name:string,old_fd:long,argstr:string)
+nd_syscall.dup2(name:string,oldfd:long,newfd:long,argstr:string)
+nd_syscall.epoll_create(name:string,size:long,argstr:string)
+nd_syscall.epoll_ctl(name:string,epfd:long,op:long,op_str:string,fd:long,event_uaddr:long,argstr:string)
+nd_syscall.epoll_pwait(name:string,argstr:string)
+nd_syscall.epoll_wait(name:string,epfd:long,events_uaddr:long,maxevents:long,timeout:long,argstr:string)
+nd_syscall.eventfd(name:string,argstr:string)
+nd_syscall.execve(name:string,filename:string,args:string,argstr:string)
+nd_syscall.exit(name:string,status:long,argstr:string)
+nd_syscall.exit_group(name:string,status:long,argstr:string)
+nd_syscall.fadvise64(name:string,fs:long,offset:long,len:long,advice:long,argstr:string)
+nd_syscall.fadvise64_64(name:string,fs:long,offset:long,len:long,advice:long,argstr:string)
+nd_syscall.fchdir(name:string,fd:long,argstr:string)
+nd_syscall.fchmod(name:string,fildes:long,mode:long,argstr:string)
+nd_syscall.fchown(name:string,fd:long,owner:long,group:long,argstr:string)
+nd_syscall.fchown16(name:string,fd:long,owner:long,group:long,argstr:string)
+nd_syscall.fcntl(name:string,fd:long,cmd:long,cmd_str:string,arg:long,argstr:string)
+nd_syscall.fdatasync(name:string,fd:long,argstr:string)
+nd_syscall.fgetxattr(name:string,filedes:long,name2:string,value_uaddr:long,size:long,argstr:string)
+nd_syscall.flistxattr(name:string,filedes:long,list_uaddr:long,size:long,argstr:string)
+nd_syscall.flock(name:string,fd:long,operation:long,argstr:string)
+nd_syscall.fork(clone_flags:long,stack_start:long,regs:long,stack_size:long,parent_tid_uaddr:long,child_tid_uaddr:long,name:string,argstr:string)
+nd_syscall.fremovexattr(name:string,filedes:long,name_uaddr:long,argstr:string)
+nd_syscall.fsetxattr(name:string,filedes:long,name2:string,value_uaddr:long,size:long,flags:long,argstr:string)
+nd_syscall.fstat(name:string,filedes:long,buf_uaddr:long,argstr:string)
+nd_syscall.fstatat(name:string,dirfd:long,path:string,buf_uaddr:long,argstr:string)
+nd_syscall.fstatfs(name:string,fd:long,buf_uaddr:long,argstr:string)
+nd_syscall.fstatfs64(name:string,fd:long,sz:long,buf_uaddr:long,argstr:string)
+nd_syscall.fsync(name:string,fd:long,argstr:string)
+nd_syscall.ftruncate(name:string,fd:long,length:long,argstr:string)
+nd_syscall.futex(name:string,futex_uaddr:long,op:long,val:long,utime_uaddr:long,uaddr2_uaddr:long,val3:long,argstr:string)
+nd_syscall.futimesat(name:string,dirfd:long,filename_uaddr:long,filename:string,tvp_uaddr:long,argstr:string)
+nd_syscall.get_mempolicy(name:string,policy_uaddr:long,nmask_uaddr:long,maxnode:long,addr:long,flags:long,argstr:string)
+nd_syscall.getcwd(name:string,buf_uaddr:long,size:long,argstr:string)
+nd_syscall.getdents(name:string,fd:long,dirp_uaddr:long,count:long,argstr:string)
+nd_syscall.getegid(name:string,argstr:string)
+nd_syscall.geteuid(name:string,argstr:string)
+nd_syscall.getgid(name:string,argstr:string)
+nd_syscall.getgroups(name:string,size:long,list_uaddr:long,argstr:string)
+nd_syscall.gethostname(name:string,name_uaddr:long,len:long,argstr:string)
+nd_syscall.getitimer(name:string,which:long,value_uaddr:long,argstr:string)
+nd_syscall.getpeername(name:string,s:long,name_uaddr:long,namelen_uaddr:long,argstr:string)
+nd_syscall.getpgid(name:string,pid:long,argstr:string)
+nd_syscall.getpgrp(name:string,argstr:string)
+nd_syscall.getpid(name:string,argstr:string)
+nd_syscall.getppid(name:string,argstr:string)
+nd_syscall.getpriority(name:string,which:long,who:long,argstr:string)
+nd_syscall.getresgid(name:string,rgid_uaddr:long,egid_uaddr:long,sgid_uaddr:long,argstr:string)
+nd_syscall.getresuid(name:string,ruid_uaddr:long,euid_uaddr:long,suid_uaddr:long,argstr:string)
+nd_syscall.getrlimit(name:string,resource:long,rlim_uaddr:long,argstr:string)
+nd_syscall.getrusage(name:string,who:long,who_str:string,usage_uaddr:long,argstr:string)
+nd_syscall.getsid(name:string,pid:long,argstr:string)
+nd_syscall.getsockname(name:string,s:long,name_uaddr:long,namelen_uaddr:long,argstr:string)
+nd_syscall.getsockopt(name:string,fd:long,level:long,level_str:string,optname:long,optname_str:string,optval_uaddr:long,optlen_uaddr:long,argstr:string)
+nd_syscall.gettid(name:string,argstr:string)
+nd_syscall.gettimeofday(name:string,tv_uaddr:long,tz_uaddr:long,argstr:string)
+nd_syscall.getuid(name:string,argstr:string)
+nd_syscall.getxattr(name:string,path:string,name2:string,value_uaddr:long,size:long,argstr:string)
+nd_syscall.init_module(name:string,umod_uaddr:long,len:long,uargs:string,argstr:string)
+nd_syscall.inotify_add_watch(name:string,fd:long,path_uaddr:long,path:string,mask:long,argstr:string)
+nd_syscall.inotify_init(name:string,argstr:string)
+nd_syscall.inotify_rm_watch(name:string,fd:long,wd:long,argstr:string)
+nd_syscall.io_cancel(name:string,ctx_id:long,iocb_uaddr:long,result_uaddr:long,argstr:string)
+nd_syscall.io_destroy(name:string,ctx:long,argstr:string)
+nd_syscall.io_getevents(name:string,ctx_id:long,min_nr:long,nr:long,events_uaddr:long,timeout_uaddr:long,timestr:string,argstr:string)
+nd_syscall.io_setup(name:string,maxevents:long,ctxp_uaddr:long,argstr:string)
+nd_syscall.io_submit(name:string,ctx_id:long,nr:long,iocbpp_uaddr:long,argstr:string)
+nd_syscall.ioctl(name:string,fd:long,request:long,argp:long,argstr:string)
+nd_syscall.ioperm(name:string,from:long,num:long,turn_on:long,argstr:string)
+nd_syscall.ioprio_get(name:string,which:long,who:long,argstr:string)
+nd_syscall.ioprio_set(name:string,which:long,who:long,ioprio:long,argstr:string)
+nd_syscall.kexec_load(name:string,entry:long,nr_segments:long,segments_uaddr:long,flags:long,argstr:string)
+nd_syscall.keyctl(name:string,argstr:string)
+nd_syscall.kill(name:string,pid:long,sig:long,argstr:string)
+nd_syscall.lchown(name:string,path:string,owner:long,group:long,argstr:string)
+nd_syscall.lchown16(name:string,path:string,owner:long,group:long,argstr:string)
+nd_syscall.lgetxattr(name:string,path:string,name2:string,value_uaddr:long,size:long,argstr:string)
+nd_syscall.link(name:string,oldpath:string,newpath:string,argstr:string)
+nd_syscall.listen(name:string,sockfd:long,backlog:long,argstr:string)
+nd_syscall.listxattr(name:string,path_uaddr:long,path:string,list_uaddr:long,size:long,argstr:string)
+nd_syscall.llistxattr(name:string,path_uaddr:long,path:string,list_uaddr:long,size:long,argstr:string)
+nd_syscall.llseek(name:string,fd:long,offset_high:long,offset_low:long,result_uaddr:long,whence:long,whence_str:string,argstr:string)
+nd_syscall.lookup_dcookie(name:string,cookie:long,buffer_uaddr:long,len:long,argstr:string)
+nd_syscall.lremovexattr(name:string,path_uaddr:long,path:string,name_uaddr:long,name2:string,argstr:string)
+nd_syscall.lseek(name:string,fildes:long,offset:long,whence:long,whence_str:string,argstr:string)
+nd_syscall.lsetxattr(name:string,path_uaddr:long,path:string,name_uaddr:long,name_str:string,value_uaddr:long,size:long,flags:long,argstr:string)
+nd_syscall.lstat(name:string,path:string,buf_uaddr:long,argstr:string)
+nd_syscall.madvise(name:string,start:long,length:long,advice:long,advice_str:string,argstr:string)
+nd_syscall.mbind(name:string,start:long,len:long,mode:long,nmask_uaddr:long,maxnode:long,flags:long,argstr:string)
+nd_syscall.migrate_pages(name:string,argstr:string)
+nd_syscall.mincore(name:string,start:long,length:long,vec_uaddr:long,argstr:string)
+nd_syscall.mkdir(name:string,pathname_uaddr:long,pathname:string,mode:long,argstr:string)
+nd_syscall.mkdirat(name:string,dirfd:long,pathname:string,mode:long,argstr:string)
+nd_syscall.mknod(name:string,pathname:string,mode:long,dev:long,argstr:string)
+nd_syscall.mlock(name:string,addr:long,len:long,argstr:string)
+nd_syscall.mlockall(name:string,flags:long,argstr:string)
+nd_syscall.modify_ldt(name:string,func:long,ptr_uaddr:long,bytecount:long,argstr:string)
+nd_syscall.mount(name:string,source:string,target:string,filesystemtype:string,mountflags:long,mountflags_str:string,data:string,argstr:string)
+nd_syscall.move_pages(name:string,argstr:string)
+nd_syscall.mprotect(name:string,addr:long,len:long,prot:long,prot_str:string,argstr:string)
+nd_syscall.mq_getsetattr(name:string,mqdes:long,u_mqstat_uaddr:long,u_omqstat_uaddr:long,argstr:string)
+nd_syscall.mq_notify(name:string,mqdes:long,notification_uaddr:long,argstr:string)
+nd_syscall.mq_open(name:string,name_uaddr:long,filename:string,mode:long,u_attr_uaddr:long,oflag:long,argstr:string)
+nd_syscall.mq_timedreceive(name:string,mqdes:long,msg_ptr_uaddr:long,msg_len:long,msg_prio_uaddr:long,abs_timout_uaddr:long,argstr:string)
+nd_syscall.mq_timedsend(name:string,mqdes:long,msg_ptr_uaddr:long,msg_len:long,msg_prio:long,abs_timeout_uaddr:long,argstr:string)
+nd_syscall.mq_unlink(name:string,u_name_uaddr:long,u_name:string,argstr:string)
+nd_syscall.mremap(name:string,old_address:long,old_size:long,new_size:long,flags:long,new_address:long,argstr:string)
+nd_syscall.msgctl(name:string,msqid:long,cmd:long,buf_uaddr:long,argstr:string)
+nd_syscall.msgget(name:string,key:long,msgflg:long,msgflg_str:string,argstr:string)
+nd_syscall.msgrcv(name:string,msqid:long,msgp_uaddr:long,msgsz:long,msgtyp:long,msgflg:long,argstr:string)
+nd_syscall.msgsnd(name:string,msqid:long,msgp_uaddr:long,msgsz:long,msgflg:long,argstr:string)
+nd_syscall.msync(name:string,start:long,length:long,flags:long,argstr:string)
+nd_syscall.munlock(name:string,addr:long,len:long,argstr:string)
+nd_syscall.munlockall(name:string,argstr:string)
+nd_syscall.munmap(name:string,start:long,length:long,argstr:string)
+vm.brk(address:long,length:long)
+vm.mmap(address:unknown,length:unknown)
+vm.munmap(address:long,length:long)
+vm.oom_kill(task:long)
+vm.pagefault(write_access:long,address:long)
+vm.write_shared(address:long)
+nfsd.close(filename:string,name:string,argstr:string)
+nfsd.commit(fh:string,count:long,offset:long,flag:long,name:string,argstr:string,size:long,units:string)
+nfsd.create(fh:string,filelen:long,filename:string,type:long,iap_valid:long,iap_mode:long,name:string,argstr:string)
+nfsd.createv3(fh:string,filelen:long,filename:string,iap_valid:long,iap_mode:long,truncp:long,verfier:long,createmode:long,name:string,argstr:string)
+nfsd.dispatch(client_ip:long,proto:long,version:long,xid:long,prog:long,proc:long,name:string,argstr:string)
+nfsd.entries(fh:string,access:long,type:long,name:string,argstr:string)
+nfsd.lookup(fh:string,filelen:long,filename:string,name:string,argstr:string)
+nfsd.open(fh:string,access:long,type:long,name:string,argstr:string)
+nfsd.read(fh:string,file:long,count:long,offset:long,vec:long,vlen:long,name:string,argstr:string,size:long,units:string)
+nfsd.rename(fh:string,tfh:string,filelen:long,filename:string,tlen:long,tname:string,name:string,argstr:string)
+nfsd.return(name:string,retstr:string)
+nfsd.unlink(fh:string,filelen:long,filename:string,type:long,name:string,argstr:string)
+nfsd.write(fh:string,file:long,count:long,offset:long,vec:long,vlen:long,name:string,argstr:string,size:long,units:string)
+process.begin)
+process.create(task:long,new_pid:long)
+process.end)
+process.exec(filename:string)
+process.exec_complete(errno:long,success:long)
+process.exit(code:long)
+process.release(task:long,pid:long)
+process.start)
+process.syscall)
+sunrpc.entry(name:string,progname:string,prog:long,vers:long,authflavor:long,servername:string,prot:long,port:long,argstr:string)
+sunrpc.return(name:string,retstr:string)
+scheduler.balance)
+scheduler.cpu_off(task_prev:unknown,task_next:unknown,idle:long)
+scheduler.cpu_on(task_prev:long,idle:long)
+scheduler.ctxswitch(prev_pid:unknown,next_pid:unknown,prev_task:unknown,next_task:unknown,prevtsk_state:unknown)
+scheduler.migrate(task:long,cpu_from:long,cpu_to:long)
+scheduler.tick(idle:long)
+scsi.iocompleted(host_no:long,channel:long,lun:long,dev_id:long,device_state:long,data_direction:long,req_addr:long,goodbytes:long)
+scsi.iodispatching(host_no:long,channel:long,lun:long,dev_id:long,device_state:long,data_direction:long,request_buffer:long,request_bufflen:long,req_addr:long)
+scsi.iodone(host_no:long,channel:long,lun:long,dev_id:long,device_state:long,data_direction:long,req_addr:long,scsi_timer_pending:long)
+scsi.ioentry(disk_major:long,disk_minor:long,device_state:long,req_addr:long)
+socket.aio_read(name:string,_sock:long,size:long,protocol:long,family:long,state:long,flags:long,type:long)
+socket.aio_write(name:string,_sock:long,size:long,protocol:long,family:long,state:long,flags:long,type:long)
+socket.close(name:string,protocol:long,family:long,state:long,flags:long,type:long)
+socket.create(name:string,protocol:long,family:long,type:long,requester:long)
+socket.receive(_dwarf_tvar_tid:long,_dwarf_tvar_sock_16_tmp:long,_dwarf_tvar_sock_17_tmp:long,_dwarf_tvar_sock_18_tmp:long,_dwarf_tvar_sock_19_tmp:long,_dwarf_tvar_sock_20_tmp:long,name:string,size:long,protocol:long,family:long,state:long,flags:long,type:long,success:long)
+socket.recvmsg(name:string,size:long,protocol:long,family:long,state:long,flags:long,type:long)
+socket.send(_dwarf_tvar_tid:long,_dwarf_tvar_sock_32_tmp:long,_dwarf_tvar_sock_33_tmp:long,_dwarf_tvar_sock_34_tmp:long,_dwarf_tvar_sock_35_tmp:long,_dwarf_tvar_sock_36_tmp:long,name:string,size:long,protocol:long,family:long,state:long,flags:long,type:long,success:long)
+socket.sendmsg(name:string,size:long,protocol:long,family:long,state:long,flags:long,type:long)
+kernel.function("sock_recvmsg@net/socket.c:649")(_dwarf_tvar_tid:long)
+kernel.function("sock_aio_read@net/socket.c:750")(_dwarf_tvar_tid:long)
+kernel.function("sock_sendmsg@net/socket.c:566")(_dwarf_tvar_tid:long)
+kernel.function("sock_aio_write@net/socket.c:792")(_dwarf_tvar_tid:long)
+begin(-1001)(num:long)
+end(idx0:string)
+tcp.disconnect(name:string,sock:long,flags:long)
+tcp.recvmsg(name:string,sock:long,size:long)
+tcp.sendmsg(name:string,sock:long,size:long)
+tcp.setsockopt(name:string,sock:long,level:long,optname:long,optstr:string,optlen:long)
+udp.disconnect(name:string,sock:long,flags:long)
+udp.recvmsg(name:string,sock:long,size:long)
+udp.sendmsg(name:string,sock:long,size:long)
+generic.fop.aio_read(file:long,dev:long,devname:string,ino:long,pos:long,count:long,buf:long,name:string,argstr:string,size:long,units:string)
+generic.fop.aio_write(file:long,dev:long,devname:string,ino:long,pos:long,count:long,buf:long,name:string,argstr:string,size:long,units:string)
+generic.fop.llseek(dev:long,devname:string,ino:long,file:long,offset:long,origin:long,maxbyte:long,name:string,argstr:string)
+generic.fop.mmap(file:long,dev:long,devname:string,ino:long,vm_start:long,vm_end:long,vm_flags:long,name:string,argstr:string)
+generic.fop.open(dev:long,devname:string,ino:long,filename:string,flag:long,size:long,name:string,argstr:string)
+generic.fop.splice_read(dev:long,devname:string,ino:long,file:long,len:long,flags:long,name:string,argstr:string,size:long,units:string)
+generic.fop.splice_write(dev:long,devname:string,ino:long,file:long,len:long,flags:long,name:string,argstr:string,size:long,units:string)
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/IDECloseMonitor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/IDECloseMonitor.java
new file mode 100644
index 0000000000..d614c9462a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/IDECloseMonitor.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * 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:
+ * Ryan Morse
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.internal;
+
+import java.text.MessageFormat;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.actions.StopScriptAction;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchListener;
+import org.eclipse.ui.IWorkbenchWindow;
+
+
+/**
+ * This listener is responsible for monitoring workbench close actions. It is used
+ * to veto a shutdown if there are scripts still running and the user does not really
+ * want to shutdown.
+ * @author Ryan Morse
+ */
+public class IDECloseMonitor implements IWorkbenchListener {
+ public boolean preShutdown(IWorkbench workbench, boolean forced) {
+ boolean close = true;
+ if(!forced) {
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+
+ StopScriptAction ssa = new StopScriptAction();
+ ssa.init(window);
+ if(ssa.anyRunning()) {
+ String msg = MessageFormat.format(Localization.getString("IDECloseMonitor.StillRunning"),(Object[]) null);
+ close = MessageDialog.openQuestion(window.getShell(), "Closing...", msg);
+ }
+ }
+ return close;
+ }
+
+ public void postShutdown(IWorkbench workbench) {}
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/IDEPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/IDEPlugin.java
new file mode 100644
index 0000000000..53c4701ab6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/IDEPlugin.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.internal;
+
+import org.eclipse.ui.IWorkbenchListener;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.plugin.*;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.linuxtools.systemtap.ui.consolelog.actions.StopScriptAction;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The main plugin class to be used in the IDE. This class contains lifecycle controls
+ * for the plugin.
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin
+ * @author Ryan Morse
+ */
+public class IDEPlugin extends AbstractUIPlugin {
+ public IDEPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * Called by the Eclipse Workbench at plugin activation time. Starts the plugin lifecycle.
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+
+ workbenchListener = new IDECloseMonitor();
+ plugin.getWorkbench().addWorkbenchListener(workbenchListener);
+ }
+
+ /**
+ * Called by the Eclipse Workbench to deactivate the plugin.
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+
+ StopScriptAction ssa = new StopScriptAction();
+ ssa.init(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
+ ssa.stopAll();
+
+ plugin.getWorkbench().removeWorkbenchListener(workbenchListener);
+
+ plugin = null;
+ }
+
+ /**
+ * Returns this plugin's instance.
+ */
+ public static IDEPlugin 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(PLUGIN_ID, path);
+ }
+
+ private IWorkbenchListener workbenchListener;
+ private static IDEPlugin plugin;
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.systemtap.ui.ide";
+
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/Localization.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/Localization.java
new file mode 100644
index 0000000000..06f73fd023
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/Localization.java
@@ -0,0 +1,22 @@
+package org.eclipse.linuxtools.systemtap.ui.ide.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Localization {
+ private static final String BUNDLE_NAME = "org.eclipse.linuxtools.systemtap.ui.ide.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.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/localization.properties
new file mode 100644
index 0000000000..56146d7aa1
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/internal/localization.properties
@@ -0,0 +1,70 @@
+RunScriptAction.NoScriptFile=No Script File\!
+RunScriptAction.Problem=Problem
+RunScriptAction.TapsetDirectoryRun=Can not run files in tapset directory\!
+RunScriptAction.Error=Error
+
+KernelSourceAction.Insert=&Insert
+KernelSourceAction.InsertSelectedFunction=Insert the Selected Function
+
+ProbeAliasAction.Insert=&Insert
+ProbeAliasAction.InsertSelectedProbe=Insert the Selected Probe
+ProbeAliasAction.AvailableVariables=available variables on this probe:
+
+FunctionBrowserAction.Insert=&Insert
+FunctionBrowserAction.InsertFunction=Insert the Selected Function
+
+CEditor.ProbeInsertFailed=Probe Insertion Failure
+CEditor.CanNotProbeLine=Stap cannot insert a probe on this line of code.
+
+IDECloseMonitor.StillRunning=There are scripts still running, are you sure you want to close?
+
+TapsetsPreferencePage.AdditionalTapsetsCategory=Additional tapsets to be used with every script
+TapsetsPreferencePage.AdditionalTapsets=&Additional tapsets:
+TapsetsPreferencePage.TapsetDirectory=Tapset Directory
+
+TapsetBrowserView.WhereDefaultTapset=Where are the default tapsets?
+
+SyntaxColoringPreferencePage.SyntaxColoringOptions=Syntax Coloring Options
+SyntaxColoringPreferencePage.STPEditor=stp Editor
+SyntaxColoringPreferencePage.DefaultColor=&Default Color:
+SyntaxColoringPreferencePage.KeywordColor=&Keyword Color:
+SyntaxColoringPreferencePage.EmbeddedCColor=&Embedded C Color:
+SyntaxColoringPreferencePage.EmbeddedColor=&Embedded Color:
+SyntaxColoringPreferencePage.CommentColor=&Comment Color:
+SyntaxColoringPreferencePage.TypeColor=&Type Color:
+SyntaxColoringPreferencePage.StringColor=&String Color:
+SyntaxColoringPreferencePage.CEditor=c Editor
+SyntaxColoringPreferencePage.PreprocessorColor=&Preprocessor Color:
+
+PathPreferencePage.KernelSourceDirectory=&Kernel source directory:
+PathPreferencePage.ExcludedSourceFolders=&Excluded source folders:
+PathPreferencePage.ExcludedDirectory=Excluded Directory
+
+ConditionalFilterPreferencePage.ConditiionalFilterSelector=Conditinal filters to be used with code completion
+ConditionalFilterPreferencePage.ConditionalFilters=&Conditional Filters:
+ConditionalFilterPreferencePage.NewFilter=New Filter
+
+IDEPreferencePage.UseStoredTapsetTree=Use stored tapset trees
+
+StapOptionsPreferencePage.StapOptions=Options for running stap
+
+TypeingPreferencePage.TypingPreferenceDescription=Empty page for now. Thinking of what to add.
+
+CodeAssistPreferencePage.CodeAssistPreferenceDescription=Preferences controling options for code assist in the editor
+CodeAssistPreferencePage.UseCodeAssist=&Use Code Assist
+CodeAssistPreferencePage.HowCodeAdded=How code assist adds code:
+CodeAssistPreferencePage.Insert=&Insert
+CodeAssistPreferencePage.Overwrite=&Overwrite
+CodeAssistPreferencePage.ActivationDelay=Activation &Delay (requires restart):
+CodeAssistPreferencePage.ActivationTrigger=Activation &Trigger:
+
+StapPreferencePage.StapPreferenceDescription=Empty page for now. Thinking of what to add.
+
+EditorPreferencePage.EditorPreferenceDescription=This is for basic properties of the editors.
+EditorPreferencePage.BackgroundColor=&Editor Background Color:
+EditorPreferencePage.ShowLineNumbers=Show Line &Numbers
+
+StapSettingsDialog.StapOptions=Stap Options
+
+KernelBrowserView.WhereKernelSource=Where is the Kernel Source Code?
+TapsetBrowserView.TapsetLocation=Tapset Location
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/CodeAssistPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/CodeAssistPreferencePage.java
new file mode 100644
index 0000000000..ea1fc87d27
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/CodeAssistPreferencePage.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+
+public class CodeAssistPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public CodeAssistPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start CodeAssistPreferencePage:", this);
+ setPreferenceStore(IDEPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("CodeAssistPreferencePage.CodeAssistPreferenceDescription"));
+ LogManager.logDebug("End CodeAssistPreferencePage:", this);
+ }
+
+ /**
+ * Creates the field editors. Field editors are abstractions of
+ * the common GUI blocks needed to manipulate various types
+ * of preferences. Each field editor knows how to save and
+ * restore itself.
+ */
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+ addField(
+ new BooleanFieldEditor(
+ IDEPreferenceConstants.P_USE_CODE_ASSIST,
+ Localization.getString("CodeAssistPreferencePage.UseCodeAssist"),
+ getFieldEditorParent()));
+ addField(new RadioGroupFieldEditor(
+ IDEPreferenceConstants.P_COMPLETION,
+ Localization.getString("CodeAssistPreferencePage.HowCodeAdded"),
+ 1,
+ new String[][] {
+ {Localization.getString("CodeAssistPreferencePage.Insert"), IDEPreferenceConstants.P_COMPLETION_INSERT },
+ {Localization.getString("CodeAssistPreferencePage.Overwrite"), IDEPreferenceConstants.P_COMPLETION_OVERWRITE }},
+ getFieldEditorParent()));
+ addField(
+ new IntegerFieldEditor(
+ IDEPreferenceConstants.P_ACTIVATION_DELAY,
+ Localization.getString("CodeAssistPreferencePage.ActivationDelay"),
+ getFieldEditorParent()));
+ addField(
+ new StringFieldEditor(
+ IDEPreferenceConstants.P_ACTIVATION_TRIGGER,
+ Localization.getString("CodeAssistPreferencePage.ActivationTrigger"),
+ getFieldEditorParent()));
+ LogManager.logDebug("End createFieldEditors", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logInfo("Initializing", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/ConditionalFilterPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/ConditionalFilterPreferencePage.java
new file mode 100644
index 0000000000..f6bcf6d91f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/ConditionalFilterPreferencePage.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.ui.ListEditor;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.ConditionalExpressionValidator;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+
+public class ConditionalFilterPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public ConditionalFilterPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start ConditionalFilterPreferencePage:", this);
+ setPreferenceStore(IDEPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("ConditionalFilterPreferencePage.ConditiionalFilterSelector"));
+ LogManager.logDebug("End ConditionalFilterPreferencePage:", this);
+ }
+
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+
+ addField(new ListEditor(IDEPreferenceConstants.P_CONDITIONAL_FILTERS,
+ Localization.getString("ConditionalFilterPreferencePage.ConditionalFilters"), Localization.getString("ConditionalFilterPreferencePage.NewFilter"), "if()", new ConditionalExpressionValidator(), getFieldEditorParent()));
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logInfo("Initializing", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/EditorPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/EditorPreferencePage.java
new file mode 100644
index 0000000000..3195f7291b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/EditorPreferencePage.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+
+public class EditorPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public EditorPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start EditorPreferencePage:", this);
+ setPreferenceStore(IDEPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("EditorPreferencePage.EditorPreferenceDescription"));
+ LogManager.logDebug("End EditorPreferencePage:", this);
+ }
+
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+ addField(new ColorFieldEditor(
+ IDEPreferenceConstants.P_EDITOR_BACKGROUND,
+ Localization.getString("EditorPreferencePage.BackgroundColor"), getFieldEditorParent()));
+
+ addField(new BooleanFieldEditor(
+ IDEPreferenceConstants.P_SHOW_LINE_NUMBERS,
+ Localization.getString("EditorPreferencePage.ShowLineNumbers"),
+ getFieldEditorParent()));
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logInfo("Initializing", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/IDEPreferenceConstants.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/IDEPreferenceConstants.java
new file mode 100644
index 0000000000..5e2129531c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/IDEPreferenceConstants.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+public class IDEPreferenceConstants {
+ //ide
+ public static final String P_STORED_TREE = "UseStoredTreePreference";
+
+ //ide.path
+// public static final String P_DEFAULT_TAPSET = "DefaultTapsetPreference";
+ public static final String P_KERNEL_SOURCE = "KernelSourcePreference";
+ public static final String P_EXCLUDED_KERNEL_SOURCE = "ExcludedKernelSource";
+
+ //ide.stap.tapsets
+ public static final String P_TAPSETS = "TapsetPreference";
+
+ //ide.editor
+ public static final String P_EDITOR_BACKGROUND = "EditorBackgroundPreference";
+ public static final String P_SHOW_LINE_NUMBERS = "ShowLineNumbers";
+
+ //ide.editor.codeassist
+ public static final String P_USE_CODE_ASSIST = "UseCodeAssistPreference";
+ public static final String P_COMPLETION = "CompletionPreference";
+ public static final String P_COMPLETION_INSERT = "CompletionInsertPreference";
+ public static final String P_COMPLETION_OVERWRITE = "CompletionOverwritePreference";
+ public static final String P_ACTIVATION_DELAY = "ActivationDelayPreference";
+ public static final String P_ACTIVATION_TRIGGER = "ActivationTriggerPreference";
+
+ //ide.editor.preferenceconstants
+ public static final String P_CONDITIONAL_FILTERS = "ConditionalFilters";
+
+ //ide.stap.stapoptions
+ public static final String[][] P_STAP = new String[][] {
+// {"-h", "\tshow help", "hStapPreference"},
+// {"-V", "\tshow version", "VStapPreference"},
+ {"-k", "\tkeep temporary directory", "kStapPreference"},
+ {"-u", "\tunoptimized translation", "uStapPreference"},
+// {"-g", "\tguru mode", "gStapPreference"},
+ {"-b", "\tbulk (relayfs) mode", "bStapPreference"},
+ {"-t", "\tbenchmarking timing information", "tStapPreference"},
+ {"-v", "\t\t\tincrease verbosity [0]", "vStapPreference"},
+ {"-p NUM", "\t\tstop after pass NUM 1-5"/*, instead of 5 (parse, elaborate, translate, compile, run)"*/, "pStapPreference"},
+ {"-s NUM", "\t\tbuffer size in megabytes", "sStapPreference"},
+// {"-I DIR", "\t\tlook in DIR for additional .stp script files, in addition to /usr/share/systemtap/tapset", "IStapPreference"},
+ {"-D NM=VAL", "\temit macro definition into C code", "DStapPreference"},
+ {"-R DIR", "\t\tlook in DIR for runtime", "RStapPreference"},
+ {"-r RELEASE", "\tuse kernel RELEASE", "rStapPreference"},
+ {"-m MODULE", "\tset probe module name", "mStapPreference"},
+ {"-o FILE", "\t\tsend output to file", "oStapPreference"},
+ {"-c CMD", "\t\tstart the probes, run CMD, and exit when it finishes", "cStapPreference"},
+ {"-x PID", "\t\tsets target() to PID", "xStapPreference"}};
+
+ public static final String[] P_STAP_OPTS = new String[] {
+ "vStapOptPreference",
+ "pStapOptPreference",
+ "sStapOptPreference",
+// "IStapOptPreference",
+ "DStapOptPreference",
+ "RStapOptPreference",
+ "rStapOptPreference",
+ "mStapOptPreference",
+ "oStapOptPreference",
+ "cStapOptPreference",
+ "xStapOptPreference"
+ };
+
+ //ide.editor.syntaxcoloring
+ public static final String P_STP_DEFAULT_COLOR = "stpDefaultColorPreference";
+ public static final String P_STP_KEYWORD_COLOR = "stpKeywordColorPreference";
+ public static final String P_STP_EMBEDDED_C_COLOR = "stpEmbeddedCColorPreference";
+ public static final String P_STP_EMBEDDED_COLOR = "stpEmbeddedColorPreference";
+ public static final String P_STP_COMMENT_COLOR = "stpCommentColorPreference";
+ public static final String P_STP_TYPE_COLOR = "stpTypeColorPreference";
+ public static final String P_STP_STRING_COLOR = "stpStringColorPreference";
+ public static final String P_C_DEFAULT_COLOR = "cDefaultColorPreference";
+ public static final String P_C_KEYWORD_COLOR = "cKeywordColorPreference";
+ public static final String P_C_COMMENT_COLOR = "cCommentColorPreference";
+ public static final String P_C_PREPROCESSOR_COLOR = "cPreprocessorColorPreference";
+ public static final String P_C_TYPE_COLOR = "cTypeColorPreference";
+ public static final String P_C_STRING_COLOR = "cStringColorPreference";
+
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/IDEPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/IDEPreferencePage.java
new file mode 100644
index 0000000000..8296a315d7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/IDEPreferencePage.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+
+public class IDEPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public IDEPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start IDEPreferencePage:", this);
+ setPreferenceStore(IDEPlugin.getDefault().getPreferenceStore());
+ setDescription("Preferences when loading the IDE perspective");
+ LogManager.logDebug("End IDEPreferencePage:", this);
+ }
+
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+ addField(new BooleanFieldEditor(
+ IDEPreferenceConstants.P_STORED_TREE,
+ Localization.getString("IDEPreferencePage.UseStoredTapsetTree"),
+ getFieldEditorParent()));
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logInfo("Initializing", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/PathPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/PathPreferencePage.java
new file mode 100644
index 0000000000..b58a9549c6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/PathPreferencePage.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.ui.ListEditor;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.DirectoryValidator;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+
+
+public class PathPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public PathPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start PathPreferencePage:", this);
+ setPreferenceStore(IDEPlugin.getDefault().getPreferenceStore());
+ setDescription("Important directories");
+ LogManager.logDebug("End PathPreferencePage:", this);
+ }
+
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+// addField(new DirectoryFieldEditor(IDEPreferenceConstants.P_DEFAULT_TAPSET,
+// "&Default tapset directory:", getFieldEditorParent()));
+ addField(new DirectoryFieldEditor(IDEPreferenceConstants.P_KERNEL_SOURCE,
+ Localization.getString("PathPreferencePage.KernelSourceDirectory"), getFieldEditorParent()));
+
+ addField(new ListEditor(IDEPreferenceConstants.P_EXCLUDED_KERNEL_SOURCE,
+ Localization.getString("PathPreferencePage.ExcludedSourceFolders"), Localization.getString("PathPreferencePage.ExcludedDirectory"), "", new DirectoryValidator(), getFieldEditorParent()));
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logInfo("Initializing", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/PreferenceInitializer.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/PreferenceInitializer.java
new file mode 100644
index 0000000000..d19dfb0e33
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/PreferenceInitializer.java
@@ -0,0 +1,93 @@
+/* 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.linuxtools.systemtap.ui.ide.editors.c.ICColorConstants;
+import org.eclipse.linuxtools.systemtap.ui.ide.editors.stp.STPColorConstants;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.swt.graphics.RGB;
+
+
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+ public void initializeDefaultPreferences() {
+ LogManager.logDebug("Start initializeDefaultPreferences:", this);
+ IPreferenceStore store = IDEPlugin.getDefault().getPreferenceStore();
+
+ //ide
+ store.setDefault(IDEPreferenceConstants.P_STORED_TREE, true);
+
+ //ide.path
+// store.setDefault(PreferenceConstants.P_DEFAULT_TAPSET, "/usr/share/systemtap/tapset");
+ store.setDefault(IDEPreferenceConstants.P_KERNEL_SOURCE, "");
+ store.setDefault(IDEPreferenceConstants.P_EXCLUDED_KERNEL_SOURCE,
+ "CVS/" + File.pathSeparator +
+ ".svn/" + File.pathSeparator +
+ "{arch}/" + File.pathSeparator +
+ ".arch-ids/" + File.pathSeparator +
+ ".bzr/" + File.pathSeparator +
+ "debian/" + File.pathSeparator +
+ ".git/");
+
+ //ide.stap.tapsets
+ store.setDefault(IDEPreferenceConstants.P_TAPSETS, "");
+
+ //ide.editor
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_EDITOR_BACKGROUND, new RGB(255,255,255));
+ store.setDefault(IDEPreferenceConstants.P_SHOW_LINE_NUMBERS, false);
+
+ //ide.editor.codeassist
+ store.setDefault(IDEPreferenceConstants.P_USE_CODE_ASSIST, true);
+ store.setDefault(IDEPreferenceConstants.P_COMPLETION, IDEPreferenceConstants.P_COMPLETION_INSERT);
+ store.setDefault(IDEPreferenceConstants.P_ACTIVATION_DELAY, 200);
+ store.setDefault(IDEPreferenceConstants.P_ACTIVATION_TRIGGER, ".");
+
+ //ide.editor.conditionalfilters
+ store.setDefault(IDEPreferenceConstants.P_CONDITIONAL_FILTERS,
+ "if(pid=currentpid)" + File.pathSeparator +
+ "if(execname=cmdname)" + File.pathSeparator +
+ "if(cpu=0)" + File.pathSeparator +
+ "if(caller=functionname)");
+
+
+ //ide.stap.stapoptions
+ for(int i=0; i<IDEPreferenceConstants.P_STAP.length; i++) {
+ store.setDefault(IDEPreferenceConstants.P_STAP[i][2], false);
+ }
+
+ for(int i=0; i<IDEPreferenceConstants.P_STAP_OPTS.length; i++) {
+ store.setDefault(IDEPreferenceConstants.P_STAP_OPTS[i], "");
+ }
+
+ //ide.editor.syntaxcoloring
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_STP_DEFAULT_COLOR, STPColorConstants.DEFAULT);
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_STP_KEYWORD_COLOR, STPColorConstants.KEYWORD);
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_STP_EMBEDDED_C_COLOR, STPColorConstants.EMBEDDEDC);
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_STP_EMBEDDED_COLOR, STPColorConstants.EMBEDDED);
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_STP_COMMENT_COLOR, STPColorConstants.COMMENT);
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_STP_TYPE_COLOR, STPColorConstants.TYPE);
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_STP_STRING_COLOR, STPColorConstants.STP_STRING);
+
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_C_DEFAULT_COLOR, ICColorConstants.DEFAULT);
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_C_KEYWORD_COLOR, ICColorConstants.KEYWORD);
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_C_COMMENT_COLOR, ICColorConstants.COMMENT);
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_C_PREPROCESSOR_COLOR, ICColorConstants.PREPROCESSOR);
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_C_TYPE_COLOR, ICColorConstants.TYPE);
+ PreferenceConverter.setDefault(store, IDEPreferenceConstants.P_C_STRING_COLOR, ICColorConstants.STRING);
+
+ LogManager.logDebug("End initializeDefaultPreferences:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/StapOptionsPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/StapOptionsPreferencePage.java
new file mode 100644
index 0000000000..ecd9ca5e84
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/StapOptionsPreferencePage.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+
+public class StapOptionsPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public StapOptionsPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start StapOptionsPreferencePage:", this);
+ setPreferenceStore(IDEPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("StapOptionsPreferencePage.StapOptions"));
+ LogManager.logDebug("End StapOptionsPreferencePage:", this);
+ }
+
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+ for(int i=0; i<IDEPreferenceConstants.P_STAP.length; i++) {
+ addField(
+ new BooleanFieldEditor(
+ IDEPreferenceConstants.P_STAP[i][2],
+ IDEPreferenceConstants.P_STAP[i][0] + "\t" + IDEPreferenceConstants.P_STAP[i][1],
+ getFieldEditorParent()));
+
+ if(2 < IDEPreferenceConstants.P_STAP[i][0].length()) {
+ StringFieldEditor sfe = new StringFieldEditor(
+ IDEPreferenceConstants.P_STAP_OPTS[i-IDEPreferenceConstants.P_STAP.length+IDEPreferenceConstants.P_STAP_OPTS.length],
+ "\t",
+ getFieldEditorParent());
+
+ addField(sfe);
+ }
+ }
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logInfo("Initializing", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/StapPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/StapPreferencePage.java
new file mode 100644
index 0000000000..51ea2e49f0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/StapPreferencePage.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+
+public class StapPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public StapPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start StapPreferencePage:", this);
+ setPreferenceStore(IDEPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("StapPreferencePage.StapPreferenceDescription"));
+ LogManager.logDebug("End StapPreferencePage:", this);
+ }
+
+ //TODO: Add content to this page
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logInfo("Initializing", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/SyntaxColoringPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/SyntaxColoringPreferencePage.java
new file mode 100644
index 0000000000..f66ed2882f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/SyntaxColoringPreferencePage.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+
+public class SyntaxColoringPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+ public SyntaxColoringPreferencePage() {
+ super();
+ LogManager.logDebug("Start SyntaxColoringPreferencePage:", this);
+ setPreferenceStore(IDEPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("SyntaxColoringPreferencePage.SyntaxColoringOptions"));
+ LogManager.logDebug("End SyntaxColoringPreferencePage:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logInfo("Initializing", this);
+ }
+
+ protected Control createContents(Composite parent) {
+ LogManager.logDebug("Start createContents: parent-" + parent, this);
+ final TabFolder tabFolder = new TabFolder(parent, SWT.BORDER);
+
+ //STP Editor
+ TabItem stpEditor = new TabItem(tabFolder, SWT.NULL);
+ stpEditor.setText(Localization.getString("SyntaxColoringPreferencePage.STPEditor"));
+ Composite comp = new Composite(tabFolder, SWT.NULL);
+ stpEditor.setControl(comp);
+
+ stpDC = createColorFieldEditor(
+ IDEPreferenceConstants.P_STP_DEFAULT_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.DefaultColor"), comp);
+ stpKC = createColorFieldEditor(
+ IDEPreferenceConstants.P_STP_KEYWORD_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.KeywordColor"), comp);
+ stpEC = createColorFieldEditor(
+ IDEPreferenceConstants.P_STP_EMBEDDED_C_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.EmbeddedCColor"), comp);
+ stpEE = createColorFieldEditor(
+ IDEPreferenceConstants.P_STP_EMBEDDED_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.EmbeddedColor"), comp);
+ stpCC = createColorFieldEditor(
+ IDEPreferenceConstants.P_STP_COMMENT_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.CommentColor"), comp);
+ stpTC = createColorFieldEditor(
+ IDEPreferenceConstants.P_STP_TYPE_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.TypeColor"), comp);
+ stpSC = createColorFieldEditor(
+ IDEPreferenceConstants.P_STP_STRING_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.StringColor"), comp);
+
+ //C Editor
+ TabItem cEditor = new TabItem(tabFolder, SWT.NULL);
+ cEditor.setText(Localization.getString("SyntaxColoringPreferencePage.CEditor"));
+ comp = new Composite(tabFolder, SWT.NULL);
+ cEditor.setControl(comp);
+
+ cDC = createColorFieldEditor(
+ IDEPreferenceConstants.P_C_DEFAULT_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.DefaultColor"), comp);
+ cKC = createColorFieldEditor(
+ IDEPreferenceConstants.P_C_KEYWORD_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.KeywordColor"), comp);
+ cPC = createColorFieldEditor(
+ IDEPreferenceConstants.P_C_PREPROCESSOR_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.PreprocessorColor"), comp);
+ cCC = createColorFieldEditor(
+ IDEPreferenceConstants.P_C_COMMENT_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.CommentColor"), comp);
+ cTC = createColorFieldEditor(
+ IDEPreferenceConstants.P_C_TYPE_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.TypeColor"), comp);
+ cSC = createColorFieldEditor(
+ IDEPreferenceConstants.P_C_STRING_COLOR,
+ Localization.getString("SyntaxColoringPreferencePage.StringColor"), comp);
+
+ LogManager.logDebug("End createContents: returnVal-" + tabFolder, this);
+ return tabFolder;
+ }
+
+ private ColorFieldEditor createColorFieldEditor(String name, String lblText, Composite parent) {
+ LogManager.logDebug("Start createColorFieldEditor: name-" + name + ", lblText-" + lblText + ", parent-" + parent, this);
+ ColorFieldEditor cfe = new ColorFieldEditor(name, lblText, parent);
+ cfe.setPage(this);
+ cfe.setPreferenceStore(getPreferenceStore());
+ cfe.load();
+
+ LogManager.logDebug("End createColorFieldEditor: returnVal-" + cfe, this);
+ return cfe;
+ }
+
+ protected void performDefaults() {
+ LogManager.logDebug("Start performDefaults:", this);
+ stpDC.loadDefault();
+ stpKC.loadDefault();
+ stpEC.loadDefault();
+ stpEE.loadDefault();
+ stpCC.loadDefault();
+ stpTC.loadDefault();
+ stpSC.loadDefault();
+ cDC.loadDefault();
+ cKC.loadDefault();
+ cPC.loadDefault();
+ cCC.loadDefault();
+ cTC.loadDefault();
+ cSC.loadDefault();
+
+ super.performDefaults();
+ LogManager.logDebug("End performDefaults:", this);
+ }
+
+ public boolean performOk() {
+ LogManager.logDebug("Start performOk:", this);
+ stpDC.store();
+ stpKC.store();
+ stpEC.store();
+ stpEE.store();
+ stpCC.store();
+ stpTC.store();
+ stpSC.store();
+ cDC.store();
+ cKC.store();
+ cPC.store();
+ cCC.store();
+ cTC.store();
+ cSC.store();
+
+ LogManager.logDebug("End performOk returnVal-true", this);
+ return true;
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ stpDC.dispose();
+ stpKC.dispose();
+ stpEC.dispose();
+ stpEE.dispose();
+ stpCC.dispose();
+ stpTC.dispose();
+ stpSC.dispose();
+ cDC.dispose();
+ cKC.dispose();
+ cPC.dispose();
+ cCC.dispose();
+ cTC.dispose();
+ cSC.dispose();
+ stpDC = null;
+ stpKC = null;
+ stpEC = null;
+ stpEE = null;
+ stpCC = null;
+ stpTC = null;
+ stpSC = null;
+ cDC = null;
+ cKC = null;
+ cPC = null;
+ cCC = null;
+ cTC = null;
+ cSC = null;
+ }
+
+ private ColorFieldEditor stpDC, stpKC, stpEC, stpEE, stpCC, stpTC, stpSC;
+ private ColorFieldEditor cDC, cKC, cPC, cCC, cTC, cSC;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/TapsetsPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/TapsetsPreferencePage.java
new file mode 100644
index 0000000000..ccf5a0f8bd
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/TapsetsPreferencePage.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+
+public class TapsetsPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public TapsetsPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start TapsetsPreferencePage:", this);
+ setPreferenceStore(IDEPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("TapsetsPreferencePage.AdditionalTapsetsCategory"));
+ LogManager.logDebug("End TapsetsPreferencePage:", this);
+ }
+
+ /**
+ * Creates the field editors. Field editors are abstractions of
+ * the common GUI blocks needed to manipulate various types
+ * of preferences. Each field editor knows how to save and
+ * restore itself.
+ */
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+ addField(new PathEditor(IDEPreferenceConstants.P_TAPSETS,
+ Localization.getString("TapsetsPreferencePage.AdditionalTapsets"), Localization.getString("TapsetsPreferencePage.TapsetDirectory"), getFieldEditorParent()));
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logInfo("Initializing", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/TypeingPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/TypeingPreferencePage.java
new file mode 100644
index 0000000000..164ca9935a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/preferences/TypeingPreferencePage.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+
+public class TypeingPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public TypeingPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start TypeingPreferencePage:", this);
+ setPreferenceStore(IDEPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("TypeingPreferencePage.TypingPreferenceDescription"));
+ LogManager.logDebug("End TypeingPreferencePage:", this);
+ }
+
+ //TODO: Add content to this page
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logInfo("Initializing", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/Query.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/Query.java
new file mode 100644
index 0000000000..d931c8e88f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/Query.java
@@ -0,0 +1,176 @@
+package org.eclipse.linuxtools.systemtap.ui.ide.structures;
+
+import java.util.StringTokenizer;
+
+public final class Query {
+
+ public String tableName;
+ public String where;
+ public String groupBy;
+ public String orderBy;
+ public String[] columnNames;
+ public String[] newColumnNames;
+
+ /**
+ * This constructor is only used internally to set the various fields
+ * to null.
+ */
+ private Query() {
+ this.where = null;
+ this.groupBy = null;
+ this.orderBy = null;
+ this.newColumnNames = null;
+ }
+
+ public Query(final String tableName, final String[] columnNames) {
+ this();
+ this.tableName = tableName;
+ this.columnNames = columnNames;
+ }
+
+ public Query(final Query query) {
+ tableName = query.tableName;
+ columnNames = query.columnNames;
+ newColumnNames = query.newColumnNames;
+ where = query.where;
+ groupBy = query.groupBy;
+ orderBy = query.orderBy;
+ }
+
+ public Query(final String tableName) {
+ this();
+ this.tableName = tableName;
+ this.columnNames = null;
+ }
+
+ public Query(final String tableName, final String[] columnNames,
+ final String[] newColumnNames, final String where,
+ final String groupBy, final String orderBy) {
+ this.tableName = tableName;
+ this.columnNames = columnNames;
+ this.newColumnNames = newColumnNames;
+ this.where = where;
+ this.groupBy = groupBy;
+ this.orderBy = orderBy;
+ }
+
+ public String toString() {
+ return buildQuery(tableName, columnNames, newColumnNames, where,
+ groupBy, orderBy);
+ }
+
+ private String buildQuery(final String tableName, final String[] fields,
+ final String[] columnNames, final String whereClauses,
+ final String groupBy, final String orderBy) {
+ String query = "SELECT ";
+ if (fields == (null))
+ query += "* ";
+ else
+ for (int i = 0; i < fields.length; i++) {
+ query += fields[i];
+ if ((columnNames != null)
+ && (columnNames.length == fields.length))
+ query += " AS " + columnNames[i];
+ if (i != (fields.length - 1))
+ query += ", ";
+ }
+ query += " FROM " + tableName;
+ if (whereClauses != null)
+ query += " WHERE " + whereClauses;
+ if (groupBy != null)
+ query += " GROUP BY " + groupBy;
+ if (orderBy != null)
+ query += " ORDER BY " + orderBy;
+ return query;
+ }
+
+ /**
+ * Turns the query into a string that can be written to a file and easily
+ * recreated as a Query object.
+ *
+ * @return
+ */
+ public String toSavableQueryString() {
+ String query = tableName + ":: COLS ";
+ if (columnNames != null)
+ for (final String element : columnNames)
+ query += element + " ";
+ else
+ query += "*";
+
+ query += ":: NEW_COLS ";
+ if (columnNames != null)
+ for (final String element : newColumnNames)
+ query += element + " ";
+ query += ":: WHERE " + where;
+ query += ":: GROUP " + groupBy;
+ query += ":: ORDER " + orderBy;
+ return query;
+ }
+
+ /**
+ * Creates a Query object from a string created by toSavableQueryString()
+ *
+ * @param query
+ * The query string to be turned into a Query object.
+ * @return a new Query object created by the given string.
+ */
+ public static Query getQueryFromString(final String query) {
+ if (query == null)
+ return null;
+ final String[] subQuery = query.split("::");
+ final Query tempQuery = new Query(subQuery[0]);
+ for (int i = 1; i < subQuery.length; i++) {
+ subQuery[i] = subQuery[i].trim();
+ if (subQuery[i].startsWith("COLS ")) {
+ String temp = subQuery[i].replace("COLS ", "");
+ temp = temp.trim();
+ final StringTokenizer tok = new StringTokenizer(temp);
+ final String next = tok.nextToken();
+ if (next.equals("null") || next.equals("*"))
+ tempQuery.columnNames = null;
+ else {
+ tempQuery.columnNames = new String[tok.countTokens() + 1];
+ tempQuery.columnNames[0] = next;
+ for (int j = 1; j < tempQuery.columnNames.length; j++)
+ tempQuery.columnNames[j] = tok.nextToken();
+ }
+ } else if (subQuery[i].startsWith("NEW_COLS ")) {
+ String temp = subQuery[i].replace("NEW_COLS ", "");
+ temp = temp.trim();
+ final StringTokenizer tok = new StringTokenizer(temp);
+ final String next = tok.nextToken();
+ if (next.equals("null"))
+ tempQuery.newColumnNames = null;
+ else {
+ tempQuery.newColumnNames = new String[tok.countTokens() + 1];
+ tempQuery.newColumnNames[0] = next;
+ for (int j = 1; j < tempQuery.newColumnNames.length; j++)
+ tempQuery.newColumnNames[j] = tok.nextToken();
+ }
+ } else if (subQuery[i].startsWith("WHERE ")) {
+ String temp = subQuery[i].replace("WHERE ", "");
+ temp = temp.trim();
+ if (temp.equals("null"))
+ tempQuery.where = null;
+ else
+ tempQuery.where = temp;
+ } else if (subQuery[i].startsWith("GROUP ")) {
+ String temp = subQuery[i].replace("GROUP ", "");
+ temp = temp.trim();
+ if (temp.equals("null"))
+ tempQuery.groupBy = null;
+ else
+ tempQuery.groupBy = temp;
+ } else if (subQuery[i].startsWith("ORDER ")) {
+ String temp = subQuery[i].replace("ORDER ", "");
+ temp = temp.trim();
+ if (temp.equals("null"))
+ tempQuery.orderBy = null;
+ else
+ tempQuery.orderBy = temp;
+ }
+ }
+ return tempQuery;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/StapErrorParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/StapErrorParser.java
new file mode 100644
index 0000000000..351dc38e3d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/StapErrorParser.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.structures;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.consolelog.structures.IErrorParser;
+
+
+/**
+ * Parses the output from the stap command into a table of strings that are displayed
+ * in the error log.
+ * @author Ryan Morse
+ */
+public final class StapErrorParser implements IErrorParser {
+ /**
+ * Parses the error log passed in into a table of strings.
+ * @param output The output from the stderr StreamGobbler.
+ * @return A table of strings in the proper format to be displayed in the error log.
+ */
+ public String[][] parseOutput(String output) {
+ String[][] sErrors = null;
+ ArrayList<String[]> errors = new ArrayList<String[]>();
+ int errorType = TYPE;
+
+ if(null != output) {
+ String[] tokens = output.split("\\s");
+ String[] row = null;
+
+ for(int i=0; i<tokens.length; i++) {
+ if(tokens[i].equals("error:")) {
+ row = new String[] {"", "", "", ""};
+ errors.add(row);
+ row[TYPE] = tokens[i-1] + " " + tokens[i];
+ errorType = ERROR;
+ i++;
+ } else if(tokens[i].equals("saw:")) {
+ errorType = SAW;
+ i++;
+ } else if(tokens[i].equals("at")) {
+ errorType = LOCATION;
+ i++;
+ } else if(tokens[i].equals("Pass")) {
+ errorType = PASS;
+
+ }
+
+ if(null != row && errorType != PASS)
+ row[errorType] += tokens[i] + " ";
+ }
+
+ sErrors = new String[errors.size()][4];
+ System.arraycopy(errors.toArray(), 0, sErrors, 0, errors.size());
+
+ for(int i=0; i<sErrors.length; i++)
+ sErrors[i][LOCATION] = fixLocation(sErrors[i][LOCATION]);
+ }
+
+ return sErrors;
+ }
+
+ private static String fixLocation(String loc) {
+ if(loc.contains(":")) {
+ loc = loc.substring(loc.indexOf(':')+1, loc.lastIndexOf(':'));
+ return loc;
+ } else
+ return "";
+ }
+
+ private static final int TYPE = 0;
+ private static final int ERROR = 1;
+ private static final int SAW = 2;
+ private static final int LOCATION = 3;
+ private static final int PASS = 4;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TapsetLibrary.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TapsetLibrary.java
new file mode 100644
index 0000000000..b884a22200
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TapsetLibrary.java
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.structures;
+
+import java.io.File;
+
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.linuxtools.systemtap.ui.ide.IDESessionSettings;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.ide.preferences.IDEPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IUpdateListener;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences.PreferenceConstants;
+import org.eclipse.ui.PlatformUI;
+
+
+
+/**
+ * This class is used for obtaining all probes and functions from the tapsets.
+ * It will initially try to obtain the list from the TreeSettings.xml file, but
+ * if there is a problem doing that it will run the TapsetParser in order to
+ * obtain everything that way.
+ * @author Ryan Morse
+ */
+public final class TapsetLibrary {
+ public static TreeNode getProbes() {
+ return probeTree;
+ }
+
+ public static TreeNode getFunctions() {
+ return functionTree;
+ }
+
+ /**
+ * This mthod will attempt to get the most up-to-date information.
+ * However, if the TapsetParser is running already it will quit,
+ * assuming that new information will be avilable soon. By registering
+ * a listener at that point the class can be notified when an update is
+ * available.
+ */
+ public static void init() {
+ if(null != stpp && stpp.isRunning())
+ return;
+
+ if(IDEPlugin.getDefault().getPreferenceStore()
+ .getBoolean(IDEPreferenceConstants.P_STORED_TREE) &&
+ isTreeFileCurrent())
+ readTreeFile();
+ else
+ runStapParser();
+ }
+
+ /**
+ * This method will create a new instance of the TapsetParser in order
+ * to get the information directly from the files.
+ */
+ private static void runStapParser() {
+ String[] tapsets = IDEPlugin.getDefault().getPreferenceStore()
+ .getString(IDEPreferenceConstants.P_TAPSETS).split(File.pathSeparator);
+
+ stpp = new TapsetParser(tapsets);
+ stpp.start();
+ stpp.addListener(completionListener);
+ functionTree = stpp.getFunctions();
+ probeTree = stpp.getProbes();
+ }
+
+ /**
+ * This method will get all of the tree information from
+ * the TreeSettings xml file.
+ */
+ private static void readTreeFile() {
+ functionTree = TreeSettings.getFunctionTree();
+ probeTree = TreeSettings.getProbeTree();
+ }
+
+ /**
+ * This method checks to see if the tapsets have changed
+ * at all since the TreeSettings.xml file was created.
+ * @return boolean indecating whether or not the TreeSettings.xml file has the most up-to-date version
+ */
+ private static boolean isTreeFileCurrent() {
+ long treesDate = TreeSettings.getTreeFileDate();
+
+ IPreferenceStore p = IDEPlugin.getDefault().getPreferenceStore();
+ String[] tapsets = p.getString(IDEPreferenceConstants.P_TAPSETS).split(File.pathSeparator);
+
+ File f = getTapsetLocation(p);
+
+ if(!checkIsCurrentFolder(treesDate, f))
+ return false;
+
+ if(null != tapsets) {
+ for(int i=0; i<tapsets.length; i++) {
+ f = new File(tapsets[i]);
+ if(f.lastModified() > treesDate)
+ return false;
+ if(f.canRead() && !checkIsCurrentFolder(treesDate, f))
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * This method attempts to locate the default tapset directory.
+ * @param p Preference store where the tapset location might be stored
+ * @return File representing the default tapset location.
+ */
+ public static File getTapsetLocation(IPreferenceStore p) {
+ File f;
+ String path = p.getString(PreferenceConstants.P_ENV[2][0]);
+ if(path.trim().equals("")) {
+ f = new File("/usr/share/systemtap/tapset");
+ if(!f.exists()) {
+ f = new File("/usr/local/share/systemtap/tapset");
+ if(!f.exists()) {
+ InputDialog i = new InputDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ Localization.getString("TapsetBrowserView.TapsetLocation"), Localization.getString("TapsetBrowserView.WhereDefaultTapset"), "", null);
+ i.open();
+ p.setValue(PreferenceConstants.P_ENV[2][0], i.getValue());
+ f = new File( i.getValue() );
+ }
+ }
+ } else {
+ f = new File( p.getString(path) );
+ }
+ IDESessionSettings.tapsetLocation = f.getAbsolutePath();
+ return f;
+ }
+
+ /**
+ * This method checks the provided time stap against the folders
+ * time stamp. This is to see if the folder may have new data in it
+ * @param time The current time stamp
+ * @param folder The folder to check if it is newer the then time stamp
+ * @return boolean indicating whther the time stamp is newer then the folder
+ */
+ private static boolean checkIsCurrentFolder(long time, File folder) {
+ File[] fs = folder.listFiles();
+
+ for(int i=0; i<fs.length; i++) {
+ if(fs[i].lastModified() > time)
+ return false;
+
+ if(fs[i].isDirectory() && fs[i].canRead())
+ if(!checkIsCurrentFolder(time, fs[i]))
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Adds a new listener to the TapsetParser
+ * @param listener the listener to be added
+ * @return boolean indacating whether or not the listener was added
+ */
+ public static boolean addListener(IUpdateListener listener) {
+ if(null == stpp)
+ return false;
+
+ stpp.addListener(listener);
+ return true;
+ }
+
+ /**
+ * Removes the provided listener from the tapsetParser.
+ * @param listener The listener to be removed from the tapsetParser
+ */
+ public static void removeUpdateListener(IUpdateListener listener) {
+ stpp.removeListener(listener);
+ }
+
+ /**
+ * This class handles saving the results of the TapsetParser to
+ * the TreeSettings.xml file.
+ */
+ private static final IUpdateListener completionListener = new IUpdateListener() {
+ public void handleUpdateEvent() {
+ functionTree = stpp.getFunctions();
+ probeTree = stpp.getProbes();
+ if(stpp.isFinishSuccessful())
+ TreeSettings.setTrees(functionTree, probeTree);
+ }
+ };
+
+ private static TreeNode functionTree = null;
+ private static TreeNode probeTree = null;
+ private static TapsetParser stpp = null;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TapsetParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TapsetParser.java
new file mode 100644
index 0000000000..e7a41bdf45
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TapsetParser.java
@@ -0,0 +1,679 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.structures;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeDefinitionNode;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IUpdateListener;
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.LoggedCommand;
+
+
+
+/**
+ * Runs stap -vp1 & stap -up2 in order to get all of the probes/functions
+ * that are defined in the tapsets. Builds probeAlias and function trees
+ * with the values obtained from the tapsets.
+ *
+ * Ugly code is a result of two issues with getting stap output. First,
+ * many tapsets do not work under stap -up2. Second since the output
+ * is not a regular language, we can't create a nice lexor/parser combination
+ * to do everything nicely.
+ * @author Ryan Morse
+ */
+public class TapsetParser implements Runnable {
+ public TapsetParser(String[] tapsets) {
+ this.tapsets = tapsets;
+ listeners = new ArrayList<IUpdateListener>();
+ }
+
+ /**
+ * This method sets up everything that is needed before actually creating
+ * a new process. It will run the first pass of stap to build the tapset
+ * tree framework.
+ */
+ protected void init() {
+ disposed = false;
+ functions = new TreeNode("", false);
+ probes = new TreeNode("", false);
+
+ String s = readPass1(null);
+ parseLevel1(s);
+ cleanupTrees();
+ }
+
+ /**
+ * This method will initialize everything and then start the process running.
+ * This method should be called by any class wishing to run the parser.
+ */
+ public void start() {
+ stopped = false;
+ init();
+ Thread t = new Thread(this, "TapsetParser");
+ t.start();
+ }
+
+ /**
+ * This method chanegs the stop variable which is checked periodically by the
+ * running thread to see if it should stop running.
+ */
+ public synchronized void stop() {
+ stopped = true;
+ }
+
+ /**
+ * This method checks to see if the process has been asked to stop
+ * @return Boolean indicating whether or not a stop command has been received
+ */
+ public boolean isRunning() {
+ return !stopped;
+ }
+
+ /**
+ * This method checks to see if the process has been disposed or not.
+ * @return Boolean indicating whether or not the parser has been disposed.
+ */
+ public boolean isDisposed() {
+ return disposed;
+ }
+
+ /**
+ * Returns the root node of the tree of functions generated by
+ * parseFiles. Functions are grouped by source file.
+ * @return A tree of tapset functions grouped by file.
+ */
+ public synchronized TreeNode getFunctions() {
+ return functions;
+ }
+
+ /**
+ * Returns the root node of the tree of the probe alias generated by
+ * parseFiles. Probes are grouped by target location.
+ * @return A tree of tapset probe aliases grouped by probe location.
+ */
+ public synchronized TreeNode getProbes() {
+ return probes;
+ }
+
+ /**
+ * This method checks to see if the parser completed executing on its own.
+ * @return Boolean indicating whether or not the thread finished on its own.
+ */
+ public boolean isFinishSuccessful() {
+ return successfulFinish;
+ }
+
+ /**
+ * Runs stap -up2 on both the function and the probe trees. At this
+ * point the trees are both filled with all data obtained from stap -vp1
+ * After each tree is finished, an update event will be fired so callers
+ * know that they can update.
+ */
+ public void run() {
+ runPass2Functions();
+ fireUpdateEvent(); //Inform listeners that a new batch of functions has variable info
+ runPass2Probes();
+ fireUpdateEvent(); //Inform listeners that a new batch of probes has variable info
+ stop();
+ successfulFinish = true;
+ fireUpdateEvent(); //Inform listeners that everything is done
+ }
+
+ /**
+ * This method will register a new listener with the parser
+ * @param listener The listener that will receive updateEvents
+ */
+ public void addListener(IUpdateListener listener) {
+ if(null != listener)
+ listeners.add(listener);
+ }
+
+ /**
+ * This method will unregister the listener with the parser
+ * @param listener The listener that no longer wants to recieve update events
+ */
+ public void removeListener(IUpdateListener listener) {
+ if(null != listener)
+ listeners.remove(listener);
+ }
+
+ /**
+ * This method will fire an updateEvent to all listeners.
+ */
+ private void fireUpdateEvent() {
+ for(int i=0; i<listeners.size(); i++)
+ ((IUpdateListener)listeners.get(i)).handleUpdateEvent();
+ }
+
+ /**
+ * Runs the stap with the given options and returns the output generated
+ * @param options String[] of any optional parameters to pass to stap
+ * @param probe String containing the script to run stap on
+ * @param level integer representing what point to stop stap at (1,2,3,4,5)
+ */
+ protected String runStap(String[] options, String probe, int level) {
+ String[] script = null;
+
+ int size = 4; //start at 4 for stap, -pX, -e, script
+ if(null != tapsets && tapsets.length > 0 && tapsets[0].trim().length() > 0)
+ size += tapsets.length<<1;
+ if(null != options && options.length > 0 && options[0].trim().length() > 0)
+ size += options.length;
+
+ script = new String[size];
+ script[0] = "stap";
+ script[1] = "-p" + level;
+ script[size-2] = "-e";
+ script[size-1] = probe;
+
+ //Add extra tapset directories
+ if(null != tapsets && tapsets.length > 0 && tapsets[0].trim().length() > 0) {
+ for(int i=0; i<tapsets.length; i++) {
+ script[2+(i<<1)] = "-I";
+ script[3+(i<<1)] = tapsets[i];
+ }
+ }
+ if(null != options && options.length > 0 && options[0].trim().length() > 0) {
+ for(int i=0; i<options.length; i++)
+ script[script.length-options.length-2+i] = options[i];
+ }
+
+ LoggedCommand cmd = new LoggedCommand(script, null, null, 0);
+ cmd.start();
+
+ //Block to prevent errors.
+ while(cmd.isRunning()) {
+ try {
+ Thread.sleep(100);
+ } catch(InterruptedException e) {
+ LogManager.logCritical("InterruptedException runStap: " + e.getMessage(), this);
+ }
+ }
+
+ cmd.stop(); //While stop was already called we do this to ensure things are shutdown before proceding
+ String s = cmd.getOutput();
+ cmd.dispose();
+
+ return s;
+ }
+
+ /**
+ * Returns a String containing all of the content from the files
+ * contained in the tapset libraries. This file always returns
+ * what ever it could get, even if an exception was generated.
+ *
+ * stap -vp1 -e 'probe begin{}'
+ * Will list everything defined in the tapsets
+ * @return the tapset library consolodated into a single string
+ */
+ private String readPass1(String script) {
+ String[] options;
+ if(null == script) {
+ script = "probe begin{}";
+ options = new String[] {"-v"};
+ } else {
+ options = null;
+ }
+
+ return runStap(options, script, 1);
+ }
+
+ /**
+ * Parses the output generated from running stap -vp1. Pulls out all functions
+ * and probe aliases from the provided string. Populates the probe and function
+ * trees.
+ *
+ * ProbeTree organized as:
+ * Root->Files->ProbePoints->Variables
+ *
+ * FunctionTree organized as:
+ * Root->Files->Functions
+ * @param s The entire output from running stap -vp1.
+ */
+ private void parseLevel1(String s) {
+ String prev = null;
+ String prev2 = null;
+ StringBuilder token = new StringBuilder("");
+ TreeNode parent;
+ TreeNode item;
+ char currChar;
+ boolean isProbe = false;
+
+ boolean contains;
+ TreeNode child;
+ int z;
+
+ for(int i=0; i<s.length(); i++) {
+ currChar = s.charAt(i);
+
+ if(!Character.isWhitespace(currChar) && '}' != currChar && '{' != currChar) {
+ token.append(currChar);
+ } else if(token.length() > 0){
+ prev2 = prev;
+ prev = token.toString();
+ token.delete(0, token.length());
+ }
+
+ //Only check for new values when starting a fresh token.
+ if(1 == token.length()) {
+ if("probe".equals(prev2) && "=".equals(token.toString())) {
+ //Probe alias found
+ do {
+ currChar = s.charAt(++i);
+ token.append(currChar);
+ } while('{' != currChar && i < s.length());
+
+ parent = probes.getChildAt(probes.getChildCount()-1);
+ parent.add(new TreeDefinitionNode("probe " + token.toString().substring(2, token.length()-1), prev, parent.getData().toString(), true));
+ isProbe = true;
+ } else if("function".equals(prev2)) {
+ //Function found
+ do {
+ currChar = s.charAt(++i);
+ token.append(currChar);
+ } while(')' != currChar && i < s.length());
+
+ parent = functions.getChildAt(functions.getChildCount()-1);
+ parent.add(new TreeDefinitionNode(prev + token.toString(), prev + token.toString(), parent.getData().toString(), true));
+ isProbe = false;
+ } else if("file".equals(prev2)) {
+ //New file started
+ if(prev.lastIndexOf('/') > 0)
+ prev2 = prev.substring(prev.lastIndexOf('/')+1);
+ functions.add(new TreeNode(prev, prev2, false));
+ probes.add(new TreeNode(prev, prev2, false));
+ isProbe = false;
+ }
+ } else if(prev2 != null && prev2.length() > 2 && token.length() > 2 && isProbe &&
+ '(' == prev2.charAt(0) && ')' == prev2.charAt(prev2.length()-1) &&
+ '(' == token.charAt(0) && ')' == token.charAt(token.length()-1) &&
+ "=".equals(prev)) {
+ //Put all variables in the probe tree
+ item = probes.getChildAt(probes.getChildCount()-1);
+ prev2 = prev2.substring(1,prev2.length()-1);
+
+ child = item.getChildAt(item.getChildCount()-1);
+ contains = false;
+ for(z=0; z<child.getChildCount(); z++) {
+ if(child.getChildAt(z).toString().equals(prev2)) {
+ contains = true;
+ break;
+ }
+ }
+
+ if(!contains)
+ child.add(new TreeNode(prev2 + ":unknown", prev2, false));
+
+ prev2 = null;
+ }
+ }
+ }
+
+ /**
+ * This method is used to build up the list of functions that were found
+ * durring the first pass of stap. These functions will then all be passed
+ * on to have stap -up2 run on them in order to find the variable types
+ * associated with them.
+ */
+ private void runPass2Functions() {
+ int i, j, k, l=0;
+ TreeNode child;
+ String function;
+ String[] parameters = new String[0];
+ StringBuilder probe = new StringBuilder("");
+
+ ArrayList<String> functionNames = new ArrayList<String>();
+
+ //Add Functions
+ for(i=0; i<functions.getChildCount(); i++) {
+ child = functions.getChildAt(i);
+ for(j=0; j<child.getChildCount(); j++) {
+ probe.delete(0, probe.length());
+ function = child.getChildAt(j).toString();
+ probe.append(function.substring(0, function.indexOf("(")+1));
+ function = function.substring(function.indexOf("(")+1, function.indexOf(")"));
+ parameters = function.split(",");
+
+ //Make sure each parameter has a distinct name so there isn't a type problem
+ if(parameters[0].length() > 0) {
+ for(k=0; k<parameters.length; k++) {
+ if(k>0)
+ probe.append(",");
+ probe.append(parameters[k] + l++);
+ }
+ }
+ probe.append(")\n");
+ functionNames.add(probe.toString());
+ }
+ }
+ parameters = (String[])functionNames.toArray(parameters);
+ runPass2FunctionSet(parameters, 0, parameters.length-1);
+ }
+
+ /**
+ * This method runs stap -up2 on the specified group of functions.
+ * If errors result, it will break the batch in half and run again
+ * on each subset
+ * @param funcs The list of all functions available in the tapsets
+ * @param low The lower bound of functions to use in this set
+ * @param high The upper bound of functions to use in this set
+ */
+ private void runPass2FunctionSet(String[] funcs, int low, int high) {
+ if(low == high)
+ return;
+ if(stopped)
+ return;
+
+ StringBuilder functionStr = new StringBuilder("probe begin{\n");
+ for(int i=low; i<high; i++)
+ functionStr.append(funcs[i]);
+ functionStr.append("}\n");
+
+ String result = runStap(new String[] {"-u"}, functionStr.toString(), 2);
+
+ if(0 < result.trim().length()) {
+ parsePass2Functions(result);
+ } else if(low+1 != high) {
+ runPass2FunctionSet(funcs, low, low+((high-low)>>1));
+ runPass2FunctionSet(funcs, low+((high-low)>>1), high);
+ }
+ }
+
+ /**
+ * Runs stap -up2 on the probe tree. The tree is broken up into
+ * smaller components to allow components to be completed at a time.
+ */
+ private void runPass2Probes() {
+ //Add Probes
+ TreeNode temp;
+ for(int i=0; i<probes.getChildCount(); i++) {
+ if(stopped)
+ return;
+ temp = probes.getChildAt(i);
+ runPass2ProbeSet(temp, 0, temp.getChildCount());
+ }
+ }
+
+ /**
+ * Runs stap -up2 on the selected probe group, using high and low
+ * to determin which subelements to select.
+ * @param probe The top level probe group to probe.
+ * @param low The lower bound of child elements of probe to include
+ * @param high The upper bound of child elements of probe to inclue
+ */
+ private void runPass2ProbeSet(TreeNode probe, int low, int high) {
+ if(low == high)
+ return;
+
+ TreeNode temp;
+ StringBuilder probeStr = new StringBuilder("");
+ String result;
+
+ for(int i=low; i<high; i++) {
+ temp = probe.getChildAt(i);
+ if(temp.getData().toString().startsWith("probe"))
+ probeStr.append("\nprobe " + temp.toString() + "{}");
+ else
+ runPass2ProbeSet(temp, 0, temp.getChildCount());
+ }
+ result = runStap(new String[] {"-u"}, probeStr.toString(), 2);
+
+ if(0 < result.trim().length()) {
+ boolean success = parsePass2Probes(result, probe);
+ if(!success) {
+ runPass2ProbeSet(probe, low, low+((high-low)>>1));
+ runPass2ProbeSet(probe, low+((high-low)>>1), high);
+ }
+ } else if(low+1 != high) {
+ runPass2ProbeSet(probe, low, low+((high-low)>>1));
+ runPass2ProbeSet(probe, low+((high-low)>>1), high);
+ }
+ }
+
+ /**
+ * Removes all directories that do not contain any fuctions or
+ * probe aliases from both trees.
+ */
+ protected void cleanupTrees() {
+ for(int i=functions.getChildCount()-1; i>=0; i--) {
+ if(0 == functions.getChildAt(i).getChildCount())
+ functions.remove(i);
+ if(0 == probes.getChildAt(i).getChildCount())
+ probes.remove(i);
+ }
+
+ functions.sortTree();
+ probes.sortTree();
+
+ formatProbes();
+ }
+
+ /**
+ * Reorders the probes tree so that probes are grouped by type
+ * instead of by file they were defined in.
+ *
+ * ProbeTree organized by class grouping. ie:
+ * syscall
+ * syscall.open
+ * filename
+ * flags
+ * mode
+ * name
+ * syscall.open.return
+ * name
+ * retstr
+ * syscall.read
+ * ...
+ * tcp
+ * tcp.disconnect
+ * tcp.disconnect.return
+ */
+ private void formatProbes() {
+ TreeNode probes2 = new TreeNode("", false);
+ TreeNode probe, fileNode, probeGroup, probeFolder;
+ String directory;
+ String[] folders;
+ boolean added;
+
+ for(int j,i=0; i<probes.getChildCount(); i++) { //Probe main group
+ fileNode = probes.getChildAt(i);
+ for(j=0; j<fileNode.getChildCount(); j++) { //Actual probes
+ probe = fileNode.getChildAt(j);
+
+ directory = probe.toString();
+ if(directory.endsWith(".return") || directory.endsWith(".entry"))
+ directory = directory.substring(0, directory.lastIndexOf('.'));
+ folders = directory.split("\\.");
+
+ probeGroup = probes2;
+ for(int k=0; k<folders.length-1; k++) { //Complete path directory
+ added = false;
+ for(int l=0; l<probeGroup.getChildCount(); l++) { //Destination folder
+ probeFolder = probeGroup.getChildAt(l);
+ if(probeFolder.toString().equals(folders[k])) {
+ probeGroup = probeFolder;
+ added = true;
+ break;
+ }
+ }
+ if(!added) { //Create brand new folder since it doesn't exist yet
+ probeFolder = new TreeNode(folders[k], false);
+ probeGroup.add(probeFolder);
+ probeGroup = probeFolder;
+ }
+ }
+ probeGroup.add(probe); //Add the probe to its appropriate directory
+ }
+ }
+ probes = probes2;
+ probes.sortTree();
+ }
+
+ /**
+ * Parses the output generated from running stap -up2 on the list of functions.
+ * Will update the function tree with return values for each function.
+ * @param s The entire output from running stap -up2 on the functions.
+ */
+ private void parsePass2Functions(String s) {
+ int i, j, k;
+ TreeNode child, child2;
+ String childString;
+ String[] functionLines = new String[0];
+ if(s.contains("# functions") && s.contains("# probes"))
+ functionLines = s.substring(s.indexOf("# functions"), s.indexOf("# probes")).split("\n");
+
+ //Rename the functions with types
+ for(i=0; i<functionLines.length; i++) {
+ for(j=0; j<functions.getChildCount(); j++) {
+ child = functions.getChildAt(j);
+ for(k=0; k<child.getChildCount(); k++) {
+ child2 = child.getChildAt(k);
+ childString = child2.toString();
+ if (childString.indexOf("(") != -1) {
+ if(functionLines[i].startsWith(childString.substring(0, childString.indexOf("(")).trim() + ":")) {
+ child2.setData(functionLines[i]);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Parses the output generated from running stap -up2 on the list of probes.
+ * Will update the probe alias tree with additional variables, as well as
+ * placing the type associated with the variable.
+ * @param s The entire output from running stap -up2 on the provided probeSet.
+ * @param probeSet The group of probes that the String s corresponds to
+ */
+ private boolean parsePass2Probes(String s, TreeNode probeSet) {
+ LogManager.logDebug("Start parseLevel2Probes: probeSet-" + probeSet, this);
+ TreeNode tree = new TreeNode("", false);
+ TreeNode probe = null;
+ String[] probeLines = null;
+ boolean variables = false;
+ String line;
+
+ if(s.contains("# probes"))
+ probeLines = s.substring(s.indexOf("# probes")).split("\n");
+
+ if(null == probeLines)
+ return false;
+
+ //Build Pass 2 tree
+ for(int i=0; i<probeLines.length; i++) {
+ line = probeLines[i].trim();
+
+ if(line.startsWith("kernel.")) {
+ probe = new TreeNode(line, false);
+ tree.add(probe);
+ //probe = lookupProbe(line, probeSet);
+ variables = false;
+ } else if(line.equals("# locals") && null != probe) {
+ variables = true;
+ } else if(null != probe && variables) {
+ if(line.contains(":"))
+ probe.add(new TreeNode(line, line.substring(0, line.lastIndexOf(":")).trim(), false));
+ } else {
+ probe = null;
+ }
+ }
+
+ //Consolidate pass1 and pass2 trees
+ int i, j, k, l;
+ boolean matched;
+ TreeNode one, two, oneC, twoC;
+ for(i=0; i<probeSet.getChildCount(); i++) {
+ for(j=0; j<tree.getChildCount(); j++) {
+ one = probeSet.getChildAt(i);
+ two = tree.getChildAt(j);
+
+ if(probesMatch(one, two)) {
+ for(l=0; l<two.getChildCount(); l++) {
+ matched = false;
+ twoC = two.getChildAt(l);
+ for(k=0; k<one.getChildCount(); k++) {
+ oneC = one.getChildAt(k);
+ if(oneC.getData().toString().substring(0, oneC.getData().toString().indexOf(":")).
+ equals(twoC.getData().toString().substring(0, twoC.getData().toString().indexOf(":")))) {
+ oneC.setData(twoC.getData());
+ matched = true;
+ }
+ }
+ if(!matched)
+ one.add(new TreeNode(twoC.getData(), twoC.toString(), false));
+ }
+ }
+ }
+ }
+
+ tree.dispose();
+ tree = null;
+ return true;
+ }
+
+ /**
+ * Compares the probes contained in the treeNodes to make sure they
+ * are actually probing the same kernel location.
+ * @param one A treeNode generated from stap -p1.
+ * @param two A treeNode generated from stap -up2.
+ * @return A boolean signifing if the treeNodes represent the same probe point.
+ */
+ private boolean probesMatch(TreeNode one, TreeNode two) {
+ try {
+ String valOneA = one.getData().toString();
+ String valTwoA = two.getData().toString();
+ String valOneB = "";
+ String valTwoB = valTwoA.substring(valTwoA.indexOf("\"")+1, valTwoA.indexOf("@"));
+
+ if(valOneA.contains("\""))
+ valOneB = valOneA.substring(valOneA.indexOf("\"")+1);
+ if(valOneB.contains("\""))
+ valOneB = valOneB.substring(0, valOneB.indexOf("\""));
+
+ if(valOneB.equals(valTwoB)) {
+ if(valOneA.contains(".return") == valTwoA.contains(".return"))
+ return true;
+ }
+ } catch(Exception e) {
+ LogManager.logCritical("Exception probesMatch: " + e.getMessage() + "\n" + one + "\n" + two, this);
+ }
+ return false;
+ }
+
+ /**
+ * This method will clean up everything from the run.
+ */
+ public void dispose() {
+ if(!disposed) {
+ disposed = true;
+ functions.dispose();
+ functions = null;
+ probes.dispose();
+ probes = null;
+ tapsets = null;
+ listeners.clear();
+ listeners = null;
+ }
+ }
+
+ private boolean stopped = true;
+ private boolean disposed = true;
+ private boolean successfulFinish = false;
+ private ArrayList<IUpdateListener> listeners;
+ private TreeNode functions;
+ private TreeNode probes;
+ private String[] tapsets;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TreeSettings.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TreeSettings.java
new file mode 100644
index 0000000000..0aa7b77492
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/structures/TreeSettings.java
@@ -0,0 +1,253 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.structures;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Calendar;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeDefinitionNode;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.SystemTapGUISettings;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.XMLMemento;
+
+
+/**
+ * Handles access to the cached stap tapset library tree, including reading the cache back from disk
+ * on startup, writing the cache to disk when the cache is initially generated, checking to make sure
+ * that the cache is up-to-date, and providing accessor methods to the rest of the IDE that allow other
+ * classes to use the cached tree data.
+ * @author Ryan Morse
+ */
+public final class TreeSettings {
+ private TreeSettings() {
+ }
+ /**
+ * Returns the modification date for the Tree File. Used to make sure that the cache is not out of
+ * date.
+ * @return The datestamp for the Tree file.
+ */
+ public static long getTreeFileDate() {
+ if(!readData()) return -1;
+ return treeFileDate;
+ }
+
+ /**
+ * Allows access to the Tapset Function tree, which contains information about all
+ * functions stored in the tapset library.
+ * @return The <code>TreeNode</code> root of the Function tree.
+ */
+ public static TreeNode getFunctionTree() {
+ if(!readData()) return null;
+ return functions;
+ }
+
+ /**
+ * Allows access to the Tapset Probe Alias tree, which contains a list of all probe aliases
+ * in the tapset library.
+ * @return The <code>TreeNode</code> root of the Probe Alias tree.
+ */
+ public static TreeNode getProbeTree() {
+ if(!readData()) return null;
+ return probes;
+ }
+
+ /**
+ * Sets the Probe Alias and Function trees that are being cached to the trees given as arguments.
+ * @param func The Function tree to store in cache.
+ * @param probe The Probe Alias tree to store in cache.
+ * @return True if the caching is successful.
+ */
+ public static boolean setTrees(TreeNode func, TreeNode probe) {
+ if(null == func || null == probe) return false;
+ functions = func;
+ probes = probe;
+ return writeData();
+ }
+
+ /**
+ * Reads the contents of the cache file into memory.
+ * @return True if the read is successful.
+ */
+ private static boolean readData() {
+ if(null == settingsFile && !openFile())
+ return false;
+
+ try {
+ FileReader reader = new FileReader(settingsFile);
+
+ if(!reader.ready())
+ return false;
+
+ XMLMemento data = XMLMemento.createReadRoot(reader, "TreeSettings");
+
+ IMemento child = data.getChild("functionTree");
+ String s = child.getString("string");
+ if("<null>".equals(s))
+ s = null;
+ String d = child.getString("data");
+ if("<null>".equals(d))
+ d = null;
+
+ functions = new TreeNode(d, s, false);
+ readTree(child, functions, 0);
+
+ child = data.getChild("probeTree");
+ s = child.getString("string");
+ if("<null>".equals(s))
+ s = null;
+ d = child.getString("data");
+ if("<null>".equals(d))
+ d = null;
+ probes = new TreeNode(d, s, false);
+ readTree(child, probes, 0);
+
+ child = data.getChild("modifiedDate");
+ treeFileDate = Long.parseLong(child.getString("date"));
+ } catch(FileNotFoundException fnfe) {
+ return false;
+ } catch(WorkbenchException we) {
+ return false;
+ } catch(Exception e) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Writes the tree data currently stored by this class to disk for later access.
+ * @return True if the write is successful.
+ */
+ private static boolean writeData() {
+ if(null == settingsFile && !openFile())
+ return false;
+
+ try {
+ XMLMemento data = XMLMemento.createWriteRoot("TreeSettings");
+
+ IMemento child = data.createChild("functionTree");
+ writeTree(child, functions, 0);
+
+ child = data.createChild("probeTree");
+ writeTree(child, probes, 0);
+
+ child = data.createChild("modifiedDate");
+ child.putString("date", (new Long(Calendar.getInstance().getTimeInMillis())).toString());
+
+ FileWriter writer = new FileWriter(settingsFile);
+ data.save(writer);
+ } catch(FileNotFoundException fnfe) {
+ return false;
+ } catch(Exception e) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Writes the tree passed in to the <code>IMemento</code> argument, up to the specified depth.
+ * @param child The <code>IMemento</code> to store the tree to.
+ * @param tree The <code>TreeNode</code> to store.
+ * @param depth The maximum depth level to write out.
+ */
+ private static void writeTree(IMemento child, TreeNode tree, int depth) {
+ if(null == tree.toString())
+ child.putString("string", "<null>");
+ else
+ child.putString("string", tree.toString());
+
+ if(null == tree.getData())
+ child.putString("data","<null>");
+ else
+ child.putString("data", tree.getData().toString());
+
+ if(tree instanceof TreeDefinitionNode) {
+ if(null == ((TreeDefinitionNode)tree).getDefinition())
+ child.putString("definition","<null>");
+ else
+ child.putString("definition", ((TreeDefinitionNode)tree).getDefinition().toString());
+ }
+
+ child.putInteger("click", (tree.isClickable()?1:0));
+ for(int i=0; i<tree.getChildCount(); i++) {
+ writeTree(child.createChild("level" + depth), tree.getChildAt(i), depth+1);
+ }
+ }
+
+ /**
+ * Opposite action as writeTree. Reads the <code>IMemento</code> passed in into the <code>TreeNode</code>
+ * up to the requested maximum depth.
+ * @param data The <code>IMemento</code> to read the tree out of.
+ * @param parent The <code>TreeNode</code> to store the tree in.
+ * @param depth The maximum depth to read.
+ */
+ private static void readTree(IMemento data, TreeNode parent, int depth) {
+ IMemento[] children = data.getChildren("level" + depth);
+
+ try {
+ if(null != children) {
+ for(int i=0; i<children.length; i++) {
+ String s = children[i].getString("string");
+ String d = children[i].getString("data");
+ String def = children[i].getString("definition");
+
+ boolean c = ((0==children[i].getInteger("click").intValue())?false:true);
+
+ if("<null>".equals(s))
+ s = null;
+ if("<null>".equals(d))
+ d = null;
+
+ TreeNode t;
+ if(null == def) {
+ t = new TreeNode(d, s, c);
+ } else {
+ if("<null>".equals(def))
+ def = null;
+
+ t = new TreeDefinitionNode(d, s, def, c);
+ }
+ parent.add(t);
+
+ readTree(children[i], t, depth+1);
+ }
+ }
+ } catch(NullPointerException e) {
+ }
+ }
+
+ private static boolean openFile() {
+ settingsFile = new File(SystemTapGUISettings.settingsFolder.getAbsolutePath() + fileName);
+
+ try {
+ if (!settingsFile.exists())
+ settingsFile.createNewFile();
+ } catch(IOException ioe) {
+ return false;
+ }
+
+ return true;
+ }
+
+ private static long treeFileDate;
+ private static TreeNode functions;
+ private static TreeNode probes;
+ private static final String fileName = "/TreeSettings.xml";
+ private static File settingsFile = null;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/uistructures/StapSettingsDialog.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/uistructures/StapSettingsDialog.java
new file mode 100644
index 0000000000..a7d78eea64
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/uistructures/StapSettingsDialog.java
@@ -0,0 +1,178 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.uistructures;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.ide.preferences.IDEPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+
+import org.eclipse.swt.widgets.Label;
+
+
+/**
+ * A dialog box displayed to prompt the user for additional arguments to pass to stap when the
+ * user presses the Run with Options button.
+ * @author Ryan Morse
+ *
+ */
+public class StapSettingsDialog extends Dialog {
+ public StapSettingsDialog(Shell parentShell) {
+ super(parentShell);
+ LogManager.logDebug("Start/End StapSettingsDialog: parentShell-" + parentShell, this);
+ LogManager.logInfo("Initializing", this);
+ }
+
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ LogManager.logDebug("Start configureShell: shell-" + shell, this);
+ shell.setText(Localization.getString("StapSettingsDialog.StapOptions"));
+ shell.setSize(new org.eclipse.swt.graphics.Point(640,170 + ((1+checkBox.length)>>1) + 50*((1+text.length)>>1)));
+ LogManager.logDebug("End configureShell:", this);
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ LogManager.logDebug("Start createDialogArea: parent-" + parent, this);
+ Composite comp = (Composite) super.createDialogArea(parent);
+
+ //Check boxes
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 2;
+ cmpChkBoxes = new Composite(comp, SWT.NONE);
+ cmpChkBoxes.setLayout(gridLayout);
+ cmpChkBoxes.setBounds(new Rectangle(100,5,460,30*((1+checkBox.length)>>1)));
+
+ int i;
+ for(i=0; i<IDEPreferenceConstants.P_STAP.length - IDEPreferenceConstants.P_STAP_OPTS.length; i++) {
+ checkBox[i] = new Button(cmpChkBoxes, SWT.CHECK);
+ checkBox[i].setText(IDEPreferenceConstants.P_STAP[i][0] + IDEPreferenceConstants.P_STAP[i][1]);
+ checkBox[i].setBackground(cmpChkBoxes.getBackground());
+ }
+
+ //Labels and Text fields
+ cmpTxtBoxes = new Composite(comp, SWT.NONE);
+ cmpTxtBoxes.setBounds(new Rectangle(5,5+30*((1+checkBox.length)>>1),620,50*((1+text.length)>>1)));
+
+ for(int j=0; j<IDEPreferenceConstants.P_STAP_OPTS.length; i++, j++) {
+ label[j] = new Label(cmpTxtBoxes, SWT.NONE);
+ label[j].setBounds(new Rectangle(320*(j/5),50*(j%5),300,17));
+ label[j].setText(IDEPreferenceConstants.P_STAP[i][0] + IDEPreferenceConstants.P_STAP[i][1]);
+ label[j].setBackground(cmpChkBoxes.getBackground());
+ text[j] = new Text(cmpTxtBoxes, SWT.BORDER);
+ text[j].setBounds(new Rectangle(320*(j/5),20+50*(j%5),300,27));
+
+ if("-v".equals(IDEPreferenceConstants.P_STAP[i][0])) {
+ text[j].addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ if('v' != e.character) {
+ e.doit = false;
+ }
+ }
+
+ public void keyReleased(KeyEvent e) {}
+ });
+ } else if("-p NUM".equals(IDEPreferenceConstants.P_STAP[i][0])) {
+ text[j].addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ if(32 <= e.character && 126 >= e.character) {
+ if('1' > e.character || '5' < e.character)
+ e.doit = false;
+ else if(0 < text[1].getText().length())
+ e.doit = false;
+ }
+ }
+
+ public void keyReleased(KeyEvent e) {}
+ });
+ } else if("-s NUM".equals(IDEPreferenceConstants.P_STAP[i][0])) {
+ text[j].addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ if(32 <= e.character && 126 >= e.character) {
+ if(!Character.isDigit(e.character))
+ e.doit = false;
+ }
+ }
+
+ public void keyReleased(KeyEvent e) {}
+ });
+ }
+ }
+
+ LogManager.logDebug("End createDialogArea: returnVal-" + comp, this);
+ return comp;
+ }
+
+ protected void buttonPressed(int buttonID) {
+ LogManager.logDebug("Start buttonPressed: buttonID-" + buttonID, this);
+ if(0 == buttonID) { //OK
+ cmdOpts = new boolean[checkBox.length];
+ cmdOptVals = new String[text.length];
+
+ for(int i=0; i<cmdOpts.length; i++)
+ cmdOpts[i] = checkBox[i].getSelection();
+
+ for(int i=0; i<cmdOptVals.length; i++)
+ cmdOptVals[i] = text[i].getText();
+ }
+
+ super.buttonPressed(buttonID);
+ LogManager.logDebug("End buttonPressed:", this);
+ }
+
+ public boolean[] getStapOpts() {
+ LogManager.logDebug("Start/End getStapOpts: returnVal-" + cmdOpts, this);
+ return cmdOpts;
+ }
+
+ public String[] getStapOptVals() {
+ LogManager.logDebug("Start/End getStapOptVals: returnVal-" + cmdOptVals, this);
+ return cmdOptVals;
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ cmdOpts = null;
+ cmdOptVals = null;
+ cmpChkBoxes.dispose();
+ cmpTxtBoxes.dispose();
+ for(int i=0; i<checkBox.length; i++)
+ checkBox[i].dispose();
+ checkBox = null;
+ for(int i=0; i<label.length; i++) {
+ label[i].dispose();
+ text[i].dispose();
+ }
+ label = null;
+ text = null;
+ }
+
+ //private static String[] tapsets = null;
+ private static boolean[] cmdOpts = null;
+ private static String[] cmdOptVals = null;
+
+ private Composite cmpChkBoxes = null;
+ private Composite cmpTxtBoxes = null;
+ private Button checkBox[] = new Button[IDEPreferenceConstants.P_STAP.length - IDEPreferenceConstants.P_STAP_OPTS.length];
+ private Label label[] = new Label[IDEPreferenceConstants.P_STAP_OPTS.length];
+ private Text text[] = new Text[IDEPreferenceConstants.P_STAP_OPTS.length];
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/BrowserView.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/BrowserView.java
new file mode 100644
index 0000000000..4d27c13b14
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/BrowserView.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.views;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.linuxtools.systemtap.ui.editor.RecentFileMenuManager;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IUpdateListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+
+
+/**
+ * The parent class of the Kernel Source browser, and grandparent of the Tapset browsers.
+ * Contains code common to all three of those classes.
+ * @author Ryan Morse
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.views.KernelBrowserView
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.views.FunctionBrowserView
+ * @see org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView
+ */
+public abstract class BrowserView extends ViewPart {
+ protected TreeViewer viewer;
+
+ public BrowserView() {
+ super();
+ }
+
+ /**
+ * Provides an interface for the TreeViewer to interact with the internal TreeNode data structure.
+ * @author Ryan Morse
+ *
+ */
+ class ViewContentProvider implements IStructuredContentProvider, ITreeContentProvider {
+ public void inputChanged(Viewer v, Object oldInput, Object newInput) {}
+
+ public void dispose() {}
+
+ public Object[] getElements(Object parent) {
+ return getChildren(parent);
+ }
+
+ public Object getParent(Object child) {
+ return null;
+ }
+
+ public Object[] getChildren(Object par) {
+ TreeNode parent = ((TreeNode)par);
+
+ Object[] children = new Object[parent.getChildCount()];
+
+ for(int i=0; i<children.length; i++) {
+ children[i] = parent.getChildAt(i);
+ }
+
+ return children;
+ }
+
+ public boolean hasChildren(Object parent) {
+ return ((TreeNode)parent).getChildCount() > 0;
+ }
+ }
+
+ /**
+ * Provides the icon and text for each entry in the tapset tree.
+ * @author Ryan Morse
+ */
+ class ViewLabelProvider extends LabelProvider {
+ public String getText(Object obj) {
+ return obj.toString();
+ }
+
+ public Image getImage(Object obj) {
+ TreeNode treeObj = (TreeNode)obj;
+ Image img;
+ String item = treeObj.getData().toString();
+
+ img = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
+ if (treeObj.getChildCount() > 0)
+ img = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
+
+
+ //Kernel Source
+ if(item.endsWith(".c"))
+ img = IDEPlugin.getImageDescriptor("icons/files/file_c.gif").createImage();
+ if(item.endsWith(".h"))
+ img = IDEPlugin.getImageDescriptor("icons/files/file_h.gif").createImage();
+
+ //Functions
+ if(item.endsWith(")") && !item.endsWith("\")")) {
+ item = item.substring(0, item.indexOf("(")).trim();
+ if(item.endsWith(":long"))
+ img = IDEPlugin.getImageDescriptor("icons/vars/var_long.gif").createImage();
+ else if(item.endsWith(":string"))
+ img = IDEPlugin.getImageDescriptor("icons/vars/var_str.gif").createImage();
+ else //if(item.endsWith(":unknown"))
+ img = IDEPlugin.getImageDescriptor("icons/vars/var_void.gif").createImage();
+ } else {
+ //Probes
+ if(item.startsWith("probe"))
+ img = IDEPlugin.getImageDescriptor("icons/misc/probe_obj.gif").createImage();
+
+ //Probe variables
+ if(item.endsWith(":long"))
+ img = IDEPlugin.getImageDescriptor("icons/vars/var_long.gif").createImage();
+ else if(item.endsWith(":string"))
+ img = IDEPlugin.getImageDescriptor("icons/vars/var_str.gif").createImage();
+ else if(item.endsWith(":unknown"))
+ img = IDEPlugin.getImageDescriptor("icons/vars/var_unk.gif").createImage();
+ }
+
+ return img;
+ }
+ }
+
+ public void createPartControl(Composite parent) {
+ parent.getShell().setCursor(new Cursor(parent.getShell().getDisplay(), SWT.CURSOR_WAIT));
+ viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ viewer.setContentProvider(new ViewContentProvider());
+ viewer.setLabelProvider(new ViewLabelProvider());
+ RecentFileMenuManager.getInstance().registerActionBar(getViewSite().getActionBars());
+ }
+
+ public TreeViewer getViewer() {
+ return viewer;
+ }
+
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+
+ public void dispose() {
+ super.dispose();
+ viewer = null;
+ }
+
+ abstract void refresh();
+
+ protected class ViewUpdater implements IUpdateListener {
+ public void handleUpdateEvent() {
+ viewer.getControl().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ refresh();
+ }
+ });
+ }
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/FunctionBrowserView.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/FunctionBrowserView.java
new file mode 100644
index 0000000000..e2c48b8b26
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/FunctionBrowserView.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.views;
+
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.linuxtools.systemtap.ui.ide.actions.hidden.FunctionBrowserAction;
+import org.eclipse.linuxtools.systemtap.ui.ide.structures.TapsetLibrary;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IWorkbenchActionConstants;
+
+
+
+/**
+ * This class is the Function Tapset Browser, which provides a list of all of the functions
+ * defined in the tapset library for the user to browse through.
+ * @author Ryan Morse
+ * @author Henry Hughes
+ */
+public class FunctionBrowserView extends BrowserView {
+ public FunctionBrowserView() {
+ super();
+ LogManager.logInfo("Initializing", this);
+ }
+
+ /**
+ * Creates the UI on the given <code>Composite</code>
+ */
+ public void createPartControl(Composite parent) {
+ LogManager.logDebug("Start createPartControl: parent-" + parent, this);
+ super.createPartControl(parent);
+ TapsetLibrary.init();
+ TapsetLibrary.addListener(new ViewUpdater());
+ refresh();
+ makeActions();
+ LogManager.logDebug("End createPartControl:", this);
+ }
+
+ /**
+ * Refreshes the list of functions in the viewer.
+ */
+ public void refresh() {
+ LogManager.logDebug("Start refresh:", this);
+ functions = TapsetLibrary.getFunctions();
+ addLocalFunctions(localFunctions);
+ LogManager.logDebug("End refresh:", this);
+ }
+
+ /**
+ * Adds the local functions specified in the argument to the viewer.
+ * @param localFunctionTree A tree of the local functions.
+ */
+ public void addLocalFunctions(TreeNode localFunctionTree) {
+ LogManager.logDebug("Start addLocalFunctions: localFunctionTree-" + localFunctionTree, this);
+
+ if(functions.getChildCount() > 0) {
+ TreeNode localFuncs = functions.getChildAt(0);
+
+ if("<local>".equals(localFuncs.toString()))
+ functions.remove(0);
+
+ if(null != localFunctions) {
+ localFunctions = localFunctionTree;
+ localFunctions.setDisplay("<local>");
+ functions.addAt(localFunctions, 0);
+ }
+ }
+ viewer.setInput(functions);
+ LogManager.logDebug("End addLocalFunctions:", this);
+ }
+
+ /**
+ * Wires up all of the actions for this browser, such as double and right click handlers.
+ */
+ private void makeActions() {
+ LogManager.logDebug("Start makeActions:", this);
+ doubleClickAction = new FunctionBrowserAction(getSite().getWorkbenchWindow(), this);
+ dblClickListener = new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ LogManager.logDebug("Start doubleClick: event-" + event, this);
+ doubleClickAction.run();
+ LogManager.logDebug("End doubleClick:", this);
+ }
+ };
+ viewer.addDoubleClickListener(dblClickListener);
+
+ //This loads the menu from plugin.xml
+ MenuManager manager = new MenuManager("functionPopup");
+ Control control = this.viewer.getControl();
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ Menu menu = manager.createContextMenu(control);
+ control.setMenu(menu);
+ getSite().registerContextMenu(manager, viewer);
+ LogManager.logDebug("End makeActions:", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ if(null != doubleClickAction)
+ doubleClickAction.dispose();
+ doubleClickAction = null;
+ if(null != viewer)
+ viewer.removeDoubleClickListener(dblClickListener);
+ dblClickListener = null;
+ if(null != localFunctions)
+ localFunctions.dispose();
+ localFunctions = null;
+ if(null != functions)
+ functions.dispose();
+ functions = null;
+ if(null != menu)
+ menu.dispose();
+ menu = null;
+ LogManager.logDebug("End dispose:", this);
+ }
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.ide.views.FunctionBrowserView";
+ private FunctionBrowserAction doubleClickAction;
+ private IDoubleClickListener dblClickListener;
+ private TreeNode functions;
+ private TreeNode localFunctions;
+ private Menu menu;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/KernelBrowserView.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/KernelBrowserView.java
new file mode 100644
index 0000000000..da9e0be617
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/KernelBrowserView.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.views;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
+import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.linuxtools.systemtap.ui.ide.actions.hidden.KernelSourceAction;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.IDEPlugin;
+import org.eclipse.linuxtools.systemtap.ui.ide.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.ide.preferences.IDEPreferenceConstants;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.structures.KernelSourceTree;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.ui.PlatformUI;
+
+
+
+/**
+ * The Kernel Source Browser module for the SystemTap GUI. This browser provides a list of kernel source
+ * files and allows the user to open those files in an editor in order to place probes in arbitary locations.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ */
+public class KernelBrowserView extends BrowserView {
+ public KernelBrowserView() {
+ super();
+ LogManager.logInfo("Initializing", this);
+ }
+
+ /**
+ * Creates the UI on the given <code>Composite</code>
+ */
+ public void createPartControl(Composite parent) {
+ LogManager.logDebug("Start createPartControl: parent-" + parent, this);
+ super.createPartControl(parent);
+
+ refresh();
+ makeActions();
+ LogManager.logDebug("End createPartControl", this);
+ }
+
+ /**
+ * Wires up all of the actions for this browser, such as double and right click handlers.
+ */
+ public void makeActions() {
+ LogManager.logDebug("Start makeActions:", this);
+ doubleClickAction = new KernelSourceAction(getSite().getWorkbenchWindow(), this);
+ dblClickListener = new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ LogManager.logDebug("Start doubleClick: event-" + event, this);
+ doubleClickAction.run();
+ LogManager.logDebug("End doubleClick:", this);
+ }
+ };
+ viewer.addDoubleClickListener(dblClickListener);
+ IDEPlugin.getDefault().getPluginPreferences().addPropertyChangeListener(propertyChangeListener);
+ LogManager.logDebug("End makeActions:", this);
+ }
+
+ /**
+ * Updates the kernel source displayed to the user with the new kernel source tree. Usually
+ * a response to the user changing the preferences related to the kernel source location, requiring
+ * that the application update the kernel source information.
+ */
+ public void refresh() {
+ LogManager.logDebug("Start refresh:", this);
+ KernelSourceTree kst = new KernelSourceTree();
+
+ IPreferenceStore p = IDEPlugin.getDefault().getPreferenceStore();
+ String kernelSource = p.getString(IDEPreferenceConstants.P_KERNEL_SOURCE);
+ if(null == kernelSource || kernelSource.length() < 1) {
+ LogManager.logInfo("Kernel Source Directory not found, querying", this);
+
+ DirectoryDialog dialog= new DirectoryDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.OPEN);
+ dialog.setText(Localization.getString("KernelBrowserView.WhereKernelSource"));
+ kernelSource = dialog.open();
+
+ if(null == kernelSource)
+ kernelSource = "";
+ p.setValue(IDEPreferenceConstants.P_KERNEL_SOURCE, kernelSource);
+ }
+
+ String[] excluded = p.getString(IDEPreferenceConstants.P_EXCLUDED_KERNEL_SOURCE).split(File.pathSeparator);
+
+ kst.buildKernelTree(kernelSource, excluded);
+ if(null != kst)
+ super.viewer.setInput(kst.getTree());
+ else
+ super.viewer.setInput(new TreeNode("", false));
+
+ kst.dispose();
+ LogManager.logDebug("End refresh:", this);
+ }
+
+ /**
+ * A <code>IPropertyChangeListener</code> that detects changes to the Kernel Source location
+ * and runs the <code>updateKernelSourceTree</code> method.
+ */
+ private final IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ LogManager.logDebug("Start propertyChange: event-" + event, this);
+ if(event.getProperty().equals(IDEPreferenceConstants.P_KERNEL_SOURCE)) {
+ refresh();
+ }
+ LogManager.logDebug("End propertyChange:", this);
+ }
+ };
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ IDEPlugin.getDefault().getPluginPreferences().removePropertyChangeListener(propertyChangeListener);
+ if(null != viewer)
+ viewer.removeDoubleClickListener(dblClickListener);
+ dblClickListener = null;
+ if(null != doubleClickAction)
+ doubleClickAction.dispose();
+ doubleClickAction = null;
+ }
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.ide.views.KernelBrowserView";
+ private KernelSourceAction doubleClickAction;
+ private IDoubleClickListener dblClickListener;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/ProbeAliasBrowserView.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/ProbeAliasBrowserView.java
new file mode 100644
index 0000000000..ab4e11dd5d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/systemtap/ui/ide/views/ProbeAliasBrowserView.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.ide.views;
+
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.linuxtools.systemtap.ui.ide.actions.hidden.ProbeAliasAction;
+import org.eclipse.linuxtools.systemtap.ui.ide.structures.TapsetLibrary;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IWorkbenchActionConstants;
+
+
+/**
+ * The Probe Alias Browser module of the SystemTap GUI. This class provides a list of all probe aliases
+ * defined in the tapset (both the standard, and user-specified tapsets), and allows the user to insert
+ * template probes into an editor.
+ * @author Henry Hughes
+ * @author Ryan Morse
+ */
+public class ProbeAliasBrowserView extends BrowserView {
+ public ProbeAliasBrowserView() {
+ super();
+ LogManager.logInfo("Initializing", this);
+ }
+
+ /**
+ * Creates the UI on the given <code>Composite</code>
+ */
+ public void createPartControl(Composite parent) {
+ LogManager.logDebug("Start createPartControl: parent-" + parent, this);
+ super.createPartControl(parent);
+ TapsetLibrary.init();
+ TapsetLibrary.addListener(new ViewUpdater());
+ refresh();
+ makeActions();
+ LogManager.logDebug("End createPartControl:", this);
+ }
+
+ /**
+ * Refreshes the list of probe aliases in the viewer.
+ */
+ public void refresh() {
+ LogManager.logDebug("Start refresh:", this);
+ super.viewer.setInput(TapsetLibrary.getProbes());
+ LogManager.logDebug("End refresh:", this);
+ }
+
+ /**
+ * Wires up all of the actions for this browser, such as double and right click handlers.
+ */
+ private void makeActions() {
+ LogManager.logDebug("Start makeActions:", this);
+ doubleClickAction = new ProbeAliasAction(getSite().getWorkbenchWindow(), this);
+ dblClickListener = new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ LogManager.logDebug("doubleClick fired", this);
+ doubleClickAction.run();
+ }
+ };
+ viewer.addDoubleClickListener(dblClickListener);
+ Control control = this.viewer.getControl();
+ MenuManager manager = new MenuManager("probePopup");
+
+ manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ Menu menu = manager.createContextMenu(control);
+ viewer.getControl().setMenu(menu);
+ getSite().registerContextMenu(manager, viewer);
+ LogManager.logDebug("End makeActions:", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ if(null != doubleClickAction)
+ doubleClickAction.dispose();
+ doubleClickAction = null;
+ if(null != viewer)
+ viewer.removeDoubleClickListener(dblClickListener);
+ dblClickListener = null;
+ if(null != menu)
+ menu.dispose();
+ menu = null;
+ }
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.ide.views.ProbeAliasBrowserView";
+ private ProbeAliasAction doubleClickAction;
+ private IDoubleClickListener dblClickListener;
+ private Menu menu;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/toc.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/toc.xml
new file mode 100644
index 0000000000..7f597e0918
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/toc.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Systemtap IDE User Guide" topic="documentation/html/toc.html">
+ <topic label="Getting Started" href="documentation/html/gettingstarted/gettingStarted.html">
+ <anchor id="gettingstarted"/>
+ </topic>
+ <topic label="Concepts" href="documentation/html/concepts/concepts.html">
+ <anchor id="concepts"/>
+ </topic>
+ <topic label="Tasks" href="documentation/html/tasks/tasks.html">
+ <anchor id="tasks"/>
+ </topic>
+ <topic label="Reference" href="documentation/html/reference/reference.html">
+ <anchor id="reference"/>
+ </topic>
+</toc>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.project
new file mode 100644
index 0000000000..92b9b02536
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.logging</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.settings/org.eclipse.jdt.core.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..66b95b1485
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Tue Jan 20 15:21:10 IST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/ChangeLog
new file mode 100644
index 0000000000..1e87f9beec
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/ChangeLog
@@ -0,0 +1,12 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * ChangeLog: Refactoring. Renaming all packages directories from *.systemtapgui.* to *.systemtap.ui.*
+ \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..dbaec2171e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Logging Plug-in
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.logging;singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.logging.internal.LoggingPlugin
+Bundle-Vendor: Eclipse
+Bundle-Localization: plugin
+Export-Package: org.eclipse.linuxtools.systemtap.ui.logging
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.linuxtools.systemtap.ui.structures
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/build.properties
new file mode 100644
index 0000000000..7b17480348
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ plugin.properties
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/plugin.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/plugin.properties
new file mode 100644
index 0000000000..e2fbef23bf
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/plugin.properties
@@ -0,0 +1 @@
+preference.logging.name=Logging \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/plugin.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/plugin.xml
new file mode 100644
index 0000000000..6108179c66
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/plugin.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.linuxtools.systemtap.ui.logging.preferences.PreferenceInitializer"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="%preference.logging.name"
+ id="com.qualityeclipse.generic.prefs.logging"
+ class="org.eclipse.linuxtools.systemtap.ui.logging.preferences.LoggingPreferencePage"/>
+ </extension>
+</plugin>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/LogManager.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/LogManager.java
new file mode 100644
index 0000000000..449be79c99
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/LogManager.java
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.logging;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.util.LinkedList;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.systemtap.ui.logging.internal.LogDaemon;
+import org.eclipse.linuxtools.systemtap.ui.logging.internal.LogEntry;
+import org.eclipse.linuxtools.systemtap.ui.logging.internal.LoggingPlugin;
+import org.eclipse.linuxtools.systemtap.ui.logging.preferences.PreferenceConstants;
+
+
+
+/**
+ * This class is responsible for all of the application's logging.
+ * @author Henry Hughes, Ryan Morse
+ */
+/*
+ * Strings in this class should not be externalized since they are
+ * primarily for debugging purposes.
+ */
+public class LogManager implements IPropertyChangeListener {
+ private LogManager() {}
+
+ /**
+ * Disables the logging service.
+ */
+ private void disable() {
+ logDebug("disabling",this);
+ }
+
+ /**
+ * Initializes the logging service: hooks a property change listener to the Logging Plugin,
+ * causes self-initialization, and starts logging.
+ */
+ public void begin() {
+ LoggingPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
+ init();
+ }
+
+ /**
+ * Gets user logging preferences and prepares the logging system to operate.
+ */
+ private void init() {
+ BufferedWriter writer = null;
+ IPreferenceStore store = LoggingPlugin.getDefault().getPreferenceStore();
+ boolean enabled = store.getBoolean(PreferenceConstants.P_LOG_ENABLED);
+ int level = Integer.parseInt(store.getString(PreferenceConstants.P_LOG_LEVEL));
+ int type = Integer.parseInt(store.getString(PreferenceConstants.P_LOG_TYPE));
+ String filename = store.getString(PreferenceConstants.P_LOG_FILE);
+
+ if(enabled) {
+ if(CONSOLE == type)
+ writer = new BufferedWriter(new OutputStreamWriter(System.out));
+ if(FILE == type) {
+ try {
+ File file = new File(filename);
+ if(!file.exists()) {
+ file.getParentFile().mkdirs();
+ file.createNewFile();
+ }
+ writer = new BufferedWriter(new FileWriter(file));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ if(null != writer) {
+ log(INFO, "Initialized - Stream " + writer.toString());
+ new LogDaemon(writer, level);
+ }
+ } else
+ disable();
+ }
+
+ /**
+ * Static accessor method, returns the shared instance of LogManager.
+ * @return Returns the shared instance of <code>LogManager</code>
+ */
+ public static LogManager getInstance() {
+ return instance;
+ }
+
+ /**
+ * Adds the input string to the logging queue at the specified level.
+ * @param level Level to log the input message to.
+ * @param input String to log.
+ */
+ private synchronized void log(int level, String input) {
+ entries.add(new LogEntry(level, input));
+ }
+
+ /**
+ * Overridden in order to unregister our property change event.
+ */
+ protected void finalize() throws Throwable {
+ //unregister ourselves
+ LoggingPlugin plugin = LoggingPlugin.getDefault();
+ if(plugin != null) {
+ IPreferenceStore store = plugin.getPreferenceStore();
+ if(store != null)
+ store.removePropertyChangeListener(this);
+ }
+ //let the JRE take care of the rest
+ super.finalize();
+ }
+
+ /**
+ * Stamps the input string with an identifier for the Object that sent it.
+ * @param input Message that has been requested to be logged.
+ * @param o Object that requested that the message be logged.
+ * @return A string comprising both the original message and an identifier for the Object.
+ */
+ @SuppressWarnings("unchecked")
+ private String stamp(String input, Object o) {
+ Class cs = o.getClass();
+ String className = cs.getName();
+ return "[" + className + "@" + Integer.toHexString(o.hashCode()) + "] " + input ;
+ }
+
+ /**
+ * Logs to the Info level. This logging level is used for basic application runtime messages such as
+ * creation of viewparts, dialogs, etc.
+ * @param input Message to log.
+ * @param o Object making the logging request.
+ */
+ public static synchronized void logInfo(String input, Object o) {
+ instance.log(INFO, instance.stamp(input,o));
+ }
+
+ /**
+ * Logs to the Debug level. This logging level is used for debugging messages, such as method
+ * entry messages.
+ * @param input Message to log.
+ * @param o Object making the logging request.
+ */
+ public static synchronized void logDebug(String input, Object o) {
+ instance.log(DEBUG, instance.stamp(input,o));
+ }
+
+ /**
+ * Logs to the Critical level. This logging level is used to signify that an error has occured
+ * but the software was able to handle it without crashing.
+ * @param input Message to log.
+ * @param o Object making the logging request.
+ */
+ public static synchronized void logCritical(String input, Object o) {
+ instance.log(CRITICAL, instance.stamp(input,o));
+ }
+
+ /**
+ * Logs to the Fatal level. This logging level is used when an error occurs that the software cannot
+ * handle, and the application crashes as a result of it.
+ * @param input Message to log.
+ * @param o Object making the logging request.
+ */
+ public static synchronized void logFatal(String input, Object o) {
+ instance.log(FATAL, instance.stamp(input,o));
+ }
+
+ /**
+ * Property change event handler, notifies the logging system when the user has changed
+ * logging related preferences.
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ String property = event.getProperty();
+ if(property.equals(PreferenceConstants.P_LOG_ENABLED) || property.equals(PreferenceConstants.P_LOG_FILE)
+ || property.equals(PreferenceConstants.P_LOG_LEVEL) || property.equals(PreferenceConstants.P_LOG_TYPE)) {
+ logInfo("LogManager reinitialization in progress", this);
+ init();
+ }
+ }
+
+ /**
+ * Gets the entries needing to be logged still
+ * @return all entries that have not yet been logged
+ */
+ public LinkedList<LogEntry> getEntries() {
+ return entries;
+ }
+
+ private static LogManager instance = new LogManager();
+ private LinkedList<LogEntry> entries = new LinkedList<LogEntry>();
+
+ public static final int DEBUG=3,INFO=2,CRITICAL=1,FATAL=0;
+ public static final int CONSOLE = 0, FILE = 1;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/Localization.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/Localization.java
new file mode 100644
index 0000000000..57cf880774
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/Localization.java
@@ -0,0 +1,22 @@
+package org.eclipse.linuxtools.systemtap.ui.logging.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Localization {
+ private static final String BUNDLE_NAME = "org.eclipse.linuxtools.systemtap.ui.logging.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.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LogDaemon.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LogDaemon.java
new file mode 100644
index 0000000000..42899a1888
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LogDaemon.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.logging.internal;
+
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.sql.Date;
+import java.text.DateFormat;
+import java.util.LinkedList;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.logging.internal.LogEntry;
+
+
+
+/**
+ * Logging daemon. This object runs on its own thread and wakes up every 100ms, at which point
+ * it flushes all queued messages to the Writer.
+ * @author Henry Hughes, Ryan Morse
+ */
+/*
+ * Strings in this class should not be externalized since they are
+ * primarily for debugging purposes.
+ */
+public class LogDaemon extends TimerTask {
+ public LogDaemon(BufferedWriter writer, int level) {
+ logLevel = level % NAMES.length;
+ Timer t = new Timer("LogDaemon",true);
+ t.scheduleAtFixedRate(this, 100, 5000);
+ }
+
+ public void run() {
+ LinkedList<?> entries = LogManager.getInstance().getEntries();
+ if(writer == null || 0 == entries.size())
+ return;
+ StringBuilder builder = new StringBuilder();
+ DateFormat df = DateFormat.getTimeInstance();
+ while(!entries.isEmpty()) {
+ LogEntry le = (LogEntry)(entries.removeFirst());
+ if(le.level > logLevel)
+ continue;
+ try {
+ builder.delete(0, builder.length());
+ String time = df.format(new Date(System.currentTimeMillis()));
+ builder.append("[" + NAMES[le.level] + "] - " + time + " - ");
+ builder.append(le.message + "\n");
+ writer.write(builder.toString());
+ writer.flush();
+ } catch(IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private int logLevel;
+ private BufferedWriter writer;
+ private final static String[] NAMES = {"fatal","critical","info","debug"};
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LogEntry.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LogEntry.java
new file mode 100644
index 0000000000..d0e69adeb6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LogEntry.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.logging.internal;
+
+/**
+ * This class represents a single log entry.
+ * @author Henry Hughes
+ */
+public class LogEntry {
+ public int level;
+ public String message;
+ public LogEntry(int level, String message) {
+ this.level = level;
+ this.message = message;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LoggingPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LoggingPlugin.java
new file mode 100644
index 0000000000..3601d1ade6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/LoggingPlugin.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.logging.internal;
+
+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 LoggingPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static LoggingPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public LoggingPlugin() {
+ 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 LoggingPlugin 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.logging", path);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/localization.properties
new file mode 100644
index 0000000000..b7e5118a15
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/internal/localization.properties
@@ -0,0 +1,10 @@
+LoggingPreferencePage.LoggingDescription=This page handles logging information about what is happening.
+LoggingPreferencePage.EnableLogging=Enable logging
+LoggingPreferencePage.Info=Info
+LoggingPreferencePage.Debug=Debug
+LoggingPreferencePage.Critical=Critical
+LoggingPreferencePage.Fatal=Fatal
+LoggingPreferencePage.LoggingLevel=Logging level
+LoggingPreferencePage.LogTo=Log to
+LoggingPreferencePage.Console=Console
+LoggingPreferencePage.File=File
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/LoggingPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/LoggingPreferencePage.java
new file mode 100644
index 0000000000..b41ff4a2b8
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/LoggingPreferencePage.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.logging.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.RadioGroupFieldEditor;
+import org.eclipse.jface.preference.StringFieldEditor;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.logging.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.logging.internal.LoggingPlugin;
+import org.eclipse.linuxtools.systemtap.ui.structures.ui.ComboFieldEditor;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+
+public class LoggingPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+ public LoggingPreferencePage() {
+ super(GRID);
+ setPreferenceStore(LoggingPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("LoggingPreferencePage.LoggingDescription"));
+ }
+
+ public void createFieldEditors() {
+ BooleanFieldEditor logging =
+ new BooleanFieldEditor(PreferenceConstants.P_LOG_ENABLED, Localization.getString("LoggingPreferencePage.EnableLogging"), getFieldEditorParent());
+ String[] debugLevel = {Localization.getString("LoggingPreferencePage.Debug"), "" + LogManager.DEBUG};
+ String[] infoLevel = {Localization.getString("LoggingPreferencePage.Info"),"" + LogManager.INFO};
+ String[] criticalLevel = {Localization.getString("LoggingPreferencePage.Critical"), "" + LogManager.CRITICAL};
+ String[] fatalLevel = {Localization.getString("LoggingPreferencePage.Fatal"), "" + LogManager.FATAL};
+ String[][] levels = {debugLevel,infoLevel,criticalLevel,fatalLevel};
+
+ ComboFieldEditor level =
+ new ComboFieldEditor(PreferenceConstants.P_LOG_LEVEL, Localization.getString("LoggingPreferencePage.LoggingLevel"), levels, getFieldEditorParent());
+ RadioGroupFieldEditor loggingType =
+ new RadioGroupFieldEditor(PreferenceConstants.P_LOG_TYPE, Localization.getString("LoggingPreferencePage.LogTo"), 1,
+ new String[][] {{ Localization.getString("LoggingPreferencePage.Console"), "" + LogManager.CONSOLE},
+ {Localization.getString("LoggingPreferencePage.File"), "" + LogManager.FILE} }
+ , getFieldEditorParent());
+ StringFieldEditor file = new StringFieldEditor(PreferenceConstants.P_LOG_FILE, Localization.getString("LoggingPreferencePage.File"), getFieldEditorParent());
+ file.setEmptyStringAllowed(true);
+
+ this.addField(logging);
+ this.addField(level);
+ this.addField(loggingType);
+ this.addField(file);
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+ public void dispose() {
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/PreferenceConstants.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/PreferenceConstants.java
new file mode 100644
index 0000000000..a32cb959b2
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/PreferenceConstants.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.logging.preferences;
+
+/**
+ * Constant definitions for plug-in preferences
+ */
+public class PreferenceConstants {
+
+ //environmentvariables
+ public static final String[][] P_ENV = new String[][] {
+ {"EnvLdLibraryPath", "LD_LIBRARY_PATH"},
+ {"EnvPath", "PATH"},
+ {"EnvSystemtapTapset", "SYSTEMTAP_TAPSET"},
+ {"EnvSystemtapRuntime", "SYSTEMTAP_RUNTIME"},
+ //{"EnvDateTime", "DATE_TIME"},
+ //{"EnvUser", "USER"},
+ //{"EnvKernel", "KERNEL"},
+ //{"EnvTestName", "TEST_NAME"},
+ //{"EnvSystemtap", "SYSTEMTAP"},
+ //{"EnvElfutils", "ELFUTILS"},
+ //{"EnvStapObj", "STAP_OBJ"},
+ //{"EnvStapSrc", "STAP_SRC"},
+ //{"EnvStapInstall", "STAP_INSTALL"},
+ //{"EnvStapTests", "STAP_TESTS"},
+ //{"EnvCvsroot", "CVSROOT"},
+ //{"EnvMailToAddr", "MAIL_TO_ADDR"},
+ //{"EnvBuildResults", "BUILD_RESULTS"},
+ //{"EnvTestResults", "TEST_RESULTS"},
+ };
+
+ //Logging
+ public static final String P_LOG_ENABLED = "STapLoggingEnabled";
+ public static final String P_LOG_TYPE = "STapLoggingType";
+ public static final String P_LOG_FILE = "STapLoggingFile";
+ public static final String P_LOG_LEVEL = "STapLoggingLevel";
+
+ //systemtap
+ public static final String P_WINDOW_STATE = "RestoreWindowStatePreference";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/PreferenceInitializer.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/PreferenceInitializer.java
new file mode 100644
index 0000000000..24f23448d6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.logging/src/org/eclipse/linuxtools/systemtap/ui/logging/preferences/PreferenceInitializer.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.logging.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.logging.internal.LoggingPlugin;
+
+
+
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = LoggingPlugin.getDefault().getPreferenceStore();
+
+ //logging
+ store.setDefault(PreferenceConstants.P_LOG_ENABLED, false);
+ store.setDefault(PreferenceConstants.P_LOG_LEVEL, LogManager.CRITICAL);
+ store.setDefault(PreferenceConstants.P_LOG_TYPE, LogManager.CONSOLE);
+ store.setDefault(PreferenceConstants.P_LOG_FILE, System.getenv("HOME") + "/systemtapGUI-log");
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/.classpath
new file mode 100644
index 0000000000..16e010260e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/.project
new file mode 100644
index 0000000000..4132b9a7df
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.structures.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/ChangeLog
new file mode 100644
index 0000000000..2a4d343e8b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/ChangeLog
@@ -0,0 +1,34 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * .classpath: New file.
+ * .project: New file.
+ * build.properties: New file.
+ * META-INF/MANIFEST.MF: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/AllTests.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/CCodeFileFilterTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/CopierTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/IndexedObjectTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/JarArchiveTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/KernelSourceTreeTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/LoggingStreamDaemonTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/CommandTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/LoggedCommandTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/StreamGobblerTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/SortTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/StringFormatterTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/TreeDefinitionNodeTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/TreeNodeTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/validators/ConditionalExpressionValidatorTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/validators/DirectoryValidatorTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/validators/IntegerValidatorTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/validators/MultiValidatorTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/validators/NumberValidatorTest.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/structures/ZipArchiveTest.java: \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..3e7e965e62
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.structures.tests
+Bundle-Version: 0.3.0.qualifier
+Bundle-Vendor: Eclipse
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.structures.tests.StructuresPlugin
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Import-Package: junit.framework,
+ org.eclipse.jface.dialogs,
+ org.eclipse.linuxtools.systemtap.ui.structures
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.linuxtools.systemtap.ui.structures
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/build.properties
new file mode 100644
index 0000000000..34d2e4d2da
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/AllTests.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/AllTests.java
new file mode 100644
index 0000000000..92585d8add
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/AllTests.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.CommandTest;
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.StreamGobblerTest;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.ConditionalExpressionValidatorTest;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.DirectoryValidatorTest;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.IntegerValidatorTest;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.MultiValidatorTest;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.NumberValidatorTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for org.eclipse.linuxtools.systemtap.ui.structures");
+
+ //Structures
+ suite.addTestSuite(CCodeFileFilterTest.class);
+ suite.addTestSuite(CommandTest.class);
+ suite.addTestSuite(CopierTest.class);
+ suite.addTestSuite(IndexedObjectTest.class);
+ suite.addTestSuite(JarArchiveTest.class);
+ suite.addTestSuite(KernelSourceTreeTest.class);
+ suite.addTestSuite(LoggingStreamDaemonTest.class);
+ suite.addTestSuite(SortTest.class);
+ suite.addTestSuite(StreamGobblerTest.class);
+ suite.addTestSuite(StringFormatterTest.class);
+ suite.addTestSuite(TreeDefinitionNodeTest.class);
+ suite.addTestSuite(TreeNodeTest.class);
+ suite.addTestSuite(ZipArchiveTest.class);
+
+ //structures.validators
+ suite.addTestSuite(ConditionalExpressionValidatorTest.class);
+ suite.addTestSuite(DirectoryValidatorTest.class);
+ suite.addTestSuite(IntegerValidatorTest.class);
+ suite.addTestSuite(MultiValidatorTest.class);
+ suite.addTestSuite(NumberValidatorTest.class);
+
+ return suite;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/CCodeFileFilterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/CCodeFileFilterTest.java
new file mode 100644
index 0000000000..268e88cfb6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/CCodeFileFilterTest.java
@@ -0,0 +1,37 @@
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.io.File;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.CCodeFileFilter;
+
+import junit.framework.TestCase;
+
+public class CCodeFileFilterTest extends TestCase {
+ public CCodeFileFilterTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ filter = new CCodeFileFilter();
+ }
+
+ public void testAccept() {
+ assertFalse(filter.accept(null));
+ assertFalse(filter.accept(new File("test")));
+ assertFalse(filter.accept(new File("test.java")));
+ assertTrue(filter.accept(new File("/root/")));
+ assertTrue(filter.accept(new File("test.h")));
+ assertTrue(filter.accept(new File("test.c")));
+ }
+
+ public void testGetDescription() {
+ filter.getDescription();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ CCodeFileFilter filter;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/CopierTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/CopierTest.java
new file mode 100644
index 0000000000..4ce3d177bd
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/CopierTest.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.Copier;
+
+import junit.framework.TestCase;
+
+public class CopierTest extends TestCase {
+ public CopierTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testCopy() {
+ ArrayList list = new ArrayList();
+ ArrayList[] lists = new ArrayList[3];
+
+ for(int i=0; i<lists.length; i++) {
+ list.add("" + i);
+ lists[i] = new ArrayList();
+ for(int j=0; j<5; j++)
+ lists[i].add(new Integer(j));
+ }
+
+ ArrayList list2 = Copier.copy(list);
+ for(int i=0; i<list.size(); i++)
+ assertEquals(list2.get(i), list.get(i));
+
+ ArrayList[] lists2 = Copier.copy(lists);
+ for(int i=0; i<list.size(); i++) {
+ for(int j=0; j<lists[i].size(); j++)
+ assertEquals(lists2[i].get(j), lists[i].get(j));
+ }
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/IndexedObjectTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/IndexedObjectTest.java
new file mode 100644
index 0000000000..8730ec022f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/IndexedObjectTest.java
@@ -0,0 +1,38 @@
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.IndexedObject;
+
+import junit.framework.TestCase;
+
+public class IndexedObjectTest extends TestCase {
+ public IndexedObjectTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ one = new IndexedObject(1, "one");
+ two = new IndexedObject(2, "two");
+ three = new IndexedObject(3, "three");
+ }
+
+ public void testToString() {
+ assertEquals("one", one.toString());
+ assertEquals("two", two.toString());
+ assertEquals("three", three.toString());
+ }
+
+ public void testCompareTo() {
+ assertEquals(0, one.compareTo(one));
+ assertTrue(-1 >= one.compareTo(two));
+ assertTrue(1 <= three.compareTo(one));
+ assertEquals(0, one.compareTo(null));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ IndexedObject one, two, three;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/JarArchiveTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/JarArchiveTest.java
new file mode 100644
index 0000000000..f6d5759589
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/JarArchiveTest.java
@@ -0,0 +1,23 @@
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import junit.framework.TestCase;
+
+public class JarArchiveTest extends TestCase {
+ public JarArchiveTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testUnjarFiles() {
+// JarArchive.unjarFiles();
+
+// JarArchive.unjarFiles();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/KernelSourceTreeTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/KernelSourceTreeTest.java
new file mode 100644
index 0000000000..2cf57cf94f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/KernelSourceTreeTest.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.io.File;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.KernelSourceTree;
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+
+
+import junit.framework.TestCase;
+
+public class KernelSourceTreeTest extends TestCase {
+ public KernelSourceTreeTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ kst = new KernelSourceTree();
+ }
+
+ public void testGetTree() {
+ assertNull("Inital tree is null", kst.getTree());
+ }
+
+ public void testBuildKernelTree() {
+ TreeNode t;
+
+ String direct = null; //Null
+ String[] excluded = null;
+ kst.buildKernelTree(direct, excluded);
+ assertNull("Null directory", kst.getTree());
+
+ direct = ""; //Empty string for directory
+ kst.buildKernelTree(direct, excluded);
+ assertNull("Empty string directory", kst.getTree());
+
+ direct = "/noSuchDirectory/"; //Missing folder
+ kst.buildKernelTree(direct, excluded);
+ assertNull("Missing directory", kst.getTree());
+
+ direct = "/root/"; //Inaccessable
+ kst.buildKernelTree(direct, excluded);
+ assertNull("Inaccessable directory", kst.getTree());
+
+ direct = "/bin/"; //No .c or .h files
+ kst.buildKernelTree(direct, excluded);
+ t = kst.getTree();
+ assertEquals("Bin folder item count", 0, t.getChildCount());
+ assertTrue("Bin folder name", "bin".equals(t.toString()));
+ assertTrue("Bin has file", t.getData() instanceof File);
+
+ excluded = new String[] {".git"};
+ direct = "/tmp/"; //No .c or .h files
+ kst.buildKernelTree(direct, excluded);
+ }
+
+ public void testDispose() {
+ kst.dispose();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ KernelSourceTree kst;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/LoggingStreamDaemonTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/LoggingStreamDaemonTest.java
new file mode 100644
index 0000000000..d5ece5ad07
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/LoggingStreamDaemonTest.java
@@ -0,0 +1,60 @@
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.io.File;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.LoggingStreamDaemon;
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.StreamGobbler;
+
+
+import junit.framework.TestCase;
+
+public class LoggingStreamDaemonTest extends TestCase {
+ public LoggingStreamDaemonTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ StreamGobbler gobbler = new StreamGobbler(System.in);
+ gobbler.start();
+ daemon = new LoggingStreamDaemon();
+ }
+
+ public void testHandleDataEvent() {
+ daemon.handleDataEvent("test");
+ }
+
+ public void testGetOutput() {
+ assertTrue("".equals(daemon.getOutput()));
+
+ daemon.handleDataEvent("test");
+ assertTrue("test".equals(daemon.getOutput()));
+ }
+
+ public void testSaveLog() {
+ File f = new File("/tmp/loggingstreamdaemon.test");
+ assertTrue(daemon.saveLog(f));
+ f.delete();
+
+ daemon.handleDataEvent("test");
+ assertTrue(daemon.saveLog(f));
+ //assertTrue("test".equals(daemon.getOutput()));
+ f.delete();
+
+ f = new File("/root/");
+ assertFalse(daemon.saveLog(f));
+ f.delete();
+ }
+
+ public void testDispose() {
+ daemon.dispose();
+ assertNull(daemon.getOutput());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ LoggingStreamDaemon daemon;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/SortTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/SortTest.java
new file mode 100644
index 0000000000..2747b73a83
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/SortTest.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.Sort;
+
+import junit.framework.TestCase;
+
+public class SortTest extends TestCase {
+ public SortTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testQuicksort() {
+ String blank = "";
+ String[] s0 = null;
+ String[] s1 = new String[0];
+ String[] s2 = new String[] {blank};
+ String[] s3 = new String[] {"a"};
+ String[] s4 = new String[] {"a", "b", "c", "d"};
+ String[] s5 = new String[] {"d", "c", "b", "a"};
+ String[] s6 = new String[] {"c", "d", "a", "b"};
+ String[] s7 = new String[] {"a", "d", "a", "b"};
+
+ Sort.quicksort(s0, 0, 0);
+ assertNull("Sort null list", s0);
+
+ Sort.quicksort(s1, 0, 0);
+ assertEquals("Sort empty list", 0, s1.length);
+
+ Sort.quicksort(s2, 0, s2.length-1);
+ assertEquals("Sort blank list", 1, s2.length);
+ assertEquals("Blank item same", blank, s2[0]);
+
+ Sort.quicksort(s3, 0, s3.length-1);
+ assertEquals("Sort single item list", 1, s3.length);
+ assertTrue("Single item same", "a".equals(s3[0]));
+
+ Sort.quicksort(s4, 0, s4.length-1);
+ assertEquals("Sort ordered list", 4, s4.length);
+ assertTrue("Single item same", "a".equals(s4[0]));
+ assertTrue("Single item same", "b".equals(s4[1]));
+ assertTrue("Single item same", "c".equals(s4[2]));
+ assertTrue("Single item same", "d".equals(s4[3]));
+
+ Sort.quicksort(s5, 0, s5.length-1);
+ assertEquals("Sort reversed list", 4, s5.length);
+ assertTrue("Single item same", "a".equals(s5[0]));
+ assertTrue("Single item same", "b".equals(s5[1]));
+ assertTrue("Single item same", "c".equals(s5[2]));
+ assertTrue("Single item same", "d".equals(s5[3]));
+
+ Sort.quicksort(s6, 0, s6.length-1);
+ assertEquals("Sort random list", 4, s6.length);
+ assertTrue("Single item same", "a".equals(s6[0]));
+ assertTrue("Single item same", "b".equals(s6[1]));
+ assertTrue("Single item same", "c".equals(s6[2]));
+ assertTrue("Single item same", "d".equals(s6[3]));
+
+ Sort.quicksort(s7, 0, s7.length-1);
+ assertEquals("Sort duplicate item list", 4, s7.length);
+ assertTrue("Single item same", "a".equals(s7[0]));
+ assertTrue("Single item same", "a".equals(s7[1]));
+ assertTrue("Single item same", "b".equals(s7[2]));
+ assertTrue("Single item same", "d".equals(s7[3]));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/StringFormatterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/StringFormatterTest.java
new file mode 100644
index 0000000000..9dda377011
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/StringFormatterTest.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.IFormattingStyles;
+import org.eclipse.linuxtools.systemtap.ui.structures.StringFormatter;
+
+import junit.framework.TestCase;
+
+public class StringFormatterTest extends TestCase {
+
+// public static void main(String[] args) {}
+
+ public StringFormatterTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ formatter = new StringFormatter();
+ }
+
+ public void testStringFormatter() {
+ formatter = new StringFormatter();
+ assertNotNull(formatter);
+ }
+
+ public void testGetFormat() {
+ formatter.setFormat(IFormattingStyles.UNFORMATED);
+ assertEquals(IFormattingStyles.UNFORMATED, formatter.getFormat());
+
+ formatter.setFormat(IFormattingStyles.BINARY);
+ assertEquals(IFormattingStyles.BINARY, formatter.getFormat());
+
+ formatter.setFormat(IFormattingStyles.DOUBLE);
+ assertEquals(IFormattingStyles.DOUBLE, formatter.getFormat());
+
+ formatter.setFormat(IFormattingStyles.HEX);
+ assertEquals(IFormattingStyles.HEX, formatter.getFormat());
+
+ formatter.setFormat(IFormattingStyles.OCTAL);
+ assertEquals(IFormattingStyles.OCTAL, formatter.getFormat());
+
+ formatter.setFormat(IFormattingStyles.STRING);
+ assertEquals(IFormattingStyles.STRING, formatter.getFormat());
+
+ formatter.setFormat(IFormattingStyles.DATE);
+ assertEquals(IFormattingStyles.DATE, formatter.getFormat());
+ }
+
+ public void testSetFormat() {
+ formatter.setFormat(IFormattingStyles.BINARY);
+ assertNotNull(formatter);
+ }
+
+ public void testFormat() {
+ formatter.setFormat(IFormattingStyles.BINARY);
+ assertTrue("0x1000".equals(formatter.format("8")));
+
+ formatter.setFormat(IFormattingStyles.HEX);
+ assertTrue("0x8".equals(formatter.format("8")));
+
+ formatter.setFormat(IFormattingStyles.OCTAL);
+ assertTrue("0x10".equals(formatter.format("8")));
+
+ formatter.setFormat(IFormattingStyles.STRING);
+ assertTrue("8".equals(formatter.format("8")));
+
+ formatter.setFormat(IFormattingStyles.UNFORMATED);
+ assertTrue("8".equals(formatter.format("8")));
+
+ formatter.setFormat(IFormattingStyles.DATE);
+ assertTrue("Dec 31, 1969 4:00:00 PM".equals(formatter.format("8")));
+
+ formatter.setFormat(IFormattingStyles.DOUBLE);
+ assertTrue("8.0".equals(formatter.format("8")));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ StringFormatter formatter;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeDefinitionNodeTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeDefinitionNodeTest.java
new file mode 100644
index 0000000000..8407c3c2b0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeDefinitionNodeTest.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeDefinitionNode;
+
+import junit.framework.TestCase;
+
+public class TreeDefinitionNodeTest extends TestCase {
+ public TreeDefinitionNodeTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ data = new StringBuilder("Object");
+ data2 = "Data";
+ d = "/usr/share";
+ d2 = "/usr";
+ s = "String";
+ s2 = "bah";
+
+ t = new TreeDefinitionNode(data, s, d, true);
+ child = new TreeDefinitionNode(data2, s2, d2, false);
+ t.add(child);
+ }
+
+ public void testTreeDefinitionNode() {
+ String d1 = "One";
+ String d2 = "two";
+ String s1 = "one";
+
+ TreeDefinitionNode t = new TreeDefinitionNode(d1, s1, d2, false);
+ assertEquals("Create child count", 0, t.getChildCount());
+ assertEquals("Create child string", s1, t.toString());
+ assertEquals("Create child data", d1, t.getData());
+ assertEquals("Create child definition", d2, t.getDefinition());
+ assertFalse("Create child clickable", t.isClickable());
+ }
+
+
+ public void testGetDefinition() {
+ assertNotSame("Correct definition", d2, t.getDefinition());
+ assertEquals("Correct definition2", d2, ((TreeDefinitionNode)t.getChildAt(0)).getDefinition());
+ }
+
+ public void testSetDefinition() {
+ String s1 = "/user/share/systemtap";
+ t.setDefinition(s1);
+ assertEquals("Replaced definition", s1, t.getDefinition());
+ }
+
+ public void testDispose() {
+ assertNotNull(t.getDefinition());
+ t.dispose();
+ assertNull(t.getDefinition());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ TreeDefinitionNode t;
+ TreeDefinitionNode child;
+ Object data;
+ String data2;
+ String s, s2;
+ String d, d2;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeNodeTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeNodeTest.java
new file mode 100644
index 0000000000..dc0701505c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeNodeTest.java
@@ -0,0 +1,231 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.TreeNode;
+
+import junit.framework.TestCase;
+
+public class TreeNodeTest extends TestCase {
+ public TreeNodeTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ data = new StringBuilder("Object");
+ data2 = "Data";
+ d = "/user/share";
+ s = "String";
+
+ t = new TreeNode(data, s, false);
+ child = new TreeNode(data2, true);
+ child2 = new TreeNode(data, s, false);
+ t.add(child);
+ t.add(child2);
+ }
+
+ public void testTreeNode() {
+ String d1 = "One";
+ String d2 = "two";
+ String s1 = "one";
+
+ TreeNode t1 = new TreeNode(d1, s1, false);
+ assertEquals("Create child count", 0, t1.getChildCount());
+ assertEquals("Create child string", s1, t1.toString());
+ assertEquals("Create child data", d1, t1.getData());
+ assertFalse("Create child clickable", t1.isClickable());
+
+ TreeNode t2 = new TreeNode(d2, true);
+ assertEquals("Create child count", 0, t2.getChildCount());
+ assertTrue("Create child string", t2.toString().equals(d2.toString()));
+ assertEquals("Create child data", d2, t2.getData());
+ assertTrue("Create child clickable", t2.isClickable());
+
+ TreeNode t3 = new TreeNode(null, true);
+ assertEquals("Create child count", 0, t3.getChildCount());
+ assertEquals("Create child string", null, t3.toString());
+ assertEquals("Create child data", null, t3.getData());
+ assertTrue("Create child clickable", t3.isClickable());
+
+ TreeNode t4 = new TreeNode(d1, s1, false);
+ assertEquals("Create child count", 0, t4.getChildCount());
+ assertEquals("Create child string", s1, t4.toString());
+ assertEquals("Create child data", d1, t4.getData());
+ assertFalse("Create child clickable", t4.isClickable());
+ }
+
+ public void testAdd() {
+ t.add(new TreeNode("One", "tne", false));
+ assertEquals("Add child", 3, t.getChildCount());
+
+ t.add(new TreeNode("two", false));
+ assertEquals("Add child2", 4, t.getChildCount());
+ }
+
+ public void testAddAt() {
+ TreeNode test1 = new TreeNode("one", false);
+ t.addAt(test1, 0);
+ assertEquals("Child added to front", test1, t.getChildAt(0));
+ assertEquals("Child correctly added", 3, t.getChildCount());
+
+ TreeNode test2 = new TreeNode("two", false);
+ t.addAt(test2, 1);
+ assertEquals("Child added to middle", test2, t.getChildAt(1));
+ assertEquals("Child correctly added", 4, t.getChildCount());
+
+ TreeNode test3 = new TreeNode("three", false);
+ t.addAt(test3, 3);
+ assertEquals("Child added to end", test3, t.getChildAt(3));
+ assertEquals("Child correctly added", 5, t.getChildCount());
+
+ TreeNode test4 = new TreeNode("four", false);
+ t.addAt(test4, 30);
+ assertEquals("Child added to end", test4, t.getChildAt(5));
+ assertEquals("Child correctly added", 6, t.getChildCount());
+ }
+
+ public void testGetChildAt() {
+ TreeNode child1 = new TreeNode("1", false);
+ t.add(child1);
+ TreeNode child2 = new TreeNode("2", false);
+ t.add(child2);
+
+ TreeNode c = t.getChildAt(0);
+ assertEquals("Retreive first child from tree", child, c);
+
+ c = t.getChildAt(2);
+ assertEquals("Retreive middle child from tree", child1, c);
+
+ c = t.getChildAt(3);
+ assertEquals("Retreive last child from tree", child2, c);
+
+ assertNull("No child here", t.getChildAt(10));
+ }
+
+ public void testGetChildCount() {
+ assertEquals("Tree child count", 2, t.getChildCount());
+ assertEquals("Child child count", 0, t.getChildAt(0).getChildCount());
+ }
+
+ public void testGetData() {
+ assertEquals("Correct data", data, t.getData());
+ assertEquals("Correct data2", data2, t.getChildAt(0).getData());
+ }
+
+ public void testIsClickable() {
+ assertFalse("Nonclickable root", t.isClickable());
+ assertTrue("Clickable child", t.getChildAt(0).isClickable());
+ }
+
+ public void testRemove() {
+ TreeNode child1 = new TreeNode("1", false);
+ t.add(child1);
+ TreeNode child2 = new TreeNode("2", false);
+ t.add(child2);
+ TreeNode child3 = new TreeNode("3", false);
+ t.add(child3);
+
+ assertEquals("Full tree before remove", 5, t.getChildCount());
+
+ assertTrue(t.remove(1));
+ assertEquals("Remove middle child from tree", 4, t.getChildCount());
+
+ assertTrue(t.remove(0));
+ assertEquals("Remove first child from tree", 3, t.getChildCount());
+
+ assertTrue(t.remove(1));
+ assertEquals("Remove last child from tree", 2, t.getChildCount());
+
+ assertFalse(t.remove(10));
+ assertEquals("Remove IndexOutOfBounds", 2, t.getChildCount());
+ }
+
+ public void testRemoveAll() {
+ t.add(new TreeNode("Child", false));
+
+ assertTrue(t.removeAll());
+ assertEquals("No children", 0, t.getChildCount());
+
+ assertTrue(t.removeAll());
+ assertEquals("Still no children", 0, t.getChildCount());
+ }
+
+ public void testSetData() {
+ Object o = "asdf";
+ t.setData(o);
+ assertEquals("Replaced data", o, t.getData());
+
+ String o1 = "aaaa";
+ t.setData(o1);
+ assertEquals("Replaced data with string", o1, t.getData());
+ }
+
+ public void testSetDisplay() {
+ String s1 = "aaaa";
+ t.setDisplay(s1);
+ assertEquals("Replaced display", s1, t.toString());
+ }
+
+ public void testSortTree() {
+ TreeNode child1 = new TreeNode("2", false);
+ t.add(child1);
+ TreeNode child2 = new TreeNode("1", false);
+ t.add(child2);
+ TreeNode child3 = new TreeNode("3", false);
+ t.add(child3);
+
+ t.sortTree();
+ assertEquals("Same number of children", 5, t.getChildCount());
+ assertEquals("Sorted first node correct", child2, t.getChildAt(0));
+ assertEquals("Sorted last node correct", child, t.getChildAt(3));
+ assertEquals("Sorted middle correct", child1, t.getChildAt(1));
+ }
+
+ public void testSortLevel() {
+ TreeNode child1 = new TreeNode("2", false);
+ t.add(child1);
+ TreeNode child2 = new TreeNode("1", false);
+ t.add(child2);
+ TreeNode child3 = new TreeNode("3", false);
+ t.add(child3);
+
+
+ t.sortLevel();
+ assertEquals("Same number of children", 5, t.getChildCount());
+ assertEquals("Sorted first node correct", child2, t.getChildAt(0));
+ assertEquals("Sorted last node correct", child, t.getChildAt(3));
+ assertEquals("Sorted middle correct", child1, t.getChildAt(1));
+ }
+
+ public void testToString() {
+ assertEquals("Object to string", data2, child.toString());
+ assertEquals("Dispaly to string", s, t.toString());
+ }
+
+ public void testDispose() {
+ t.dispose();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ TreeNode t;
+ TreeNode child;
+ TreeNode child2;
+ Object data;
+ String data2;
+ String s;
+ String d;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/ZipArchiveTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/ZipArchiveTest.java
new file mode 100644
index 0000000000..b04890b920
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/ZipArchiveTest.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.io.File;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.ZipArchive;
+
+import junit.framework.TestCase;
+
+public class ZipArchiveTest extends TestCase {
+ public ZipArchiveTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ File f = new File("/tmp/test/a");
+ f.getParentFile().mkdirs();
+ f.createNewFile();
+
+ ZipArchive.zipFiles("/tmp/test/a.zip", new String[] {"/tmp/test/a"}, new String[] {"a"});
+ ZipArchive.compressFile("/tmp/test/a.gz", "/tmp/test/a.zip");
+ }
+
+ public void testZipFiles() {
+ File b = new File("/tmp/test/b.zip");
+ assertFalse(b.exists());
+ ZipArchive.zipFiles(b.getAbsolutePath(), new String[] {"/tmp/test/a", "/tmp/test/a.zip"}, new String[] {"a", "a.zip"});
+ assertTrue(b.exists());
+ }
+
+ public void testUnzipFiles() {
+ File b = new File("/tmp/test/aa/");
+ assertFalse(b.exists());
+ b.mkdirs();
+ ZipArchive.unzipFiles("/tmp/test/a.zip", b.getAbsolutePath());
+ assertTrue(b.exists());
+ assertTrue(new File(b.getAbsolutePath() + "a").exists());
+ }
+
+ public void testCompressFile() {
+ File b = new File("/tmp/test/b.gz");
+ assertFalse(b.exists());
+ ZipArchive.compressFile(b.getAbsolutePath(), "/tmp/test/a.zip");
+ assertTrue(b.exists());
+ }
+
+ public void testUncompressFile() {
+ File b = new File("/tmp/test/bb/");
+ assertFalse(b.exists());
+ b.mkdirs();
+ ZipArchive.uncompressFile(b.getAbsolutePath() + "a.zip", "/tmp/test/a.gz");
+ assertTrue(b.exists());
+ assertTrue(new File(b.getAbsolutePath() + "a.zip").exists());
+ }
+
+ protected void tearDown() throws Exception {
+ new File("/tmp/test/").deleteOnExit();
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/CommandTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/CommandTest.java
new file mode 100644
index 0000000000..590e2fb815
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/CommandTest.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.runnable;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.Command;
+
+import junit.framework.TestCase;
+
+public class CommandTest extends TestCase {
+ public CommandTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ tc = new Command(new String[] {"ls", "/home/"}, null, null);
+ }
+
+ public void testCommand() {
+ assertNotNull("Command not null", tc);
+
+ tc = new Command(null, null, null);
+ assertNotNull("Command not null", tc);
+
+ tc = new Command(new String[] {}, null, null);
+ assertNotNull("Command not null", tc);
+
+ tc = new Command(new String[] {""}, null, null);
+ assertNotNull("Command not null", tc);
+
+ tc = new Command(new String[] {"a"}, null, null);
+ assertNotNull("Command not null", tc);
+
+ tc = new Command(new String[] {"ls", "/"}, null, null);
+ assertNotNull("Command not null", tc);
+ }
+
+ public void testIsFinished() {
+ assertTrue("Not finished", tc.isRunning());
+ tc.stop();
+ assertFalse("Finished", tc.isRunning());
+ }
+
+ public void testStop() {
+ assertTrue("Running", tc.isRunning());
+ tc.stop();
+ assertFalse("Not running", tc.isRunning());
+ }
+
+ public void testGetReturnValue() {
+ assertEquals(-1, tc.getReturnValue());
+ }
+
+ public void testIsDisposed() {
+ assertFalse(tc.isDisposed());
+ tc.dispose();
+ assertTrue(tc.isDisposed());
+ }
+
+ public void testDispose() {
+ tc.dispose();
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ Command tc;
+}
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/LoggedCommandTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/LoggedCommandTest.java
new file mode 100644
index 0000000000..76ef6ab6f4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/LoggedCommandTest.java
@@ -0,0 +1,67 @@
+package org.eclipse.linuxtools.systemtap.ui.structures.runnable;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.LoggedCommand;
+
+import junit.framework.TestCase;
+
+public class LoggedCommandTest extends TestCase {
+ public LoggedCommandTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ cmd = new LoggedCommand(new String[] {"stap", "-v", "-p1", "-e", "probe nosuchfunc{}"}, null, null);
+ }
+
+ public void testLoggedCommand() {
+ cmd.dispose();
+
+ cmd = new LoggedCommand(new String[] {"stap", "-v", "-p1", "-e", "probe nosuchfunc{}"}, null, null);
+ cmd.start();
+ assertTrue(cmd.isRunning());
+ assertFalse(cmd.isDisposed());
+ cmd.stop();
+ assertFalse(cmd.isRunning());
+ assertFalse(cmd.isDisposed());
+ cmd.dispose();
+
+ cmd = new LoggedCommand(new String[] {"stap", "-v", "-p1", "-e", "probe nosuchfunc{}"}, null, null, 100);
+ cmd.start();
+ assertTrue(cmd.isRunning());
+ assertFalse(cmd.isDisposed());
+ cmd.stop();
+ assertFalse(cmd.isRunning());
+ assertFalse(cmd.isDisposed());
+ cmd.dispose();
+ }
+
+ public void testGetOutput() {
+
+ }
+
+ public void testSaveLog() {
+
+ }
+
+ public void testStop() {
+ cmd.start();
+ assertTrue(cmd.isRunning());
+ cmd.stop();
+ assertFalse(cmd.isRunning());
+ }
+
+ public void testDispose() {
+ assertFalse(cmd.isDisposed());
+ cmd.dispose();
+ assertTrue(cmd.isDisposed());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ cmd.dispose();
+ }
+
+ LoggedCommand cmd;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/StreamGobblerTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/StreamGobblerTest.java
new file mode 100644
index 0000000000..631c3b9620
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/StreamGobblerTest.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.runnable;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.runnable.StreamGobbler;
+
+import junit.framework.TestCase;
+
+public class StreamGobblerTest extends TestCase {
+ public StreamGobblerTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ sg = new StreamGobbler(System.in);
+ sg.start();
+ }
+
+ public void testStreamGobbler() {
+ assertNotNull("StreamGobbler not null", sg);
+
+ sg = new StreamGobbler(null);
+ assertNotNull("StreamGobbler not null", sg);
+
+ sg = new StreamGobbler(System.in);
+ assertNotNull("StreamGobbler not null", sg);
+ }
+
+ public void testIsRunning() {
+ assertTrue("StreamGobbler running", sg.isRunning());
+ sg.stop();
+ assertFalse("StreamGobbler stopped", sg.isRunning());
+ }
+
+ public void testStop() {
+ assertTrue("StreamGobbler running", sg.isRunning());
+ sg.stop();
+ assertFalse("StreamGobbler stopped", sg.isRunning());
+ }
+
+ public void testDispose() {
+ sg.dispose();
+ assertFalse(sg.isRunning());
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ StreamGobbler sg;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/ConditionalExpressionValidatorTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/ConditionalExpressionValidatorTest.java
new file mode 100644
index 0000000000..82e5c4cf9d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/ConditionalExpressionValidatorTest.java
@@ -0,0 +1,35 @@
+package org.eclipse.linuxtools.systemtap.ui.structures.validators;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.ConditionalExpressionValidator;
+
+import junit.framework.TestCase;
+
+public class ConditionalExpressionValidatorTest extends TestCase {
+ public ConditionalExpressionValidatorTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testIsValid() {
+ ConditionalExpressionValidator validator = new ConditionalExpressionValidator();
+
+ assertNotNull("Null not valid", validator.isValid(null));
+ assertNotNull("Blank not valid", validator.isValid(""));
+ assertNotNull("String not valid", validator.isValid("sdf"));
+ assertNotNull("if not valid", validator.isValid("if"));
+ assertNotNull("if( not valid", validator.isValid("if("));
+ assertNotNull("if) not valid", validator.isValid("if)"));
+ assertNotNull("if() not valid", validator.isValid("if()"));
+ assertNull("if(a) valid", validator.isValid("if(a)"));
+ assertNull("if (a) valid", validator.isValid("if ()"));
+ assertNull("if(a=b) valid", validator.isValid("if(a=b)"));
+ assertNotNull("if(a)b not valid", validator.isValid("if(a)d"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/DirectoryValidatorTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/DirectoryValidatorTest.java
new file mode 100644
index 0000000000..1e650fc8c0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/DirectoryValidatorTest.java
@@ -0,0 +1,32 @@
+package org.eclipse.linuxtools.systemtap.ui.structures.validators;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.DirectoryValidator;
+
+import junit.framework.TestCase;
+
+public class DirectoryValidatorTest extends TestCase {
+ public DirectoryValidatorTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testIsValid() {
+ DirectoryValidator validator = new DirectoryValidator();
+
+ assertNotNull("Null not valid", validator.isValid(null));
+ assertNotNull("Blank not valid", validator.isValid(""));
+ assertNotNull("String valid", validator.isValid("sdf"));
+ assertNotNull("// not valid", validator.isValid("//"));
+ assertNotNull("/root/ad not valid", validator.isValid("/root/ad"));
+ assertNull("/ is valid", validator.isValid("/"));
+ assertNull("/root/ is valid", validator.isValid("/root/"));
+ assertNull("/blah/bld/ is valid", validator.isValid("/blah/bld/"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/IntegerValidatorTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/IntegerValidatorTest.java
new file mode 100644
index 0000000000..418f84f8f7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/IntegerValidatorTest.java
@@ -0,0 +1,32 @@
+package org.eclipse.linuxtools.systemtap.ui.structures.validators;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.IntegerValidator;
+
+import junit.framework.TestCase;
+
+public class IntegerValidatorTest extends TestCase {
+ public IntegerValidatorTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testIsValid() {
+ IntegerValidator validator = new IntegerValidator();
+
+ assertNotNull("Null not an iteger", validator.isValid(null));
+ assertNotNull("Blank not an iteger", validator.isValid(""));
+ assertNotNull("String not an iteger", validator.isValid("sdf"));
+ assertNotNull("Not an iteger", validator.isValid("2.2.2"));
+ assertNotNull("Double is not valid", validator.isValid("2.2"));
+ assertNotNull("Double is not valid", validator.isValid(".3"));
+ assertNull("Integer is valid", validator.isValid("3"));
+ assertNull("Integer is valid", validator.isValid("343"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/MultiValidatorTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/MultiValidatorTest.java
new file mode 100644
index 0000000000..f3e5ac56f5
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/MultiValidatorTest.java
@@ -0,0 +1,46 @@
+package org.eclipse.linuxtools.systemtap.ui.structures.validators;
+
+import junit.framework.TestCase;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.ConditionalExpressionValidator;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.DirectoryValidator;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.IntegerValidator;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.MultiValidator;
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.NumberValidator;
+
+
+public class MultiValidatorTest extends TestCase {
+ public MultiValidatorTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ validator = new MultiValidator();
+ validator.addValidator(new NumberValidator());
+ validator.addValidator(new NumberValidator());
+ }
+
+ public void testAddValidator() {
+ validator.addValidator(new IntegerValidator());
+ validator.addValidator(new ConditionalExpressionValidator());
+ validator.addValidator(new DirectoryValidator());
+ validator.addValidator(new NumberValidator());
+ }
+
+ public void testIsValid() {
+ assertNotNull("Null not a number", validator.isValid(null));
+ assertNotNull("Blank not a number", validator.isValid(""));
+ assertNotNull("String not a number", validator.isValid("sdf"));
+ assertNotNull("Not a number", validator.isValid("2.2.2"));
+ assertNull("Integer is valid", validator.isValid("3"));
+ assertNull("Double is valid", validator.isValid("2.2"));
+ assertNull("Double is a number", validator.isValid(".3"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ MultiValidator validator;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/NumberValidatorTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/NumberValidatorTest.java
new file mode 100644
index 0000000000..08851eea3a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures.tests/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/NumberValidatorTest.java
@@ -0,0 +1,31 @@
+package org.eclipse.linuxtools.systemtap.ui.structures.validators;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.validators.NumberValidator;
+
+import junit.framework.TestCase;
+
+public class NumberValidatorTest extends TestCase {
+ public NumberValidatorTest(String name) {
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testIsValid() {
+ NumberValidator validator = new NumberValidator();
+
+ assertNotNull("Null not a number", validator.isValid(null));
+ assertNotNull("Blank not a number", validator.isValid(""));
+ assertNotNull("String not a number", validator.isValid("sdf"));
+ assertNotNull("Not a number", validator.isValid("2.2.2"));
+ assertNull("Integer is valid", validator.isValid("3"));
+ assertNull("Double is valid", validator.isValid("2.2"));
+ assertNull("Double is a number", validator.isValid(".3"));
+ }
+
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.project
new file mode 100644
index 0000000000..262157cf8c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.structures</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.settings/org.eclipse.jdt.core.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..17951b6ff9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Fri Feb 27 17:06:56 IST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/ChangeLog
new file mode 100644
index 0000000000..b3ca1b3c9a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/ChangeLog
@@ -0,0 +1,12 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * ChangeLog: Refactoring. Renaming all packages directories from *.systemtapgui.* to *.systemtap.ui.*
+ \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..e541a24df7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Structures Plug-in
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.structures;singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.structures.internal.StructuresPlugin
+Bundle-Vendor: Eclipse
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.linuxtools.systemtap.ui.structures,
+ org.eclipse.linuxtools.systemtap.ui.structures.listeners,
+ org.eclipse.linuxtools.systemtap.ui.structures.runnable,
+ org.eclipse.linuxtools.systemtap.ui.structures.ui,
+ org.eclipse.linuxtools.systemtap.ui.structures.validators
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/build.properties
new file mode 100644
index 0000000000..98def4deb0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ src/
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/CCodeFileFilter.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/CCodeFileFilter.java
new file mode 100644
index 0000000000..0b621e03ba
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/CCodeFileFilter.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.io.File;
+import java.io.FileFilter;
+
+public class CCodeFileFilter implements FileFilter {
+ /**
+ * Checks a file type and only passes it (returns true) if it is either a directory, a .c, or a .h
+ * file type.
+ *
+ * @param f The file to check.
+ *
+ * @return A boolean value indicating whether or not to display the file.
+ */
+ public boolean accept(File f) {
+ if(null == f)
+ return false;
+ return f.isDirectory() ||
+ f.getName().toLowerCase().endsWith(".c") ||
+ f.getName().toLowerCase().endsWith(".h");
+ }
+
+ public String getDescription() {
+ return ".c, .h files";
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/Copier.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/Copier.java
new file mode 100644
index 0000000000..a2bb421c43
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/Copier.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.util.ArrayList;
+
+public final class Copier {
+
+ /**
+ * Returns a copy of the passed in ArrayList array object.
+ *
+ * @param list The ArrayList array object to copy.
+ *
+ * @return The copy of the ArrayList array.
+ */
+ @SuppressWarnings("unchecked")
+ public static ArrayList[] copy(ArrayList[] list) {
+ ArrayList[] list2 = new ArrayList[list.length];
+
+ for(int i=0; i<list2.length; i++)
+ list2[i] = copy(list[i]);
+
+ return list2;
+ }
+
+ /**
+ * Returns a copy of the passed in ArrayList object.
+ *
+ * @param list The ArrayList object to copy.
+ *
+ * @return The copy of the ArrayList.
+ */
+ @SuppressWarnings("unchecked")
+ public static ArrayList copy(ArrayList list) {
+ ArrayList list2 = new ArrayList();
+ list2.addAll(list);
+ return list2;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IFormattingStyles.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IFormattingStyles.java
new file mode 100644
index 0000000000..65c099c913
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IFormattingStyles.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.internal.Localization;
+
+public interface IFormattingStyles {
+ public static final int UNFORMATED = 0;
+ public static final int STRING = 1;
+ public static final int DATE = 2;
+ public static final int DOUBLE = 3;
+ public static final int HEX = 4;
+ public static final int OCTAL = 5;
+ public static final int BINARY = 6;
+
+ public static String[] FORMAT_TITLES = {Localization.getString("IFormattingStyles.Unformatted"), Localization.getString("IFormattingStyles.String"), Localization.getString("IFormattingStyles.Date"), Localization.getString("IFormattingStyles.Double"), Localization.getString("IFormattingStyles.Hex"), Localization.getString("IFormattingStyles.Octal"), Localization.getString("IFormattingStyles.Binary")};
+
+ public void setFormat(int format);
+ public String format(String s);
+ public int getFormat();
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IPasswordPrompt.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IPasswordPrompt.java
new file mode 100644
index 0000000000..6b1f8c8b72
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IPasswordPrompt.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+public interface IPasswordPrompt {
+ public String getPassword();
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IndexedObject.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IndexedObject.java
new file mode 100644
index 0000000000..e3cfb5cc21
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/IndexedObject.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+@SuppressWarnings("unchecked")
+public class IndexedObject implements Comparable{
+ public int index;
+ public Object val;
+
+ public IndexedObject(int i, Object v) {
+ index = i;
+ val = v;
+ }
+
+ public String toString() {
+ return val.toString();
+ }
+
+ public int compareTo(Object o) {
+ if(o instanceof IndexedObject) {
+ Comparable thisVal = (val instanceof Comparable) ? (Comparable)val : val.toString();
+ IndexedObject t = (IndexedObject)o;
+ Comparable otherVal = (t.val instanceof Comparable) ? (Comparable)t.val : t.val.toString();
+ return thisVal.compareTo(otherVal);
+ }
+ return 0;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/JarArchive.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/JarArchive.java
new file mode 100644
index 0000000000..4cddea2f47
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/JarArchive.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Enumeration;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+public class JarArchive {
+ public static void unjarFiles(String jarFileName, String destination) {
+ unjarFiles(jarFileName, destination, null);
+ }
+
+ /**
+ * Un-jars a specified file to a specified directory using a specificed path filter.
+ *
+ * @param jarFileName The file to extract.
+ * @param destination Where to extract the files to.
+ * @param pathFilter The path filter to apply.
+ */
+ public static void unjarFiles(String jarFileName, String destination, String pathFilter) {
+ try {
+ JarFile jf = new JarFile(jarFileName);
+
+ for (Enumeration<?> entries = jf.entries(); entries.hasMoreElements();) {
+ JarEntry jarEntry = (JarEntry)entries.nextElement();
+ String jarEntryName = jarEntry.getName();
+
+ if(null == pathFilter || jarEntryName.contains(pathFilter)) {
+ int lastDirSep;
+ if ( (lastDirSep = jarEntryName.lastIndexOf('/')) > 0 ) {
+ String dirName = jarEntryName.substring(0, lastDirSep);
+ (new File(destination + dirName)).mkdirs();
+ }
+
+ if (!jarEntryName.endsWith("/")) {
+ OutputStream out = new FileOutputStream(destination + jarEntryName);
+ InputStream in = jf.getInputStream(jarEntry);
+
+ transferData(in, out);
+
+ out.close();
+ in.close();
+ }
+ }
+ }
+ } catch (IOException e) {}
+ }
+
+ /**
+ * Transfer data from one stream to another.
+ *
+ * @param in The stream to transfer from.
+ * @param out The stream to transfer to.
+ */
+ private static void transferData(InputStream in, OutputStream out) {
+ try {
+ byte[] buf = new byte[BUFFER_SIZE];
+ int len;
+ while((len = in.read(buf)) > 0)
+ out.write(buf, 0, len);
+ } catch (IOException e) {}
+ }
+
+ private static final int BUFFER_SIZE = 1024;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/KernelSourceTree.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/KernelSourceTree.java
new file mode 100644
index 0000000000..8a5c4465f7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/KernelSourceTree.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.io.File;
+
+public class KernelSourceTree {
+ public TreeNode getTree() {
+ return kernelTree;
+ }
+
+ /**
+ * Builds the kernel tree from file parameter direct and stores the excluded string array.
+ *
+ * @param direct The file to include into the tree.
+ * @param excluded The string array to store as excluded.
+ */
+ public void buildKernelTree(String direct, String[] excluded) {
+ this.excluded = excluded;
+ try {
+ File f = new File(direct);
+
+ kernelTree = new TreeNode(f, f.getName(), false);
+ addLevel(kernelTree);
+ } catch(Exception e) {
+ kernelTree = null;
+ }
+ }
+
+ /**
+ * Adds a level to the kernel source tree.
+ *
+ * @param top The top of the tree to add a level to.
+ */
+ private void addLevel(TreeNode top) {
+ boolean add;
+ TreeNode current;
+ File f = (File)top.getData();
+
+ File[] fs = f.listFiles(new CCodeFileFilter());
+ for(int i=0; i<fs.length; i++) {
+ add = true;
+ for(int j=0; j<excluded.length; j++) {
+ if(fs[i].isDirectory() && fs[i].getName().equals(excluded[j].substring(0, excluded[j].length()-1)))
+ add = false;
+ }
+ if(add) {
+ current = new TreeNode(fs[i], fs[i].getName(), !fs[i].isDirectory());
+ top.add(current);
+ if(fs[i].isDirectory()) {
+ addLevel(top.getChildAt(top.getChildCount()-1));
+ if(0 == current.getChildCount())
+ top.remove(top.getChildCount()-1);
+ }
+ }
+ }
+ top.sortLevel();
+ }
+
+ public void dispose() {
+ kernelTree = null;
+ }
+
+ private TreeNode kernelTree;
+ private String[] excluded;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/LoggingStreamDaemon.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/LoggingStreamDaemon.java
new file mode 100644
index 0000000000..5f1b6188ad
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/LoggingStreamDaemon.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IGobblerListener;
+
+
+
+public class LoggingStreamDaemon implements IGobblerListener {
+
+ /**
+ * Sets up an output to log to.
+ */
+ public LoggingStreamDaemon() {
+ output = new StringBuilder();
+ try {
+ outputFile = File.createTempFile(this.toString(), ".tmp");
+ writer = new FileWriter(outputFile, true);
+ } catch(IOException ioe) {
+ outputFile = null;
+ }
+ saveLog = false;
+ }
+
+ /**
+ * Pushes output to log.
+ */
+ protected void pushData() {
+ if(null != writer) {
+ try {
+ writer.write(output.toString());
+ output.delete(0, output.length());
+ writer.flush();
+ } catch(IOException ioe) {}
+ }
+ }
+
+ /**
+ * Outputs one line.
+ */
+ public void handleDataEvent(String line) {
+ output.append(line);
+ this.pushData();
+ }
+
+ /**
+ * Reads in and returns the output produced.
+ *
+ * @return The logged data.
+ */
+ public String getOutput() {
+ if(null == outputFile)
+ return null;
+ try {
+ if(output.length() > 0) pushData();
+ FileReader reader = new FileReader(outputFile);
+ char[] buffer = new char[BUFFER_SIZE];
+ int count;
+ StringBuilder builder = new StringBuilder();
+ while(-1 != (count = reader.read(buffer)))
+ builder.append(buffer, 0, count);
+ return builder.toString();
+ } catch(IOException ioe) {}
+ return null;
+ }
+
+ /**
+ * Saves the logfile.
+ *
+ * @param file The file to save the log data to.
+ *
+ * @return True if the save was successful.
+ */
+ public boolean saveLog(File file) {
+ try {
+ if(!file.exists()) {
+ file.getParentFile().mkdirs();
+ file.createNewFile();
+ }
+ FileReader r = new FileReader(outputFile);
+ FileWriter w = new FileWriter(file, true);
+ char[] buffer = new char[BUFFER_SIZE];
+ int count;
+ while(-1 != (count = r.read(buffer)))
+ w.write(new String(buffer, 0, count));
+ w.flush();
+ writer.close();
+ writer = w;
+ r.close();
+ outputFile.delete();
+ outputFile = file;
+ saveLog = true;
+ } catch(IOException ioe) {
+ return false;
+ }
+ return true;
+ }
+
+ public void dispose() {
+ if(null != outputFile && !saveLog)
+ outputFile.delete();
+ outputFile = null;
+ if(null != writer) {
+ try {
+ writer.close();
+ } catch(IOException ioe) {}
+ }
+ writer = null;
+ }
+
+ protected StringBuilder output;
+ protected File outputFile;
+ protected FileWriter writer;
+ private boolean saveLog;
+
+ private static final int BUFFER_SIZE = 1024;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/PasswordPrompt.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/PasswordPrompt.java
new file mode 100644
index 0000000000..b3debd9cde
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/PasswordPrompt.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.ui.PasswordDialog;
+import org.eclipse.ui.PlatformUI;
+
+
+
+public class PasswordPrompt implements IPasswordPrompt {
+ public PasswordPrompt() {
+ this(null);
+ }
+
+ public PasswordPrompt(String pass) {
+ password = pass;
+ triedSaved = false;
+ }
+
+ /**
+ * Prompts the user for their password.
+ *
+ * @return The string response of the user.
+ */
+ public String getPassword() {
+ if(triedSaved || null == password) {
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ boolean stop = false;
+ public void run() {
+ if(stop) return;
+ try {
+ PasswordDialog input = new PasswordDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
+ input.open();
+ password = input.getPassword();
+ save = input.getPasswordSaved();
+ input.dispose();
+ if(null == password) password = "";
+ } catch (Exception e) {
+ stop = true;
+ }
+ }
+ });
+ }
+
+ triedSaved = true;
+ return password;
+ }
+
+ public boolean getSavePassword() {
+ return save;
+ }
+
+ private boolean save;
+ private String password;
+ private boolean triedSaved;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/RegExParser.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/RegExParser.java
new file mode 100644
index 0000000000..f9ba214ecd
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/RegExParser.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public final class RegExParser {
+
+ /**
+ * Accepts a string of output from the script and compares it against the supplied regular
+ * expression. The output is split and returned as an array of objects.
+ *
+ * @param s The line of output from the script.
+ * @param regEx The regular expression used in comparison.
+ *
+ * @return The array of objects representing the parsed line.
+ */
+ public static Object[] parseLine(StringBuilder s, String[] regEx) {
+ Object[] d = null;
+
+ StringBuilder wholeRegExpr = new StringBuilder();
+ for(int i=0; i<regEx.length; i++) {
+ regEx[i] = '(' + regEx[i] + ')';
+ wholeRegExpr.append(regEx[i]);
+ }
+ Pattern wholePattern = Pattern.compile(wholeRegExpr.toString());
+ Matcher wholeMatcher = wholePattern.matcher(s);
+
+ if(wholeMatcher.find()) {
+ d = new Object[regEx.length>>1];
+
+ int group=0, j;
+
+ for(int i=0; i<regEx.length; i++) {
+ for(j=0; j<regEx[i].length(); j++)
+ if(regEx[i].charAt(j) == ')')
+ group++;
+
+ if((i&1)==0)
+ d[i>>1] = wholeMatcher.group(group);
+ }
+ s.delete(wholeMatcher.start(), wholeMatcher.end());
+ }
+
+ return d;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/Sort.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/Sort.java
new file mode 100644
index 0000000000..eea8bd01f5
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/Sort.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+public final class Sort {
+
+ /**
+ * Performs quicksort on the supplied list.
+ *
+ * @param list The list to sort.
+ * @param p Recursed value, initially top value.
+ * @param r Recursed value, initially bottom value.
+ */
+ public static void quicksort(Object[] list, int p, int r) {
+ if(null == list)
+ return;
+ else if (p < r) {
+ int q = partition(list,p,r);
+ if (q == r)
+ q--;
+
+ quicksort(list,p,q);
+ quicksort(list,q+1,r);
+ }
+ }
+
+ /**
+ * Partitions the input list, used by Quiksort.
+ *
+ * @param list The list to partition.
+ * @param p Recursed value, initially top value.
+ * @param r Recursed value, initially bottom value.
+ */
+ @SuppressWarnings("unchecked")
+ private static int partition (Object[] list, int p, int r) {
+ Comparable pivot = (list[p] instanceof Comparable ? (Comparable)list[p] : list[p].toString());
+ int lo = p;
+ int hi = r;
+
+ while (true) {
+ while (getComparable(list[hi]).compareTo(pivot) >= 0 && lo < hi)
+ hi--;
+
+ while (getComparable(list[lo]).compareTo(pivot) < 0 && lo < hi)
+ lo++;
+
+ if (lo < hi) {
+ Object T = list[lo];
+ list[lo] = list[hi];
+ list[hi] = T;
+ } else
+ return hi;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private static Comparable getComparable(Object o) {
+ return (o instanceof Comparable
+ ? (Comparable)o
+ : o.toString());
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/StringFormatter.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/StringFormatter.java
new file mode 100644
index 0000000000..caab4c4ed6
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/StringFormatter.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.text.DateFormat;
+import java.util.Date;
+
+
+public class StringFormatter implements IFormattingStyles {
+ public StringFormatter() {
+ format = IFormattingStyles.UNFORMATED;
+ }
+
+ public int getFormat() {
+ return format;
+ }
+
+ public void setFormat(int format) {
+ this.format = format;
+ }
+
+ /**
+ * Potentially modifies a string value according to a certain format based on the current value
+ * of format.
+ *
+ * @param s The string to potential modify.
+ *
+ * @return The modified string.
+ */
+ public String format(String s) {
+ switch (format) {
+ case STRING:
+ return s;
+ case DATE:
+ return DateFormat.getDateTimeInstance().format(new Date(Long.parseLong(s)));
+ case HEX:
+ return "0x"+Long.toHexString(Long.parseLong(s));
+ case OCTAL:
+ return "0x"+Long.toOctalString(Long.parseLong(s));
+ case BINARY:
+ return "0x" + Long.toBinaryString(Long.parseLong(s));
+ case DOUBLE:
+ return "" + Double.parseDouble(s);
+ }
+ return s;
+ }
+
+ private int format;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeDefinitionNode.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeDefinitionNode.java
new file mode 100644
index 0000000000..f660f6867c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeDefinitionNode.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+public class TreeDefinitionNode extends TreeNode {
+ public TreeDefinitionNode(Object d, String disp, String def, boolean c) {
+ super(d, disp, c);
+ definition = def;
+ }
+
+ public String getDefinition() {
+ return definition;
+ }
+
+ public void setDefinition(String d) {
+ definition = d;
+ }
+
+ public void dispose() {
+ super.dispose();
+ definition = null;
+ }
+
+ private String definition;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeNode.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeNode.java
new file mode 100644
index 0000000000..c751516d60
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/TreeNode.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.util.ArrayList;
+
+public class TreeNode {
+ public TreeNode(Object d, boolean c) {
+ children = new ArrayList<TreeNode>();
+ data = d;
+ clickable = c;
+
+ if(null == data)
+ display = null;
+ else
+ display = d.toString();
+ }
+
+ public TreeNode(Object d, String disp, boolean c) {
+ children = new ArrayList<TreeNode>();
+ data = d;
+ display = disp;
+ clickable = c;
+ }
+
+ public void add(TreeNode item) {
+ children.add(item);
+ }
+
+ public void addAt(TreeNode item, int location) {
+ children.add(Math.min(children.size(), location), item);
+ }
+
+ public int getChildCount() {
+ return children.size();
+ }
+
+ public TreeNode getChildAt(int i){
+ if(children.size() > i)
+ return (TreeNode)children.get(i);
+ else
+ return null;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public boolean isClickable() {
+ return clickable;
+ }
+
+ public boolean remove(int i) {
+ if(children.size() > i)
+ return(null != children.remove(i));
+ else
+ return false;
+ }
+
+ public boolean removeAll() {
+ for(int i=children.size()-1; i>=0; i--) {
+ this.remove(i);
+ }
+ return true;
+ }
+
+ public void setData(Object d) {
+ data = d;
+ }
+
+ public void setDisplay(String disp) {
+ display = disp;
+ }
+
+ /**
+ * Restructures the tree so that probes are grouped by type and
+ * functions are sorted alphabetically.
+ */
+ public void sortTree() {
+ TreeNode temp = null;
+
+ sortLevel();
+ for(int i=0; i<this.getChildCount(); i++) {
+ temp = this.getChildAt(i);
+
+ temp.sortTree();
+ }
+ }
+
+ /**
+ * Performs quicksort on the level.
+ */
+ public void sortLevel() {
+ int j;
+
+ Object children[] = this.children.toArray();
+ this.removeAll();
+ Sort.quicksort(children, 0, children.length-1);
+
+ for(j=0; j<children.length; j++)
+ this.add((TreeNode)children[j]);
+ }
+
+ public String toString() {
+ return display;
+ }
+
+ public void dispose() {
+ if(null != children)
+ for(int i=children.size()-1; i>=0; i--)
+ ((TreeNode)children.get(i)).dispose();
+ children = null;
+ data = null;
+ display = null;
+ }
+
+ private ArrayList<TreeNode> children;
+ private Object data;
+ private String display;
+ private boolean clickable;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/UpdateManager.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/UpdateManager.java
new file mode 100644
index 0000000000..f9adbb5a1a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/UpdateManager.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.util.ArrayList;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IUpdateListener;
+
+
+
+public class UpdateManager {
+ public UpdateManager(int delay) {
+ updateListeners = new ArrayList<IUpdateListener>();
+ stopped = false;
+ disposed = false;
+ timer = new Timer("Update Manager", true);
+ timer.scheduleAtFixedRate(new Notify(), delay, delay);
+ }
+
+ /**
+ * Terminates the timer and removes all update listeners.
+ */
+ public void stop() {
+ if(!stopped) {
+ stopped = true;
+ timer.cancel();
+ for(int i=0; i<updateListeners.size(); i++)
+ removeUpdateListener((IUpdateListener)updateListeners.get(i));
+ }
+ }
+
+ public void addUpdateListener(IUpdateListener l) {
+ if(!updateListeners.contains(l))
+ updateListeners.add(l);
+ }
+ public void removeUpdateListener(IUpdateListener l) {
+ if(updateListeners.contains(l))
+ updateListeners.remove(l);
+ }
+
+ public boolean isRunning() {
+ return !stopped;
+ }
+
+ public void dispose() {
+ if(!disposed) {
+ disposed = true;
+ stop();
+ timer = null;
+ updateListeners = null;
+ }
+ }
+
+ /**
+ * Handle any events that are timed to occur.
+ */
+ private class Notify extends TimerTask {
+ public void run() {
+ try{
+ if(!stopped) {
+ for(int i = 0; i < updateListeners.size(); i++)
+ ((IUpdateListener)(updateListeners.get(i))).handleUpdateEvent();
+ }
+ }catch(Exception e) {;}
+ }
+
+ }
+
+ private Timer timer;
+ private ArrayList<IUpdateListener> updateListeners;
+ private boolean stopped;
+ private boolean disposed;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ZipArchive.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ZipArchive.java
new file mode 100644
index 0000000000..09ee1544a3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ZipArchive.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Enumeration;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+import java.util.zip.ZipOutputStream;
+
+public final class ZipArchive {
+
+ /**
+ * Zips files.
+ *
+ * @param zipFileName The name of the zipped file you wish to make.
+ * @param files The collection of files to zip.
+ * @param names The names of the files you wish to zip.
+ */
+ public static void zipFiles(String zipFileName, String[] files, String[] names) {
+ try {
+ ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName));
+
+ for (int i=0; i<files.length; i++) {
+ FileInputStream in = new FileInputStream(files[i]);
+
+ out.putNextEntry(new ZipEntry(names[i]));
+
+ transferData(in, out);
+
+ out.closeEntry();
+ in.close();
+ }
+
+ out.close();
+ } catch (IOException e) {}
+ }
+
+ /**
+ * Unzips files.
+ *
+ * @param zipFileName The name of the file you wish to unzip.
+ * @param destination The location you wish to unzip files to.
+ */
+ public static void unzipFiles(String zipFileName, String destination) {
+ try {
+ ZipFile zf = new ZipFile(zipFileName);
+
+ for (Enumeration<?> entries = zf.entries(); entries.hasMoreElements();) {
+ ZipEntry zipEntry = (ZipEntry)entries.nextElement();
+ String zipEntryName = zipEntry.getName();
+
+ int lastDirSep;
+ if ( (lastDirSep = zipEntryName.lastIndexOf('/')) > 0 ) {
+ String dirName = zipEntryName.substring(0, lastDirSep);
+ (new File(dirName)).mkdirs();
+ }
+
+ if (!zipEntryName.endsWith("/")) {
+ OutputStream out = new FileOutputStream(destination + zipEntryName);
+ InputStream in = zf.getInputStream(zipEntry);
+
+ transferData(in, out);
+
+ out.close();
+ in.close();
+ }
+ }
+ } catch (IOException e) {}
+ }
+
+ /**
+ * Compresses files.
+ *
+ * @param outFileName The new compressed file you wish to create.
+ * @param inFileName The file you wish to compress.
+ */
+ public static void compressFile(String outFileName, String inFileName) {
+ try {
+ GZIPOutputStream out = new GZIPOutputStream(new FileOutputStream(outFileName));
+ FileInputStream in = new FileInputStream(inFileName);
+
+ transferData(in, out);
+
+ in.close();
+ out.finish();
+ out.close();
+ } catch (IOException ioe) {}
+ }
+
+ /**
+ * Uncompresses files.
+ *
+ * @param outFileName The new uncompressed file you wish to create.
+ * @param inFileName The file you wish to uncompress.
+ */
+ public static void uncompressFile(String outFileName, String inFileName) {
+ try {
+ GZIPInputStream in = new GZIPInputStream(new FileInputStream(inFileName));
+ FileOutputStream out = new FileOutputStream(outFileName);
+
+ transferData(in, out);
+
+ in.close();
+ out.close();
+ } catch (IOException e) {}
+ }
+
+ /**
+ * Transfers data from one stream to another.
+ *
+ * @param in The source stream.
+ * @param out The export stream.
+ */
+ private static void transferData(InputStream in, OutputStream out) {
+ try {
+ byte[] buf = new byte[BUFFER_SIZE];
+ int len;
+ while((len = in.read(buf)) > 0)
+ out.write(buf, 0, len);
+ } catch (IOException e) {}
+ }
+
+ private static final int BUFFER_SIZE = 1024;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/Localization.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/Localization.java
new file mode 100644
index 0000000000..3cc5bc87ff
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/Localization.java
@@ -0,0 +1,22 @@
+package org.eclipse.linuxtools.systemtap.ui.structures.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Localization {
+ private static final String BUNDLE_NAME = "org.eclipse.linuxtools.systemtap.ui.structures.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.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/StructuresPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/StructuresPlugin.java
new file mode 100644
index 0000000000..bca379c781
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/StructuresPlugin.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.internal;
+
+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 StructuresPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static StructuresPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public StructuresPlugin() {
+ 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 StructuresPlugin 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.structures", path);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/localization.properties
new file mode 100644
index 0000000000..f5c5f1fd7f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/internal/localization.properties
@@ -0,0 +1,23 @@
+IFormattingStyles.Unformatted=Unformatted
+IFormattingStyles.String=String
+IFormattingStyles.Date=Date
+IFormattingStyles.Double=Double
+IFormattingStyles.Hex=Hex
+IFormattingStyles.Octal=Octal
+IFormattingStyles.Binary=Binary
+Command.Password=Password:
+PasswordDialog.Password=Password
+PasswordDialog.SUDOPassword=SUDO Password:
+PasswordDialog.SavePassword=Save password?
+NumberValidator.NotNull=Can't be null
+NumberValidator.NaN=NAN
+ConditionalExpressionValidator.NotNull=Can't be null
+ConditionalExpressionValidator.StartWithIf=Must start with 'if'
+ConditionalExpressionValidator.MustContain=Must contain '('
+ConditionalExpressionValidator.MustEndWith=Must end with ')'
+ConditionalExpressionValidator.MustEnterSomething=Must enter something in the expression
+DirectoryValidator.NotNull=Can't be null
+DirectoryValidator.LongerFile=Must be a longer folder name
+DirectoryValidator.MustEndWith=Must end with '/'
+DirectoryValidator.CanNotContain=Can not contain '//'
+IntegerValidator.NaN=NAN
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IActionListener.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IActionListener.java
new file mode 100644
index 0000000000..6c1a51862e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IActionListener.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.listeners;
+
+public interface IActionListener {
+ public void handleActionEvent();
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IGobblerListener.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IGobblerListener.java
new file mode 100644
index 0000000000..a0533d4a24
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IGobblerListener.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.listeners;
+
+public interface IGobblerListener {
+
+ /**
+ * called by streamgobbler when new data is present
+ *
+ */
+ public void handleDataEvent(String line);
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/ITabListener.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/ITabListener.java
new file mode 100644
index 0000000000..019ca969f4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/ITabListener.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.listeners;
+
+public interface ITabListener {
+ public void tabOpened();
+ public void tabClosed();
+ public void tabChanged();
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IUpdateListener.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IUpdateListener.java
new file mode 100644
index 0000000000..ef99c082f0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/listeners/IUpdateListener.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.listeners;
+
+public interface IUpdateListener {
+ abstract void handleUpdateEvent();
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/Command.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/Command.java
new file mode 100644
index 0000000000..f8423a0ed0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/Command.java
@@ -0,0 +1,279 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.runnable;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.IPasswordPrompt;
+import org.eclipse.linuxtools.systemtap.ui.structures.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IGobblerListener;
+
+
+
+/**
+ * A class to spawn a separate thread to run a <code>Process</code>.
+ * @author Ryan Morse
+ */
+public class Command implements Runnable {
+ /*
+ * Bug in the exec command prevents using a single string. Forced
+ * to use a workaround in order to run commands with spaces.
+ *
+ * http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4365120
+ * http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4109888
+ */
+
+ /**
+ * Spawns the new thread that this class will run in. From the Runnable
+ * interface spawning the new thread automatically calls the run() method.
+ * This must be called by the implementing class in order to start the
+ * StreamGobbler.
+ * @param cmd The entire command to run
+ * @param envVars List of all environment variables to use
+ * @param prompt The password promt for allowing the user to enter their password.
+ * @param monitorDelay The time in MS to wait between checking whether the <code>Process</code> has finished.
+ */
+ public Command(String[] cmd, String[] envVars, IPasswordPrompt prompt, int monitorDelay) {
+ this.cmd = cmd;
+ this.envVars = envVars;
+ this.prompt = prompt;
+ this.monitorDelay = monitorDelay;
+ }
+
+ /**
+ * Spawns the new thread that this class will run in. From the Runnable
+ * interface spawning the new thread automatically calls the run() method.
+ * This must be called by the implementing class in order to start the
+ * StreamGobbler.
+ * @param cmd The entire command to run
+ * @param envVars List of all environment variables to use
+ * @param prompt The password promt for allowing the user to enter their password.
+ */
+ public Command(String[] cmd, String[] envVars, IPasswordPrompt prompt) {
+ this(cmd, envVars, prompt, 100);
+ }
+
+ /**
+ * Starts the <code>Thread</code> that the new <code>Process</code> will run in.
+ * This must be called in order to get the process to start running.
+ */
+ public void start() {
+ if(init()) {
+ Thread t = new Thread(this, cmd[0]);
+ t.start();
+ } else {
+ stop();
+ returnVal = Integer.MIN_VALUE;
+ }
+ }
+
+ /**
+ * Starts up the process that will execute the provided command and registers
+ * the <code>StreamGobblers</code> with their respective streams.
+ */
+ protected boolean init() {
+ try {
+ process = Runtime.getRuntime().exec(cmd, envVars);
+
+ errorGobbler = new StreamGobbler(process.getErrorStream());
+ inputGobbler = new StreamGobbler(process.getInputStream());
+
+ int i;
+ for(i=0; i<inputListeners.size(); i++)
+ inputGobbler.addDataListener(inputListeners.get(i));
+ for(i=0; i<errorListeners.size(); i++)
+ errorGobbler.addDataListener(errorListeners.get(i));
+ return true;
+ } catch(IOException ioe) {}
+ return false;
+ }
+
+ /**
+ * This method handles checking the status of the running <code>Process</code>. It
+ * is called when the new Thread is created, and thus should never be called by
+ * any implementing program. To run call the <code>start</code> method.
+ */
+ public void run() {
+ errorGobbler.start();
+ inputGobbler.start();
+
+ try {
+ while(!stopped) {
+ try {
+ if(null != errorGobbler && errorGobbler.readLine().endsWith(Localization.getString("Command.Password"))) {
+ PrintWriter writer = new PrintWriter(process.getOutputStream(), true);
+ writer.println(prompt.getPassword());
+ }
+
+ returnVal = process.exitValue(); //Dont care what the value is, just whether it throws an exception
+ stop(); //Above line will throw an exception if not finished
+ } catch(IllegalThreadStateException itse) {}
+
+ if(0 < monitorDelay)
+ Thread.sleep(monitorDelay);
+ }
+ } catch(InterruptedException ie) {
+ } catch(NullPointerException npe) {}
+ }
+
+ /**
+ * Stops the process from running and stops the <code>StreamGobblers</code> from monitering
+ * the dead process.
+ */
+ public synchronized void stop() {
+ if(!stopped) {
+ stopped = true;
+ if(null != errorGobbler)
+ errorGobbler.stop();
+ if(null != inputGobbler)
+ inputGobbler.stop();
+ if(null != process)
+ process.destroy();
+ }
+ }
+
+ /**
+ * Method to check whether or not the process in running.
+ * @return The execution status.
+ */
+ public boolean isRunning() {
+ return !stopped;
+ }
+
+ /**
+ * Method to check if this class has already been disposed.
+ * @return Status of the class.
+ */
+ public boolean isDisposed() {
+ return disposed;
+ }
+
+ /**
+ * The return value of the process.
+ * 2^231-1 if the process is still running.
+ * -2^231 if there was an error creating the process
+ * @return The return value generated from running the provided command.
+ */
+ public int getReturnValue() {
+ return returnVal;
+ }
+
+ /**
+ * Registers the provided <code>IGobblerListener</code> with the InputStream
+ * @param listener A listener to monitor the InputStream from the Process
+ */
+ public void addInputStreamListener(IGobblerListener listener) {
+ if(null != inputGobbler)
+ inputGobbler.addDataListener(listener);
+ else
+ inputListeners.add(listener);
+ }
+
+ /**
+ * Registers the provided <code>IGobblerListener</code> with the ErrorStream
+ * @param listener A listener to monitor the ErrorStream from the Process
+ */
+ public void addErrorStreamListener(IGobblerListener listener) {
+ if(null != errorGobbler)
+ errorGobbler.addDataListener(listener);
+ else
+ errorListeners.add(listener);
+ }
+
+ /**
+ * Returns the list of everything that is listening the the InputStream
+ * @return List of all <code>IGobblerListeners</code> that are monitoring the stream.
+ */
+
+ public ArrayList<IGobblerListener> getInputStreamListeners() {
+ if(null != inputGobbler)
+ return inputListeners;
+ else {
+ ArrayList<IGobblerListener> dataListeners = inputGobbler.getDataListeners();
+ return dataListeners;
+ }
+ }
+
+ /**
+ * Returns the list of everything that is listening the the ErrorStream
+ * @return List of all <code>IGobblerListeners</code> that are monitoring the stream.
+ */
+
+ public ArrayList<IGobblerListener> getErrorStreamListeners() {
+ if(null != errorGobbler)
+ return errorListeners;
+ else
+ return errorGobbler.getDataListeners();
+ }
+
+ /**
+ * Removes the provided listener from those monitoring the InputStream.
+ * @param listener An </code>IGobblerListener</code> that is monitoring the stream.
+ */
+ public void removeInputStreamListener(IGobblerListener listener) {
+ if(null != inputGobbler)
+ inputGobbler.removeDataListener(listener);
+ else
+ inputListeners.remove(listener);
+ }
+
+ /**
+ * Removes the provided listener from those monitoring the ErrorStream.
+ * @param listener An </code>IGobblerListener</code> that is monitoring the stream.
+ */
+ public void removeErrorStreamListener(IGobblerListener listener) {
+ if(null != errorGobbler)
+ errorGobbler.removeDataListener(listener);
+ else
+ errorListeners.remove(listener);
+ }
+
+ /**
+ * Disposes of all internal components of this class. Nothing in the class should be
+ * referenced after this is called.
+ */
+ public void dispose() {
+ if(!disposed) {
+ stop();
+ disposed = true;
+ inputListeners = null;
+ errorListeners = null;
+
+ if(null != inputGobbler)
+ inputGobbler.dispose();
+ inputGobbler = null;
+
+ if(null != errorGobbler)
+ errorGobbler.dispose();
+ errorGobbler = null;
+ }
+ }
+
+ private boolean stopped = false;
+ private boolean disposed = false;
+ private StreamGobbler inputGobbler = null;
+ private StreamGobbler errorGobbler = null;
+ private ArrayList<IGobblerListener> inputListeners = new ArrayList<IGobblerListener>(); //Only used to allow adding listeners before creating the StreamGobbler
+ private ArrayList<IGobblerListener> errorListeners = new ArrayList<IGobblerListener>(); //Only used to allow adding listeners before creating the StreamGobbler
+ private int returnVal = Integer.MAX_VALUE;
+
+ private String[] cmd;
+ private String[] envVars;
+ private IPasswordPrompt prompt;
+ private int monitorDelay;
+ protected Process process;
+
+ public static final int ERROR_STREAM = 0;
+ public static final int INPUT_STREAM = 1;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/LoggedCommand.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/LoggedCommand.java
new file mode 100644
index 0000000000..d9e918a881
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/LoggedCommand.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.runnable;
+
+import java.io.File;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.IPasswordPrompt;
+import org.eclipse.linuxtools.systemtap.ui.structures.LoggingStreamDaemon;
+
+
+
+/**
+ * A class to spawn a separate thread to run a <code>Process</code> and to automatically
+ * log everything using the <code>LoggingStreamDaemon</code>.
+ * @author Ryan Morse
+ */
+public class LoggedCommand extends Command {
+ /**
+ * Spawns the new thread that this class will run in. From the Runnable
+ * interface spawning the new thread automatically calls the run() method.
+ * This must be called by the implementing class in order to start the
+ * StreamGobbler.
+ * @param cmd The entire command to run
+ * @param envVars List of all environment variables to use
+ * @param prompt The password promt for allowing the user to enter their password.
+ */
+ public LoggedCommand(String[] cmd, String[] envVars, IPasswordPrompt prompt) {
+ super(cmd, envVars, prompt, 0);
+ }
+
+ /**
+ * Spawns the new thread that this class will run in. From the Runnable
+ * interface spawning the new thread automatically calls the run() method.
+ * This must be called by the implementing class in order to start the
+ * StreamGobbler.
+ * @param cmd The entire command to run
+ * @param envVars List of all environment variables to use
+ * @param prompt The password promt for allowing the user to enter their password.
+ * @param monitorDelay the time between checking to see if the process finished
+ */
+ public LoggedCommand(String[] cmd, String[] envVars, IPasswordPrompt prompt, int monitorDelay) {
+ super(cmd, envVars, prompt, monitorDelay);
+ logger = new LoggingStreamDaemon();
+ addInputStreamListener(logger);
+ }
+
+ /**
+ * Gets all of the output from the input stream.
+ * @return String containing the entire output from the input stream.
+ */
+ public String getOutput() {
+ if(!isDisposed())
+ return logger.getOutput();
+ else
+ return null;
+ }
+
+ /**
+ * Saves the input stream data to a premanent file. Any new data on the
+ * stream will automatically be saved to the file.
+ * @param file The file to save the InputStream to.
+ */
+ public boolean saveLog(File file) {
+ return logger.saveLog(file);
+ }
+
+ /**
+ * Stops the process from running and unregisters the StreamListener
+ */
+ public synchronized void stop() {
+ if(isRunning()) {
+ super.stop();
+ removeInputStreamListener(logger);
+ }
+ }
+
+ /**
+ * Dispoes of all internal references in this class. Nothing should be called
+ * after dispose.
+ */
+ public void dispose() {
+ if(!isDisposed()) {
+ super.dispose(); //Do this first to ensure logger reads everything possible
+ logger.dispose();
+ }
+ }
+
+ private LoggingStreamDaemon logger;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/StreamGobbler.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/StreamGobbler.java
new file mode 100644
index 0000000000..91a9034588
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/runnable/StreamGobbler.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.runnable;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+
+import org.eclipse.linuxtools.systemtap.ui.structures.listeners.IGobblerListener;
+
+
+
+/**
+ * A separate thread to listen to an InputStream and pull all the data
+ * out of it. When data is found a new event is fired share the data with
+ * any <code>IDataListener</code> that is listening.
+ * @author Ryan Morse
+ */
+public class StreamGobbler implements Runnable {
+ public StreamGobbler(InputStream is) {
+ if(null != is) {
+ this.is = is;
+ line = new StringBuilder();
+ listeners = new ArrayList<IGobblerListener>();
+ }
+ locked = false;
+ }
+
+ /**
+ * Spawns the new thread that this class will run in. From the Runnable
+ * interface spawning the new thread automatically calls the run() method.
+ * This must be called by the implementing class in order to start the
+ * StreamGobbler.
+ */
+ //Make sure to call this method to start the StreamGobbler
+ public void start() {
+ t = new Thread(this, "StreamGobbler");
+ t.start();
+ }
+
+ /**
+ * Checks to see if the gobbler is still running.
+ * @return boolean representing whether or not it is sill running
+ */
+ public boolean isRunning() {
+ return (null != t);
+ }
+
+ /**
+ * The main method of this class. It monitors the provided thread to see
+ * when new data is available and then appends it to its current list of
+ * data. When a new line is read it will fire a DataEvent for listeners
+ * to get ahold of the data.
+ */
+ public void run() {
+ Thread thisThread = Thread.currentThread();
+ try {
+ int val=-1;
+
+ while(t == thisThread) {
+ while(0 < is.available()) {
+ if(-1 == (val = is.read()))
+ this.stop();
+ else
+ line.append((char)val);
+ if ('\n' == val)
+ this.fireNewDataEvent();
+
+ }
+ try {
+ Thread.sleep(10);
+ } catch(InterruptedException ie) {}
+ }
+ } catch (IOException ioe) {} //If stream closed before thread shuts down
+ }
+
+ /**
+ * Stops the gobbler from monitering the stream, and fires one last data event
+ * to make sure that listeners have the entire contents of what was read in
+ * from the stream.
+ */
+ public synchronized void stop() {
+ try { //Make sure we don't stop while there is still data in the stream
+ while(0 != is.available()) {
+ Thread.sleep(10);
+ }
+ } catch(Exception e) {}
+ t = null;
+ notify();
+ //Fire one last time to ensure listeners have gotten everything.
+ this.fireNewDataEvent();
+ }
+
+ /**
+ * Method for getting the most recently read line from the stream.
+ * @return String representing the current line being read from the
+ * <code>InputStream</code>
+ */
+ public String readLine() {
+ return line.toString();
+ }
+
+ /**
+ * Gets rid of all internal references to objects.
+ */
+ public void dispose() {
+ if(isRunning())
+ stop();
+ line = null;
+ t = null;
+ is = null;
+ }
+
+ /**
+ * Fires new events to everything that is monitering this stream. Then clears
+ * the current line of data.
+ */
+ private void fireNewDataEvent() {
+ //Implement our own lock since using synchronized causes a deadlock here
+ /* while(locked) {
+ try {
+ wait(10);
+ } catch(Exception e) {}
+ }
+ locked = true;*/
+ for(int i = 0; i < listeners.size(); i++)
+ {
+
+ ((IGobblerListener)(listeners.get(i))).handleDataEvent(line.toString());
+ }
+ line.delete(0, line.length());
+ locked = false;
+ }
+
+ public void fireNewDataEvent(String l) {
+ //Implement our own lock since using synchronized causes a deadlock here
+ /* while(locked) {
+ try {
+ wait(10);
+ } catch(Exception e) {}
+ }
+ locked = true;*/
+ for(int i = 0; i < listeners.size(); i++)
+ {
+ ((IGobblerListener)(listeners.get(i))).handleDataEvent(l);
+ }
+// line.delete(0, line.length());
+ locked = false;
+ }
+
+ /**
+ * Registers the provided listener to get data events.
+ * @param l A listener that needs to moniter the stream.
+ */
+ public void addDataListener(IGobblerListener l) {
+
+ if(!listeners.contains(l))
+ {
+
+ listeners.add(l);
+
+ }
+
+ }
+
+ /**
+ * Unregisters the provied listener from getting new data events.
+ * @param l A listener that is monitering the stream and should be removed
+ */
+ public void removeDataListener(IGobblerListener l) {
+
+ if(listeners.contains(l))
+ listeners.remove(l);
+ }
+
+ /**
+ * Returns a list of all of the <code>IGobblerListeners</code> that
+ * are lstening for data events.
+ * @return ArrayList of all of the listeners registered.
+ */
+ public ArrayList<IGobblerListener> getDataListeners() {
+ return listeners;
+ }
+
+ private ArrayList<IGobblerListener> listeners;
+ private StringBuilder line;
+ private Thread t;
+ private InputStream is;
+
+ @SuppressWarnings("unused")
+ private boolean locked;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/ComboFieldEditor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/ComboFieldEditor.java
new file mode 100644
index 0000000000..7bf9afdc0e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/ComboFieldEditor.java
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.ui;
+
+import org.eclipse.jface.preference.FieldEditor;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * A field editor for a combo box that allows the drop-down selection of one of a list of items.
+ */
+public class ComboFieldEditor extends FieldEditor {
+
+ /**
+ * The <code>Combo</code> widget.
+ */
+ private Combo fCombo;
+
+ /**
+ * The value (not the name) of the currently selected item in the Combo widget.
+ */
+ private String fValue;
+
+ /**
+ * The names (labels) and underlying values to populate the combo widget. These should be
+ * arranged as: { {name1, value1}, {name2, value2}, ...}
+ */
+ private String[][] fEntryNamesAndValues;
+
+ public ComboFieldEditor(String name, String labelText, String[][] entryNamesAndValues, Composite parent) {
+ init(name, labelText);
+ Assert.isTrue(checkArray(entryNamesAndValues));
+ fEntryNamesAndValues = entryNamesAndValues;
+ createControl(parent);
+ }
+
+ /**
+ * Checks whether given <code>String[][]</code> is of "type"
+ * <code>String[][2]</code>.
+ *
+ * @return <code>true</code> if it is ok, and <code>false</code> otherwise
+ */
+ private boolean checkArray(String[][] table) {
+ if (table == null) {
+ return false;
+ }
+ for (int i = 0; i < table.length; i++) {
+ String[] array = table[i];
+ if (array == null || array.length != 2) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @see FieldEditor#adjustForNumColumns(int)
+ */
+ protected void adjustForNumColumns(int numColumns) {
+ if (numColumns > 1) {
+ Control control = getLabelControl();
+ int left = numColumns;
+ if (control != null) {
+ ((GridData)control.getLayoutData()).horizontalSpan = 1;
+ left = left - 1;
+ }
+ ((GridData)fCombo.getLayoutData()).horizontalSpan = left;
+ } else {
+ Control control = getLabelControl();
+ if (control != null) {
+ ((GridData)control.getLayoutData()).horizontalSpan = 1;
+ }
+ ((GridData)fCombo.getLayoutData()).horizontalSpan = 1;
+ }
+ }
+
+ /**
+ * @see FieldEditor#doFillIntoGrid(Composite, int)
+ */
+ protected void doFillIntoGrid(Composite parent, int numColumns) {
+ int comboC = 1;
+ if (numColumns > 1) {
+ comboC = numColumns - 1;
+ }
+ Control control = getLabelControl(parent);
+ GridData gd = new GridData();
+ gd.horizontalSpan = 1;
+ control.setLayoutData(gd);
+ control = getComboBoxControl(parent);
+ gd = new GridData();
+ gd.horizontalSpan = comboC;
+ gd.horizontalAlignment = GridData.FILL;
+ control.setLayoutData(gd);
+ control.setFont(parent.getFont());
+ }
+
+ /**
+ * @see FieldEditor#doLoad()
+ */
+ protected void doLoad() {
+ updateComboForValue(getPreferenceStore().getString(getPreferenceName()));
+ }
+
+ /**
+ * @see FieldEditor#doLoadDefault()
+ */
+ protected void doLoadDefault() {
+ updateComboForValue(getPreferenceStore().getDefaultString(getPreferenceName()));
+ }
+
+ /**
+ * @see FieldEditor#doStore()
+ */
+ protected void doStore() {
+ if (fValue == null) {
+ getPreferenceStore().setToDefault(getPreferenceName());
+ return;
+ }
+
+ getPreferenceStore().setValue(getPreferenceName(), fValue);
+ }
+
+ /**
+ * @see FieldEditor#getNumberOfControls()
+ */
+ public int getNumberOfControls() {
+ return 1;
+ }
+
+ /**
+ * Lazily create and return the Combo control.
+ */
+ public Combo getComboBoxControl(Composite parent) {
+ if (fCombo == null) {
+ fCombo = new Combo(parent, SWT.READ_ONLY);
+ fCombo.setFont(parent.getFont());
+ for (int i = 0; i < fEntryNamesAndValues.length; i++) {
+ fCombo.add(fEntryNamesAndValues[i][0], i);
+ }
+
+ fCombo.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent evt) {
+ String oldValue = fValue;
+ String name = fCombo.getText();
+ fValue = getValueForName(name);
+ setPresentsDefaultValue(false);
+ fireValueChanged(VALUE, oldValue, fValue);
+ }
+ });
+ }
+ return fCombo;
+ }
+
+ /**
+ * Given the name (label) of an entry, return the corresponding value.
+ */
+ protected String getValueForName(String name) {
+ for (int i = 0; i < fEntryNamesAndValues.length; i++) {
+ String[] entry = fEntryNamesAndValues[i];
+ if (name.equals(entry[0])) {
+ return entry[1];
+ }
+ }
+ return fEntryNamesAndValues[0][0];
+ }
+
+ /**
+ * Set the name in the combo widget to match the specified value.
+ */
+ protected void updateComboForValue(String value) {
+ fValue = value;
+ for (int i = 0; i < fEntryNamesAndValues.length; i++) {
+ if (value.equals(fEntryNamesAndValues[i][1])) {
+ fCombo.setText(fEntryNamesAndValues[i][0]);
+ return;
+ }
+ }
+ if (fEntryNamesAndValues.length > 0) {
+ fValue = fEntryNamesAndValues[0][1];
+ }
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/ListEditor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/ListEditor.java
new file mode 100644
index 0000000000..35a27dd93e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/ListEditor.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.ui;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.swt.widgets.Composite;
+
+public class ListEditor extends org.eclipse.jface.preference.ListEditor {
+ public ListEditor(String name, String labelText, String dialogText, String initialVal, IInputValidator validator, Composite parent) {
+ init(name, labelText);
+ dialogTitle = dialogText;
+ this.initialVal = initialVal;
+ this.validator = validator;
+ createControl(parent);
+ }
+
+ /**
+ * Creates and populates a StringBuffer with the supplied items.
+ *
+ * @param items An array of strings to make the StringBuffer with.
+ *
+ * @return Returns the StringBuffer.
+ */
+ protected String createList(String[] items) {
+ StringBuffer path = new StringBuffer("");
+
+ for (int i = 0; i < items.length; i++) {
+ path.append(items[i]);
+ path.append(File.pathSeparator);
+ }
+ return path.toString();
+ }
+
+ protected String getNewInputObject() {
+ InputDialog dialog = new InputDialog(getShell(), dialogTitle, null, initialVal, validator);
+ dialog.open();
+
+ return dialog.getValue();
+ }
+
+ /**
+ * Parses the passed in string into an array of strings.
+ *
+ * @param stringList The string to pass parse.
+ *
+ * @return Returns the array of strings.
+ */
+ protected String[] parseString(String stringList) {
+ StringTokenizer st = new StringTokenizer(stringList, File.pathSeparator + "\n\r");
+ ArrayList<Object> v = new ArrayList<Object>();
+ while (st.hasMoreElements()) {
+ v.add(st.nextElement());
+ }
+ return (String[]) v.toArray(new String[v.size()]);
+ }
+
+ private String dialogTitle;
+ private String initialVal;
+ private IInputValidator validator;
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/PasswordDialog.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/PasswordDialog.java
new file mode 100644
index 0000000000..b829d42478
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/ui/PasswordDialog.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.ui;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.linuxtools.systemtap.ui.structures.internal.Localization;
+import org.eclipse.swt.SWT;
+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;
+
+
+
+public class PasswordDialog extends Dialog {
+ public PasswordDialog(Shell parentShell) {
+ super(parentShell);
+ }
+
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ shell.setText(Localization.getString("PasswordDialog.Password"));
+ shell.setSize(275, 150);
+ }
+
+ /**
+ * Creates the dialog that requests SUDO password from the user.
+ *
+ * @param parent The parent composite object.
+ *
+ * @return The dialogue composite.
+ */
+ protected Control createDialogArea(Composite parent) {
+ Composite comp = new Composite(parent, SWT.NONE);
+
+ Label lblPassword = new Label(comp, SWT.RIGHT);
+ lblPassword.setText(Localization.getString("PasswordDialog.SUDOPassword"));
+ lblPassword.setBounds(5, 15, 110, 20);
+
+ txtPassword = new Text(comp, SWT.SINGLE | SWT.PASSWORD);
+ txtPassword.setBounds(115, 15, 150, 20);
+
+ chkSavePassword = new Button(comp, SWT.CHECK);
+ chkSavePassword.setText(Localization.getString("PasswordDialog.SavePassword"));
+ chkSavePassword.setBackground(comp.getBackground());
+ chkSavePassword.setBounds(5, 45, 200, 20);
+
+ return comp;
+ }
+
+ /**
+ * Retrieves and stores the password.
+ *
+ * @param buttonId ID of the button that the user clicks.
+ */
+ protected void buttonPressed(int buttonId) {
+ if(0 == buttonId)
+ password = txtPassword.getText();
+ else
+ password = null;
+
+ passwordSaved = chkSavePassword.getSelection();
+
+ super.buttonPressed(buttonId);
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public boolean getPasswordSaved() {
+ return passwordSaved;
+ }
+
+ public void dispose() {
+ password = null;
+ txtPassword.dispose();
+ }
+
+ private Text txtPassword;
+ private String password;
+ private Button chkSavePassword;
+ private boolean passwordSaved;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/ConditionalExpressionValidator.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/ConditionalExpressionValidator.java
new file mode 100644
index 0000000000..42e40d360c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/ConditionalExpressionValidator.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.validators;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.linuxtools.systemtap.ui.structures.internal.Localization;
+
+
+
+public class ConditionalExpressionValidator implements IInputValidator {
+
+ /**
+ * Determines whether or not the string is valid within the contraints.
+ *
+ * @param s The string to check.
+ *
+ * @return The return message.
+ */
+ public String isValid(String s) {
+ if(null == s)
+ return Localization.getString("ConditionalExpressionValidator.NotNull");
+ if(!s.startsWith("if"))
+ return Localization.getString("ConditionalExpressionValidator.StartWithIf");
+ if(!s.contains("("))
+ return Localization.getString("ConditionalExpressionValidator.MustContain");
+ if(!s.endsWith(")"))
+ return Localization.getString("ConditionalExpressionValidator.MustEndWith");
+ if(s.length() < 5)
+ return Localization.getString("ConditionalExpressionValidator.MustEnterSomething");
+ return null;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/DirectoryValidator.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/DirectoryValidator.java
new file mode 100644
index 0000000000..9e34f433ea
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/DirectoryValidator.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.validators;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.linuxtools.systemtap.ui.structures.internal.Localization;
+
+
+
+public class DirectoryValidator implements IInputValidator {
+
+ /**
+ * Determines whether or not the string is valid within the contraints.
+ *
+ * @param s The string to check.
+ *
+ * @return The return message.
+ */
+ public String isValid(String s) {
+ if(null == s)
+ return Localization.getString("DirectoryValidator.NotNull");
+ if(s.length() < 1)
+ return Localization.getString("DirectoryValidator.LongerFile");
+ if(!s.endsWith("/"))
+ return Localization.getString("DirectoryValidator.MustEndWith");
+ if(s.contains("//"))
+ return Localization.getString("DirectoryValidator.CanNotContain");
+ return null;
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/IntegerValidator.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/IntegerValidator.java
new file mode 100644
index 0000000000..dfe1e2b75f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/IntegerValidator.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.validators;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.linuxtools.systemtap.ui.structures.internal.Localization;
+
+
+
+public class IntegerValidator implements IInputValidator {
+
+ /**
+ * Determines whether or not the string is valid within the contraints.
+ *
+ * @param s The string to check.
+ *
+ * @return The return message.
+ */
+ public String isValid(String s) {
+ try {
+ Integer.parseInt(s);
+ return null;
+ } catch(NumberFormatException nfe) {
+ return Localization.getString("IntegerValidator.NaN");
+ }
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/MultiValidator.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/MultiValidator.java
new file mode 100644
index 0000000000..39342b053c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/MultiValidator.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.validators;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+
+public class MultiValidator implements IInputValidator {
+ public void addValidator(IInputValidator validator) {
+ validators.add(validator);
+ }
+
+
+ /**
+ * Determines whether or not the string is valid within the contraints.
+ *
+ * @param s The string to check.
+ *
+ * @return The return message.
+ */
+ public String isValid(String s) {
+ String message = null;
+ for(int i=0; i<validators.size(); i++) {
+ message = ((IInputValidator)validators.get(i)).isValid(s);
+ if(null != message)
+ return message;
+ }
+ return null;
+ }
+
+ ArrayList<IInputValidator> validators = new ArrayList<IInputValidator>();
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/NumberValidator.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/NumberValidator.java
new file mode 100644
index 0000000000..6875a01b78
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.structures/src/org/eclipse/linuxtools/systemtap/ui/structures/validators/NumberValidator.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.structures.validators;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.linuxtools.systemtap.ui.structures.internal.Localization;
+
+
+
+public class NumberValidator implements IInputValidator {
+
+ /**
+ * Determines whether or not the string is valid within the contraints.
+ *
+ * @param s The string to check.
+ *
+ * @return The return message.
+ */
+ public String isValid(String s) {
+ if(null == s)
+ return Localization.getString("NumberValidator.NotNull");
+ try {
+ Double.parseDouble(s);
+ return null;
+ } catch(NumberFormatException nfe) {
+ return Localization.getString("NumberValidator.NaN");
+ }
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.project
new file mode 100644
index 0000000000..4be8264f57
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.systemtapgui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.settings/org.eclipse.jdt.core.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..fa96056aad
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,65 @@
+#Fri Feb 06 21:16:21 IST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=ignore
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/ChangeLog
new file mode 100644
index 0000000000..5c3b0d2e24
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/ChangeLog
@@ -0,0 +1,12 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make version 0.3.0.qualifier.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Change provider from IBM to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * ChangeLog: Refactoring. Renaming all packages directories from *.systemtapgui.* to *.systemtap.ui.*
+ \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..2b46a1c8f4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: SystemTapGUI Plug-in
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.systemtapgui;singleton:=true
+Bundle-Version: 0.3.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.systemtapgui.internal.SystemTapGUIPlugin
+Bundle-Vendor: Eclipse
+Bundle-Localization: plugin
+Export-Package: org.eclipse.linuxtools.systemtap.ui.systemtapgui,
+ org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.linuxtools.systemtap.ui.logging,
+ org.eclipse.help,
+ org.eclipse.help.appserver,
+ org.eclipse.help.base,
+ org.eclipse.help.ui,
+ org.eclipse.help.webapp
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/about.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/about.html
new file mode 100644
index 0000000000..5d6dee8192
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/about.html
@@ -0,0 +1,23 @@
+<html>
+<head>
+<title>About Systemtap GUI</title>
+
+<body>
+ <center>
+ <img src="splash.bmp">
+
+ <br/>
+ Copyright &#169; 2006 IBM &#174;. All rights reserved.
+
+ <br/><br/>
+ <a href="http://sourceware.org/systemtap/">Systemtap</a>
+
+ <br/><br/>
+ Contact: <a href="mailto:morser@us.ibm.com, hhughesw@us.ibm.com, jhbriggs@us.ibm.com, hien@us.ibm.com?subject=SystemTap GUI">Systemtap GUI developers</a>
+
+ <!--This is here to satisfy RFRS requirements-->
+ <br/><br/>
+ This offering is powered by Eclipse technology and includes Eclipse plug-ins that can be installed and used with other Eclipse (3.1)-based offerings.
+ </center>
+</body>
+</html> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/aboutImage.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/aboutImage.gif
new file mode 100644
index 0000000000..4a8ae9b315
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/aboutImage.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/build.properties
new file mode 100644
index 0000000000..540f037315
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/build.properties
@@ -0,0 +1,14 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ splash.bmp,\
+ about.html,\
+ aboutImage.gif,\
+ documentation/,\
+ toc.xml,\
+ plugin_customization.ini,\
+ plugin.properties,\
+ icons/,\
+ build.properties
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/gettingstarted/gettingStarted.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/gettingstarted/gettingStarted.html
new file mode 100644
index 0000000000..0cbdcb2d6f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/gettingstarted/gettingStarted.html
@@ -0,0 +1,95 @@
+<a href="../toc.html">Table of Contents</a>
+
+<h1>SystemTap Development User Guide</h1>
+
+Welcome to the SystemTap Development Help pages. This section is intended to provide users with information
+and links about the SystemTap scripting language itself, in addition to a brief introduction to SystemTap
+GUI's structure for new users and a brief explanation of SystemTap.
+
+<h2>SystemTap GUI's Plugin Design</h2>
+
+SystemTap GUI was built with a modular goal in mind, namely, to provide the application as a series of
+plugins so that users may obtain just the ones they need without having to use a heavy-weight application
+should if they didn't need to. The most common example of this is to ship the Dashboard plugin
+independently, allowing non-SystemTap savvy users the ability to execute modules without having to write
+any scripts. The application in its complete state includes three perspective, each with a specific goal:
+
+<ul>
+<li><b>IDE Perspective</b> - Contains script editor and Function, Kernel Source, and Probe Alias browsers
+to assist in the creation and editting of SystemTap scripts.</li>
+<li><b>Graphics Perspective</b> - Graphs data from SystemTap scripts in the desired graph form according
+to a regular expression passed to interpret the data.</li>
+<li><b>Dashboard Perspective</b> - Allows the execution of modules, which are scripts with associated
+metadata that open one or more graphs in a dashboard environment that update in real time.This perspective
+is still under development</li>
+</ul>
+
+Each perspective has full documentation associated with it and is packaged in the respective plugin.
+
+<h2>
+Systemtap
+</h2>
+
+SystemTap provides free software (GPL) infrastructure to simplify the gathering of information about the
+running Linux kernel. This assists diagnosis of a performance or functional problem. SystemTap eliminates
+the need for the developer to go through the tedious and disruptive instrument, recompile, install, and
+reboot sequence that may be otherwise required to collect data.<br><br>
+
+SystemTap provides a simple command line interface and scripting language for writing instrumentation for a
+live running kernel. The internal tapset library as well as the published samples can be used to
+aid reuse and abstraction. <br><br>
+
+Current project members include Red Hat, IBM, Intel, and Hitachi.<br><br>
+
+See also: <a href="http://sourceware.org/systemtap/kprobes-status.html">Current status.</a>
+
+<h2>
+Configuration Tutorial
+</h2>
+
+This tutorial is written to guide a new SystemTap GUI user through some basic post-installation setup in
+order to get the most out of the application.<br>
+
+<h3>Installation</h3>
+
+If SystemTap GUI is not yet installed, or for problems in basic installation, please see the <a href="installation.html">
+installation help page</a>.
+
+<h3>Kernel Source Location</h3>
+
+In order to use the kernel source browser you'll need to point it to the kernel source initially. Do this by
+either selecting the Kernel Source Browser in the browser pane or by going to
+<b><u>W</u>indow-><u>P</u>references</b>, then going to the SystemTap->IDE->Path tab and setting the location
+there. This configuration detail is relevent to the IDE Perspective only.
+
+<h3>Tutorials</h3>
+
+If you haven't already, you will want to take the IDE and Graphing tutorials. You can find them in the Getting
+Started section of each perspective's help pages. These tutorial provides fundamental knowledge on graphing in SystemTap GUI.
+
+<h3>Preferences (Optional)</h3>
+
+Finally, you may want to set certain non-essential preferences before using SystemTap GUI regularly. Use
+<b><u>W</u>indow-><u>P</u>references</b> to access the Preferences page.
+
+Of particular note are
+Logging->Log To, SystemTap->Environment Variables, SystemTap->Graphing->Refresh Delay,
+SystemTap->IDE->Editor->Syntax Coloring.
+
+<h2>Links to SystemTap Resources</h2>
+
+The following links contain information specific to the SystemTap scripting language.
+
+<ul>
+<li><b>SystemTap website</b> - <a href="http://sourceware.org/systemtap/">http://sourceware.org/systemtap/</a></li>
+<li><b>SystemTap wiki</b> - <a href="http://sourceware.org/systemtap/wiki">http://sourceware.org/systemtap/wiki</a></li>
+<li><b>SystemTap tutorial</b> - <a href="http://sourceware.org/systemtap/tutorial/">http://sourceware.org/systemtap/tutorial/</a>
+<li><b>Full list of documentation</b> - <a href="http://sourceware.org/systemtap/documentation.html">http://sourceware.org/systemtap/documentation.html</a>
+</ul>
+
+The following links are related to the SystemTap GUI project:
+
+<ul>
+<li><b>SystemTap GUI Sourceforge</b> - <a href="https://sourceforge.net/projects/stapgui/">https://sourceforge.net/projects/stapgui/</a>
+<li><b>SystemTap GUI Homepage</b> - <a href="http://stapgui.sourceforge.net/">http://stapgui.sourceforge.net/</a>
+</ul>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/gettingstarted/installation.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/gettingstarted/installation.html
new file mode 100644
index 0000000000..a90e1ef06b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/gettingstarted/installation.html
@@ -0,0 +1,46 @@
+<a href="../toc.html">Table of Contents</a>
+
+<h2>
+Installation
+</h2>
+
+This section details the steps required for the installation of Systemtap GUI on the user's machine.
+
+<h3>
+Requirements
+</h3>
+
+<b>Hardware Requirements:</b>
+<ul><li>x86, x86_64, ppc64, s390</li></ul>
+
+<b>Sotware Requirements:</b>
+<ul>
+<li>Linux kernel v2.6.14 or newer</li>
+<li>Eclipse v3.4.1</li>
+<li>SystemTap v0.7 or newer</li>
+</ul>
+
+The Gui is a client-server application and the server and client can be installed seperately. The client is an eclipse plugin and requires eclipse to be installed. It provides an IDE to write scripts and a visualizer to view the output in graphical form.
+ The server (stapgui-server) provides stdout/stderr data collection and process management services for processes run on a remote system. The server executes the SystemTap script, collects all output to stderr and stdout from that process, then funnels it via a socket to the client.
+The client and server can be installed on machines with different architectures.This allows users to monitor remote machines. You may also download and build the source yourself.
+
+<br><b>NOTE: The client and server are seperate packages and need to be installed independently.</b> You are viewing this help on the eclipse based client.</br>
+
+<br>NOTE: Installation assumes you already have both Eclipse and SystemTap installed.
+
+<h3>Server</h3>
+
+<ol>
+<li>Install the systemtapguiserver rpm.</li>
+ Eg on Fedora run the command:
+ yum install systemtapguiserver
+<li> Run the command 'stapgui-server'. You will get a message saying "Listening for Connections..." in a minute or so which shows that the server is up and running.</li>
+</ol>
+
+<h3>Client</h3>
+<ol>
+<li> Install the eclipse-systemtapgui rpm.</li>
+ Eg on Fedora run the command:
+ yum install eclipse-systemtapgui
+<li>Launch eclipse and open the SystemTap IDE perspective to start writing scripts.</li>
+</ol>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/toc.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/toc.html
new file mode 100644
index 0000000000..6559d518f7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/html/toc.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Table of Contents</title>
+</head>
+
+<body>
+<h1>Table of Contents</h1>
+
+<ul>
+<li><a href="gettingstarted/gettingStarted.html">Introduction and Links</a></li>
+<li><a href="gettingstarted/installation.html">Installation</a></li>
+</ul>
+
+</body>
+</html> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/tocgettingstarted.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/tocgettingstarted.xml
new file mode 100644
index 0000000000..f30e1cea80
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/documentation/tocgettingstarted.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Getting Started" link_to="toc.xml#gettingstarted">
+ <!--<topic label="IDE Tutorial" href="documentation/html/gettingStarted/IDETutorial.html">
+ <topic label="Lesson 1" href="documentation/html/gettingstarted/IDETutorial/lesson1.html" />
+ <topic label="Lesson 2" href="documentation/html/gettingstarted/IDETutorial/lesson2.html" />
+ <topic label="Lesson 3" href="documentation/html/gettingstarted/IDETutorial/lesson3.html" />
+ </topic>
+ <topic label="Data Display Tutorial" href="documentation/html/concepts/dataDisplayTutorial.html">
+ <topic label="Lesson 1" href="documentation/html/gettingstarted/dataDisplayTutorial/lesson1.html" />
+ <topic label="Lesson 2" href="documentation/html/gettingstarted/dataDisplayTutorial/lesson2.html" />
+ <topic label="Lesson 3" href="documentation/html/gettingstarted/dataDisplayTutorial/lesson3.html" />
+ </topic>
+ <topic label="Configuration Tutorial" href="documentation/html/concepts/configurationTutorial.html">
+ <topic label="Lesson 1" href="documentation/html/gettingstarted/configurationTutorial/lesson1.html" />
+ <topic label="Lesson 2" href="documentation/html/gettingstarted/configurationTutorial/lesson2.html" />
+ <topic label="Lesson 3" href="documentation/html/gettingstarted/configurationTutorial/lesson3.html" />
+ </topic>
+ <topic label="Systemtap and Kprobes" href="documentation/html/concepts/systemtapAndKprobes.html" />
+ -->
+</toc>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/eclipse.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/eclipse.gif
new file mode 100644
index 0000000000..eb7b90c767
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/eclipse.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/perspective_obj.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/perspective_obj.gif
new file mode 100644
index 0000000000..173661c5df
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/perspective_obj.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/welcome.gif b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/welcome.gif
new file mode 100644
index 0000000000..542dddca3f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/icons/welcome.gif
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin.properties
new file mode 100644
index 0000000000..c1fb95d0d4
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin.properties
@@ -0,0 +1,10 @@
+about.text=System Tap GUI\n\n\
+Version 1.0.rc1\n\n\
+Build ID:\n\n\
+Copywrite: At some point we will\n\
+have a real copywrite info here.\n\n\
+Buit on the Eclipse framework.\
+
+
+preference.systemTap.name=SystemTap
+preference.envVars.name=Environment Variables \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin.xml
new file mode 100644
index 0000000000..93f2801b53
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ id="application"
+ point="org.eclipse.core.runtime.applications">
+ <application>
+ <run class="org.eclipse.linuxtools.systemtap.ui.systemtapgui.Application"/>
+ </application>
+ </extension>
+
+
+ <extension
+ id="systemtapGUI"
+ point="org.eclipse.core.runtime.products">
+ <product
+ application="org.eclipse.linuxtools.systemtap.ui.systemtapgui.application"
+ name="systemtapgui">
+ <property name="aboutImage" value="aboutImage.gif"/>
+ <property
+ name="aboutText"
+ value="System Tap GUI&#x0A;Version 1.0.rc1&#x0A;Build ID:&#x0A;Copywrite: At some point we will&#x0A;have a real copywrite info here.&#x0A;&#x0A;Buit on the Eclipse framework."/>
+ <property name="preferenceCustomization" value="plugin_customization.ini"/>
+ <property
+ name="appName"
+ value="systemtapgui">
+ </property>
+ </product>
+ </extension>
+
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="toc.xml"
+ primary="true"/>
+ <toc file="documentation/tocgettingstarted.xml"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="%preference.systemTap.name"
+ id="com.qualityeclipse.systemtap.prefs.view"
+ class="org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences.SystemTapPreferencePage"/>
+ <page
+ name="%preference.envVars.name"
+ id="com.qualityeclipse.systemtap.prefs.environmentvariables"
+ class="org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences.EnvironmentVariablesPreferencePage"
+ category="com.qualityeclipse.systemtap.prefs.view"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences.PreferenceInitializer"/>
+ </extension>
+</plugin>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin_customization.ini b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin_customization.ini
new file mode 100644
index 0000000000..1ba76e5515
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/plugin_customization.ini
@@ -0,0 +1,6 @@
+org.eclipse.ui/DOCK_PERSPECTIVE_BAR=top_right
+org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=true
+org.eclipse.ui/initialFastViewBarLocation=left
+org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
+org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = false
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/splash.bmp b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/splash.bmp
new file mode 100644
index 0000000000..a2b6eff570
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/splash.bmp
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/splash2.bmp b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/splash2.bmp
new file mode 100644
index 0000000000..54bd540dbb
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/splash2.bmp
Binary files differ
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/Application.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/Application.java
new file mode 100644
index 0000000000..14f7aaf721
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/Application.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui;
+
+import org.eclipse.core.runtime.IPlatformRunnable;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+
+public class Application implements IPlatformRunnable {
+
+ /**
+ * Instantiates the workbench and creats a settings folder if it does not exist.
+ *
+ * @param args not used
+ *
+ * @return an IPlatformRunnable condition, either EXIT_RESTART or EXIT_OK
+ */
+ @SuppressWarnings("deprecation")
+ public Object run(Object args) throws Exception {
+ Display display = PlatformUI.createDisplay();
+
+ if(!SystemTapGUISettings.settingsFolder.exists())
+ SystemTapGUISettings.settingsFolder.mkdir();
+
+ try {
+ int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
+ if (returnCode == PlatformUI.RETURN_RESTART) {
+ return IPlatformRunnable.EXIT_RESTART;
+ }
+ return IPlatformRunnable.EXIT_OK;
+ } finally {
+ display.dispose();
+ }
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationActionBarAdvisor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationActionBarAdvisor.java
new file mode 100644
index 0000000000..c694dd5078
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationActionBarAdvisor.java
@@ -0,0 +1,330 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui;
+
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.ICoolBarManager;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarContributionItem;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.internal.Localization;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.ContributionItemFactory;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.part.CoolItemGroupMarker;
+
+
+
+public final class ApplicationActionBarAdvisor extends ActionBarAdvisor {
+
+ public ApplicationActionBarAdvisor(IActionBarConfigurer actionBarConfigurer) {
+ super(actionBarConfigurer);
+ LogManager.logDebug("Start/End ApplicationActionBarAdvisor: actionBarConfigurer-" + actionBarConfigurer, this);
+ }
+
+ /**
+ * Populates the passed in coolbar with the appropriate actions.
+ *
+ * @param cbManager the ICoolBarManager object that recieves the actions.
+ */
+ protected void fillCoolBar(ICoolBarManager cbManager) {
+ LogManager.logDebug("Start fillCollBar: cbManager-" + cbManager, this);
+ cbManager.add(new GroupMarker("group.file"));
+ {
+ // File Group
+ IToolBarManager fileToolBar = new ToolBarManager(cbManager.getStyle());
+ fileToolBar.add(new Separator(IWorkbenchActionConstants.FILE_START));
+ fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.NEW_GROUP));
+ fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
+ fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT));
+ fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.IMPORT_EXT));
+ fileToolBar.add(new GroupMarker("export.ext"));
+
+ fileToolBar.add(new Separator(IWorkbenchActionConstants.SAVE_GROUP));
+ fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
+ fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT));
+ fileToolBar.add(new Separator(IWorkbenchActionConstants.FILE_END));
+
+ //Edit
+ fileToolBar.add(new Separator(IWorkbenchActionConstants.EDIT_START));
+ fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
+ fileToolBar.add(new Separator(IWorkbenchActionConstants.EDIT_END));
+
+ //History
+ fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.HISTORY_GROUP));
+
+ //Build
+ fileToolBar.add(new Separator(IWorkbenchActionConstants.BUILD_GROUP));
+ fileToolBar.add(new CoolItemGroupMarker(IWorkbenchActionConstants.BUILD_EXT));
+ fileToolBar.add(new CoolItemGroupMarker("stop.ext"));
+
+ //Other
+ fileToolBar.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+
+ // Add to the cool bar manager
+ cbManager.add(new ToolBarContributionItem(fileToolBar,IWorkbenchActionConstants.TOOLBAR_FILE));
+ }
+
+ cbManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+
+ cbManager.add(new GroupMarker(IWorkbenchActionConstants.GROUP_EDITOR));
+ LogManager.logDebug("End fillCoolBar:", this);
+ }
+
+ /**
+ * Adds the menu groups to the passed in IMenuManager.
+ *
+ * @param menubar the IMenuManager object to populate
+ */
+ protected void fillMenuBar(IMenuManager menubar) {
+ LogManager.logDebug("Start fillMenuBar: menubar-" + menubar, this);
+ menubar.add(createFakeFileMenu());
+ menubar.add(createFakeHelpMenu());
+ menubar.add(createFileMenu());
+ menubar.add(createEditMenu());
+ menubar.add(createNavigateMenu());
+ menubar.add(createBuildMenu());
+ menubar.add(createWindowMenu());
+ menubar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+ menubar.add(createHelpMenu());
+ LogManager.logDebug("End fillMenuBar:", this);
+ }
+
+ /**
+ * Creates the file menu different from the standard eclipe edition.
+ *
+ * @return the MenuManager object created
+ */
+ private MenuManager createFakeFileMenu() {
+ LogManager.logDebug("Start createFakeFileMenu:", this);
+ MenuManager menu = new MenuManager(Localization.getString("ApplicationActionBarAdvisor.File"), IWorkbenchActionConstants.M_FILE);
+ menu.setVisible(false);
+
+ LogManager.logDebug("End createFakeFileMenu:", this);
+ return menu;
+ }
+
+ /**
+ * Creates the help menu different from the standard eclipe edition.
+ *
+ * @return the MenuManager object created
+ */
+ private MenuManager createFakeHelpMenu() {
+ LogManager.logDebug("Start createFakeHelpMenu:", this);
+ MenuManager menu = new MenuManager(Localization.getString("ApplicationActionBarAdvisor.Help"), IWorkbenchActionConstants.M_HELP);
+ menu.setVisible(false);
+
+ LogManager.logDebug("End createFakeHelpMenu:", this);
+ return menu;
+ }
+
+ /**
+ * Creates and returns the File menu.
+ *
+ * @return the MenuManager object created
+ */
+ private MenuManager createFileMenu() {
+ LogManager.logDebug("Start createFileMenu:", this);
+
+ MenuManager menu = new MenuManager(Localization.getString("ApplicationActionBarAdvisor.File"), IWorkbenchActionConstants.M_FILE + "2");
+ //menu.remove("org.eclipse.ui.edit.text.openExternalFile");
+ menu.add(new Separator(IWorkbenchActionConstants.FILE_START));
+ menu.add(new Separator(IWorkbenchActionConstants.NEW_EXT));
+ menu.add(new Separator(IWorkbenchActionConstants.CLOSE_EXT));
+ menu.add(new Separator(IWorkbenchActionConstants.SAVE_EXT));
+ menu.add(new Separator(IWorkbenchActionConstants.PRINT_EXT));
+ menu.add(new Separator(IWorkbenchActionConstants.IMPORT_EXT));
+ menu.add(new GroupMarker("export.ext"));
+ menu.add(new Separator("recentFiles.ext"));
+ menu.add(new Separator(IWorkbenchActionConstants.CLOSE_EXT));
+ menu.add(getAction(ActionFactory.QUIT.getId()));
+ menu.add(new Separator(IWorkbenchActionConstants.FILE_END));
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+
+ LogManager.logDebug("End createFileMenu: returnVal-" + menu, this);
+ return menu;
+ }
+
+ /**
+ * Creates and returns the Edit menu.
+ *
+ * @return the MenuManager object created
+ */
+ private MenuManager createEditMenu() {
+ LogManager.logDebug("Start createEditMenu:", this);
+
+ MenuManager menu = new MenuManager(Localization.getString("ApplicationActionBarAdvisor.Edit"), IWorkbenchActionConstants.M_EDIT);
+ menu.add(new Separator(IWorkbenchActionConstants.EDIT_START));
+ menu.add(new Separator(IWorkbenchActionConstants.UNDO_EXT));
+ menu.add(new Separator(IWorkbenchActionConstants.CUT_EXT));
+ menu.add(new Separator(IWorkbenchActionConstants.FIND_EXT));
+ menu.add(new Separator(IWorkbenchActionConstants.ADD_EXT));
+ menu.add(new Separator(IWorkbenchActionConstants.EDIT_END));
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+
+ LogManager.logDebug("End createEditMenu: returnVal-" + menu, this);
+ return menu;
+ }
+
+ /**
+ * Creates and returns the Navigate menu.
+ *
+ * @return the MenuManager object created
+ */
+ private MenuManager createNavigateMenu() {
+ LogManager.logDebug("Start createNavigateMenu:", this);
+
+ MenuManager menu = new MenuManager(Localization.getString("ApplicationActionBarAdvisor.Navigate"), IWorkbenchActionConstants.M_NAVIGATE);
+ menu.add(new Separator(IWorkbenchActionConstants.NAV_START));
+ menu.add(getAction(ActionFactory.FORWARD_HISTORY.getId()));
+ menu.add(getAction(ActionFactory.BACKWARD_HISTORY.getId()));
+ menu.add(new Separator(IWorkbenchActionConstants.NAV_END));
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+
+ LogManager.logDebug("End createNavigateMenu: returnVal-" + menu, this);
+ return menu;
+ }
+
+ /**
+ * Creates and returns the Build menu.
+ *
+ * @return the MenuManager object created
+ */
+ private MenuManager createBuildMenu() {
+ LogManager.logDebug("Start createBuildMenu:", this);
+
+ MenuManager menu = new MenuManager(Localization.getString("ApplicationActionBarAdvisor.Run"), IWorkbenchActionConstants.M_LAUNCH);
+ menu.add(new Separator(IWorkbenchActionConstants.WB_START));
+ menu.add(new GroupMarker(IWorkbenchActionConstants.BUILD_GROUP));
+ menu.add(new GroupMarker(IWorkbenchActionConstants.BUILD_EXT));
+ menu.add(new Separator("build.stop"));
+ menu.add(new Separator(IWorkbenchActionConstants.WB_END));
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+
+ LogManager.logDebug("End createBuildMenu: returnVal-" + menu, this);
+ return menu;
+ }
+
+ /**
+ * Creates and returns the Window menu.
+ *
+ * @return the MenuManager object created
+ */
+ private MenuManager createWindowMenu() {
+ LogManager.logDebug("Start createWindowMenu:", this);
+
+ MenuManager menu = new MenuManager(Localization.getString("ApplicationActionBarAdvisor.Window"), IWorkbenchActionConstants.M_WINDOW);
+ menu.add(new Separator(IWorkbenchActionConstants.PROJ_START));
+ menu.add(getAction(ActionFactory.OPEN_NEW_WINDOW.getId()));
+
+ menu.add(new Separator("perspective.ext"));
+ MenuManager menuPerspectives = new MenuManager(Localization.getString("ApplicationActionBarAdvisor.OpenPerspective"));
+ menuPerspectives.add(perspectives);
+ menu.add(menuPerspectives);
+
+ menu.add(new GroupMarker(IWorkbenchActionConstants.VIEW_EXT));
+ MenuManager menuViews = new MenuManager(Localization.getString("ApplicationActionBarAdvisor.ShowViews"));
+ menuViews.add(views);
+ menu.add(menuViews);
+
+ menu.add(new Separator(IWorkbenchActionConstants.WINDOW_EXT));
+ menu.add(new Separator(IWorkbenchActionConstants.PROJ_END));
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ menu.add(getAction(ActionFactory.PREFERENCES.getId()));
+
+ LogManager.logDebug("End createWindowMenu: returnVal-" + menu, this);
+ return menu;
+ }
+
+ /**
+ * Creates and returns the Help menu.
+ *
+ * @return the MenuManager object created
+ */
+ private MenuManager createHelpMenu() {
+ LogManager.logDebug("Start createHelpMenu:", this);
+
+ MenuManager menu = new MenuManager(Localization.getString("ApplicationActionBarAdvisor.Help"), IWorkbenchActionConstants.M_HELP + "2");
+ menu.add(new Separator(IWorkbenchActionConstants.HELP_START));
+ menu.add(getAction(ActionFactory.HELP_CONTENTS.getId()));
+ menu.add(getAction(ActionFactory.HELP_SEARCH.getId()));
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ menu.add(new Separator(IWorkbenchActionConstants.HELP_END));
+ menu.add(getAction(ActionFactory.ABOUT.getId()));
+
+ LogManager.logDebug("End createHelpMenu: returnVal-" + menu, this);
+ return menu;
+ }
+
+ /**
+ * Registers certain actions global.
+ *
+ * @param window the IWorkbenchWindow object to assign
+ */
+ protected void makeActions(IWorkbenchWindow window) {
+ LogManager.logDebug("Start makeActions: window-" + window, this);
+ //registerAsGlobal(ActionFactory.SAVE.create(window));
+ //registerAsGlobal(ActionFactory.SAVE_AS.create(window));
+ //registerAsGlobal(ActionFactory.SAVE_ALL.create(window));
+ //registerAsGlobal(ActionFactory.CLOSE.create(window));
+ //registerAsGlobal(ActionFactory.CLOSE_ALL.create(window));
+ //registerAsGlobal(ActionFactory.CLOSE_ALL_SAVED.create(window));
+ //registerAsGlobal(ActionFactory.PRINT.create(window));
+ //registerAsGlobal(ActionFactory.IMPORT.create(window));
+ registerAsGlobal(ActionFactory.QUIT.create(window));
+ //registerAsGlobal(ActionFactory.UNDO.create(window));
+ //registerAsGlobal(ActionFactory.REDO.create(window));
+ //registerAsGlobal(ActionFactory.CUT.create(window));
+ //registerAsGlobal(ActionFactory.COPY.create(window));
+ //registerAsGlobal(ActionFactory.PASTE.create(window));
+ //registerAsGlobal(ActionFactory.SELECT_ALL.create(window));
+ registerAsGlobal(ActionFactory.FIND.create(window));
+ //registerAsGlobal(ActionFactory.REVERT.create(window));
+ registerAsGlobal(ActionFactory.OPEN_NEW_WINDOW.create(window));
+ registerAsGlobal(ActionFactory.PREFERENCES.create(window));
+ //registerAsGlobal(ActionFactory.FORWARD.create(window));
+ //registerAsGlobal(ActionFactory.BACK.create(window));
+ registerAsGlobal(ActionFactory.FORWARD_HISTORY.create(window));
+ registerAsGlobal(ActionFactory.BACKWARD_HISTORY.create(window));
+ registerAsGlobal(ActionFactory.ABOUT.create(window));
+ registerAsGlobal(ActionFactory.HELP_CONTENTS.create(window));
+ registerAsGlobal(ActionFactory.HELP_SEARCH.create(window));
+
+ views = ContributionItemFactory.VIEWS_SHORTLIST.create(window);
+ perspectives = ContributionItemFactory.PERSPECTIVES_SHORTLIST.create(window);
+
+ LogManager.logDebug("End makeActions:", this);
+ }
+
+ /**
+ * Registers the action as global action and registers it for disposal.
+ *
+ * @param action the action to register
+ */
+ private void registerAsGlobal(IAction action) {
+ LogManager.logDebug("Start registerAsGlobal: action-" + action, this);
+ getActionBarConfigurer().registerGlobalAction(action);
+ register(action);
+ LogManager.logDebug("End registerAsGlobal:", this);
+ }
+
+ private IContributionItem views, perspectives;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationWorkbenchAdvisor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationWorkbenchAdvisor.java
new file mode 100644
index 0000000000..26a7cf8392
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationWorkbenchAdvisor.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui;
+
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.internal.SystemTapGUIPlugin;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences.PreferenceConstants;
+import org.eclipse.ui.application.IWorkbenchConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+
+
+public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
+ private static final String PERSPECTIVE_ID = Perspective.ID;
+
+ public ApplicationWorkbenchAdvisor() {
+ super();
+ LogManager.getInstance().begin();
+ }
+
+ public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+ return new ApplicationWorkbenchWindowAdvisor(configurer);
+ }
+
+ public String getInitialWindowPerspectiveId() {
+ return PERSPECTIVE_ID;
+ }
+
+ /**
+ * Initializes the configurer object, loads preferences.
+ *
+ * @param configurer The IWorkbenchConfigurer object to initialize.
+ */
+ public void initialize(IWorkbenchConfigurer configurer) {
+ LogManager.logDebug("Start initialize: configurer-" + configurer, this);
+ LogManager.logInfo("Initializing", this);
+ super.initialize(configurer);
+ configurer.setSaveAndRestore(
+ SystemTapGUIPlugin.getDefault().getPreferenceStore()
+ .getBoolean(PreferenceConstants.P_WINDOW_STATE));
+ LogManager.logDebug("End initialize:", this);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationWorkbenchWindowAdvisor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationWorkbenchWindowAdvisor.java
new file mode 100644
index 0000000000..62cc0ed58e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/ApplicationWorkbenchWindowAdvisor.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui;
+
+import java.util.List;
+
+import org.eclipse.jface.preference.PreferenceManager;
+import org.eclipse.jface.preference.PreferenceNode;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
+
+ public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+ super(configurer);
+ }
+
+ public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
+ return new ApplicationActionBarAdvisor(configurer);
+ }
+
+ /**
+ * Sets options for the configurer object such as size, coolbar, status line, title.
+ */
+ public void preWindowOpen() {
+ IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
+ configurer.setInitialSize(new Point(800, 600));
+ configurer.setShowCoolBar(true);
+ configurer.setShowStatusLine(false);
+ configurer.setShowPerspectiveBar(true);
+ configurer.setTitle("SystemTap GUI");
+
+ removeExcessPreferences();
+ }
+
+ /**
+ * Used to whipe out all eclipses standard preferences.
+ */
+ public void removeExcessPreferences() {
+ List l = PlatformUI.getWorkbench().getPreferenceManager().getElements(PreferenceManager.PRE_ORDER);
+ String id;
+ for(int i=0; i<l.size(); i++) {
+ id = ((PreferenceNode)l.get(i)).getId();
+ if(id.startsWith("org.eclipse"))
+ PlatformUI.getWorkbench().getPreferenceManager().remove(id);
+ }
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/Perspective.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/Perspective.java
new file mode 100644
index 0000000000..7a96c340d9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/Perspective.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui;
+
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.views.WelcomeView;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+
+
+public class Perspective implements IPerspectiveFactory {
+ public static String ID = "org.eclipse.linuxtools.systemtap.ui.systemtapgui.Perspective";
+
+ /**
+ * Sets options in the IPageLayout object such as editorAreaVisible and the Welcome View.
+ *
+ * @param layout The IPageLayout object to set options on.
+ */
+ public void createInitialLayout(IPageLayout layout) {
+ LogManager.logDebug("Start createInitialLayout: layout-" + layout, this);
+ LogManager.logInfo("Initializing", this);
+ String editorArea = layout.getEditorArea();
+ layout.setEditorAreaVisible(false);
+
+ layout.addStandaloneView(WelcomeView.ID, false, IPageLayout.TOP, 1.00f, editorArea);
+ layout.getViewLayout(WelcomeView.ID).setCloseable(false);
+ layout.addShowViewShortcut(WelcomeView.ID);
+
+ layout.addPerspectiveShortcut(ID);
+
+ LogManager.logDebug("End createInitialLayout:", this);
+
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/SystemTapGUISettings.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/SystemTapGUISettings.java
new file mode 100644
index 0000000000..a8f60d98ae
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/SystemTapGUISettings.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui;
+
+import java.io.File;
+
+public final class SystemTapGUISettings {
+ public static final File settingsFolder = new File(System.getenv("HOME") + "/.systemtapgui/");
+ public static final String installDirectory = System.getProperty("user.dir");
+ public static final String tempDirectory = "/tmp/systemtapgui/";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/Localization.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/Localization.java
new file mode 100644
index 0000000000..2fb25e6299
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/Localization.java
@@ -0,0 +1,22 @@
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui.internal;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Localization {
+ private static final String BUNDLE_NAME = "org.eclipse.linuxtools.systemtap.ui.systemtapgui.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.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/SystemTapGUIPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/SystemTapGUIPlugin.java
new file mode 100644
index 0000000000..da7f6a960d
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/SystemTapGUIPlugin.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui.internal;
+
+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 SystemTapGUIPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static SystemTapGUIPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public SystemTapGUIPlugin() {
+ 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 SystemTapGUIPlugin 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.systemtapgui", path);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/localization.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/localization.properties
new file mode 100644
index 0000000000..58efed72b7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/internal/localization.properties
@@ -0,0 +1,11 @@
+ApplicationActionBarAdvisor.File=&File
+ApplicationActionBarAdvisor.Help=&Help
+ApplicationActionBarAdvisor.Edit=&Edit
+ApplicationActionBarAdvisor.Navigate=&Navigate
+ApplicationActionBarAdvisor.Run=&Run
+ApplicationActionBarAdvisor.Window=&Window
+ApplicationActionBarAdvisor.OpenPerspective=&Open Perspective
+ApplicationActionBarAdvisor.ShowViews=Show &Views
+SystemTapPreferencePage.GUIPreferencesDescription=Preferences for the entire GUI application
+SystemTapPreferencePage.RememberWindowState=Remember window state
+WelcomeView.Welcome=Welcome
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/EnvironmentVariablesPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/EnvironmentVariablesPreferencePage.java
new file mode 100644
index 0000000000..28f9a9be8e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/EnvironmentVariablesPreferencePage.java
@@ -0,0 +1,168 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.internal.SystemTapGUIPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.IWorkbench;
+
+
+
+public class EnvironmentVariablesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ /**
+ * Set the description of the page.
+ */
+ public EnvironmentVariablesPreferencePage() {
+ super();
+ LogManager.logDebug("Start EnvironmentVariablesPreferencePage:", this);
+ setPreferenceStore(SystemTapGUIPlugin.getDefault().getPreferenceStore());
+ setDescription("Environment Variables.");
+ LogManager.logDebug("End EnvironmentVariablesPreferencePage:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logDebug("Start init:", this);
+ LogManager.logInfo("Initializing", this);
+ LogManager.logDebug("End init:", this);
+ }
+
+ /**
+ * Creates a ScrolledComposite, sets options on oit, opens string field editors for the
+ * preferences.
+ *
+ * @param The parent of the ScrolledComposite object.
+ *
+ * @return The ScrolledComposite object that is created configured.
+ */
+ protected Control createContents(Composite parent) {
+ LogManager.logDebug("Start createComponents: parent-" + parent, this);
+ ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ Composite c = new Composite(sc, SWT.NONE);
+ sc.setExpandHorizontal(true);
+ sc.setExpandVertical(true);
+ sc.setContent(c);
+ sc.setMinSize(c.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+
+ envVariables = new StringFieldEditor[PreferenceConstants.P_ENV.length];
+ for(int i=0; i<envVariables.length; i++) {
+ envVariables[i] = createStringFieldEditor(PreferenceConstants.P_ENV[i][0],
+ PreferenceConstants.P_ENV[i][1], c);
+ }
+ LogManager.logDebug("End createComponents: returnVal-" + sc, this);
+ return sc;
+ }
+
+ /**
+ * Creates and returns a StringFieldEditor object with preferences set to it.
+ *
+ * @param name Name of the field.
+ * @param lblText Label text of the field.
+ * @param parent Composite object parent of the object.
+ *
+ * @return The created and configued StringFieldEditor ojbect.
+ */
+ private StringFieldEditor createStringFieldEditor(String name, String lblText, Composite parent) {
+ LogManager.logDebug("Start createStringFieldEditor: name-" + name + ", lblText-" + lblText + ", parent-" + parent, this);
+ StringFieldEditor sfe = new StringFieldEditor(name, lblText, parent);
+ sfe.setPage(this);
+ sfe.setPreferenceStore(getPreferenceStore());
+ sfe.load();
+
+ LogManager.logDebug("End createStringFieldEditor: returnVal-" + sfe, this);
+ return sfe;
+ }
+
+ /**
+ * Loads the default environment variables.
+ */
+ protected void performDefaults() {
+ LogManager.logDebug("Start performDefaults:", this);
+ for(int i=0; i<envVariables.length; i++)
+ envVariables[i].loadDefault();
+
+ super.performDefaults();
+ LogManager.logDebug("End performDefaults:", this);
+ }
+
+ /**
+ * Stores the modified environment variables.
+ *
+ * @return True.
+ */
+ public boolean performOk() {
+ LogManager.logDebug("Start performOk:", this);
+ for(int i=0; i<envVariables.length; i++)
+ envVariables[i].store();
+
+ LogManager.logDebug("End performOk: returnVal-true", this);
+ return true;
+ }
+
+ /**
+ * Returns the currently stored environment variables in the form of a string array.
+ *
+ * @return The string array containing the current environment variables.
+ */
+ public static String[] getEnvironmentVariables() {
+ LogManager.logDebug("Start getEnvVars:", EnvironmentVariablesPreferencePage.class);
+ ArrayList vars = new ArrayList();
+ String[] envVars = null;
+ String var;
+
+ int i;
+ if(null == SystemTapGUIPlugin.getDefault() || null == SystemTapGUIPlugin.getDefault().getPreferenceStore())
+ return null;
+ IPreferenceStore p = SystemTapGUIPlugin.getDefault().getPreferenceStore();
+ for(i=0; i<PreferenceConstants.P_ENV.length; i++) {
+ var = p.getString(PreferenceConstants.P_ENV[i][0]).trim();
+ if(!var.equals("")) {
+ vars.add(PreferenceConstants.P_ENV[i][0] + "=" + var);
+ }
+ }
+
+ if(vars.size() > 0) {
+ envVars = new String[vars.size()];
+ for(i = 0; i<vars.size(); i++)
+ envVars[i] = (String)vars.get(i);
+ }
+
+ LogManager.logDebug("End getEnvVars: returnVal-" + envVars, EnvironmentVariablesPreferencePage.class);
+ return envVars;
+ }
+
+ /**
+ * Clears the environment variables string array.
+ */
+ public void dispose() {
+ LogManager.logDebug("Start dispose:", this);
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+
+ for(int i=0; i<envVariables.length; i++) {
+ envVariables[i].dispose();
+ envVariables[i] = null;
+ }
+ envVariables = null;
+ LogManager.logDebug("End dispose:", this);
+ }
+
+ private static StringFieldEditor[] envVariables;
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/PreferenceConstants.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/PreferenceConstants.java
new file mode 100644
index 0000000000..8521081551
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/PreferenceConstants.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences;
+
+/**
+ * Constant definitions for plug-in preferences
+ */
+public class PreferenceConstants {
+
+ //environmentvariables
+ public static final String[][] P_ENV = new String[][] {
+ {"EnvLdLibraryPath", "LD_LIBRARY_PATH"},
+ {"EnvPath", "PATH"},
+ {"EnvSystemtapTapset", "SYSTEMTAP_TAPSET"},
+ {"EnvSystemtapRuntime", "SYSTEMTAP_RUNTIME"},
+ //{"EnvDateTime", "DATE_TIME"},
+ //{"EnvUser", "USER"},
+ //{"EnvKernel", "KERNEL"},
+ //{"EnvTestName", "TEST_NAME"},
+ //{"EnvSystemtap", "SYSTEMTAP"},
+ //{"EnvElfutils", "ELFUTILS"},
+ //{"EnvStapObj", "STAP_OBJ"},
+ //{"EnvStapSrc", "STAP_SRC"},
+ //{"EnvStapInstall", "STAP_INSTALL"},
+ //{"EnvStapTests", "STAP_TESTS"},
+ //{"EnvCvsroot", "CVSROOT"},
+ //{"EnvMailToAddr", "MAIL_TO_ADDR"},
+ //{"EnvBuildResults", "BUILD_RESULTS"},
+ //{"EnvTestResults", "TEST_RESULTS"},
+ };
+
+ //systemtap
+ public static final String P_WINDOW_STATE = "RestoreWindowStatePreference";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/PreferenceInitializer.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/PreferenceInitializer.java
new file mode 100644
index 0000000000..fab7d865f9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/PreferenceInitializer.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.internal.SystemTapGUIPlugin;
+
+
+
+public class PreferenceInitializer extends AbstractPreferenceInitializer {
+ public void initializeDefaultPreferences() {
+ LogManager.logDebug("Start initializeDefaultPreferences:", this);
+ IPreferenceStore store = SystemTapGUIPlugin.getDefault().getPreferenceStore();
+
+ //gui
+ store.setDefault(PreferenceConstants.P_WINDOW_STATE, true);
+ }
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/SystemTapPreferencePage.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/SystemTapPreferencePage.java
new file mode 100644
index 0000000000..9a0944e370
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/preferences/SystemTapPreferencePage.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.internal.SystemTapGUIPlugin;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+
+public class SystemTapPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ /**
+ * Get the current preferences.
+ */
+ public SystemTapPreferencePage() {
+ super(GRID);
+ LogManager.logDebug("Start SystemTapPreferencePage:", this);
+ setPreferenceStore(SystemTapGUIPlugin.getDefault().getPreferenceStore());
+ setDescription(Localization.getString("SystemTapPreferencePage.GUIPreferencesDescription"));
+ LogManager.logDebug("End SystemTapPreferencePage:", this);
+ }
+
+ /**
+ * Sets up the field editors for optional change by the user.
+ */
+ public void createFieldEditors() {
+ LogManager.logDebug("Start createFieldEditors:", this);
+ addField(new BooleanFieldEditor(
+ PreferenceConstants.P_WINDOW_STATE,
+ Localization.getString("SystemTapPreferencePage.RememberWindowState"),
+ getFieldEditorParent()));
+ LogManager.logDebug("End createFieldEditors:", this);
+ }
+
+ public void init(IWorkbench workbench) {
+ LogManager.logInfo("Initializing", this);
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ }
+} \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/views/WelcomeView.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/views/WelcomeView.java
new file mode 100644
index 0000000000..5834ed90c0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/src/org/eclipse/linuxtools/systemtap/ui/systemtapgui/views/WelcomeView.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.systemtap.ui.systemtapgui.views;
+
+import org.eclipse.linuxtools.systemtap.ui.logging.LogManager;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.internal.Localization;
+import org.eclipse.linuxtools.systemtap.ui.systemtapgui.internal.SystemTapGUIPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.part.ViewPart;
+
+
+
+public class WelcomeView extends ViewPart {
+ public WelcomeView() {
+ super();
+ LogManager.logInfo("Initializing", this);
+ }
+
+ /**
+ * Establishes the components for the Welcome View.
+ *
+ * @param parent Composite parent of the new object.
+ */
+ public void createPartControl(Composite parent) {
+ Composite cmpMain = new Composite(parent, SWT.NONE);
+ cmpMain.setLayout(new FormLayout());
+ cmpMain.setBackground(new Color(parent.getDisplay(), 170, 200, 255));
+
+ Label lblTitle = new Label(cmpMain,SWT.NONE);
+ lblTitle.setText(Localization.getString("WelcomeView.Welcome"));
+ lblTitle.setFont(new Font(parent.getDisplay(), "Arial", 40, SWT.BOLD));
+ lblTitle.setBackground(cmpMain.getBackground());
+ lblTitle.setForeground(new Color(parent.getDisplay(), 0, 0, 100));
+ lblTitle.setAlignment(SWT.CENTER);
+
+ Image imgIcon = new Image(parent.getDisplay(), SystemTapGUIPlugin.getImageDescriptor("splash.bmp").getImageData());
+ Label lblImage = new Label(cmpMain,SWT.NONE);
+ lblImage.setBackground(cmpMain.getBackground());
+ lblImage.setImage(imgIcon);
+
+ lblImage.setAlignment(SWT.CENTER);
+
+
+ FormData titleData = new FormData();
+ titleData.left = new FormAttachment(0, 0);
+ titleData.top = new FormAttachment(0, 0);
+ titleData.right = new FormAttachment(100, 0);
+ titleData.bottom = new FormAttachment(20, 0);
+ lblTitle.setLayoutData(titleData);
+
+ FormData iconData = new FormData();
+ iconData.left = new FormAttachment(0, 0);
+ iconData.top = new FormAttachment(lblTitle);
+ iconData.right = new FormAttachment(100, 0);
+ iconData.bottom = new FormAttachment(80, 0);
+ lblImage.setLayoutData(iconData);
+
+
+ }
+
+ public void setFocus() {
+ }
+
+ public void dispose() {
+ LogManager.logInfo("Disposing", this);
+ super.dispose();
+ }
+
+ public static final String ID = "org.eclipse.linuxtools.systemtap.ui.systemtapgui.views.WelcomeView";
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/toc.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/toc.xml
new file mode 100644
index 0000000000..9e8d52c4c2
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.systemtapgui/toc.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="Systemtap Development User Guide" topic="documentation/html/toc.html">
+ <topic label="Introduction and Links" href="documentation/html/gettingstarted/gettingStarted.html">
+ <anchor id="gettingstarted"/>
+ </topic>
+ <topic label="Installation" href="documentation/html/gettingstarted/installation.html">
+ <anchor id="installation"/>
+ </topic>
+</toc>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/.project
new file mode 100644
index 0000000000..f7fc7e4dbe
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.test-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/ChangeLog
new file mode 100644
index 0000000000..a871e1b315
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/ChangeLog
@@ -0,0 +1,7 @@
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * .project: New file.
+ * build.properties: New file.
+ * epl-v10.html: New file.
+ * feature.properties: New file.
+ * feature.xml: \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/build.properties
new file mode 100644
index 0000000000..0dc2b5f024
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/build.properties
@@ -0,0 +1,4 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ epl-v10.html,\
+ test.xml
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/epl-v10.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/epl-v10.html
new file mode 100644
index 0000000000..9321f4082e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/epl-v10.html
@@ -0,0 +1,256 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Eclipse Public License - Version 1.0</title>
+
+<style type="text/css">
+ body {
+ size: 8.5in 11.0in;
+ margin: 0.25in 0.5in 0.25in 0.5in;
+ tab-interval: 0.5in;
+ }
+ p {
+ margin-left: auto;
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ p.list {
+ margin-left: 0.5in;
+ margin-top: 0.05em;
+ margin-bottom: 0.05em;
+ }
+ </style></head><body lang="EN-US">
+
+<p align="center"><b>Eclipse Public License - v 1.0</b></p>
+
+<p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
+DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS
+AGREEMENT.</p>
+
+<p><b>1. DEFINITIONS</b></p>
+
+<p>"Contribution" means:</p>
+
+<p class="list">a) in the case of the initial Contributor, the initial
+code and documentation distributed under this Agreement, and</p>
+<p class="list">b) in the case of each subsequent Contributor:</p>
+<p class="list">i) changes to the Program, and</p>
+<p class="list">ii) additions to the Program;</p>
+<p class="list">where such changes and/or additions to the Program
+originate from and are distributed by that particular Contributor. A
+Contribution 'originates' from a Contributor if it was added to the
+Program by such Contributor itself or anyone acting on such
+Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii)
+are not derivative works of the Program.</p>
+
+<p>"Contributor" means any person or entity that distributes
+the Program.</p>
+
+<p>"Licensed Patents" mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.</p>
+
+<p>"Program" means the Contributions distributed in accordance
+with this Agreement.</p>
+
+<p>"Recipient" means anyone who receives the Program under
+this Agreement, including all Contributors.</p>
+
+<p><b>2. GRANT OF RIGHTS</b></p>
+
+<p class="list">a) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the
+Contribution of such Contributor, if any, and such derivative works, in
+source code and object code form.</p>
+
+<p class="list">b) Subject to the terms of this Agreement, each
+Contributor hereby grants Recipient a non-exclusive, worldwide,
+royalty-free patent license under Licensed Patents to make, use, sell,
+offer to sell, import and otherwise transfer the Contribution of such
+Contributor, if any, in source code and object code form. This patent
+license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered
+by the Licensed Patents. The patent license shall not apply to any other
+combinations which include the Contribution. No hardware per se is
+licensed hereunder.</p>
+
+<p class="list">c) Recipient understands that although each Contributor
+grants the licenses to its Contributions set forth herein, no assurances
+are provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by
+any other entity based on infringement of intellectual property rights
+or otherwise. As a condition to exercising the rights and licenses
+granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For
+example, if a third party patent license is required to allow Recipient
+to distribute the Program, it is Recipient's responsibility to acquire
+that license before distributing the Program.</p>
+
+<p class="list">d) Each Contributor represents that to its knowledge it
+has sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.</p>
+
+<p><b>3. REQUIREMENTS</b></p>
+
+<p>A Contributor may choose to distribute the Program in object code
+form under its own license agreement, provided that:</p>
+
+<p class="list">a) it complies with the terms and conditions of this
+Agreement; and</p>
+
+<p class="list">b) its license agreement:</p>
+
+<p class="list">i) effectively disclaims on behalf of all Contributors
+all warranties and conditions, express and implied, including warranties
+or conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;</p>
+
+<p class="list">ii) effectively excludes on behalf of all Contributors
+all liability for damages, including direct, indirect, special,
+incidental and consequential damages, such as lost profits;</p>
+
+<p class="list">iii) states that any provisions which differ from this
+Agreement are offered by that Contributor alone and not by any other
+party; and</p>
+
+<p class="list">iv) states that source code for the Program is available
+from such Contributor, and informs licensees how to obtain it in a
+reasonable manner on or through a medium customarily used for software
+exchange.</p>
+
+<p>When the Program is made available in source code form:</p>
+
+<p class="list">a) it must be made available under this Agreement; and</p>
+
+<p class="list">b) a copy of this Agreement must be included with each
+copy of the Program.</p>
+
+<p>Contributors may not remove or alter any copyright notices contained
+within the Program.</p>
+
+<p>Each Contributor must identify itself as the originator of its
+Contribution, if any, in a manner that reasonably allows subsequent
+Recipients to identify the originator of the Contribution.</p>
+
+<p><b>4. COMMERCIAL DISTRIBUTION</b></p>
+
+<p>Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial use of
+the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create
+potential liability for other Contributors. Therefore, if a Contributor
+includes the Program in a commercial product offering, such Contributor
+("Commercial Contributor") hereby agrees to defend and
+indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses")
+arising from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with its
+distribution of the Program in a commercial product offering. The
+obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In
+order to qualify, an Indemnified Contributor must: a) promptly notify
+the Commercial Contributor in writing of such claim, and b) allow the
+Commercial Contributor to control, and cooperate with the Commercial
+Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own
+expense.</p>
+
+<p>For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor's responsibility
+alone. Under this section, the Commercial Contributor would have to
+defend claims against the other Contributors related to those
+performance claims and warranties, and if a court requires any other
+Contributor to pay any damages as a result, the Commercial Contributor
+must pay those damages.</p>
+
+<p><b>5. NO WARRANTY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION,
+ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement , including but not limited to
+the risks and costs of program errors, compliance with applicable laws,
+damage to or loss of data, programs or equipment, and unavailability or
+interruption of operations.</p>
+
+<p><b>6. DISCLAIMER OF LIABILITY</b></p>
+
+<p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</p>
+
+<p><b>7. GENERAL</b></p>
+
+<p>If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further action
+by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.</p>
+
+<p>If Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other
+software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the
+date such litigation is filed.</p>
+
+<p>All Recipient's rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of time
+after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive.</p>
+
+<p>Everyone is permitted to copy and distribute copies of this
+Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The
+Agreement Steward reserves the right to publish new versions (including
+revisions) of this Agreement from time to time. No one other than the
+Agreement Steward has the right to modify this Agreement. The Eclipse
+Foundation is the initial Agreement Steward. The Eclipse Foundation may
+assign the responsibility to serve as the Agreement Steward to a
+suitable separate entity. Each new version of the Agreement will be
+given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the
+Agreement under which it was received. In addition, after a new version
+of the Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
+rights or licenses to the intellectual property of any Contributor under
+this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.</p>
+
+<p>This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No party
+to this Agreement will bring a legal action under this Agreement more
+than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.</p>
+
+</body></html> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/feature.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/feature.properties
new file mode 100644
index 0000000000..b856560ac5
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/feature.properties
@@ -0,0 +1,112 @@
+#*******************************************************************************
+# Copyright (c) 2008 Red Hat, Inc.
+# 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:
+# Red Hat, Inc. - initial API and implementation
+#********************************************************************************
+featureName=SystemtapGui Integration Automated Tests (Incubation)
+description=Tests for plugins that integrate SystemTapGui with the workbench.
+featureProvider=Eclipse
+copyright=Copyright 2008 Red Hat, Inc.
+licenseURL=epl-v10.html
+license=\
+ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\n\
+March 17, 2005\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the Eclipse Foundation\n\
+is provided to you under the terms and conditions of the Eclipse Public\n\
+License Version 1.0 ("EPL"). A copy of the EPL is provided with this\n\
+Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse.org CVS\n\
+repository ("Repository") in CVS modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+Features may also include other Features ("Included Features"). Files named\n\
+"feature.xml" may contain a list of the names and version numbers of\n\
+Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Eclipse Update Manager, you must agree to a license ("Feature Update\n\
+License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties". Such Abouts,\n\
+Feature Licenses and Feature Update Licenses contain the terms and\n\
+conditions (or references to such terms and conditions) that govern your\n\
+use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use,\n\
+and re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/feature.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/feature.xml
new file mode 100644
index 0000000000..1e8f0cb04f
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.test-feature/feature.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.linuxtools.systemtap.ui.test"
+ label="%featureName"
+ version="0.2.0.qualifier"
+ provider-name="%featureProvider">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.junit" version="0.0.0"/>
+ <import plugin="org.eclipse.cdt.core"/>
+ <import plugin="org.eclipse.cdt.debug.core"/>
+ <import plugin="org.eclipse.cdt.debug.ui"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.debug.core"/>
+ <import plugin="org.eclipse.debug.ui"/>
+ <import plugin="org.eclipse.jface.text"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ <import plugin="org.eclipse.ui.editors"/>
+ <import plugin="org.eclipse.cdt.core.tests"/>
+ <import plugin="org.eclipse.cdt.launch"/>
+ <import plugin="org.eclipse.ui.console"/>
+ <import plugin="org.eclipse.birt.chart.engine"/>
+ <import plugin="org.eclipse.birt.core"/>
+ <import plugin="org.eclipse.cdt.ui"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.consolelog"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.consolelog.tests"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.editor"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.graphing"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.graphing.tests"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.graphingapi.ui"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.ide"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.ide.tests"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.logging"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.structures"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.structures.tests"/>
+ <import plugin="org.eclipse.linuxtools.systemtap.ui.systemtapgui"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.consolelog.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.graphing.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.graphingapi.nonui.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.ide.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.systemtap.ui.structures.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.classpath b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.classpath
new file mode 100644
index 0000000000..cc60ba7232
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.project b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.project
new file mode 100644
index 0000000000..8e87749a8c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.systemtap.ui.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.settings/org.eclipse.jdt.core.prefs b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..24ac4cae5c
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Sat Jun 20 00:37:21 IST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/ChangeLog b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/ChangeLog
new file mode 100644
index 0000000000..dd4afca2a7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/ChangeLog
@@ -0,0 +1,16 @@
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ * plugin.properties: Change provider from Eclipse.org to Eclipse.
+
+2009-07-07 Anithra P Janakiraman <anithra@linux.vnet.ibm.com>
+
+ * .classpath: New file.
+ * .project: New file.
+ * .settings/org.eclipse.jdt.core.prefs: New file.
+ * about.html: New file.
+ * build.properties: New file.
+ * META-INF/MANIFEST.MF: New file.
+ * plugin.properties: New file.
+ * plugin.xml: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiMockProcess.java: New file.
+ * src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiTestsPlugin.java: \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..f99e3fcf32
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.tests;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.tests.SystemTapGuiTestsPlugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit;bundle-version="[0.0.0,4.0.0)"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.eclipse.cdt.core.model,
+ org.eclipse.cdt.launch,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core,
+ org.eclipse.debug.core.model,
+ org.eclipse.debug.ui
+Export-Package: org.eclipse.linuxtools.systemtap.ui.tests
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/about.html b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/about.html
new file mode 100644
index 0000000000..e6a2741fc0
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/about.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>About</title>
+</head><body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>October 24, 2008</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body></html> \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/build.properties
new file mode 100644
index 0000000000..234be1c706
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/build.properties
@@ -0,0 +1,10 @@
+bin.includes = META-INF/,\
+ test.xml,\
+ about.html,\
+ plugin.properties,\
+ .,\
+ plugin.xml
+jars.compile.order = .
+source.. = src/
+output.. = bin/
+
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.properties
new file mode 100644
index 0000000000..4fb735673e
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.properties
@@ -0,0 +1,13 @@
+#*******************************************************************************
+# Copyright (c) 2008 Red Hat, Inc.
+# 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:
+# Red Hat, Inc. - initial API and implementation
+#********************************************************************************
+Bundle-Vendor.0 = Eclipse
+Bundle-Name.0 = SystemTapGui Test Suite (Incubation)
+launchConfigurationType.name.0 = SystemTapGui (Test) \ No newline at end of file
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.xml
new file mode 100644
index 0000000000..a8be1517f3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.debug.core.launchDelegates">
+ <launchDelegate
+ delegate="org.eclipse.linuxtools.systemtap.ui.tests.SystemtapGuiTestLaunchDelegate"
+ id="org.eclipse.linuxtools.systemtap.ui.tests.launchDelegate"
+ modes="profile"
+ sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
+ sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"
+ type="org.eclipse.linuxtools.systemtap.ui.launch.systemtapguiLaunch">
+ </launchDelegate>
+ </extension>
+
+</plugin>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiMockProcess.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiMockProcess.java
new file mode 100644
index 0000000000..3c31f495e7
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiMockProcess.java
@@ -0,0 +1,56 @@
+package org.eclipse.linuxtools.systemtap.ui.tests;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+public class SystemtapGuiMockProcess extends Process {
+ protected int exitcode;
+
+ public SystemtapGuiMockProcess(int exitcode) {
+ this.exitcode = exitcode;
+ }
+
+ @Override
+ public void destroy() {
+ }
+
+ @Override
+ public int exitValue() {
+ return exitcode;
+ }
+
+ @Override
+ public InputStream getErrorStream() {
+ return new InputStream() {
+ @Override
+ public int read() throws IOException {
+ return -1;
+ }
+ };
+ }
+
+ @Override
+ public InputStream getInputStream() {
+ return new InputStream() {
+ @Override
+ public int read() throws IOException {
+ return -1;
+ }
+ };
+ }
+
+ @Override
+ public OutputStream getOutputStream() {
+ return new OutputStream() {
+ public void write(int b) throws IOException {
+ }
+ };
+ }
+
+ @Override
+ public int waitFor() throws InterruptedException {
+ return exitcode;
+ }
+
+}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiTestsPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiTestsPlugin.java
new file mode 100644
index 0000000000..d943b9d4f3
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiTestsPlugin.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.systemtap.ui.tests;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+public class SystemtapGuiTestsPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.linuxtools.systemtap.ui.tests"; //$NON-NLS-1$
+
+ // Test Launch Delegate ID
+ public static final String DELEGATE_ID = PLUGIN_ID + ".launchDelegate"; //$NON-NLS-1$
+
+ // Java Runtime System Properties
+
+ /**
+ * usage: -Declipse.valgrind.tests.generateFiles=<yes|no> [default: no]
+ * if yes, will run Valgrind and store its output files for each test under
+ * <plugin root>/valgrindFiles
+ * no, will use default output directory for valgrind's output
+ */
+ public static final String SYSTEM_PROPERTY_GENERATE_FILES = "eclipse.valgrind.tests.generateFiles"; //$NON-NLS-1$
+ public static final boolean GENERATE_FILES = System.getProperty(SYSTEM_PROPERTY_GENERATE_FILES, "no").equals("yes"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * usage: -Declipse.valgrind.tests.runValgrind=<yes|no> [default: yes]
+ * if yes, will run Valgrind as in a normal launch
+ * no, will simulate Valgrind execution with pregenerated log files
+ */
+ public static final String SYSTEM_PROPERTY_RUN_VALGRIND = "eclipse.valgrind.tests.runValgrind"; //$NON-NLS-1$
+ // generateFiles implies runValgrind
+ public static final boolean RUN_VALGRIND = GENERATE_FILES || System.getProperty(SYSTEM_PROPERTY_RUN_VALGRIND, "yes").equals("yes"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // Launch config attribute to mock valgrind's exit code
+ public static final String ATTR_MOCK_EXIT_CODE = PLUGIN_ID + ".MOCK_EXIT_CODE"; //$NON-NLS-1$
+
+ // The shared instance
+ private static SystemtapGuiTestsPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public SystemtapGuiTestsPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static SystemtapGuiTestsPlugin getDefault() {
+ return plugin;
+ }
+
+}

Back to the top