Search in sources :

Example 1 with HotSpotsFilteredTree

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

the class CpuDumpEditor method createHotSpotsPage.

/**
     * Creates the hot spots page.
     */
private void createHotSpotsPage() {
    Composite panel = new Composite(getContainer(), SWT.NONE);
    panel.setLayout(new FillLayout());
    final HotSpotsFilteredTree hotSpotsFilteredTree = new HotSpotsFilteredTree(panel, getEditorSite().getActionBars());
    TreeViewer hotSpotsViewer = hotSpotsFilteredTree.getViewer();
    hotSpotsViewer.setContentProvider(new AbstractContentProvider() {

        @Override
        public Object[] getElements(Object inputElement) {
            if (inputElement instanceof ICpuModel) {
                return ((ICpuModel) inputElement).getHotSpotRoots();
            }
            return new Object[0];
        }
    });
    hotSpotsViewer.setLabelProvider(new HotSpotsLabelProvider(hotSpotsFilteredTree));
    hotSpotsViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            hotSpotsFilteredTree.updateStatusLine((IStructuredSelection) event.getSelection());
        }
    });
    hotSpotsViewer.setUseHashlookup(true);
    hotSpotsViewer.setInput(cpuModel);
    hotSpotsFilteredTree.sortColumn(hotSpotsViewer.getTree().getColumn(1));
    int page = addPage(panel);
    trees.put(hotSpotsFilteredTree, page);
    setPageText(page, Messages.hotSpotsPageLabel);
    setPageImage(page, getHotSpotsImage());
}
Also used : Composite(org.eclipse.swt.widgets.Composite) HotSpotsFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.HotSpotsFilteredTree) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) HotSpotsLabelProvider(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.HotSpotsLabelProvider) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) FillLayout(org.eclipse.swt.layout.FillLayout) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ICpuModel(org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModel) AbstractContentProvider(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractContentProvider)

Example 2 with HotSpotsFilteredTree

use of org.talend.designer.runtime.visualization.internal.ui.properties.cpu.HotSpotsFilteredTree 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);
}
Also used : HotSpotsFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.HotSpotsFilteredTree) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) AbstractContentProvider(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractContentProvider) HotSpotsLabelProvider(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.HotSpotsLabelProvider) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ICpuModel(org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModel)

Example 3 with HotSpotsFilteredTree

use of org.talend.designer.runtime.visualization.internal.ui.properties.cpu.HotSpotsFilteredTree 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);
}
Also used : HotSpotsFilteredTree(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.HotSpotsFilteredTree) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) AbstractContentProvider(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractContentProvider) HotSpotsLabelProvider(org.talend.designer.runtime.visualization.internal.ui.properties.cpu.HotSpotsLabelProvider) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ICpuModel(org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModel)

Aggregations

ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)3 TreeViewer (org.eclipse.jface.viewers.TreeViewer)3 ICpuModel (org.talend.designer.runtime.visualization.internal.core.cpu.ICpuModel)3 AbstractContentProvider (org.talend.designer.runtime.visualization.internal.ui.properties.cpu.AbstractContentProvider)3 HotSpotsFilteredTree (org.talend.designer.runtime.visualization.internal.ui.properties.cpu.HotSpotsFilteredTree)3 HotSpotsLabelProvider (org.talend.designer.runtime.visualization.internal.ui.properties.cpu.HotSpotsLabelProvider)3 FillLayout (org.eclipse.swt.layout.FillLayout)1 Composite (org.eclipse.swt.widgets.Composite)1