Search in sources :

Example 1 with GraphDisplaySet

use of org.eclipse.linuxtools.systemtap.graphing.ui.GraphDisplaySet in project linuxtools by eclipse.

the class SaveGraphImageHandler method getActiveGraph.

private AbstractChartBuilder getActiveGraph() {
    GraphSelectorEditor graphEditor = getActiveGraphEditor();
    if (graphEditor == null) {
        return null;
    }
    GraphDisplaySet gds = graphEditor.getActiveDisplaySet();
    return gds == null ? null : gds.getActiveGraph();
}
Also used : GraphSelectorEditor(org.eclipse.linuxtools.systemtap.graphing.ui.views.GraphSelectorEditor) GraphDisplaySet(org.eclipse.linuxtools.systemtap.graphing.ui.GraphDisplaySet)

Example 2 with GraphDisplaySet

use of org.eclipse.linuxtools.systemtap.graphing.ui.GraphDisplaySet in project linuxtools by eclipse.

the class GraphSelectorEditor method createScriptSets.

/**
 * This method will create a new script set for each of the provided dataSets.
 * Each new script set will be given a new tab item at the end of the list.
 * @param scriptName The full name of the script that is being monitored.
 * @param titles The names to be shown on each new tab
 * @param dataSets The <code>IFilteredDataSet</code>s for each new script set
 * @since 2.2
 */
public void createScriptSets(String scriptName, List<String> titles, List<IFilteredDataSet> dataSets) {
    CTabItem item = null;
    for (int i = 0, n = titles.size(); i < n; i++) {
        item = new CTabItem(scriptFolder, SWT.CLOSE);
        item.setText(titles.get(i));
        Composite parent = new Composite(scriptFolder, SWT.NONE);
        final GraphDisplaySet gds = new GraphDisplaySet(parent, dataSets.get(i));
        displaySets.add(gds);
        item.setControl(parent);
        item.addDisposeListener(e -> gds.dispose());
    }
    // Choose the last created item.
    scriptFolder.setSelection(item);
    this.setPartName(NLS.bind(Messages.GraphSelectorEditor_graphsEditorTitle, scriptName.substring(scriptName.lastIndexOf('/') + 1)));
}
Also used : Composite(org.eclipse.swt.widgets.Composite) CTabItem(org.eclipse.swt.custom.CTabItem) GraphDisplaySet(org.eclipse.linuxtools.systemtap.graphing.ui.GraphDisplaySet)

Aggregations

GraphDisplaySet (org.eclipse.linuxtools.systemtap.graphing.ui.GraphDisplaySet)2 GraphSelectorEditor (org.eclipse.linuxtools.systemtap.graphing.ui.views.GraphSelectorEditor)1 CTabItem (org.eclipse.swt.custom.CTabItem)1 Composite (org.eclipse.swt.widgets.Composite)1