@Test public void testRowCountOneAndTwo() { List<NotificationRow> rows = new ArrayList<>(); rows.add(new NotificationRow()); notificationWidgetViewImpl.init(presenter, rows); ListDataProvider<NotificationRow> dataProvider = getFieldValue(NotificationWidgetViewImpl.class, notificationWidgetViewImpl, "dataProvider"); Assert.assertEquals(1, dataProvider.getList().size()); rows = new ArrayList<>(); rows.add(new NotificationRow()); notificationWidgetViewImpl.init(presenter, rows); Assert.assertEquals(1, dataProvider.getList().size()); rows.add(new NotificationRow()); notificationWidgetViewImpl.init(presenter, rows); Assert.assertEquals(2, dataProvider.getList().size()); notificationWidgetViewImpl.init(presenter, Collections.EMPTY_LIST); Assert.assertEquals(0, dataProvider.getList().size()); }
@PostConstruct public void init() { addButton.addEventListener("click", event -> addOrEdit(new NotificationRow()), false); closeButton.addEventListener("click", event -> hide(), false); okButton.addEventListener("click", event -> ok(), false); }
NotificationWidgetViewImpl extends Composite implements NotificationWidgetView { @PostConstruct public void init() { addButton.addEventListener("click", event -> addOrEdit(new NotificationRow()), false); closeButton.addEventListener("click", event -> hide(), false); okButton.addEventListener("click", event -> ok(), false); } }
NotificationWidgetViewImpl extends Composite implements NotificationWidgetView { @PostConstruct public void init() { addButton.addEventListener("click", event -> addOrEdit(new NotificationRow()), false); closeButton.addEventListener("click", event -> hide(), false); okButton.addEventListener("click", event -> ok(), false); }  }
NotificationWidgetViewImpl extends Composite implements NotificationWidgetView { @PostConstruct public void init() { addButton.addEventListener("click", event -> addOrEdit(new NotificationRow()), false); closeButton.addEventListener("click", event -> hide(), false); okButton.addEventListener("click", event -> ok(), false); }  @PostConstruct void init(); @Override void init(final NotificationWidgetView.Presenter presenter, List<NotificationRow> rows); @Override void delete(NotificationRow row); @Override void addOrEdit(NotificationRow row); @Override void setReadOnly(boolean readOnly); @Override void show(); void onSubscription(@Observes NotificationEvent event); @Override void refreshTable(); @Override void hide(); }
NotificationWidgetViewImpl extends Composite implements NotificationWidgetView { @PostConstruct public void init() { addButton.addEventListener("click", event -> addOrEdit(new NotificationRow()), false); closeButton.addEventListener("click", event -> hide(), false); okButton.addEventListener("click", event -> ok(), false); }  @PostConstruct void init(); @Override void init(final NotificationWidgetView.Presenter presenter, List<NotificationRow> rows); @Override void delete(NotificationRow row); @Override void addOrEdit(NotificationRow row); @Override void setReadOnly(boolean readOnly); @Override void show(); void onSubscription(@Observes NotificationEvent event); @Override void refreshTable(); @Override void hide();  }