@Test public void init() { tested.init(); verify(customClassName, times(1)).addKeyDownHandler(keyDownHandlerCaptor.capture()); KeyDownHandler handler = keyDownHandlerCaptor.getValue(); doReturn(Integer.valueOf('1')).when(keyDownEvent).getNativeKeyCode(); handler.onKeyDown(keyDownEvent); verify(keyDownEvent, times(0)).preventDefault(); doReturn(Integer.valueOf(' ')).when(keyDownEvent).getNativeKeyCode(); handler.onKeyDown(keyDownEvent); verify(keyDownEvent, times(1)).preventDefault(); }
@PostConstruct public void init() { customClassName.addKeyDownHandler(event -> { int iChar = event.getNativeKeyCode(); if (iChar == ' ') { event.preventDefault(); } }); deleteButton.setIcon(IconType.TRASH); }
DefaultImportListItemWidgetView extends Composite implements ImportListItemWidgetView<DefaultImport>,
                                                                          ComboBoxView.ModelPresenter { @PostConstruct public void init() { customClassName.addKeyDownHandler(event -> { int iChar = event.getNativeKeyCode(); if (iChar == ' ') { event.preventDefault(); } }); deleteButton.setIcon(IconType.TRASH); } }
DefaultImportListItemWidgetView extends Composite implements ImportListItemWidgetView<DefaultImport>,
                                                                          ComboBoxView.ModelPresenter { @PostConstruct public void init() { customClassName.addKeyDownHandler(event -> { int iChar = event.getNativeKeyCode(); if (iChar == ' ') { event.preventDefault(); } }); deleteButton.setIcon(IconType.TRASH); }  }
DefaultImportListItemWidgetView extends Composite implements ImportListItemWidgetView<DefaultImport>,
                                                                          ComboBoxView.ModelPresenter { @PostConstruct public void init() { customClassName.addKeyDownHandler(event -> { int iChar = event.getNativeKeyCode(); if (iChar == ' ') { event.preventDefault(); } }); deleteButton.setIcon(IconType.TRASH); }  @Override void setParentWidget(final ImportsEditorWidgetView.Presenter<DefaultImport> parentWidget); @Override void setTextBoxModelValue(final TextBox textBox, final String value); @Override void setListBoxModelValue(final ValueListBox<String> listBox, final String displayName); @Override String getModelValue(final ValueListBox<String> listBox); @Override void notifyModelChanged(); @PostConstruct void init(); @Override DefaultImport getModel(); @Override void setModel(final DefaultImport model); @EventHandler("deleteButton") void handleDeleteButton(final ClickEvent e); }
DefaultImportListItemWidgetView extends Composite implements ImportListItemWidgetView<DefaultImport>,
                                                                          ComboBoxView.ModelPresenter { @PostConstruct public void init() { customClassName.addKeyDownHandler(event -> { int iChar = event.getNativeKeyCode(); if (iChar == ' ') { event.preventDefault(); } }); deleteButton.setIcon(IconType.TRASH); }  @Override void setParentWidget(final ImportsEditorWidgetView.Presenter<DefaultImport> parentWidget); @Override void setTextBoxModelValue(final TextBox textBox, final String value); @Override void setListBoxModelValue(final ValueListBox<String> listBox, final String displayName); @Override String getModelValue(final ValueListBox<String> listBox); @Override void notifyModelChanged(); @PostConstruct void init(); @Override DefaultImport getModel(); @Override void setModel(final DefaultImport model); @EventHandler("deleteButton") void handleDeleteButton(final ClickEvent e);  }