Class ShellAccessor

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

    public class ShellAccessor
    extends DecorationsAccessor<org.eclipse.swt.widgets.Shell>
    Accessor class for Shell objects.
    • Constructor Detail

      • ShellAccessor

        public ShellAccessor​(@Nullable org.eclipse.swt.widgets.Shell shell)
        Constructs a new ShellAccessor instance.
        Parameters:
        shell - the Shell object to access.
      • ShellAccessor

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

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

      • accessMenuBar

        public MenuAccessor accessMenuBar()
        Gets this Shell's menu bar.
        Returns:
        this Shell's menu bar.
      • accessMenuItem

        public MenuItemAccessor accessMenuItem​(java.util.function.Predicate<org.eclipse.swt.widgets.MenuItem> predicate)
        Convenience function which gets a specific MenuItem from this Shell's menu bar.

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

        Parameters:
        predicate - the match criteria to use.
        Returns:
        the found MenuItem.
      • close

        public void close()
        Convenience function to close this Shell.