Search in sources :

Example 1 with GraphComposite

use of org.eclipse.linuxtools.systemtap.graphing.ui.widgets.GraphComposite in project linuxtools by eclipse.

the class GraphDisplaySet method addGraph.

public void addGraph(final GraphData gd) {
    CTabItem item = new CTabItem(folder, SWT.CLOSE);
    item.setText(// $NON-NLS-1$
    MessageFormat.format(// $NON-NLS-1$
    Localization.getString("GraphDisplaySet.GraphTabTitle"), gd.title, GraphFactory.getGraphName(gd.graphID)));
    final GraphComposite gc = new GraphComposite(folder, SWT.FILL, gd, dataSet);
    gc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    gc.addCheckOption(Messages.GraphCompositeTitle, SelectionListener.widgetSelectedAdapter(e -> {
        gc.setTitleVisible(((Button) e.getSource()).getSelection());
    }));
    gc.addCheckOption(Messages.GraphCompositeLegend, SelectionListener.widgetSelectedAdapter(e -> {
        gc.setLegendVisible(((Button) e.getSource()).getSelection());
    }));
    folder.setSelection(item);
    AbstractChartBuilder g = gc.getCanvas();
    item.setControl(gc);
    if (null != g) {
        if (null != updater) {
            updater.addUpdateListener(g);
        }
        builders.add(g);
    }
}
Also used : Messages(org.eclipse.linuxtools.systemtap.graphing.ui.widgets.Messages) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) AbstractChartBuilder(org.eclipse.linuxtools.systemtap.graphing.ui.charts.AbstractChartBuilder) Localization(org.eclipse.linuxtools.internal.systemtap.graphing.ui.Localization) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) GraphComposite(org.eclipse.linuxtools.systemtap.graphing.ui.widgets.GraphComposite) GraphFactory(org.eclipse.linuxtools.systemtap.graphing.ui.wizards.graph.GraphFactory) DataSetFactory(org.eclipse.linuxtools.systemtap.graphing.ui.wizards.dataset.DataSetFactory) Composite(org.eclipse.swt.widgets.Composite) GraphData(org.eclipse.linuxtools.systemtap.graphing.core.structures.GraphData) AbstractUIPlugin(org.eclipse.ui.plugin.AbstractUIPlugin) IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) GridData(org.eclipse.swt.layout.GridData) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Button(org.eclipse.swt.widgets.Button) DataGrid(org.eclipse.linuxtools.systemtap.graphing.ui.datadisplay.DataGrid) CTabFolder(org.eclipse.swt.custom.CTabFolder) FormLayout(org.eclipse.swt.layout.FormLayout) PlatformUI(org.eclipse.ui.PlatformUI) FormData(org.eclipse.swt.layout.FormData) IDataSet(org.eclipse.linuxtools.systemtap.graphing.core.datasets.IDataSet) CTabFolder2Adapter(org.eclipse.swt.custom.CTabFolder2Adapter) GraphingPreferenceConstants(org.eclipse.linuxtools.internal.systemtap.graphing.ui.preferences.GraphingPreferenceConstants) CTabFolderEvent(org.eclipse.swt.custom.CTabFolderEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment) SelectGraphAndSeriesWizard(org.eclipse.linuxtools.systemtap.graphing.ui.wizards.graph.SelectGraphAndSeriesWizard) IFilteredDataSet(org.eclipse.linuxtools.systemtap.graphing.core.datasets.IFilteredDataSet) CTabItem(org.eclipse.swt.custom.CTabItem) List(java.util.List) UpdateManager(org.eclipse.linuxtools.systemtap.structures.UpdateManager) WizardDialog(org.eclipse.jface.wizard.WizardDialog) SWT(org.eclipse.swt.SWT) IWorkbench(org.eclipse.ui.IWorkbench) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GraphingUIPlugin(org.eclipse.linuxtools.internal.systemtap.graphing.ui.GraphingUIPlugin) SelectionListener(org.eclipse.swt.events.SelectionListener) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) AbstractChartBuilder(org.eclipse.linuxtools.systemtap.graphing.ui.charts.AbstractChartBuilder) GraphComposite(org.eclipse.linuxtools.systemtap.graphing.ui.widgets.GraphComposite) CTabItem(org.eclipse.swt.custom.CTabItem)

Aggregations

MessageFormat (java.text.MessageFormat)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)1 IPropertyChangeListener (org.eclipse.jface.util.IPropertyChangeListener)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 GraphingUIPlugin (org.eclipse.linuxtools.internal.systemtap.graphing.ui.GraphingUIPlugin)1 Localization (org.eclipse.linuxtools.internal.systemtap.graphing.ui.Localization)1 GraphingPreferenceConstants (org.eclipse.linuxtools.internal.systemtap.graphing.ui.preferences.GraphingPreferenceConstants)1 IDataSet (org.eclipse.linuxtools.systemtap.graphing.core.datasets.IDataSet)1 IFilteredDataSet (org.eclipse.linuxtools.systemtap.graphing.core.datasets.IFilteredDataSet)1 GraphData (org.eclipse.linuxtools.systemtap.graphing.core.structures.GraphData)1 AbstractChartBuilder (org.eclipse.linuxtools.systemtap.graphing.ui.charts.AbstractChartBuilder)1 DataGrid (org.eclipse.linuxtools.systemtap.graphing.ui.datadisplay.DataGrid)1 GraphComposite (org.eclipse.linuxtools.systemtap.graphing.ui.widgets.GraphComposite)1 Messages (org.eclipse.linuxtools.systemtap.graphing.ui.widgets.Messages)1 DataSetFactory (org.eclipse.linuxtools.systemtap.graphing.ui.wizards.dataset.DataSetFactory)1 GraphFactory (org.eclipse.linuxtools.systemtap.graphing.ui.wizards.graph.GraphFactory)1 SelectGraphAndSeriesWizard (org.eclipse.linuxtools.systemtap.graphing.ui.wizards.graph.SelectGraphAndSeriesWizard)1 UpdateManager (org.eclipse.linuxtools.systemtap.structures.UpdateManager)1