Search in sources :

Example 1 with SwitchSampleTimeAction

use of org.eclipse.linuxtools.internal.gprof.action.SwitchSampleTimeAction in project linuxtools by eclipse.

the class GprofTest method changeMode.

private void changeMode(GmonView view, boolean timeModeRequested) {
    AbstractSTTreeViewer gmonViewer = (AbstractSTTreeViewer) view.getSTViewer();
    GmonDecoder decoder = (GmonDecoder) gmonViewer.getInput();
    int prof_rate = decoder.getHistogramDecoder().getProfRate();
    if (prof_rate == 0) {
        return;
    }
    TreeColumn tc = gmonViewer.getViewer().getTree().getColumn(1);
    SampleProfField spf = (SampleProfField) tc.getData();
    if (spf.getColumnHeaderText().endsWith("Samples") ^ !timeModeRequested) {
        new SwitchSampleTimeAction(view).run();
    }
}
Also used : TreeColumn(org.eclipse.swt.widgets.TreeColumn) GmonDecoder(org.eclipse.linuxtools.internal.gprof.parser.GmonDecoder) SwitchSampleTimeAction(org.eclipse.linuxtools.internal.gprof.action.SwitchSampleTimeAction) AbstractSTTreeViewer(org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTTreeViewer) SampleProfField(org.eclipse.linuxtools.internal.gprof.view.fields.SampleProfField)

Example 2 with SwitchSampleTimeAction

use of org.eclipse.linuxtools.internal.gprof.action.SwitchSampleTimeAction in project linuxtools by eclipse.

the class GmonView method createActions.

@Override
protected void createActions() {
    super.createActions();
    action1 = new SwitchContentProviderAction("Display function call graph", "icons/ch_callees.png", getSTViewer().getViewer(), // $NON-NLS-1$ //$NON-NLS-2$
    CallGraphContentProvider.sharedInstance);
    action2 = new SwitchContentProviderAction("Sort samples per file", "icons/c_file_obj.gif", getSTViewer().getViewer(), // $NON-NLS-1$ //$NON-NLS-2$
    FileHistogramContentProvider.sharedInstance);
    action3 = new SwitchContentProviderAction("Sort samples per function", "icons/function_obj.gif", getSTViewer().getViewer(), // $NON-NLS-1$ //$NON-NLS-2$
    FunctionHistogramContentProvider.sharedInstance);
    action4 = new SwitchContentProviderAction("Sort samples per line", "icons/line_obj.gif", getSTViewer().getViewer(), // $NON-NLS-1$ //$NON-NLS-2$
    FlatHistogramContentProvider.sharedInstance);
    switchSampleTime = new SwitchSampleTimeAction(this);
}
Also used : SwitchContentProviderAction(org.eclipse.linuxtools.internal.gprof.action.SwitchContentProviderAction) SwitchSampleTimeAction(org.eclipse.linuxtools.internal.gprof.action.SwitchSampleTimeAction)

Aggregations

SwitchSampleTimeAction (org.eclipse.linuxtools.internal.gprof.action.SwitchSampleTimeAction)2 AbstractSTTreeViewer (org.eclipse.linuxtools.dataviewers.abstractviewers.AbstractSTTreeViewer)1 SwitchContentProviderAction (org.eclipse.linuxtools.internal.gprof.action.SwitchContentProviderAction)1 GmonDecoder (org.eclipse.linuxtools.internal.gprof.parser.GmonDecoder)1 SampleProfField (org.eclipse.linuxtools.internal.gprof.view.fields.SampleProfField)1 TreeColumn (org.eclipse.swt.widgets.TreeColumn)1