@Test public void testSetDataProvider_HasDataProvider() { HasItemsAvailableValuesAspectDefinition hasItemsAvailableValuesAspectDefinition = new HasItemsAvailableValuesAspectDefinition( AvailableValuesType.DYNAMIC); @SuppressWarnings("unchecked") ListDataProvider<Object> dataProvider = mock(ListDataProvider.class); @SuppressWarnings("unchecked") HasDataProvider<Object> component = mock(HasDataProvider.class, withSettings().extraInterfaces(Component.class)); hasItemsAvailableValuesAspectDefinition.setDataProvider(new LabelComponentWrapper(component), dataProvider); verify(component).setDataProvider(dataProvider); }
@SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataProvider(listDataProvider); } else if (component instanceof ComboBox) { ((ComboBox<Object>)component).setDataProvider(listDataProvider); } else if (component instanceof HasFilterableDataProvider) { ((HasFilterableDataProvider<Object, SerializablePredicate<Object>>)component) .setDataProvider(listDataProvider); } }
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataProvider(listDataProvider); } else if (component instanceof ComboBox) { ((ComboBox<Object>)component).setDataProvider(listDataProvider); } else if (component instanceof HasFilterableDataProvider) { ((HasFilterableDataProvider<Object, SerializablePredicate<Object>>)component) .setDataProvider(listDataProvider); } } }
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataProvider(listDataProvider); } else if (component instanceof ComboBox) { ((ComboBox<Object>)component).setDataProvider(listDataProvider); } else if (component instanceof HasFilterableDataProvider) { ((HasFilterableDataProvider<Object, SerializablePredicate<Object>>)component) .setDataProvider(listDataProvider); } } HasItemsAvailableValuesAspectDefinition(AvailableValuesType availableValuesType); }
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataProvider(listDataProvider); } else if (component instanceof ComboBox) { ((ComboBox<Object>)component).setDataProvider(listDataProvider); } else if (component instanceof HasFilterableDataProvider) { ((HasFilterableDataProvider<Object, SerializablePredicate<Object>>)component) .setDataProvider(listDataProvider); } } HasItemsAvailableValuesAspectDefinition(AvailableValuesType availableValuesType);  }
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataProvider(listDataProvider); } else if (component instanceof ComboBox) { ((ComboBox<Object>)component).setDataProvider(listDataProvider); } else if (component instanceof HasFilterableDataProvider) { ((HasFilterableDataProvider<Object, SerializablePredicate<Object>>)component) .setDataProvider(listDataProvider); } } HasItemsAvailableValuesAspectDefinition(AvailableValuesType availableValuesType);   }