Search in sources :

Example 1 with AbstractFilteredTree

use of org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree in project tdi-studio-se by Talend.

the class CpuDumpEditor method refresh.

/**
     * Refreshes the view.
     */
protected void refresh() {
    refreshCallersCalleesPage();
    refreshContentDescription();
    cpuModel.refreshMaxValues();
    for (AbstractFilteredTree tree : trees.keySet()) {
        if (tree != null && !tree.getViewer().getControl().isDisposed()) {
            tree.getViewer().refresh();
        }
    }
}
Also used : AbstractFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree)

Example 2 with AbstractFilteredTree

use of org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree 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)

Example 3 with AbstractFilteredTree

use of org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree in project tdi-studio-se by Talend.

the class CpuDumpEditor method showCallerCalleeTab.

/**
     * Shows the caller/callee tab.
     */
void showCallerCalleeTab() {
    for (Entry<AbstractFilteredTree, Integer> entry : trees.entrySet()) {
        AbstractFilteredTree filteredTree = entry.getKey();
        if (filteredTree != null && filteredTree.getViewerType() == ViewerType.Caller) {
            setActivePage(entry.getValue());
            // setActivePage() doesn't send PageChangedEvent
            pageSelectionChanged();
        }
    }
}
Also used : AbstractFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree)

Example 4 with AbstractFilteredTree

use of org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree in project tdi-studio-se by Talend.

the class CpuDumpEditor method getTargetTreeNodes.

/*
     * @see FindAction.IFindTarget#getTargetTreeNodes()
     */
@Override
public ITreeNode[] getTargetTreeNodes() {
    ITreeNode[] nodes = new ITreeNode[0];
    AbstractFilteredTree activeFilteredTree = getActiveFilteredTree();
    if (activeFilteredTree == null) {
        return nodes;
    }
    ViewerType viewerType = activeFilteredTree.getViewerType();
    if (viewerType == ViewerType.CallTree) {
        nodes = cpuModel.getCallTreeRoots();
    } else if (viewerType == ViewerType.HotSpots) {
        nodes = cpuModel.getHotSpotRoots();
    } else if (viewerType == ViewerType.Caller) {
        nodes = cpuModel.getCallers();
    } else if (viewerType == ViewerType.Callee) {
        nodes = cpuModel.getCallees();
    }
    return nodes;
}
Also used : ITreeNode(org.talend.designer.runtime.visualization.internal.core.cpu.ITreeNode) AbstractFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree) ViewerType(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree.ViewerType)

Aggregations

AbstractFilteredTree (org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree)4 ViewerType (org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractFilteredTree.ViewerType)2 ICallTreeNode (org.talend.designer.runtime.visualization.internal.core.cpu.ICallTreeNode)1 IMethodNode (org.talend.designer.runtime.visualization.internal.core.cpu.IMethodNode)1 ITreeNode (org.talend.designer.runtime.visualization.internal.core.cpu.ITreeNode)1