Class ToolBarAccessor

  • All Implemented Interfaces:
    java.util.function.Supplier<org.eclipse.swt.widgets.ToolBar>

    public class ToolBarAccessor
    extends ControlAccessor<org.eclipse.swt.widgets.ToolBar>
    Accessor class for ToolBar objects.
    • Constructor Detail

      • ToolBarAccessor

        public ToolBarAccessor​(@Nullable org.eclipse.swt.widgets.ToolBar toolBar)
        Constructs a new ToolBarAccessor instance.
        Parameters:
        toolBar - the ToolBar object to access.
      • ToolBarAccessor

        public ToolBarAccessor​(java.util.Optional<org.eclipse.swt.widgets.ToolBar> toolBarHolder)
        Constructs a new ToolBarAccessor instance.
        Parameters:
        toolBarHolder - the optional ToolBar object to access.
      • ToolBarAccessor

        public ToolBarAccessor​(Accessor<org.eclipse.swt.widgets.ToolBar> accessor)
        Constructs a new ToolBarAccessor instance.
        Parameters:
        accessor - the accessor to the ToolBar instance to access.
    • Method Detail

      • items

        public java.util.stream.Stream<org.eclipse.swt.widgets.ToolItem> items()
        Gets all ToolItems of this ToolBar.
        Returns:
        all ToolItems of this ToolBar.
      • accessItem

        public ToolItemAccessor accessItem​(java.util.function.Predicate<org.eclipse.swt.widgets.ToolItem> predicate)
        Convenience function which gets a specific ToolItem.

        A test failure is signaled if either none or more than one matching ToolItem exists.

        Parameters:
        predicate - the match criteria to use.
        Returns:
        the found ToolItem.
      • accessItem

        public ToolItemAccessor accessItem​(java.lang.String text)
        Convenience function which gets a specific ToolItem.

        A test failure is signaled if either none or more than one matching ToolItem exists.

        Parameters:
        text - the item text to match.
        Returns:
        the found ToolItem.
      • accessItem

        public ToolItemAccessor accessItem​(int itemIndex)
        Convenience function which gets a specific ToolItem from this ToolBar.

        A test failure is signaled if the ToolItem does not exist.

        Parameters:
        itemIndex - the item index to get.
        Returns:
        the found ToolItem.