Class MenuActionComboBox.ItemFactory<V>

java.lang.Object
com.e1c.langtool.ui.common.combo.MenuActionComboBox.ItemFactory<V>
Type Parameters:
V - the type of items contained by parent MenuActionComboBox
All Implemented Interfaces:
MenuActionComboBox.IContributionItemFactory<V>
Enclosing class:
MenuActionComboBox<T>

public static class MenuActionComboBox.ItemFactory<V> extends Object implements MenuActionComboBox.IContributionItemFactory<V>
The base implementation of contribution item factory.

This factory creates contribution items based on Action with text and image are gotten from ILabelProvider. Also this actions has Action.run() method that calls IComboBox.select(int) to select item by click.

  • Constructor Details

    • ItemFactory

      public ItemFactory(MenuActionComboBox<V> combo, ILabelProvider labelProvider)
      Creates a new contribution item factory.
      Parameters:
      combo - the parent combobox for which this factory is specified
      labelProvider - the label provider to get data for creating items
  • Method Details

    • create

      public org.eclipse.jface.action.IContributionItem create(V item, int index)
      Description copied from interface: MenuActionComboBox.IContributionItemFactory
      Creates a new contribution item for dropdown menu that is a representation of the given item in specified index.
      Specified by:
      create in interface MenuActionComboBox.IContributionItemFactory<V>
      Parameters:
      item - the item on basis of which the ContributionItem will be created
      index - the index of the given item (see IComboBox.indexOf(Object)
      Returns:
      a new ContributionItem element for dropdown menu
      See Also:
      • ContributionItem
    • createAction

      protected org.eclipse.jface.action.Action createAction(V item, int index)