Search in sources :

Example 6 with ChartEditorInput

use of org.eclipse.linuxtools.internal.valgrind.massif.charting.ChartEditorInput in project linuxtools by eclipse.

the class MassifViewPart method refreshView.

@Override
public void refreshView() {
    if (output != null && pid != null) {
        saveChartAction.setChart(null);
        MassifSnapshot[] snapshots = output.getSnapshots(pid);
        pidAction.setPids(output.getPids());
        if (snapshots != null) {
            viewer.setInput(snapshots);
            // $NON-NLS-1$ //$NON-NLS-2$
            String timeWithUnit = TITLE_TIME + " (" + getUnitString(snapshots) + ")";
            for (TableColumn column : viewer.getTable().getColumns()) {
                if (column.getText().startsWith(TITLE_TIME)) {
                    column.setText(timeWithUnit);
                }
                viewer.getTable().layout(true);
            }
            MassifSnapshot[] detailed = getDetailed(snapshots);
            nodes = new MassifHeapTreeNode[detailed.length];
            for (int i = 0; i < detailed.length; i++) {
                nodes[i] = detailed[i].getRoot();
            }
            treeViewer.getViewer().setInput(nodes);
            // create and display chart
            if (snapshots.length > 0) {
                ChartEditorInput input = getChartInput(pid);
                if (input == null) {
                    createChart(snapshots);
                } else {
                    displayChart(input);
                }
            }
        }
    }
}
Also used : ChartEditorInput(org.eclipse.linuxtools.internal.valgrind.massif.charting.ChartEditorInput) TableColumn(org.eclipse.swt.widgets.TableColumn)

Aggregations

ChartEditorInput (org.eclipse.linuxtools.internal.valgrind.massif.charting.ChartEditorInput)6 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)3 IAction (org.eclipse.jface.action.IAction)3 HeapChart (org.eclipse.linuxtools.internal.valgrind.massif.charting.HeapChart)3 SaveChartAction (org.eclipse.linuxtools.dataviewers.charts.actions.SaveChartAction)2 IEditorPart (org.eclipse.ui.IEditorPart)2 Test (org.junit.Test)2 IPath (org.eclipse.core.runtime.IPath)1 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)1 Action (org.eclipse.jface.action.Action)1 ChartEditor (org.eclipse.linuxtools.internal.valgrind.massif.charting.ChartEditor)1 Point (org.eclipse.swt.graphics.Point)1 Composite (org.eclipse.swt.widgets.Composite)1 TableColumn (org.eclipse.swt.widgets.TableColumn)1 IEditorInput (org.eclipse.ui.IEditorInput)1 Chart (org.swtchart.Chart)1 ILineSeries (org.swtchart.ILineSeries)1