Search in sources :

Example 6 with IMethodNode

use of org.talend.designer.runtime.visualization.internal.core.cpu.IMethodNode in project tdi-studio-se by Talend.

the class CpuDumpEditor method refreshContentDescription.

/**
     * Refreshes the content description.
     */
private void refreshContentDescription() {
    StringBuilder description = new StringBuilder();
    AbstractFilteredTree activeTree = getActiveFilteredTree();
    if (activeTree == null) {
        setContentDescription(description.toString());
        return;
    }
    ViewerType type = activeTree.getViewerType();
    IMethodNode callersCalleesTarget = cpuModel.getCallersCalleesTarget();
    if ((type == ViewerType.Caller || type == ViewerType.Callee) && callersCalleesTarget != null) {
        description.append(NLS.bind(Messages.callersCalleesTargetIndicator, callersCalleesTarget.getName()));
    }
    ICallTreeNode focusedNode = cpuModel.getFocusTarget();
    if (focusedNode != null) {
        if ((type != ViewerType.Caller && type != ViewerType.Callee) || callersCalleesTarget != null) {
            description.append(NLS.bind(Messages.focusTargetIndicator, focusedNode.getNonqualifiedName()));
        }
    }
    String thread = null;
    if (focusedNode != null) {
        thread = focusedNode.getThread();
    } else if (callersCalleesTarget != null) {
        thread = callersCalleesTarget.getThread();
    }
    if (description.length() > 0 && thread != null) {
        description.append(NLS.bind(Messages.threadIndicator, thread));
    }
    setContentDescription(description.toString());
}
Also used : IMethodNode(org.talend.designer.runtime.visualization.internal.core.cpu.IMethodNode) ICallTreeNode(org.talend.designer.runtime.visualization.internal.core.cpu.ICallTreeNode) AbstractFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree) ViewerType(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree.ViewerType)

Aggregations

IMethodNode (org.talend.designer.runtime.visualization.internal.core.cpu.IMethodNode)6 ICallTreeNode (org.talend.designer.runtime.visualization.internal.core.cpu.ICallTreeNode)2 ICpuModel (org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModel)2 IContributionItem (org.eclipse.jface.action.IContributionItem)1 IStatusLineManager (org.eclipse.jface.action.IStatusLineManager)1 StatusLineContributionItem (org.eclipse.jface.action.StatusLineContributionItem)1 ISelection (org.eclipse.jface.viewers.ISelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 AbstractFilteredTree (org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree)1 ViewerType (org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree.ViewerType)1