use of org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput in project linuxtools by eclipse.
the class CachegrindLabelProvider method update.
@Override
public void update(ViewerCell cell) {
ICachegrindElement element = ((ICachegrindElement) cell.getElement());
int index = cell.getColumnIndex();
if (index == 0) {
if (element instanceof CachegrindFile) {
// Try to use the CElementLabelProvider
IAdaptable model = ((CachegrindFile) element).getModel();
if (model != null) {
cell.setText(cLabelProvider.getText(model));
cell.setImage(cLabelProvider.getImage(model));
} else {
// Fall back
String name = ((CachegrindFile) element).getName();
cell.setText(name);
cell.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE));
}
} else if (element instanceof CachegrindFunction) {
// Try to use the CElementLabelProvider
IAdaptable model = ((CachegrindFunction) element).getModel();
if (model != null) {
cell.setText(cLabelProvider.getText(model));
cell.setImage(cLabelProvider.getImage(model));
} else {
// Fall back
String name = ((CachegrindFunction) element).getName();
cell.setText(name);
cell.setImage(FUNC_IMG);
}
} else if (element instanceof CachegrindLine) {
// $NON-NLS-1$
cell.setText(NLS.bind(Messages.getString("CachegrindViewPart.line"), ((CachegrindLine) element).getLine()));
cell.setImage(DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_INSTRUCTION_POINTER_TOP));
} else if (element instanceof CachegrindOutput) {
// $NON-NLS-1$
cell.setText(NLS.bind(Messages.getString("CachegrindViewPart.Total_PID"), ((CachegrindOutput) element).getPid()));
cell.setImage(DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_REGISTER));
}
} else if (element instanceof CachegrindFunction) {
cell.setText(df.format(((CachegrindFunction) element).getTotals()[index - 1]));
} else if (element instanceof CachegrindLine) {
cell.setText(df.format(((CachegrindLine) element).getValues()[index - 1]));
} else if (element instanceof CachegrindOutput) {
cell.setText(df.format(((CachegrindOutput) element).getSummary()[index - 1]));
}
}
use of org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput in project linuxtools by eclipse.
the class CachegrindLaunchDelegate method parseOutput.
private void parseOutput(File[] cachegrindOutputs, IProgressMonitor monitor) throws IOException {
outputs = new CachegrindOutput[cachegrindOutputs.length];
for (int i = 0; i < cachegrindOutputs.length; i++) {
outputs[i] = new CachegrindOutput();
CachegrindParser.getParser().parse(outputs[i], cachegrindOutputs[i]);
}
monitor.worked(2);
}
Aggregations