use of org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModel in project tdi-studio-se by Talend.
the class FocusOnAction method aboutToShow.
/**
* Notifies when menu is about to be shown.
*/
public void aboutToShow() {
ICpuModel cpuModel = (ICpuModel) filteredTree.getViewer().getInput();
boolean focused = cpuModel.getFocusTarget() != null;
setChecked(focused);
Object element = ((TreeSelection) filteredTree.getViewer().getSelection()).getFirstElement();
// frame is selected on call tree
if (element instanceof ICallTreeNode) {
selectedNode = (ICallTreeNode) element;
setEnabled(true);
if (!focused) {
updateMenu();
}
return;
}
if (filteredTree.getViewerType() == ViewerType.CallTree) {
// thread node is selected on call tree
selectedNode = null;
} else {
selectedNode = cpuModel.getFocusTarget();
}
setEnabled(focused);
updateMenu();
}
use of org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModel in project tdi-studio-se by Talend.
the class ShowCallersCalleesAction method run.
/*
* @see Action#run()
*/
@Override
public void run() {
ICpuModel cpuModel = (ICpuModel) treeViewer.getInput();
cpuModel.setCallersCalleesTarget(callesCalleesTargetNode);
}
use of org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModel in project tdi-studio-se by Talend.
the class CpuDumpEditor method createCalleeViewer.
/**
* Create the callee viewer.
*
* @param parent The parent composite
* @param page The page
*/
private void createCalleeViewer(Composite parent, int page) {
final HotSpotsFilteredTree calleeFilteredTree = new HotSpotsFilteredTree(parent, getEditorSite().getActionBars()) {
@Override
public ViewerType getViewerType() {
return ViewerType.Callee;
}
@Override
protected String getMethodColumnName() {
return org.talend.designer.runtime.visualization.internal.ui.properties.cpu.Messages.calleeColumnLabel;
}
@Override
protected String getMethodColumnToolTip() {
return org.talend.designer.runtime.visualization.internal.ui.properties.cpu.Messages.calleeColumnToolTip;
}
};
TreeViewer calleeViewer = calleeFilteredTree.getViewer();
calleeViewer.setContentProvider(new AbstractContentProvider() {
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof ICpuModel) {
return ((ICpuModel) inputElement).getCallees();
}
return new Object[0];
}
});
calleeViewer.setLabelProvider(new HotSpotsLabelProvider(calleeFilteredTree));
calleeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
calleeFilteredTree.updateStatusLine((IStructuredSelection) event.getSelection());
}
});
calleeViewer.setUseHashlookup(true);
calleeViewer.setInput(cpuModel);
calleeFilteredTree.sortColumn(calleeViewer.getTree().getColumn(1));
trees.put(calleeFilteredTree, page);
}
use of org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModel in project tdi-studio-se by Talend.
the class CpuDumpEditor method createCallerViewer.
/**
* Creates the caller viewer.
*
* @param parent The parent composite
* @param page The page
*/
private void createCallerViewer(Composite parent, int page) {
final HotSpotsFilteredTree callerFilteredTree = new HotSpotsFilteredTree(parent, getEditorSite().getActionBars()) {
@Override
public ViewerType getViewerType() {
return ViewerType.Caller;
}
@Override
protected String getMethodColumnName() {
return org.talend.designer.runtime.visualization.internal.ui.properties.cpu.Messages.callerColumnLabel;
}
@Override
protected String getMethodColumnToolTip() {
return org.talend.designer.runtime.visualization.internal.ui.properties.cpu.Messages.callerColumnToolTip;
}
};
TreeViewer callerViewer = callerFilteredTree.getViewer();
callerViewer.setContentProvider(new AbstractContentProvider() {
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof ICpuModel) {
return ((ICpuModel) inputElement).getCallers();
}
return new Object[0];
}
});
callerViewer.setLabelProvider(new HotSpotsLabelProvider(callerFilteredTree));
callerViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
callerFilteredTree.updateStatusLine((IStructuredSelection) event.getSelection());
}
});
callerViewer.setUseHashlookup(true);
callerViewer.setInput(cpuModel);
callerFilteredTree.sortColumn(callerViewer.getTree().getColumn(1));
trees.put(callerFilteredTree, page);
}
Aggregations