I have this code:
//FrameFixture frame = (...got it from window, main frame...)
JTableFixture table = frame.table(new GenericTypeMatcher<JTable>(JTable.class) {
@Override protected boolean isMatching(JTable table) {
return (table instanceof myTreeTable);
}
});
Isnt there any better kind of syntactic sugar for fetching a component by his .class (inheriting from a basic component)?
If you need implementation of
ComponentMatcherthen TypeMatcher can do matching based on type.However
TypeMatchercannot be used in case of ContainerFixture.table methods as they requireGenericTypeMatcher.TypeMatcherandGenericTypeMatcherboth implementComponentMatcherbut aren't in the same hierarchy.GenericTypeMatcheris abstract, so you have to provide an implementation. You could get away with your own extension if needed, ie:And use it like this: