Search in sources :

Example 1 with CpuModelFactory

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

the class CpuDumpEditor method init.

/*
     * @see MultiPageEditorPart#init(IEditorSite, IEditorInput)
     */
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
    super.init(site, input);
    cpuModel = new CpuModelFactory().createCpuModel();
    cpuModel.addModelChangeListener(new ICpuModelChangeListener() {

        @Override
        public void modelChanged(CpuModelEvent event) {
            if (event.state == CpuModelState.CallersCalleesTargetChanged) {
                refresh();
                if (cpuModel.getCallersCalleesTarget() != null) {
                    showCallerCalleeTab();
                }
            }
        }
    });
    setPartName(input.getName());
    if (input instanceof IFileEditorInput) {
        String filePath = ((IFileEditorInput) input).getFile().getRawLocation().toOSString();
        loadDumpFile(filePath);
    } else if (input instanceof FileStoreEditorInput) {
        String filePath = ((FileStoreEditorInput) input).getURI().getPath();
        loadDumpFile(filePath);
    }
}
Also used : ICpuModelChangeListener(org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModelChangeListener) IFileEditorInput(org.eclipse.ui.IFileEditorInput) CpuModelFactory(org.talend.designer.runtime.visualization.internal.core.cpu.CpuModelFactory) CpuModelEvent(org.talend.designer.runtime.visualization.internal.core.cpu.CpuModelEvent) FileStoreEditorInput(org.eclipse.ui.ide.FileStoreEditorInput)

Aggregations

IFileEditorInput (org.eclipse.ui.IFileEditorInput)1 FileStoreEditorInput (org.eclipse.ui.ide.FileStoreEditorInput)1 CpuModelEvent (org.talend.designer.runtime.visualization.internal.core.cpu.CpuModelEvent)1 CpuModelFactory (org.talend.designer.runtime.visualization.internal.core.cpu.CpuModelFactory)1 ICpuModelChangeListener (org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModelChangeListener)1