Class TmfEventsTable

java.lang.Object
org.eclipse.tracecompass.tmf.core.component.TmfComponent
org.eclipse.tracecompass.tmf.ui.viewers.events.TmfEventsTable
All Implemented Interfaces:
EventListener, org.eclipse.jface.util.IPropertyChangeListener, org.eclipse.jface.viewers.ISelectionProvider, ITmfComponent, IColorSettingsListener, org.eclipse.ui.ide.IGotoMarker

public class TmfEventsTable extends TmfComponent implements org.eclipse.ui.ide.IGotoMarker, IColorSettingsListener, org.eclipse.jface.viewers.ISelectionProvider, org.eclipse.jface.util.IPropertyChangeListener
The generic TMF Events table This is a view that will list events that are read from a trace.
Author:
Francois Chouinard, Patrick Tasse
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The events table search/filter state
    static interface 
    The events table search/filter/data keys
  • Constructor Summary

    Constructors
    Constructor
    Description
    TmfEventsTable(org.eclipse.swt.widgets.Composite parent, int cacheSize)
    Basic constructor, using the default set of columns
    TmfEventsTable(org.eclipse.swt.widgets.Composite parent, int cacheSize, @NonNull Iterable<ITmfEventAspect<?>> aspects)
    Standard constructor, where we define which columns to use.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addBookmark(org.eclipse.core.resources.IFile bookmarksFile)
    Add a bookmark to this event table.
    void
    addBookmark(org.eclipse.core.resources.IMarker... bookmarks)
    Add one or more bookmarks to this event table.
    void
    addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
     
    void
    cacheUpdated(boolean completed)
    Notify that the event cache has been updated
    void
    Notify the listener that the color settings have changed.
    void
    Dispose of the component
    void
    eventFilterApplied(org.eclipse.tracecompass.internal.provisional.tmf.core.model.filters.TmfFilterAppliedSignal signal)
    Receive a signal to apply a filter.
    int[]
    Returns an array of zero-relative integers that map the creation order of the receiver's columns to the order in which they are currently being displayed.
    boolean[]
    Get whether the columns are resizable
    int[]
    Get column widths
    Get the contents of the row in the events table corresponding to an event.
    org.eclipse.jface.viewers.ISelection
     
    Get the virtual table contained in this event table.
    void
    gotoMarker(org.eclipse.core.resources.IMarker marker)
     
    void
    propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)
     
    void
    Refresh the table
    void
    refreshBookmarks(org.eclipse.core.resources.IFile bookmarksFile)
    Refresh the bookmarks assigned to this trace, from the contents of a bookmark file.
    void
    registerContextMenus(org.eclipse.ui.IWorkbenchPartSite site)
    Registers context menus with a site for extension.
    void
    removeBookmark(org.eclipse.core.resources.IMarker... bookmarks)
    Remove one or more bookmarks from this event table.
    void
    removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
     
    void
    Handler for the selection range signal.
    void
    setColumnOrder(int[] order)
    Sets the order that the columns in the receiver should be displayed in to the given argument which is described in terms of the zero-relative ordering of when the columns were added.
    void
    setColumnWidth(int[] width, boolean[] resizable)
    Sets the column width and resizability
    void
    Notify this table that is got the UI focus.
    void
    setLayoutData(Object layoutData)
    Assign a layout data object to this view.
    void
    setSelection(org.eclipse.jface.viewers.ISelection selection)
     
    void
    setStatusLineManager(org.eclipse.jface.action.IStatusLineManager statusLineManager)
    Assign the status line manager
    void
    setTrace(ITmfTrace trace, boolean disposeOnClose)
    Assign a new trace to this event table.
    void
    Handler for the trace updated signal

    Methods inherited from class org.eclipse.tracecompass.tmf.core.component.TmfComponent

    broadcast, broadcastAsync, getName, init

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TmfEventsTable

      public TmfEventsTable(org.eclipse.swt.widgets.Composite parent, int cacheSize)
      Basic constructor, using the default set of columns
      Parameters:
      parent - The parent composite UI object
      cacheSize - The size of the event table cache
    • TmfEventsTable

      public TmfEventsTable(org.eclipse.swt.widgets.Composite parent, int cacheSize, @NonNull Iterable<ITmfEventAspect<?>> aspects)
      Standard constructor, where we define which columns to use.
      Parameters:
      parent - The parent composite UI object
      cacheSize - The size of the event table cache
      aspects - The event aspects to display in this table. One column per aspect will be created.

      The iteration order of this collection will correspond to the initial ordering of the columns in the table.

  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: ITmfComponent
      Dispose of the component
      Specified by:
      dispose in interface ITmfComponent
      Overrides:
      dispose in class TmfComponent
    • setLayoutData

      public void setLayoutData(Object layoutData)
      Assign a layout data object to this view.
      Parameters:
      layoutData - The layout data to assign
    • getTable

      public TmfVirtualTable getTable()
      Get the virtual table contained in this event table.
      Returns:
      The TMF virtual table
    • eventFilterApplied

      public void eventFilterApplied(org.eclipse.tracecompass.internal.provisional.tmf.core.model.filters.TmfFilterAppliedSignal signal)
      Receive a signal to apply a filter. This will apply the filter if the source is not this viewer already
      Parameters:
      signal - The signal
      Since:
      4.2
    • propertyChange

      public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event)
      Specified by:
      propertyChange in interface org.eclipse.jface.util.IPropertyChangeListener
      Since:
      1.0
    • getItemStrings

      public String[] getItemStrings(ITmfEvent event)
      Get the contents of the row in the events table corresponding to an event. The order of the elements corresponds to the current order of the columns.
      Parameters:
      event - The event printed in this row
      Returns:
      The event row entries
    • getColumnOrder

      public int[] getColumnOrder()
      Returns an array of zero-relative integers that map the creation order of the receiver's columns to the order in which they are currently being displayed.

      Specifically, the indices of the returned array represent the current visual order of the columns, and the contents of the array represent the creation order of the columns.

      Returns:
      the current visual order of the receiver's columns
      Since:
      1.0
    • getColumnWidth

      public int[] getColumnWidth()
      Get column widths
      Returns:
      the current visual widths of the receiver's columns
      Since:
      2.1
    • getColumnResizable

      public boolean[] getColumnResizable()
      Get whether the columns are resizable
      Returns:
      an array stating if each column is resizable
      Since:
      2.1
    • setColumnOrder

      public void setColumnOrder(int[] order)
      Sets the order that the columns in the receiver should be displayed in to the given argument which is described in terms of the zero-relative ordering of when the columns were added.

      Specifically, the contents of the array represent the original position of each column at the time its creation.

      Parameters:
      order - the new order to display the columns
      Since:
      1.0
    • setColumnWidth

      public void setColumnWidth(int[] width, boolean[] resizable)
      Sets the column width and resizability
      Parameters:
      width - an array of widths
      resizable - an array of bools saying if a column is resizable or not
      Since:
      2.1
    • setFocus

      public void setFocus()
      Notify this table that is got the UI focus.
    • registerContextMenus

      public void registerContextMenus(org.eclipse.ui.IWorkbenchPartSite site)
      Registers context menus with a site for extension. This method can be called for part sites so that context menu contributions can be added.
      Parameters:
      site - the site that the context menus will be registered for
      Since:
      1.2
    • setTrace

      public void setTrace(ITmfTrace trace, boolean disposeOnClose)
      Assign a new trace to this event table.
      Parameters:
      trace - The trace to assign to this event table
      disposeOnClose - true if the trace should be disposed when the table is disposed
    • setStatusLineManager

      public void setStatusLineManager(org.eclipse.jface.action.IStatusLineManager statusLineManager)
      Assign the status line manager
      Parameters:
      statusLineManager - The status line manager, or null to disable status line messages
    • cacheUpdated

      public void cacheUpdated(boolean completed)
      Notify that the event cache has been updated
      Parameters:
      completed - Also notify if the populating of the cache is complete, or not.
    • addSelectionChangedListener

      public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
      Specified by:
      addSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
    • getSelection

      public org.eclipse.jface.viewers.ISelection getSelection()
      Specified by:
      getSelection in interface org.eclipse.jface.viewers.ISelectionProvider
    • removeSelectionChangedListener

      public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
      Specified by:
      removeSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
    • setSelection

      public void setSelection(org.eclipse.jface.viewers.ISelection selection)
      Specified by:
      setSelection in interface org.eclipse.jface.viewers.ISelectionProvider
    • addBookmark

      public void addBookmark(org.eclipse.core.resources.IFile bookmarksFile)
      Add a bookmark to this event table.
      Parameters:
      bookmarksFile - The file to use for the bookmarks
    • addBookmark

      public void addBookmark(org.eclipse.core.resources.IMarker... bookmarks)
      Add one or more bookmarks to this event table.
      Parameters:
      bookmarks - The bookmarks to add
      Since:
      2.0
    • removeBookmark

      public void removeBookmark(org.eclipse.core.resources.IMarker... bookmarks)
      Remove one or more bookmarks from this event table.
      Parameters:
      bookmarks - The bookmarks to remove
      Since:
      2.0
    • refreshBookmarks

      public void refreshBookmarks(org.eclipse.core.resources.IFile bookmarksFile)
      Refresh the bookmarks assigned to this trace, from the contents of a bookmark file.
      Parameters:
      bookmarksFile - The bookmark file to use
    • gotoMarker

      public void gotoMarker(org.eclipse.core.resources.IMarker marker)
      Specified by:
      gotoMarker in interface org.eclipse.ui.ide.IGotoMarker
    • colorSettingsChanged

      public void colorSettingsChanged(ColorSetting[] colorSettings)
      Description copied from interface: IColorSettingsListener
      Notify the listener that the color settings have changed.
      Specified by:
      colorSettingsChanged in interface IColorSettingsListener
      Parameters:
      colorSettings - The new color settings
    • traceUpdated

      public void traceUpdated(TmfTraceUpdatedSignal signal)
      Handler for the trace updated signal
      Parameters:
      signal - The incoming signal
    • selectionRangeUpdated

      public void selectionRangeUpdated(TmfSelectionRangeUpdatedSignal signal)
      Handler for the selection range signal.
      Parameters:
      signal - The incoming signal
      Since:
      1.0
    • refresh

      public void refresh()
      Refresh the table