- java.lang.Object
-
- de.carne.test.swt.tester.accessor.Accessor<T>
-
- de.carne.test.swt.tester.accessor.ControlAccessor<T>
-
- de.carne.test.swt.tester.accessor.CompositeAccessor<T>
-
- de.carne.test.swt.tester.accessor.DecorationsAccessor<org.eclipse.swt.widgets.Shell>
-
- de.carne.test.swt.tester.accessor.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 Summary
Constructors Constructor Description ShellAccessor(@Nullable org.eclipse.swt.widgets.Shell shell)Constructs a new ShellAccessor instance.ShellAccessor(Accessor<org.eclipse.swt.widgets.Shell> accessor)Constructs a new ShellAccessor instance.ShellAccessor(java.util.Optional<org.eclipse.swt.widgets.Shell> shellHolder)Constructs a new ShellAccessor instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MenuAccessoraccessMenuBar()Gets this Shell's menu bar.MenuItemAccessoraccessMenuItem(java.util.function.Predicate<org.eclipse.swt.widgets.MenuItem> predicate)Convenience function which gets a specific MenuItem from this Shell's menu bar.voidclose()Convenience function to close this Shell.-
Methods inherited from class de.carne.test.swt.tester.accessor.DecorationsAccessor
matchText, matchText
-
Methods inherited from class de.carne.test.swt.tester.accessor.CompositeAccessor
accessButton, accessButton, accessButton, accessChild, accessChild, children
-
Methods inherited from class de.carne.test.swt.tester.accessor.ControlAccessor
accessEnabled, matchClass
-
Methods inherited from class de.carne.test.swt.tester.accessor.Accessor
equals, get, get, getOptional, hashCode, notPresent, toString
-
-
-
-
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.
-
-