1 /*
   2  * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
   3  * 
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * The contents of this file are subject to the terms of either the Universal Permissive License
   7  * v 1.0 as shown at http://oss.oracle.com/licenses/upl
   8  *
   9  * or the following license:
  10  *
  11  * Redistribution and use in source and binary forms, with or without modification, are permitted
  12  * provided that the following conditions are met:
  13  * 
  14  * 1. Redistributions of source code must retain the above copyright notice, this list of conditions
  15  * and the following disclaimer.
  16  * 
  17  * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
  18  * conditions and the following disclaimer in the documentation and/or other materials provided with
  19  * the distribution.
  20  * 
  21  * 3. Neither the name of the copyright holder nor the names of its contributors may be used to
  22  * endorse or promote products derived from this software without specific prior written permission.
  23  * 
  24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  25  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  26  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  27  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  30  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
  31  * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32  */
  33 package org.openjdk.jmc.flightrecorder.ext.jfx;
  34 
  35 import java.util.ArrayList;
  36 import java.util.Arrays;
  37 import java.util.List;
  38 import java.util.stream.Stream;
  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;
  79 import org.openjdk.jmc.ui.charts.IXDataRenderer;
  80 import org.openjdk.jmc.ui.charts.RendererToolkit;
  81 import org.openjdk.jmc.ui.charts.XYChart;
  82 import org.openjdk.jmc.ui.column.ColumnManager.SelectionState;
  83 import org.openjdk.jmc.ui.column.ColumnMenusFactory;
  84 import org.openjdk.jmc.ui.column.TableSettings;
  85 import org.openjdk.jmc.ui.column.TableSettings.ColumnSettings;
  86 import org.openjdk.jmc.ui.handlers.MCContextMenuManager;
  87 import org.openjdk.jmc.ui.misc.ChartCanvas;
  88 import org.openjdk.jmc.ui.misc.CompositeToolkit;
  89 import org.openjdk.jmc.ui.misc.PersistableSashForm;
  90 
  91 public class JfxPage extends AbstractDataPage {
  92 
  93         public static class Factory implements IDataPageFactory {
  94                 @Override
  95                 public String getName(IState state) {
  96                         return Messages.JfxPage_JAVA_FX;
  97                 }
  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());
 213                         inputTable.getManager().getViewer().addSelectionChangedListener(
 214                                         e -> pageContainer.showSelection(inputTable.getSelection().getItems()));
 215                         DataPageToolkit.addContextMenus(pageContainer, inputTable, Messages.JfxPage_INPUT_HISTOGRAM_SELECTION,
 216                                         inputFilter.getShowSearchAction(), inputFilter.getShowFilterAction());
 217                         input.setClient(inputFilter.getComponent());
 218                         inputFilter.loadState(state.getChild(INPUT_FILTER));
 219 
 220                         chartCanvas = new ChartCanvas(mainSash);
 221                         DataPageToolkit.createChartTimestampTooltip(chartCanvas);
 222                         chart = new XYChart(editor.getRecordingRange(), RendererToolkit.empty(), 180);
 223                         chart.setVisibleRange(timelineRange.getStart(), timelineRange.getEnd());
 224                         chart.addVisibleRangeListener(r -> timelineRange = r);
 225                         DataPageToolkit.setChart(chartCanvas, chart, pageContainer::showSelection);
 226 
 227                         PersistableSashForm.loadState(mainSash, state.getChild(MAIN_SASH));
 228                         PersistableSashForm.loadState(tableSash, state.getChild(TABLE_SASH));
 229                         PersistableSashForm.loadState(phasesSash, state.getChild(PHASES_SASH));
 230 
 231                         flavorSelector = FlavorSelector.itemsWithTimerange(form, JfxConstants.JFX_FILTER, items.getItems(),
 232                                         pageContainer, this::onInputSelected, this::onShow, flavorSelectorState);
 233 
 234                         onPulsesFilterChange(pulsesTableFilter);
 235                         onPhasesFilterChange(phasesTableFilter);
 236                         onInputFilterChange(inputTableFilter);
 237 
 238                         pulsesTable.getManager().setSelectionState(pulseSelection);
 239                         phasesTable.getManager().setSelectionState(phaseSelection);
 240                         inputTable.getManager().setSelectionState(inputSelection);
 241                 }
 242 
 243                 private void onPulsesFilterChange(IItemFilter newFilter) {
 244                         pulsesFilter.filterChangeHelper(newFilter, pulsesTable, getItems().apply(JfxConstants.JFX_PULSE_FILTER));
 245                         pulsesTableFilter = newFilter;
 246                 }
 247 
 248                 private void onPhasesFilterChange(IItemFilter newFilter) {
 249                         phasesFilter.filterChangeHelper(newFilter, phasesTable, getItems().apply(JfxConstants.JFX_PULSE_FILTER));
 250                         phasesTableFilter = newFilter;
 251                 }
 252 
 253                 private void onInputFilterChange(IItemFilter newFilter) {
 254                         inputFilter.filterChangeHelper(newFilter, inputTable, getItems().apply(JfxConstants.JFX_INPUT_FILTER));
 255                         inputTableFilter = newFilter;
 256                 }
 257 
 258                 @Override
 259                 public void saveTo(IWritableState state) {
 260                         PersistableSashForm.saveState(mainSash, state.createChild(MAIN_SASH));
 261                         PersistableSashForm.saveState(tableSash, state.createChild(TABLE_SASH));
 262                         PersistableSashForm.saveState(phasesSash, state.createChild(PHASES_SASH));
 263                         pulsesTable.getManager().getSettings().saveState(state.createChild(PULSES_TABLE));
 264                         phasesTable.getManager().getSettings().saveState(state.createChild(PHASES_TABLE));
 265                         inputTable.getManager().getSettings().saveState(state.createChild(INPUT_TABLE));
 266                         pulsesFilter.saveState(state.createChild(PULSES_FILTER));
 267                         phasesFilter.saveState(state.createChild(PHASES_FILTER));
 268                         inputFilter.saveState(state.createChild(INPUT_FILTER));
 269 
 270                         saveToLocal();
 271                 }
 272 
 273                 private void saveToLocal() {
 274                         pulseSelection = pulsesTable.getManager().getSelectionState();
 275                         phaseSelection = phasesTable.getManager().getSelectionState();
 276                         inputSelection = inputTable.getManager().getSelectionState();
 277                         flavorSelectorState = flavorSelector.getFlavorSelectorState();
 278                 }
 279 
 280                 private void onShow(Boolean show) {
 281                         IRange<IQuantity> range = show ? currentRange : pageContainer.getRecordingRange();
 282                         chart.setVisibleRange(range.getStart(), range.getEnd());
 283                         chartCanvas.redrawChart();
 284                 }
 285 
 286                 private void onInputSelected(IItemCollection items, IRange<IQuantity> currentRange) {
 287                         selectionItems = items;
 288                         this.currentRange = currentRange;
 289                         phaseItems = getItems().apply(JfxConstants.JFX_PULSE_FILTER);
 290                         pulsesTable.show(phaseItems);
 291                         inputTable.show(getItems().apply(JfxConstants.JFX_INPUT_FILTER));
 292 
 293                         buildChart();
 294                 }
 295 
 296                 private IItemCollection getItems() {
 297                         return selectionItems != null ? selectionItems : items.getItems();
 298                 }
 299 
 300                 private void buildChart() {
 301                         List<IXDataRenderer> rows = new ArrayList<>();
 302                         Stream<IXDataRenderer> phaseRows = AggregationGrid.mapItems(ItemCollectionToolkit.stream(phaseItems),
 303                                         JfrAttributes.EVENT_THREAD, JfxPage::buildThreadRenderer);
 304                         phaseRows.forEach(rows::add);
 305 
 306                         HistogramSelection inputSelection = inputTable.getSelection();
 307                         IItemCollection inputItems = inputSelection.getRowCount() > 0 ? inputSelection.getItems()
 308                                         : getItems().apply(JfxConstants.JFX_INPUT_FILTER);
 309                         IXDataRenderer inputRenderer = DataPageToolkit.buildSpanRenderer(inputItems,
 310                                         DataPageToolkit.getAttributeValueColor(JfxConstants.INPUT_TYPE));
 311                         rows.add(new ItemRow(Messages.JfxPage_INPUTS, JfxConstants.INPUT_TYPE.getDescription(), inputRenderer,
 312                                         inputItems));
 313 
 314                         chartCanvas.replaceRenderer(RendererToolkit.uniformRows(rows));
 315                 }
 316 
 317                 private void onPulsesSelected() {
 318                         phasesTable.show(pulsesTable.getSelection().getItems());
 319                         onPhasesSelected(false);
 320                 }
 321 
 322                 private void onPhasesSelected(boolean fromPhasesTable) {
 323                         HistogramSelection s = pulsesTable.getSelection();
 324                         if (fromPhasesTable) {
 325                                 IItemCollection phasesItems = ItemCollectionToolkit.build(phasesTable.getSelection().get());
 326                                 setChartVisibleRange(phasesItems);
 327                                 showSelectedPhases(phasesItems);
 328                         } else if (s.getRowCount() > 0) {
 329                                 IItemCollection selectedItems = s.getItems();
 330                                 setChartVisibleRange(selectedItems);
 331                                 showSelectedPhases(selectedItems);
 332                         } else {
 333                                 showSelectedPhases(getItems().apply(JfxConstants.JFX_PULSE_FILTER));
 334                         }
 335                 }
 336 
 337                 private void setChartVisibleRange(IItemCollection toShowItems) {
 338                         IAggregator<IQuantity, ?> firstStartAggregator = Aggregators.min(JfrAttributes.START_TIME);
 339                         IQuantity firstSelected = toShowItems.getAggregate(firstStartAggregator);
 340                         IAggregator<IQuantity, ?> lastEndAggregator = Aggregators.max(JfrAttributes.END_TIME);
 341                         IQuantity lastSelected = toShowItems.getAggregate(lastEndAggregator);
 342                         chart.setVisibleRange(firstSelected, lastSelected);
 343                 }
 344 
 345                 private void showSelectedPhases(IItemCollection phasesItems) {
 346                         this.phaseItems = phasesItems;
 347                         buildChart();
 348                         pageContainer.showSelection(phasesItems);
 349                 }
 350 
 351         }
 352 
 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());
 415         }
 416 
 417 }