< prev index next >

application/org.openjdk.jmc.flightrecorder.ext.jfx/src/main/java/org/openjdk/jmc/flightrecorder/ext/jfx/JfxPage.java

Print this page




  39 
  40 import org.eclipse.jface.resource.ImageDescriptor;
  41 import org.eclipse.swt.SWT;
  42 import org.eclipse.swt.custom.SashForm;
  43 import org.eclipse.swt.graphics.Image;
  44 import org.eclipse.swt.widgets.Composite;
  45 import org.eclipse.ui.forms.widgets.Form;
  46 import org.eclipse.ui.forms.widgets.FormToolkit;
  47 import org.eclipse.ui.forms.widgets.Section;
  48 import org.eclipse.ui.plugin.AbstractUIPlugin;
  49 
  50 import org.openjdk.jmc.common.IState;
  51 import org.openjdk.jmc.common.IWritableState;
  52 import org.openjdk.jmc.common.item.Aggregators;
  53 import org.openjdk.jmc.common.item.IAggregator;
  54 import org.openjdk.jmc.common.item.IItemCollection;
  55 import org.openjdk.jmc.common.item.IItemFilter;
  56 import org.openjdk.jmc.common.unit.IQuantity;
  57 import org.openjdk.jmc.common.unit.IRange;
  58 import org.openjdk.jmc.flightrecorder.JfrAttributes;

  59 import org.openjdk.jmc.flightrecorder.ui.IDataPageFactory;
  60 import org.openjdk.jmc.flightrecorder.ui.IDisplayablePage;
  61 import org.openjdk.jmc.flightrecorder.ui.IPageContainer;
  62 import org.openjdk.jmc.flightrecorder.ui.IPageDefinition;
  63 import org.openjdk.jmc.flightrecorder.ui.IPageUI;
  64 import org.openjdk.jmc.flightrecorder.ui.ItemCollectionToolkit;
  65 import org.openjdk.jmc.flightrecorder.ui.StreamModel;
  66 import org.openjdk.jmc.flightrecorder.ui.common.AbstractDataPage;
  67 import org.openjdk.jmc.flightrecorder.ui.common.AggregationGrid;
  68 import org.openjdk.jmc.flightrecorder.ui.common.DataPageToolkit;
  69 import org.openjdk.jmc.flightrecorder.ui.common.FilterComponent;
  70 import org.openjdk.jmc.flightrecorder.ui.common.FlavorSelector;
  71 import org.openjdk.jmc.flightrecorder.ui.common.FlavorSelector.FlavorSelectorState;
  72 import org.openjdk.jmc.flightrecorder.ui.common.ItemHistogram;
  73 import org.openjdk.jmc.flightrecorder.ui.common.ItemHistogram.HistogramSelection;
  74 import org.openjdk.jmc.flightrecorder.ui.common.ItemHistogram.ItemHistogramBuilder;
  75 import org.openjdk.jmc.flightrecorder.ui.common.ItemList;
  76 import org.openjdk.jmc.flightrecorder.ui.common.ItemList.ItemListBuilder;
  77 import org.openjdk.jmc.flightrecorder.ui.common.ItemRow;
  78 import org.openjdk.jmc.flightrecorder.ui.selection.SelectionStoreActionToolkit;


  98 
  99                 @Override
 100                 public ImageDescriptor getImageDescriptor(IState state) {
 101                         return AbstractUIPlugin.imageDescriptorFromPlugin("org.openjdk.jmc.flightrecorder.ext.jfx", //$NON-NLS-1$
 102                                         "icons/pulse.png"); //$NON-NLS-1$
 103                 }
 104 
 105                 @Override
 106                 public String[] getTopics(IState state) {
 107                         return new String[] {JfxConstants.JFX_RULE_PATH};
 108                 }
 109 
 110                 @Override
 111                 public IDisplayablePage createPage(IPageDefinition definition, StreamModel items, IPageContainer editor) {
 112                         return new JfxPage(definition, items, editor);
 113                 }
 114         }
 115 
 116         private static final ItemHistogramBuilder BY_PULSE_HISTOGRAM = new ItemHistogramBuilder();
 117         private static final ItemHistogramBuilder INPUT_HISTOGRAM = new ItemHistogramBuilder();
 118         private static final ItemListBuilder PHASE_LIST = new ItemListBuilder();
 119 
 120         private static final String TOTAL_DURATION = "totalDuration"; //$NON-NLS-1$
 121         private static final String PULSE_START = "pulseStart"; //$NON-NLS-1$
 122 
 123         static {
 124                 BY_PULSE_HISTOGRAM.addCountColumn();
 125                 BY_PULSE_HISTOGRAM.addColumn(TOTAL_DURATION, Aggregators.sum(JfrAttributes.DURATION));
 126                 BY_PULSE_HISTOGRAM.addColumn(PULSE_START, JfxConstants.PULSE_START);
 127 
 128                 PHASE_LIST.addColumn(JfrAttributes.DURATION);
 129                 PHASE_LIST.addColumn(JfrAttributes.START_TIME);
 130                 PHASE_LIST.addColumn(JfxConstants.PHASE_NAME);
 131                 PHASE_LIST.addColumn(JfrAttributes.EVENT_THREAD);
 132                 PHASE_LIST.addColumn(JfxConstants.PULSE_ID);
 133 
 134                 INPUT_HISTOGRAM.addCountColumn();
 135                 INPUT_HISTOGRAM.addColumn(TOTAL_DURATION, Aggregators.sum(JfrAttributes.DURATION));
 136         }
 137 
 138         private class JfxUI implements IPageUI {
 139 
 140                 private static final String PULSES_FILTER = "pulsesFilter"; //$NON-NLS-1$
 141                 private static final String PHASES_FILTER = "phasesFilter"; //$NON-NLS-1$
 142                 private static final String INPUT_FILTER = "inputFilter"; //$NON-NLS-1$
 143                 private final ChartCanvas chartCanvas;
 144                 private final ItemHistogram pulsesTable;
 145                 private final ItemHistogram inputTable;
 146                 private final ItemList phasesTable;
 147                 private IPageContainer pageContainer;
 148                 private final SashForm tableSash;
 149                 private final SashForm mainSash;
 150                 private final SashForm phasesSash;
 151                 private IItemCollection selectionItems;
 152                 private XYChart chart;
 153                 private IItemCollection phaseItems;
 154 
 155                 private static final String MAIN_SASH = "mainSash"; //$NON-NLS-1$
 156                 private static final String TABLE_SASH = "tableSash"; //$NON-NLS-1$
 157                 private static final String PHASES_SASH = "phasesSash"; //$NON-NLS-1$
 158                 private static final String PULSES_TABLE = "pulseTable"; //$NON-NLS-1$
 159                 private static final String PHASES_TABLE = "phaseTable"; //$NON-NLS-1$
 160                 private static final String INPUT_TABLE = "inputTable"; //$NON-NLS-1$
 161                 private final StreamModel items;
 162                 private IRange<IQuantity> currentRange;
 163                 private FlavorSelector flavorSelector;
 164                 private FilterComponent pulsesFilter;
 165                 private FilterComponent phasesFilter;
 166                 private FilterComponent inputFilter;
 167 
 168                 public JfxUI(Composite parent, FormToolkit toolkit, IPageContainer editor, IState state, StreamModel items,
 169                                 String name, Image icon) {
 170                         this.pageContainer = editor;
 171                         this.items = items;
 172                         Form form = DataPageToolkit.createForm(parent, toolkit, name, icon);
 173 


 174                         mainSash = new SashForm(form.getBody(), SWT.VERTICAL | SWT.SMOOTH);
 175                         toolkit.adapt(mainSash);
 176                         tableSash = new SashForm(mainSash, SWT.HORIZONTAL | SWT.SMOOTH);
 177                         toolkit.adapt(tableSash);
 178 
 179                         Section phases = CompositeToolkit.createSection(tableSash, toolkit, Messages.JfxPage_PHASES);
 180                         phasesSash = new SashForm(phases, SWT.HORIZONTAL | SWT.SMOOTH);
 181                         phases.setClient(phasesSash);
 182                         pulsesTable = BY_PULSE_HISTOGRAM.buildWithoutBorder(phasesSash, JfxConstants.PULSE_ID,
 183                                         getPulseTableSettings(state.getChild(PULSES_TABLE)));
 184                         pulsesFilter = FilterComponent.createFilterComponent(pulsesTable, pulsesTableFilter,
 185                                         getItems().apply(JfxConstants.JFX_PULSE_FILTER), pageContainer.getSelectionStore()::getSelections,
 186                                         this::onPulsesFilterChange);
 187                         pulsesTable.getManager().getViewer().addSelectionChangedListener(e -> onPulsesSelected());
 188                         DataPageToolkit.addContextMenus(pageContainer, pulsesTable, Messages.JfxPage_PULSE_HISTOGRAM_SELECTION,
 189                                         pulsesFilter.getShowSearchAction(), pulsesFilter.getShowFilterAction());
 190                         pulsesFilter.loadState(state.getChild(PULSES_FILTER));
 191 
 192                         phasesTable = PHASE_LIST.buildWithoutBorder(phasesSash, getPhaseListSettings(state.getChild(PHASES_TABLE)));






 193                         phasesFilter = FilterComponent.createFilterComponent(phasesTable, phasesTableFilter,
 194                                         getItems().apply(JfxConstants.JFX_PULSE_FILTER), pageContainer.getSelectionStore()::getSelections,
 195                                         this::onPhasesFilterChange);
 196                         phasesTable.getManager().getViewer()
 197                                         .addSelectionChangedListener(e -> onPhasesSelected(!e.getSelection().isEmpty()));
 198                         MCContextMenuManager itemMM = MCContextMenuManager
 199                                         .create(phasesTable.getManager().getViewer().getControl());
 200                         ColumnMenusFactory.addDefaultMenus(phasesTable.getManager(), itemMM);
 201                         itemMM.add(phasesFilter.getShowSearchAction());
 202                         itemMM.add(phasesFilter.getShowFilterAction());
 203                         SelectionStoreActionToolkit.addSelectionStoreActions(pageContainer.getSelectionStore(), phasesTable,
 204                                         Messages.JfxPage_PHASE_TABLE_SELECTION, itemMM);
 205                         phasesFilter.loadState(state.getChild(PHASES_FILTER));
 206 
 207                         Section input = CompositeToolkit.createSection(tableSash, toolkit, Messages.JfxPage_INPUT);
 208                         inputTable = INPUT_HISTOGRAM.buildWithoutBorder(input, JfxConstants.INPUT_TYPE,
 209                                         getInputTableSettings(state.getChild(INPUT_TABLE)));
 210                         inputFilter = FilterComponent.createFilterComponent(inputTable, inputTableFilter, getItems(),
 211                                         pageContainer.getSelectionStore()::getSelections, this::onInputFilterChange);
 212                         inputTable.getManager().getViewer().addSelectionChangedListener(e -> buildChart());


 353         private IRange<IQuantity> timelineRange;
 354         private SelectionState pulseSelection;
 355         private SelectionState phaseSelection;
 356         private SelectionState inputSelection;
 357         private FlavorSelectorState flavorSelectorState;
 358         private IItemFilter pulsesTableFilter;
 359         private IItemFilter phasesTableFilter;
 360         private IItemFilter inputTableFilter;
 361 
 362         public JfxPage(IPageDefinition definition, StreamModel items, IPageContainer editor) {
 363                 super(definition, items, editor);
 364                 timelineRange = editor.getRecordingRange();
 365         }
 366 
 367         @Override
 368         public IItemFilter getDefaultSelectionFilter() {
 369                 return JfxConstants.JFX_FILTER;
 370         }
 371 
 372         private static IXDataRenderer buildThreadRenderer(Object threadName, IItemCollection items) {

 373                 IXDataRenderer phaseRenderer = DataPageToolkit.buildSpanRenderer(items,
 374                                 DataPageToolkit.getAttributeValueColor(JfxConstants.PHASE_NAME));
 375                 return new ItemRow(String.valueOf(threadName), JfxConstants.PHASE_NAME.getDescription(), phaseRenderer, items);
 376         }
 377 
 378         private static TableSettings getPulseTableSettings(IState state) {
 379                 if (state == null) {
 380                         return new TableSettings(TOTAL_DURATION,
 381                                         Arrays.asList(new ColumnSettings(ItemHistogram.KEY_COL_ID, false, 75, false),
 382                                                         new ColumnSettings(TOTAL_DURATION, false, 75, false)));
 383                 } else {
 384                         return new TableSettings(state);
 385                 }
 386         }
 387 
 388         private static TableSettings getPhaseListSettings(IState state) {
 389                 if (state == null) {
 390                         return new TableSettings(JfrAttributes.DURATION.getIdentifier(),
 391                                         Arrays.asList(new ColumnSettings(JfrAttributes.DURATION.getIdentifier(), false, 100, false),
 392                                                         new ColumnSettings(JfrAttributes.DURATION.getIdentifier(), false, 200, false),
 393                                                         new ColumnSettings(JfxConstants.PHASE_NAME.getIdentifier(), false, 100, false),
 394                                                         new ColumnSettings(JfxConstants.PULSE_ID.getIdentifier(), false, 100, false),
 395                                                         new ColumnSettings(JfrAttributes.EVENT_THREAD.getIdentifier(), false, 200, false)));
 396                 } else {
 397                         return new TableSettings(state);
 398                 }
 399         }
 400 
 401         private static TableSettings getInputTableSettings(IState state) {
 402                 if (state == null) {
 403                         return new TableSettings(TOTAL_DURATION,
 404                                         Arrays.asList(new ColumnSettings(ItemHistogram.KEY_COL_ID, false, 100, false),
 405                                                         new ColumnSettings(TOTAL_DURATION, false, 75, false),
 406                                                         new ColumnSettings(ItemHistogram.COUNT_COL_ID, false, 100, false)));
 407                 } else {
 408                         return new TableSettings(state);
 409                 }
 410         }
 411 
 412         @Override
 413         public IPageUI display(Composite parent, FormToolkit toolkit, IPageContainer editor, IState state) {
 414                 return new JfxUI(parent, toolkit, editor, state, getDataSource(), getName(), getIcon());


  39 
  40 import org.eclipse.jface.resource.ImageDescriptor;
  41 import org.eclipse.swt.SWT;
  42 import org.eclipse.swt.custom.SashForm;
  43 import org.eclipse.swt.graphics.Image;
  44 import org.eclipse.swt.widgets.Composite;
  45 import org.eclipse.ui.forms.widgets.Form;
  46 import org.eclipse.ui.forms.widgets.FormToolkit;
  47 import org.eclipse.ui.forms.widgets.Section;
  48 import org.eclipse.ui.plugin.AbstractUIPlugin;
  49 
  50 import org.openjdk.jmc.common.IState;
  51 import org.openjdk.jmc.common.IWritableState;
  52 import org.openjdk.jmc.common.item.Aggregators;
  53 import org.openjdk.jmc.common.item.IAggregator;
  54 import org.openjdk.jmc.common.item.IItemCollection;
  55 import org.openjdk.jmc.common.item.IItemFilter;
  56 import org.openjdk.jmc.common.unit.IQuantity;
  57 import org.openjdk.jmc.common.unit.IRange;
  58 import org.openjdk.jmc.flightrecorder.JfrAttributes;
  59 import org.openjdk.jmc.flightrecorder.ext.jfx.JfxVersionUtil.JavaFxEventAvailability;
  60 import org.openjdk.jmc.flightrecorder.ui.IDataPageFactory;
  61 import org.openjdk.jmc.flightrecorder.ui.IDisplayablePage;
  62 import org.openjdk.jmc.flightrecorder.ui.IPageContainer;
  63 import org.openjdk.jmc.flightrecorder.ui.IPageDefinition;
  64 import org.openjdk.jmc.flightrecorder.ui.IPageUI;
  65 import org.openjdk.jmc.flightrecorder.ui.ItemCollectionToolkit;
  66 import org.openjdk.jmc.flightrecorder.ui.StreamModel;
  67 import org.openjdk.jmc.flightrecorder.ui.common.AbstractDataPage;
  68 import org.openjdk.jmc.flightrecorder.ui.common.AggregationGrid;
  69 import org.openjdk.jmc.flightrecorder.ui.common.DataPageToolkit;
  70 import org.openjdk.jmc.flightrecorder.ui.common.FilterComponent;
  71 import org.openjdk.jmc.flightrecorder.ui.common.FlavorSelector;
  72 import org.openjdk.jmc.flightrecorder.ui.common.FlavorSelector.FlavorSelectorState;
  73 import org.openjdk.jmc.flightrecorder.ui.common.ItemHistogram;
  74 import org.openjdk.jmc.flightrecorder.ui.common.ItemHistogram.HistogramSelection;
  75 import org.openjdk.jmc.flightrecorder.ui.common.ItemHistogram.ItemHistogramBuilder;
  76 import org.openjdk.jmc.flightrecorder.ui.common.ItemList;
  77 import org.openjdk.jmc.flightrecorder.ui.common.ItemList.ItemListBuilder;
  78 import org.openjdk.jmc.flightrecorder.ui.common.ItemRow;
  79 import org.openjdk.jmc.flightrecorder.ui.selection.SelectionStoreActionToolkit;


  99 
 100                 @Override
 101                 public ImageDescriptor getImageDescriptor(IState state) {
 102                         return AbstractUIPlugin.imageDescriptorFromPlugin("org.openjdk.jmc.flightrecorder.ext.jfx", //$NON-NLS-1$
 103                                         "icons/pulse.png"); //$NON-NLS-1$
 104                 }
 105 
 106                 @Override
 107                 public String[] getTopics(IState state) {
 108                         return new String[] {JfxConstants.JFX_RULE_PATH};
 109                 }
 110 
 111                 @Override
 112                 public IDisplayablePage createPage(IPageDefinition definition, StreamModel items, IPageContainer editor) {
 113                         return new JfxPage(definition, items, editor);
 114                 }
 115         }
 116 
 117         private static final ItemHistogramBuilder BY_PULSE_HISTOGRAM = new ItemHistogramBuilder();
 118         private static final ItemHistogramBuilder INPUT_HISTOGRAM = new ItemHistogramBuilder();
 119         private final ItemListBuilder phaseList = new ItemListBuilder();
 120 
 121         private static final String TOTAL_DURATION = "totalDuration"; //$NON-NLS-1$
 122         private static final String PULSE_START = "pulseStart"; //$NON-NLS-1$
 123 
 124         static {
 125                 BY_PULSE_HISTOGRAM.addCountColumn();
 126                 BY_PULSE_HISTOGRAM.addColumn(TOTAL_DURATION, Aggregators.sum(JfrAttributes.DURATION));
 127                 BY_PULSE_HISTOGRAM.addColumn(PULSE_START, JfxConstants.PULSE_START);
 128 






 129                 INPUT_HISTOGRAM.addCountColumn();
 130                 INPUT_HISTOGRAM.addColumn(TOTAL_DURATION, Aggregators.sum(JfrAttributes.DURATION));
 131         }
 132 
 133         private class JfxUI implements IPageUI {
 134 
 135                 private static final String PULSES_FILTER = "pulsesFilter"; //$NON-NLS-1$
 136                 private static final String PHASES_FILTER = "phasesFilter"; //$NON-NLS-1$
 137                 private static final String INPUT_FILTER = "inputFilter"; //$NON-NLS-1$
 138                 private final ChartCanvas chartCanvas;
 139                 private final ItemHistogram pulsesTable;
 140                 private final ItemHistogram inputTable;
 141                 private final ItemList phasesTable;
 142                 private IPageContainer pageContainer;
 143                 private final SashForm tableSash;
 144                 private final SashForm mainSash;
 145                 private final SashForm phasesSash;
 146                 private IItemCollection selectionItems;
 147                 private XYChart chart;
 148                 private IItemCollection phaseItems;
 149 
 150                 private static final String MAIN_SASH = "mainSash"; //$NON-NLS-1$
 151                 private static final String TABLE_SASH = "tableSash"; //$NON-NLS-1$
 152                 private static final String PHASES_SASH = "phasesSash"; //$NON-NLS-1$
 153                 private static final String PULSES_TABLE = "pulseTable"; //$NON-NLS-1$
 154                 private static final String PHASES_TABLE = "phaseTable"; //$NON-NLS-1$
 155                 private static final String INPUT_TABLE = "inputTable"; //$NON-NLS-1$
 156                 private final StreamModel items;
 157                 private IRange<IQuantity> currentRange;
 158                 private FlavorSelector flavorSelector;
 159                 private FilterComponent pulsesFilter;
 160                 private FilterComponent phasesFilter;
 161                 private FilterComponent inputFilter;
 162 
 163                 public JfxUI(Composite parent, FormToolkit toolkit, IPageContainer editor, IState state, StreamModel items,
 164                                 String name, Image icon) {
 165                         this.pageContainer = editor;
 166                         this.items = items;
 167                         Form form = DataPageToolkit.createForm(parent, toolkit, name, icon);
 168 
 169                         JavaFxEventAvailability availability = JfxVersionUtil.getAvailability(getItems());
 170                         
 171                         mainSash = new SashForm(form.getBody(), SWT.VERTICAL | SWT.SMOOTH);
 172                         toolkit.adapt(mainSash);
 173                         tableSash = new SashForm(mainSash, SWT.HORIZONTAL | SWT.SMOOTH);
 174                         toolkit.adapt(tableSash);
 175 
 176                         Section phases = CompositeToolkit.createSection(tableSash, toolkit, Messages.JfxPage_PHASES);
 177                         phasesSash = new SashForm(phases, SWT.HORIZONTAL | SWT.SMOOTH);
 178                         phases.setClient(phasesSash);
 179                         pulsesTable = BY_PULSE_HISTOGRAM.buildWithoutBorder(phasesSash, JfxVersionUtil.getPulseIdAttribute(availability),
 180                                         getPulseTableSettings(state.getChild(PULSES_TABLE)));
 181                         pulsesFilter = FilterComponent.createFilterComponent(pulsesTable, pulsesTableFilter,
 182                                         getItems().apply(JfxConstants.JFX_PULSE_FILTER), pageContainer.getSelectionStore()::getSelections,
 183                                         this::onPulsesFilterChange);
 184                         pulsesTable.getManager().getViewer().addSelectionChangedListener(e -> onPulsesSelected());
 185                         DataPageToolkit.addContextMenus(pageContainer, pulsesTable, Messages.JfxPage_PULSE_HISTOGRAM_SELECTION,
 186                                         pulsesFilter.getShowSearchAction(), pulsesFilter.getShowFilterAction());
 187                         pulsesFilter.loadState(state.getChild(PULSES_FILTER));
 188 
 189                         phaseList.addColumn(JfrAttributes.DURATION);
 190                         phaseList.addColumn(JfrAttributes.START_TIME);
 191                         phaseList.addColumn(JfxVersionUtil.getPhaseNameAttribute(availability));
 192                         phaseList.addColumn(JfrAttributes.EVENT_THREAD);
 193                         phaseList.addColumn(JfxVersionUtil.getPulseIdAttribute(availability));
 194                         
 195                         phasesTable = phaseList.buildWithoutBorder(phasesSash, getPhaseListSettings(state.getChild(PHASES_TABLE)));
 196                         phasesFilter = FilterComponent.createFilterComponent(phasesTable, phasesTableFilter,
 197                                         getItems().apply(JfxConstants.JFX_PULSE_FILTER), pageContainer.getSelectionStore()::getSelections,
 198                                         this::onPhasesFilterChange);
 199                         phasesTable.getManager().getViewer()
 200                                         .addSelectionChangedListener(e -> onPhasesSelected(!e.getSelection().isEmpty()));
 201                         MCContextMenuManager itemMM = MCContextMenuManager
 202                                         .create(phasesTable.getManager().getViewer().getControl());
 203                         ColumnMenusFactory.addDefaultMenus(phasesTable.getManager(), itemMM);
 204                         itemMM.add(phasesFilter.getShowSearchAction());
 205                         itemMM.add(phasesFilter.getShowFilterAction());
 206                         SelectionStoreActionToolkit.addSelectionStoreActions(pageContainer.getSelectionStore(), phasesTable,
 207                                         Messages.JfxPage_PHASE_TABLE_SELECTION, itemMM);
 208                         phasesFilter.loadState(state.getChild(PHASES_FILTER));
 209 
 210                         Section input = CompositeToolkit.createSection(tableSash, toolkit, Messages.JfxPage_INPUT);
 211                         inputTable = INPUT_HISTOGRAM.buildWithoutBorder(input, JfxConstants.INPUT_TYPE,
 212                                         getInputTableSettings(state.getChild(INPUT_TABLE)));
 213                         inputFilter = FilterComponent.createFilterComponent(inputTable, inputTableFilter, getItems(),
 214                                         pageContainer.getSelectionStore()::getSelections, this::onInputFilterChange);
 215                         inputTable.getManager().getViewer().addSelectionChangedListener(e -> buildChart());


 356         private IRange<IQuantity> timelineRange;
 357         private SelectionState pulseSelection;
 358         private SelectionState phaseSelection;
 359         private SelectionState inputSelection;
 360         private FlavorSelectorState flavorSelectorState;
 361         private IItemFilter pulsesTableFilter;
 362         private IItemFilter phasesTableFilter;
 363         private IItemFilter inputTableFilter;
 364 
 365         public JfxPage(IPageDefinition definition, StreamModel items, IPageContainer editor) {
 366                 super(definition, items, editor);
 367                 timelineRange = editor.getRecordingRange();
 368         }
 369 
 370         @Override
 371         public IItemFilter getDefaultSelectionFilter() {
 372                 return JfxConstants.JFX_FILTER;
 373         }
 374 
 375         private static IXDataRenderer buildThreadRenderer(Object threadName, IItemCollection items) {
 376                 // Attribute only used for looking up color and name information here
 377                 IXDataRenderer phaseRenderer = DataPageToolkit.buildSpanRenderer(items,
 378                                 DataPageToolkit.getAttributeValueColor(JfxConstants.ATTRIBUTE_PHASE_NAME_12));
 379                 return new ItemRow(String.valueOf(threadName), JfxConstants.ATTRIBUTE_PHASE_NAME_12.getDescription(), phaseRenderer, items);
 380         }
 381 
 382         private static TableSettings getPulseTableSettings(IState state) {
 383                 if (state == null) {
 384                         return new TableSettings(TOTAL_DURATION,
 385                                         Arrays.asList(new ColumnSettings(ItemHistogram.KEY_COL_ID, false, 75, false),
 386                                                         new ColumnSettings(TOTAL_DURATION, false, 75, false)));
 387                 } else {
 388                         return new TableSettings(state);
 389                 }
 390         }
 391 
 392         private static TableSettings getPhaseListSettings(IState state) {
 393                 if (state == null) {
 394                         return new TableSettings(JfrAttributes.DURATION.getIdentifier(),
 395                                         Arrays.asList(new ColumnSettings(JfrAttributes.DURATION.getIdentifier(), false, 100, false),
 396                                                         new ColumnSettings(JfrAttributes.DURATION.getIdentifier(), false, 200, false),
 397                                                         new ColumnSettings(JfxConstants.ATTRIBUTE_PHASE_NAME_12.getIdentifier(), false, 100, false),
 398                                                         new ColumnSettings(JfxConstants.ATTRIBUTE_PULSE_ID_12.getIdentifier(), false, 100, false),
 399                                                         new ColumnSettings(JfrAttributes.EVENT_THREAD.getIdentifier(), false, 200, false)));
 400                 } else {
 401                         return new TableSettings(state);
 402                 }
 403         }
 404 
 405         private static TableSettings getInputTableSettings(IState state) {
 406                 if (state == null) {
 407                         return new TableSettings(TOTAL_DURATION,
 408                                         Arrays.asList(new ColumnSettings(ItemHistogram.KEY_COL_ID, false, 100, false),
 409                                                         new ColumnSettings(TOTAL_DURATION, false, 75, false),
 410                                                         new ColumnSettings(ItemHistogram.COUNT_COL_ID, false, 100, false)));
 411                 } else {
 412                         return new TableSettings(state);
 413                 }
 414         }
 415 
 416         @Override
 417         public IPageUI display(Composite parent, FormToolkit toolkit, IPageContainer editor, IState state) {
 418                 return new JfxUI(parent, toolkit, editor, state, getDataSource(), getName(), getIcon());
< prev index next >