Module de.carne.test.swt
Class ItemAccessor<T extends org.eclipse.swt.widgets.Item>
- java.lang.Object
-
- de.carne.test.swt.tester.accessor.Accessor<T>
-
- de.carne.test.swt.tester.accessor.ItemAccessor<T>
-
- Type Parameters:
T- the actual object type to access.
- All Implemented Interfaces:
java.util.function.Supplier<T>
- Direct Known Subclasses:
CoolItemAccessor,MenuItemAccessor,ToolItemAccessor
public class ItemAccessor<T extends org.eclipse.swt.widgets.Item> extends Accessor<T>
Accessor class for Item objects.
-
-
Constructor Summary
Constructors Constructor Description ItemAccessor(@Nullable T item)Constructs a new ItemAccessor instance.ItemAccessor(Accessor<T> accessor)Constructs a new ItemAccessor instance.ItemAccessor(java.util.Optional<T> optionalItem)Constructs a new ItemAccessor instance.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <S extends org.eclipse.swt.widgets.Item>
java.util.function.Predicate<S>matchText(java.lang.String text)Creates a Predicate for exact text matching.static <S extends org.eclipse.swt.widgets.Item>
java.util.function.Predicate<S>matchText(java.util.regex.Pattern textPattern)Creates a Predicate for pattern text matching.-
Methods inherited from class de.carne.test.swt.tester.accessor.Accessor
equals, get, get, getOptional, hashCode, notPresent, toString
-
-
-
-
Constructor Detail
-
ItemAccessor
public ItemAccessor(@Nullable T item)
Constructs a new ItemAccessor instance.- Parameters:
item- the Item instance to access.
-
ItemAccessor
public ItemAccessor(java.util.Optional<T> optionalItem)
Constructs a new ItemAccessor instance.- Parameters:
optionalItem- the optional Item instance to access.
-
ItemAccessor
public ItemAccessor(Accessor<T> accessor)
Constructs a new ItemAccessor instance.- Parameters:
accessor- the accessor to the Item instance to access.
-
-
Method Detail
-
matchText
public static <S extends org.eclipse.swt.widgets.Item> java.util.function.Predicate<S> matchText(java.lang.String text)
Creates a Predicate for exact text matching.- Type Parameters:
S- the actual widget type.- Parameters:
text- the text to match.- Returns:
- the created Predicate.
-
matchText
public static <S extends org.eclipse.swt.widgets.Item> java.util.function.Predicate<S> matchText(java.util.regex.Pattern textPattern)
Creates a Predicate for pattern text matching.- Type Parameters:
S- the actual widget type.- Parameters:
textPattern- the pattern to match.- Returns:
- the created Predicate.
-
-