- java.lang.Object
-
- de.carne.test.swt.tester.accessor.Accessor<T>
-
- de.carne.test.swt.tester.accessor.ControlAccessor<org.eclipse.swt.widgets.ToolBar>
-
- de.carne.test.swt.tester.accessor.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 Summary
Constructors Constructor Description ToolBarAccessor(@Nullable org.eclipse.swt.widgets.ToolBar toolBar)Constructs a new ToolBarAccessor instance.ToolBarAccessor(Accessor<org.eclipse.swt.widgets.ToolBar> accessor)Constructs a new ToolBarAccessor instance.ToolBarAccessor(java.util.Optional<org.eclipse.swt.widgets.ToolBar> toolBarHolder)Constructs a new ToolBarAccessor instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ToolItemAccessoraccessItem(int itemIndex)Convenience function which gets a specific ToolItem from this ToolBar.ToolItemAccessoraccessItem(java.lang.String text)Convenience function which gets a specific ToolItem.ToolItemAccessoraccessItem(java.util.function.Predicate<org.eclipse.swt.widgets.ToolItem> predicate)Convenience function which gets a specific ToolItem.java.util.stream.Stream<org.eclipse.swt.widgets.ToolItem>items()Gets all ToolItems of this ToolBar.-
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
-
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.
-
-