use of org.eclipse.linuxtools.internal.gprof.view.fields.SampleProfField 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();
}
}
use of org.eclipse.linuxtools.internal.gprof.view.fields.SampleProfField in project linuxtools by eclipse.
the class SwitchSampleTimeAction method run.
@Override
public void run() {
AbstractSTTreeViewer gmonViewer = (AbstractSTTreeViewer) view.getSTViewer();
GmonDecoder decoder = (GmonDecoder) gmonViewer.getInput();
if (decoder != null) {
int prof_rate = decoder.getHistogramDecoder().getProfRate();
if (prof_rate == 0) {
MessageDialog.openError(view.getSite().getShell(), Messages.SwitchSampleTimeAction_GMON_PROF_RATE_IS_NULL, Messages.SwitchSampleTimeAction_GMON_PROF_RATE_IS_NULL_LONG_MSG);
return;
}
TreeColumn tc = gmonViewer.getViewer().getTree().getColumn(1);
SampleProfField spf = (SampleProfField) tc.getData();
spf.toggle();
tc.setText(spf.getColumnHeaderText());
gmonViewer.getViewer().refresh();
}
}
Aggregations