Class AbstractTableViewerColumnBuilder<V extends org.eclipse.jface.viewers.AbstractTableViewer,​C extends org.eclipse.jface.viewers.ViewerColumn>

  • Type Parameters:
    V - the TableViewer implementation to use
    C - the ViewerColumn implementation to use
    Direct Known Subclasses:
    DefaultTableViewerColumnBuilder, GridViewerColumnBuilder, GridViewerColumnBuilder

    public abstract class AbstractTableViewerColumnBuilder<V extends org.eclipse.jface.viewers.AbstractTableViewer,​C extends org.eclipse.jface.viewers.ViewerColumn>
    extends java.lang.Object
    A table viewer configuration helper class.
    Author:
    Mat Hansen
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void bindValue​(org.eclipse.swt.widgets.Widget column, org.eclipse.jface.databinding.swt.IWidgetValueProperty valueProperty, org.eclipse.core.databinding.observable.value.IObservableValue observable)
      Binds a value to a widget value property.
      C build​(V tableViewer)
      Creates a new viewer column.
      protected void configure​(V tableViewer, C viewerColumn)
      Configures a viewer column instance.
      protected void configureContextMap​(org.eclipse.swt.widgets.Widget column)
      Configures the context map of the given widget.
      protected void configureDatabinding​(org.eclipse.swt.widgets.Widget column)
      Configures data binding for the given column widget.
      protected abstract void configureEditingSupport​(C viewerColumn, V tableViewer)
      Configures the EditingSupport for the given table viewer/column.
      protected void configureImage​(org.eclipse.swt.widgets.Item column)
      Configures a image for the given column item.
      protected void configureLabelProvider​(C column, V tableViewer)
      Configures the label provider of the given column.
      protected abstract void configureViewerColumn​(C viewerColumn)
      Configures a viewer column instance.
      abstract C createViewerColumn​(V tableViewer)
      Creates a new ViewerColumn instance.
      ColumnConfiguration getConfig()  
      protected abstract org.eclipse.swt.widgets.Item getTableColumn​(C viewerColumn)
      Returns the table column control for the given viewer column.
      AbstractTableViewerColumnBuilder<V,​C> withDatabinding​(org.eclipse.emf.databinding.EMFDataBindingContext dataBindingContext)
      Adds databinding support.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • build

        public C build​(V tableViewer)
        Creates a new viewer column.
        Parameters:
        tableViewer - the parent table viewer
        Returns:
        the table viewer column
      • createViewerColumn

        public abstract C createViewerColumn​(V tableViewer)
        Creates a new ViewerColumn instance.
        Parameters:
        tableViewer - the TableViewer
        Returns:
        a ViewerColumn instance
      • getTableColumn

        protected abstract org.eclipse.swt.widgets.Item getTableColumn​(C viewerColumn)
        Returns the table column control for the given viewer column.
        Parameters:
        viewerColumn - the viewer column
        Returns:
        a table column control
      • configureViewerColumn

        protected abstract void configureViewerColumn​(C viewerColumn)
        Configures a viewer column instance.
        Parameters:
        viewerColumn - the viewer column to configure
      • configure

        protected void configure​(V tableViewer,
                                 C viewerColumn)
        Configures a viewer column instance.
        Parameters:
        tableViewer - the table viewer the column belongs to
        viewerColumn - the viewer column to configure
      • configureEditingSupport

        protected abstract void configureEditingSupport​(C viewerColumn,
                                                        V tableViewer)
        Configures the EditingSupport for the given table viewer/column.
        Parameters:
        viewerColumn - the viewer column to configure
        tableViewer - the table viewer the column belongs to
      • withDatabinding

        public AbstractTableViewerColumnBuilder<V,​C> withDatabinding​(org.eclipse.emf.databinding.EMFDataBindingContext dataBindingContext)
        Adds databinding support.
        Parameters:
        dataBindingContext - the EMFDataBindingContext to use
        Returns:
        a new TableViewerColumnBuilder instance
      • bindValue

        protected void bindValue​(org.eclipse.swt.widgets.Widget column,
                                 org.eclipse.jface.databinding.swt.IWidgetValueProperty valueProperty,
                                 org.eclipse.core.databinding.observable.value.IObservableValue observable)
        Binds a value to a widget value property.
        Parameters:
        column - the widget
        valueProperty - the value property to bind to
        observable - the value to bind to
      • configureDatabinding

        protected void configureDatabinding​(org.eclipse.swt.widgets.Widget column)
        Configures data binding for the given column widget.
        Parameters:
        column - the column widget to configure
      • configureLabelProvider

        protected void configureLabelProvider​(C column,
                                              V tableViewer)
        Configures the label provider of the given column.
        Parameters:
        column - the column to configure
        tableViewer - the table viewer the column belongs to
      • configureImage

        protected void configureImage​(org.eclipse.swt.widgets.Item column)
        Configures a image for the given column item.
        Parameters:
        column - the column item to configure an image for
      • configureContextMap

        protected void configureContextMap​(org.eclipse.swt.widgets.Widget column)
        Configures the context map of the given widget.
        Parameters:
        column - the column widget to configure