Class TimePercentageLabelProvider

All Implemented Interfaces:
IBaseLabelProvider, IToolTipProvider

public class TimePercentageLabelProvider extends StyledCellLabelProvider
Percentage column label provider. Adds bar chart based on results into column. Can be used for both table and method list views.
  • Field Details

    • FIRST_PART

      public static final int FIRST_PART
      Percent bars less than this value will be green.
      See Also:
    • SECOND_PART

      public static final int SECOND_PART
      Percent bars less than this value, but more than FIRST_PART will be light green.
      See Also:
    • THIRD_PART

      public static final int THIRD_PART
      Percent bars less than this value, but more than SECOND_PART will be yellow.
      See Also:
    • FOURTH_PART

      public static final int FOURTH_PART
      Percent bars less than this value, but more than THIRD_PART will be orange. The ones that are more than this value will be red.
      See Also:
  • Constructor Details

    • TimePercentageLabelProvider

      public TimePercentageLabelProvider(Viewer viewer, boolean includeInternal)
      Creates new TimePercentageLabelProvider.
      Parameters:
      viewer - Viewer to attach label provider to. Cannot be null.
      includeInternal - true if should be in full time mode, false otherwise.
  • Method Details

    • setMaxPercents

      public void setMaxPercents(IProfilingResult results)
      Sets max percents using profiling result.
      Parameters:
      results - Result to use for computing max percents span.
    • setMaxPercents

      public void setMaxPercents(MethodStatisticsResult stats)
      Sets max percents using method statistics result.
      Parameters:
      results - Result to use for computing max percents span.
    • setTargets

      public void setTargets(boolean showClient, boolean showServer, boolean showMobileManagedServer)
      Sets flag to show or hide results from client or server. These flags also determine the percentages that will be shown in table and method list. If both flags are true, the usual percentage will be shown, but if only one is set to true, then shown percentages will be recalculated using only time of code execution on that target.
      Parameters:
      showClient - true if results from client are shown and false if they're hidden.
      showServer - true if results from server are shown and false if they're hidden.
    • dispose

      public void dispose()
      Specified by:
      dispose in interface IBaseLabelProvider
      Overrides:
      dispose in class StyledCellLabelProvider
    • paint

      protected void paint(org.eclipse.swt.widgets.Event event, Object element)
      Overrides:
      paint in class StyledCellLabelProvider
    • getToolTipText

      public String getToolTipText(Object element)
      Specified by:
      getToolTipText in interface IToolTipProvider
      Overrides:
      getToolTipText in class CellLabelProvider