use of org.talend.designer.runtime.visualization.internal.core.cpu.IThreadNode in project tdi-studio-se by Talend.
the class CallTreeLabelProvider method getTimeInMsColumnText.
/**
* Gets the time in milliseconds column text.
*
* @param element the element
* @return the time column text
*/
private String getTimeInMsColumnText(Object element) {
ICpuModel cpuModel = (ICpuModel) treeViewer.getInput();
if (cpuModel == null) {
//$NON-NLS-1$
return "";
}
int length = String.valueOf(cpuModel.getMaxTotalTime() * 1000).length();
length = (length > 10) ? 10 : length;
if (element instanceof IThreadNode) {
String milliseconds = getMillisecondsText(((IThreadNode) element).getTotalTime(), length);
return milliseconds;
} else if (element instanceof ICallTreeNode) {
long totalTime = ((ICallTreeNode) element).getTotalTime();
return getMillisecondsText(totalTime, length);
}
//$NON-NLS-1$
return "";
}
Aggregations