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();
}
}
}
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());
}
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();
}
}
}
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;
}
Aggregations