use of org.erlide.tracing.core.mvc.model.treenodes.ITreeNode in project erlide_eclipse by erlang.
the class TraceDataHandler method processReturnTrace.
private ITreeNode processReturnTrace(final String label, final Images image, final OtpErlangTuple tuple, final boolean showRetValue) {
final StringBuilder labelBuilder = new StringBuilder(label).append(": ");
final ITreeNode processNode = createProcessNode("process: ", tuple.elementAt(TraceDataHandler.INDEX_PROCESS));
processNode.setImage(Activator.getImage(Images.PROCESS_NODE));
final ITreeNode functionNode = createFunctionNode("function: ", tuple.elementAt(TraceDataHandler.INDEX_FUNCTION));
functionNode.setImage(Activator.getImage(Images.FUNCTION_NODE));
labelBuilder.append(lastFunctionDescription);
final ITreeNode node = new TreeNode();
node.addChildren(processNode, functionNode);
if (showRetValue) {
final ITreeNode returnValueNode = new TreeNode("return value: " + tuple.elementAt(TraceDataHandler.INDEX_RETURN_VALUE));
returnValueNode.setImage(Activator.getImage(Images.INFO_NODE));
labelBuilder.append("->").append(tuple.elementAt(TraceDataHandler.INDEX_RETURN_VALUE));
node.addChildren(returnValueNode);
}
node.setLabel(createNodeLabel(labelBuilder.toString()));
node.setImage(Activator.getImage(image));
return node;
}
use of org.erlide.tracing.core.mvc.model.treenodes.ITreeNode in project erlide_eclipse by erlang.
the class TraceDataHandler method processLinkTrace.
private ITreeNode processLinkTrace(final String label, final Images image, final OtpErlangTuple tuple) {
final StringBuilder labelBuilder = new StringBuilder(label).append(": ");
final ITreeNode process1Node = createProcessNode("process 1: ", tuple.elementAt(TraceDataHandler.INDEX_PROCESS));
process1Node.setImage(Activator.getImage(Images.PROCESS_NODE));
labelBuilder.append(lastProcessDescription).append("->");
final ITreeNode process2Node = createProcessNode("process 2: ", tuple.elementAt(TraceDataHandler.INDEX_PROCESS2));
process2Node.setImage(Activator.getImage(Images.PROCESS_NODE));
labelBuilder.append(lastProcessDescription);
final TreeNode node = new TreeNode(createNodeLabel(labelBuilder.toString()));
node.setImage(Activator.getImage(image));
node.addChildren(process1Node, process2Node);
return node;
}
use of org.erlide.tracing.core.mvc.model.treenodes.ITreeNode in project erlide_eclipse by erlang.
the class TraceDataHandler method processExitTrace.
private ITreeNode processExitTrace(final String label, final OtpErlangTuple tuple) {
final StringBuilder labelBuilder = new StringBuilder(label).append(": ");
final ITreeNode processNode = createProcessNode("process: ", tuple.elementAt(TraceDataHandler.INDEX_PROCESS));
processNode.setImage(Activator.getImage(Images.PROCESS_NODE));
labelBuilder.append(lastProcessDescription);
final ITreeNode reasonNode = new TreeNode("reason: " + tuple.elementAt(TraceDataHandler.INDEX_REASON).toString(), Activator.getImage(Images.INFO_NODE));
final TreeNode node = new TreeNode(createNodeLabel(labelBuilder.toString()));
node.setImage(Activator.getDefault().getImageRegistry().get(Images.EXIT_NODE.toString()));
node.addChildren(processNode, reasonNode);
return node;
}
use of org.erlide.tracing.core.mvc.model.treenodes.ITreeNode in project erlide_eclipse by erlang.
the class TraceDataHandler method processDropTrace.
// functions creating nodes
private ITreeNode processDropTrace(final OtpErlangTuple tuple) {
final OtpErlangLong amount = (OtpErlangLong) tuple.elementAt(1);
final ITreeNode node = new TreeNode("Dropped traces: " + amount.longValue(), Activator.getImage(Images.DROP_NODE));
return node;
}
use of org.erlide.tracing.core.mvc.model.treenodes.ITreeNode in project erlide_eclipse by erlang.
the class TraceBrowserView method doSelection.
/**
* Action performed when user clicks on tree element.
*
* @param event
*/
private void doSelection(final SelectionChangedEvent event) {
final IStructuredSelection selection = (IStructuredSelection) event.getSelection();
final ITreeNode treeNode = (ITreeNode) selection.getFirstElement();
if (treeNode != null) {
task = new RunnableWithProgress("Loading trace results...") {
@Override
public void doAction() {
TraceBackend.getInstance().setActiveResultSet((TracingResultsNode) treeNode);
final int limit = Activator.getDefault().getPreferenceStore().getInt(PreferenceNames.TRACES_LOAD_LIMIT);
TraceBackend.getInstance().loadDataFromFile(1, limit);
}
};
try {
final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
new ProgressMonitorDialog(shell).run(true, false, task);
doAfterLoadingFile();
} catch (final Exception e) {
ErlLogger.error(e);
} finally {
task = null;
}
}
}
Aggregations