Class TableActionBar<V extends org.eclipse.jface.viewers.AbstractTableViewer>

  • Type Parameters:
    V - the concrete viewer type
    All Implemented Interfaces:
    ActionBar<V>
    Direct Known Subclasses:
    TableRendererActionBar

    public class TableActionBar<V extends org.eclipse.jface.viewers.AbstractTableViewer>
    extends java.lang.Object
    implements ActionBar<V>
    The table control action bar.
    Since:
    1.18
    Author:
    Mat Hansen
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addControl​(java.lang.String id, org.eclipse.swt.widgets.Control control)
      Add a control to the action bar.
      protected void applyLayout​(org.eclipse.swt.widgets.Composite composite)
      Applies a layout to the action bar composite.
      void fillComposite​(org.eclipse.swt.widgets.Composite composite, V viewer)
      This method is called to fill the given Composite with action controls.
      int getActionCount()
      Get the number of currently registered actions.
      protected java.util.Collection<Action> getActions()
      Returns a list of known actions.
      Optional<org.eclipse.swt.widgets.Control> getControlById​(java.lang.String id)
      Get a control by its action ID.
      int getControlCount()
      Get the number of currently registered controls.
      void updateActionBar()
      Updates the controls of this action bar.
      • Methods inherited from class java.lang.Object

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

      • fillComposite

        public void fillComposite​(org.eclipse.swt.widgets.Composite composite,
                                  V viewer)
        Description copied from interface: ActionBar
        This method is called to fill the given Composite with action controls.
        Specified by:
        fillComposite in interface ActionBar<V extends org.eclipse.jface.viewers.AbstractTableViewer>
        Parameters:
        composite - the composite
        viewer - the AbstractTableViewer
      • applyLayout

        protected void applyLayout​(org.eclipse.swt.widgets.Composite composite)
        Applies a layout to the action bar composite.
        Parameters:
        composite - the composite to apply a layout to
      • getActions

        protected java.util.Collection<Action> getActions()
        Returns a list of known actions.
        Returns:
        list of actions
      • addControl

        protected void addControl​(java.lang.String id,
                                  org.eclipse.swt.widgets.Control control)
        Add a control to the action bar.
        Parameters:
        id - the ID of the control (typically the same as the ID of the bound action)
        control - the control instance
      • getControlById

        public Optional<org.eclipse.swt.widgets.Control> getControlById​(java.lang.String id)
        Description copied from interface: ActionBar
        Get a control by its action ID.
        Specified by:
        getControlById in interface ActionBar<V extends org.eclipse.jface.viewers.AbstractTableViewer>
        Parameters:
        id - the action ID to get the control for
        Returns:
        the control for the given action ID (if any)
      • getControlCount

        public int getControlCount()
        Description copied from interface: ActionBar
        Get the number of currently registered controls.
        Specified by:
        getControlCount in interface ActionBar<V extends org.eclipse.jface.viewers.AbstractTableViewer>
        Returns:
        the number of controls
      • getActionCount

        public int getActionCount()
        Description copied from interface: ActionBar
        Get the number of currently registered actions.
        Specified by:
        getActionCount in interface ActionBar<V extends org.eclipse.jface.viewers.AbstractTableViewer>
        Returns:
        the number of actions
      • updateActionBar

        public void updateActionBar()
        Updates the controls of this action bar. For instance, this can include enabling or disabling controls dependent on whether actions can be executed.

        Invokes canExecute() on all bound actions and updates the enabled state for each control accordingly.

        Specified by:
        updateActionBar in interface ActionBar<V extends org.eclipse.jface.viewers.AbstractTableViewer>