Search in sources :

Example 1 with ChartStreamDaemon

use of org.eclipse.linuxtools.systemtap.graphing.core.structures.ChartStreamDaemon in project linuxtools by eclipse.

the class RunScriptChartHandler method scriptConsoleInitialized.

@Override
protected void scriptConsoleInitialized(ScriptConsole console) {
    int n = parsers.size();
    for (int i = 0; i < n; i++) {
        console.getCommand().addInputStreamListener(new ChartStreamDaemon(dataSets.get(i), parsers.get(i)));
    }
    try {
        String name = console.getName();
        String title = name.substring(name.lastIndexOf('/') + 1);
        IWorkbenchPage p = PlatformUI.getWorkbench().showPerspective(IDEPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow());
        GraphSelectorEditor ivp = (GraphSelectorEditor) p.openEditor(new GraphSelectorEditorInput(title), GraphSelectorEditor.ID);
        String scriptName = console.getName();
        ivp.createScriptSets(scriptName, names, dataSets);
        for (int i = 0; i < n; i++) {
            for (GraphData graph : graphs.get(i)) {
                ivp.getDisplaySet(i).addGraph(graph);
            }
        }
    } catch (WorkbenchException we) {
        ExceptionErrorDialog.openError(Messages.RunScriptChartHandler_couldNotSwitchToGraphicPerspective, we);
    }
    super.scriptConsoleInitialized(console);
}
Also used : GraphSelectorEditorInput(org.eclipse.linuxtools.systemtap.graphing.ui.views.GraphSelectorEditorInput) ChartStreamDaemon(org.eclipse.linuxtools.systemtap.graphing.core.structures.ChartStreamDaemon) GraphSelectorEditor(org.eclipse.linuxtools.systemtap.graphing.ui.views.GraphSelectorEditor) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) WorkbenchException(org.eclipse.ui.WorkbenchException) GraphData(org.eclipse.linuxtools.systemtap.graphing.core.structures.GraphData)

Example 2 with ChartStreamDaemon

use of org.eclipse.linuxtools.systemtap.graphing.core.structures.ChartStreamDaemon in project linuxtools by eclipse.

the class ChartStreamDaemonTest method setUp.

@Before
public void setUp() {
    csd = new ChartStreamDaemon(null, null);
    assertNotNull(csd);
    csd1 = new ChartStreamDaemon(new RowDataSet(new String[] { "a" }), new RowParser(new String[] { "\\w", "\\s" }));
    assertNotNull(csd1);
}
Also used : RowDataSet(org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.RowDataSet) ChartStreamDaemon(org.eclipse.linuxtools.systemtap.graphing.core.structures.ChartStreamDaemon) RowParser(org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.RowParser) Before(org.junit.Before)

Aggregations

ChartStreamDaemon (org.eclipse.linuxtools.systemtap.graphing.core.structures.ChartStreamDaemon)2 RowDataSet (org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.RowDataSet)1 RowParser (org.eclipse.linuxtools.systemtap.graphing.core.datasets.row.RowParser)1 GraphData (org.eclipse.linuxtools.systemtap.graphing.core.structures.GraphData)1 GraphSelectorEditor (org.eclipse.linuxtools.systemtap.graphing.ui.views.GraphSelectorEditor)1 GraphSelectorEditorInput (org.eclipse.linuxtools.systemtap.graphing.ui.views.GraphSelectorEditorInput)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 WorkbenchException (org.eclipse.ui.WorkbenchException)1 Before (org.junit.Before)1