target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testInstantiate_NoNoArgs() { Assertions.assertThrows(IllegalArgumentException.class, () -> { Classes.instantiate(WithArg.class); }); }
public static <T> T instantiate(Class<T> clazz) { try { return clazz .getConstructor() .newInstance(); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new IllegalArgumentException( String.format("Canno...
Classes { public static <T> T instantiate(Class<T> clazz) { try { return clazz .getConstructor() .newInstance(); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new IllegalArgumentException( String.for...
Classes { public static <T> T instantiate(Class<T> clazz) { try { return clazz .getConstructor() .newInstance(); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new IllegalArgumentException( String.for...
Classes { public static <T> T instantiate(Class<T> clazz) { try { return clazz .getConstructor() .newInstance(); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new IllegalArgumentException( String.for...
Classes { public static <T> T instantiate(Class<T> clazz) { try { return clazz .getConstructor() .newInstance(); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { throw new IllegalArgumentException( String.for...
@Test public void testDisplayMessages_noMessageList() { Assertions.assertThrows(NullPointerException.class, () -> { selectBinding.displayMessages(null); }); }
@Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; }
ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } }
ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } ElementBinding(ComponentWrapper componentWrapper, PropertyD...
ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } ElementBinding(ComponentWrapper componentWrapper, PropertyD...
ElementBinding implements Binding { @Override public MessageList displayMessages(MessageList messages) { MessageList messagesForProperty = getRelevantMessages(messages); componentWrapper.setValidationMessages(messagesForProperty); return messagesForProperty; } ElementBinding(ComponentWrapper componentWrapper, PropertyD...
@Test public void testSetDateFormat_NoSpecialDateFormatSet() { MultiformatDateField multiformatDateField = new MultiformatDateField(); String dateFormat = multiformatDateField.getDateFormat(); List<String> alternativeFormat = multiformatDateField.getAlternativeFormat(); assertThat(dateFormat, is(nullValue())); assertTh...
public List<String> getAlternativeFormat() { return Arrays.asList(getState().getAlternativeFormats()); }
MultiformatDateField extends DateField { public List<String> getAlternativeFormat() { return Arrays.asList(getState().getAlternativeFormats()); } }
MultiformatDateField extends DateField { public List<String> getAlternativeFormat() { return Arrays.asList(getState().getAlternativeFormats()); } MultiformatDateField(); MultiformatDateField(String caption, LocalDate value); MultiformatDateField(String caption); MultiformatDateField( ValueChangeListener<...
MultiformatDateField extends DateField { public List<String> getAlternativeFormat() { return Arrays.asList(getState().getAlternativeFormats()); } MultiformatDateField(); MultiformatDateField(String caption, LocalDate value); MultiformatDateField(String caption); MultiformatDateField( ValueChangeListener<...
MultiformatDateField extends DateField { public List<String> getAlternativeFormat() { return Arrays.asList(getState().getAlternativeFormats()); } MultiformatDateField(); MultiformatDateField(String caption, LocalDate value); MultiformatDateField(String caption); MultiformatDateField( ValueChangeListener<...
@Test public void testGetCurrentView_empty() { setUpApplicationLayout(); Component currentView = applicationLayout.getCurrentView(); assertThat(currentView, is(instanceOf(EmptyView.class))); }
protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
@Test public void testGetCurrentView() { setUpApplicationLayout(); View view = mock(View.class, withSettings().extraInterfaces(Component.class).defaultAnswer(Mockito.CALLS_REAL_METHODS)); applicationLayout.showView(view); Component currentView = applicationLayout.getCurrentView(); assertThat(currentView, is(view)); }
protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { protected <T extends View & Component> T getCurrentView() { @SuppressWarnings("unchecked") T view = (T)mainArea; return view; } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
@Test public void testShowView() { setUpApplicationLayout(); assertThat(applicationLayout.getComponentCount(), is(3)); assertThat(applicationLayout.getComponent(1), is(instanceOf(EmptyView.class))); View view = mock(View.class, withSettings().extraInterfaces(Component.class).defaultAnswer(Mockito.CALLS_REAL_METHODS)); ...
@Override public void showView(View view) { setMainArea(view.getViewComponent()); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
@Test public void testShowView_NotAComponent() { setUpApplicationLayout(); assertThat(applicationLayout.getComponentCount(), is(3)); assertThat(applicationLayout.getComponent(1), is(instanceOf(EmptyView.class))); View view = mock(View.class, withSettings().defaultAnswer(Mockito.CALLS_REAL_METHODS)); Assertions.assertTh...
@Override public void showView(View view) { setMainArea(view.getViewComponent()); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
@Test public void testShowView_WithViewComponent() { setUpApplicationLayout(); assertThat(applicationLayout.getComponentCount(), is(3)); assertThat(applicationLayout.getComponent(1), is(instanceOf(EmptyView.class))); View view = mock(View.class); Component component = mock(Component.class); when(view.getViewComponent()...
@Override public void showView(View view) { setMainArea(view.getViewComponent()); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
@Test public void testShowView_NoFooter() { applicationLayout = new ApplicationLayout(header, null); assertThat(applicationLayout.getComponentCount(), is(2)); assertThat(applicationLayout.getComponent(1), is(instanceOf(EmptyView.class))); View view = mock(View.class, withSettings().extraInterfaces(Component.class).defa...
@Override public void showView(View view) { setMainArea(view.getViewComponent()); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
ApplicationLayout extends VerticalLayout implements ViewDisplay { @Override public void showView(View view) { setMainArea(view.getViewComponent()); } ApplicationLayout(ApplicationHeader header, @CheckForNull ApplicationFooter footer); @Override void showView(View view); }
@Test public void testInit() { initUi(); assertThat(UI.getCurrent().getContent(), is(linkkiUi.getApplicationLayout())); }
@Override protected void init(VaadinRequest request) { requireNonNull(applicationConfig, "configure must be called before executing any initialization to set an ApplicationConfig"); ApplicationLayout applicationLayout = applicationConfig.createApplicationLayout(); setContent(applicationLayout); configureNavigator(appli...
LinkkiUi extends UI { @Override protected void init(VaadinRequest request) { requireNonNull(applicationConfig, "configure must be called before executing any initialization to set an ApplicationConfig"); ApplicationLayout applicationLayout = applicationConfig.createApplicationLayout(); setContent(applicationLayout); co...
LinkkiUi extends UI { @Override protected void init(VaadinRequest request) { requireNonNull(applicationConfig, "configure must be called before executing any initialization to set an ApplicationConfig"); ApplicationLayout applicationLayout = applicationConfig.createApplicationLayout(); setContent(applicationLayout); co...
LinkkiUi extends UI { @Override protected void init(VaadinRequest request) { requireNonNull(applicationConfig, "configure must be called before executing any initialization to set an ApplicationConfig"); ApplicationLayout applicationLayout = applicationConfig.createApplicationLayout(); setContent(applicationLayout); co...
LinkkiUi extends UI { @Override protected void init(VaadinRequest request) { requireNonNull(applicationConfig, "configure must be called before executing any initialization to set an ApplicationConfig"); ApplicationLayout applicationLayout = applicationConfig.createApplicationLayout(); setContent(applicationLayout); co...
@Test public void testLayoutInitializedWithCorrectLocale() { linkkiUi.setLocale(Locale.CANADA); initUi(); String menuItem = ((ApplicationMenu)((ApplicationHeader)linkkiUi.getApplicationLayout().getComponent(0)) .getComponent(0)).getItems().get(0).getText(); assertThat(menuItem, is(Locale.CANADA.getDisplayCountry())); }
public ApplicationLayout getApplicationLayout() { return (ApplicationLayout)getContent(); }
LinkkiUi extends UI { public ApplicationLayout getApplicationLayout() { return (ApplicationLayout)getContent(); } }
LinkkiUi extends UI { public ApplicationLayout getApplicationLayout() { return (ApplicationLayout)getContent(); } @SuppressFBWarnings(value = "NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR", justification = "applicationConfig/Layout will be non-null once configure was called") protected LinkkiUi(); @SuppressFBWarnin...
LinkkiUi extends UI { public ApplicationLayout getApplicationLayout() { return (ApplicationLayout)getContent(); } @SuppressFBWarnings(value = "NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR", justification = "applicationConfig/Layout will be non-null once configure was called") protected LinkkiUi(); @SuppressFBWarnin...
LinkkiUi extends UI { public ApplicationLayout getApplicationLayout() { return (ApplicationLayout)getContent(); } @SuppressFBWarnings(value = "NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR", justification = "applicationConfig/Layout will be non-null once configure was called") protected LinkkiUi(); @SuppressFBWarnin...
@Test public void testGetPattern() { assertThat(DateFormats.getPattern(GERMAN), is(DateFormats.PATTERN_DE)); assertThat(DateFormats.getPattern(GERMANY), is(DateFormats.PATTERN_DE)); assertThat(DateFormats.getPattern(AUSTRIA), is(DateFormats.PATTERN_DE)); assertThat(DateFormats.getPattern(ENGLISH), is(not(nullValue())))...
public static String getPattern(Locale locale) { requireNonNull(locale, "locale must not be null"); String registeredPattern = LANGUAGE_PATTERNS.get(locale.getLanguage()); if (registeredPattern != null) { return registeredPattern; } else { return defaultLocalePattern(locale); } }
DateFormats { public static String getPattern(Locale locale) { requireNonNull(locale, "locale must not be null"); String registeredPattern = LANGUAGE_PATTERNS.get(locale.getLanguage()); if (registeredPattern != null) { return registeredPattern; } else { return defaultLocalePattern(locale); } } }
DateFormats { public static String getPattern(Locale locale) { requireNonNull(locale, "locale must not be null"); String registeredPattern = LANGUAGE_PATTERNS.get(locale.getLanguage()); if (registeredPattern != null) { return registeredPattern; } else { return defaultLocalePattern(locale); } } private DateFormats(); }
DateFormats { public static String getPattern(Locale locale) { requireNonNull(locale, "locale must not be null"); String registeredPattern = LANGUAGE_PATTERNS.get(locale.getLanguage()); if (registeredPattern != null) { return registeredPattern; } else { return defaultLocalePattern(locale); } } private DateFormats(); s...
DateFormats { public static String getPattern(Locale locale) { requireNonNull(locale, "locale must not be null"); String registeredPattern = LANGUAGE_PATTERNS.get(locale.getLanguage()); if (registeredPattern != null) { return registeredPattern; } else { return defaultLocalePattern(locale); } } private DateFormats(); s...
@Test public void testUnselect_checkVisibilitySetToFalse() { HorizontalLayout content = new HorizontalLayout(); SidebarSheet sheet = createSideBarSheet(content); sheet.unselect(); assertThat(content.isVisible(), is(false)); }
protected void unselect() { getButton().removeStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); getContent().setVisible(false); }
SidebarSheet { protected void unselect() { getButton().removeStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); getContent().setVisible(false); } }
SidebarSheet { protected void unselect() { getButton().removeStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); getContent().setVisible(false); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, Strin...
SidebarSheet { protected void unselect() { getButton().removeStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); getContent().setVisible(false); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, Strin...
SidebarSheet { protected void unselect() { getButton().removeStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); getContent().setVisible(false); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, Strin...
@Test public void testSelect_checkVisibilitySetToTrue() { HorizontalLayout content = new HorizontalLayout(); SidebarSheet sheet = createSideBarSheet(content); sheet.select(); assertThat(content.isVisible(), is(true)); }
protected void select() { uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); }
SidebarSheet { protected void select() { uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); } }
SidebarSheet { protected void select() { uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
SidebarSheet { protected void select() { uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
SidebarSheet { protected void select() { uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
@Test public void testSelect_CheckObserver() { HorizontalLayout content = new HorizontalLayout(); SidebarSheet sidebarSheet = new SidebarSheet(VaadinIcons.STAR_HALF_LEFT, "Test SidebarSheet", content, () -> triggered = true); sidebarSheet.select(); assertThat(triggered, is(true)); }
protected void select() { uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); }
SidebarSheet { protected void select() { uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); } }
SidebarSheet { protected void select() { uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
SidebarSheet { protected void select() { uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
SidebarSheet { protected void select() { uiUpdateObserver.ifPresent(UiUpdateObserver::uiUpdated); getContent().setVisible(true); getButton().addStyleName(LinkkiApplicationTheme.SIDEBAR_SELECTED); } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Com...
@Test public void testToString() { SidebarSheet sheet = new SidebarSheet(VaadinIcons.ADJUST, "Foo", new TextField()); assertThat(sheet.toString(), is("Foo")); }
@Override public String toString() { return name; }
SidebarSheet { @Override public String toString() { return name; } }
SidebarSheet { @Override public String toString() { return name; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Res...
SidebarSheet { @Override public String toString() { return name; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Res...
SidebarSheet { @Override public String toString() { return name; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Res...
@Test public void testGetId_DerivedByName() { SidebarSheet sidebarSheet = new SidebarSheet(VaadinIcons.STAR_HALF_LEFT, "Test SidebarSheet", new HorizontalLayout()); assertThat(sidebarSheet.getId(), is("Test SidebarSheet")); }
public String getId() { return id; }
SidebarSheet { public String getId() { return id; } }
SidebarSheet { public String getId() { return id; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Resource icon, Str...
SidebarSheet { public String getId() { return id; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Resource icon, Str...
SidebarSheet { public String getId() { return id; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Resource icon, Str...
@Test public void testGetId() { SidebarSheet sidebarSheet = new SidebarSheet("sheet1", VaadinIcons.STAR_HALF_LEFT, "Test SidebarSheet", new HorizontalLayout()); assertThat(sidebarSheet.getId(), is("sheet1")); }
public String getId() { return id; }
SidebarSheet { public String getId() { return id; } }
SidebarSheet { public String getId() { return id; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Resource icon, Str...
SidebarSheet { public String getId() { return id; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Resource icon, Str...
SidebarSheet { public String getId() { return id; } @Deprecated SidebarSheet(Resource icon, Component content, String tooltip); SidebarSheet(Resource icon, String name, Component content); SidebarSheet(Resource icon, String name, Component content, UiUpdateObserver uiUpdateObserver); SidebarSheet(Resource icon, Str...
@Test public void testSelect_NotRegistered() { SidebarLayout sidebarLayout = new SidebarLayout(); SidebarSheet sheet1 = new SidebarSheet(ANY_ICON, ANY_STRING, createNewContent()); Assertions.assertThrows(IllegalArgumentException.class, () -> { sidebarLayout.select(sheet1); }); }
public void select(String id) { getSidebarSheet(id).ifPresent(this::select); }
SidebarLayout extends CssLayout { public void select(String id) { getSidebarSheet(id).ifPresent(this::select); } }
SidebarLayout extends CssLayout { public void select(String id) { getSidebarSheet(id).ifPresent(this::select); } SidebarLayout(); }
SidebarLayout extends CssLayout { public void select(String id) { getSidebarSheet(id).ifPresent(this::select); } SidebarLayout(); void addSheets(Stream<SidebarSheet> sheets); void addSheets(Iterable<SidebarSheet> sheets); void addSheets(@NonNull SidebarSheet... sheets); void addSheet(SidebarSheet sheet); Registration a...
SidebarLayout extends CssLayout { public void select(String id) { getSidebarSheet(id).ifPresent(this::select); } SidebarLayout(); void addSheets(Stream<SidebarSheet> sheets); void addSheets(Iterable<SidebarSheet> sheets); void addSheets(@NonNull SidebarSheet... sheets); void addSheet(SidebarSheet sheet); Registration a...
@Test public void testBuilder_CancelCaption_NoCancelButton() { OkCancelDialog dialog = OkCancelDialog.builder("") .buttonOption(ButtonOption.OK_ONLY) .cancelCaption("cancel it") .build(); OkCancelDialog dialog2 = OkCancelDialog.builder("") .cancelCaption("cancel it") .buttonOption(ButtonOption.OK_ONLY) .build(); assert...
public static Builder builder(String caption) { return new Builder(caption); }
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } }
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
@Test public void testSetContent() { OkCancelDialog dialog = OkCancelDialog.builder("").build(); assertThat(DialogTestUtil.getContents(dialog).size(), is(0)); dialog.setContent(new Label()); assertThat(DialogTestUtil.getContents(dialog), hasSize(1)); assertThat(dialog, is(showingEnabledOkButton())); }
@SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override public void setContent(@CheckForNull Component content) { if (mainArea == null) { super.setContent(content); } else { mainArea.removeAllComponents(); mainArea.addComponent(content); } }
OkCancelDialog extends Window { @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override public void setContent(@CheckForNull Component content) { if (mainArea == null) { super.setContent(content); } else { mainArea.removeAllComponents(); mainArea.addComponen...
OkCancelDialog extends Window { @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override public void setContent(@CheckForNull Component content) { if (mainArea == null) { super.setContent(content); } else { mainArea.removeAllComponents(); mainArea.addComponen...
OkCancelDialog extends Window { @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override public void setContent(@CheckForNull Component content) { if (mainArea == null) { super.setContent(content); } else { mainArea.removeAllComponents(); mainArea.addComponen...
OkCancelDialog extends Window { @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification = "yeah, we know...") @Override public void setContent(@CheckForNull Component content) { if (mainArea == null) { super.setContent(content); } else { mainArea.removeAllComponents(); mainArea.addComponen...
@Test public void testOk() { Handler okHandler = mock(Handler.class); Handler cancelHandler = mock(Handler.class); OkCancelDialog dialog = OkCancelDialog.builder("") .okHandler(okHandler) .cancelHandler(cancelHandler) .build(); dialog.open(); assertThat(UI.getCurrent().getWindows(), hasSize(1)); DialogTestUtil.clickOkB...
protected void ok() { okHandler.apply(); }
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } }
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Deprecated OkCancelDialog(String caption, ...
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Deprecated OkCancelDialog(String caption, ...
OkCancelDialog extends Window { protected void ok() { okHandler.apply(); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Deprecated OkCancelDialog(String caption, ...
@Test public void testRegister() { String customPattern = "yyMMdd"; DateFormats.register("foobar", customPattern); assertThat(DateFormats.getPattern(new Locale("foobar")), is(customPattern)); }
public static void register(String languageCode, String pattern) { LANGUAGE_PATTERNS.put(languageCode, pattern); }
DateFormats { public static void register(String languageCode, String pattern) { LANGUAGE_PATTERNS.put(languageCode, pattern); } }
DateFormats { public static void register(String languageCode, String pattern) { LANGUAGE_PATTERNS.put(languageCode, pattern); } private DateFormats(); }
DateFormats { public static void register(String languageCode, String pattern) { LANGUAGE_PATTERNS.put(languageCode, pattern); } private DateFormats(); static void register(String languageCode, String pattern); static String getPattern(Locale locale); }
DateFormats { public static void register(String languageCode, String pattern) { LANGUAGE_PATTERNS.put(languageCode, pattern); } private DateFormats(); static void register(String languageCode, String pattern); static String getPattern(Locale locale); static final String PATTERN_ISO; static final String PATTERN_DE; }
@Test public void testSetOkCaption() { OkCancelDialog dialog = OkCancelDialog.builder("").build(); dialog.setOkCaption("confirm it"); assertThat(dialog.getOkCaption(), is("confirm it")); assertThat(DialogTestUtil.getButtons(dialog).get(0).getCaption(), is("confirm it")); }
public void setOkCaption(String okCaption) { okButton.setCaption(requireNonNull(okCaption, "okCaption must not be null")); }
OkCancelDialog extends Window { public void setOkCaption(String okCaption) { okButton.setCaption(requireNonNull(okCaption, "okCaption must not be null")); } }
OkCancelDialog extends Window { public void setOkCaption(String okCaption) { okButton.setCaption(requireNonNull(okCaption, "okCaption must not be null")); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprec...
OkCancelDialog extends Window { public void setOkCaption(String okCaption) { okButton.setCaption(requireNonNull(okCaption, "okCaption must not be null")); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprec...
OkCancelDialog extends Window { public void setOkCaption(String okCaption) { okButton.setCaption(requireNonNull(okCaption, "okCaption must not be null")); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprec...
@Test public void testSetCancelCaption() { OkCancelDialog dialog = OkCancelDialog.builder("").build(); dialog.setCancelCaption("cancel it"); assertThat(dialog.getCancelCaption(), is("cancel it")); assertThat(DialogTestUtil.getButtons(dialog).get(1).getCaption(), is("cancel it")); }
public void setCancelCaption(String cancelCaption) { if (cancelButton != null) { cancelButton.setCaption(requireNonNull(cancelCaption, "cancelCaption must not be null")); } else { throw new IllegalStateException("Dialog does not have a cancel button"); } }
OkCancelDialog extends Window { public void setCancelCaption(String cancelCaption) { if (cancelButton != null) { cancelButton.setCaption(requireNonNull(cancelCaption, "cancelCaption must not be null")); } else { throw new IllegalStateException("Dialog does not have a cancel button"); } } }
OkCancelDialog extends Window { public void setCancelCaption(String cancelCaption) { if (cancelButton != null) { cancelButton.setCaption(requireNonNull(cancelCaption, "cancelCaption must not be null")); } else { throw new IllegalStateException("Dialog does not have a cancel button"); } } protected OkCancelDialog(Strin...
OkCancelDialog extends Window { public void setCancelCaption(String cancelCaption) { if (cancelButton != null) { cancelButton.setCaption(requireNonNull(cancelCaption, "cancelCaption must not be null")); } else { throw new IllegalStateException("Dialog does not have a cancel button"); } } protected OkCancelDialog(Strin...
OkCancelDialog extends Window { public void setCancelCaption(String cancelCaption) { if (cancelButton != null) { cancelButton.setCaption(requireNonNull(cancelCaption, "cancelCaption must not be null")); } else { throw new IllegalStateException("Dialog does not have a cancel button"); } } protected OkCancelDialog(Strin...
@Test public void testContent() { Label content1 = new Label("1"); Label content2 = new Label("2"); OkCancelDialog dialog = OkCancelDialog.builder("caption") .content(content1, content2) .build(); assertThat(DialogTestUtil.getContents(dialog), contains(content1, content2)); }
public static Builder builder(String caption) { return new Builder(caption); }
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } }
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
@Test public void testButtonOption() { OkCancelDialog dialog = OkCancelDialog.builder("").buttonOption(ButtonOption.OK_ONLY).build(); assertThat(DialogTestUtil.getButtons(dialog), hasSize(1)); }
public static Builder builder(String caption) { return new Builder(caption); }
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } }
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
OkCancelDialog extends Window { public static Builder builder(String caption) { return new Builder(caption); } protected OkCancelDialog(String caption, Handler okHandler, Handler cancelHandler, ButtonOption buttonOption, Component... contentComponents); @Deprecated OkCancelDialog(String caption); @Depreca...
@Test public void testNewOkCancelDialog_CreationOfDialog() { Handler okHandler = mock(Handler.class); Handler cancelHandler = mock(Handler.class); OkCancelDialog dialog = new PmoBasedDialogFactory() .newOkCancelDialog("test", okHandler, cancelHandler, ButtonOption.OK_CANCEL, new TestPmo()); assertThat(dialog.getCaption...
@Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); }
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } }
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
@Test public void testNewOkCancelDialog_CreationOfDialog_NoPmo() { OkCancelDialog dialog = new PmoBasedDialogFactory() .newOkCancelDialog("test", Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_CANCEL); assertThat(DialogTestUtil.getContents(dialog), hasSize(0)); }
@Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); }
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } }
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
@Test public void testNewOkCancelDialog_CreationOfDialog_MultiplePmo() { OkCancelDialog dialog = new PmoBasedDialogFactory() .newOkCancelDialog("test", Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_CANCEL, new TestPmo(), new TestPmo()); assertThat(DialogTestUtil.getContents(dialog), hasSize(2)); }
@Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); }
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } }
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
@Test public void testNewOkCancelDialog_ValidationService() { MessageList ml = new MessageList(); ValidationService validationService = mock(ValidationService.class); when(validationService.getValidationMessages()).thenReturn(ml); PmoBasedDialogFactory pmoBasedDialogFactory = new PmoBasedDialogFactory(validationService...
@Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); }
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } }
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
@Test public void testNewOkCancelDialog_PropertyBehaviorProvider() { PmoBasedDialogFactory dialogFactoryWithoutBehavior = new PmoBasedDialogFactory( ValidationService.NOP_VALIDATION_SERVICE, PropertyBehaviorProvider.NO_BEHAVIOR_PROVIDER); OkCancelDialog dialog = dialogFactoryWithoutBehavior.newOkCancelDialog("test", Ha...
@Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); }
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } }
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
PmoBasedDialogFactory { @Deprecated public OkCancelDialog newOkCancelDialog(String title, Object pmo, Handler okHandler) { return newOkCancelDialog(title, okHandler, pmo); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior... propertyBehavior)...
@Test public void testNewOkDialog() { OkCancelDialog dialog = new PmoBasedDialogFactory().newOkDialog("title", new TestPmo()); List<AbstractField<?>> fields = getAllFields(dialog); assertThat(fields, hasSize(1)); assertThat(fields.get(0), is(instanceOf(TextField.class))); assertThat(dialog.getCaption(), is("title")); }
public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); }
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } }
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior...
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior...
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior...
@Test public void testGetIfPresent() { LazyInitializingMap<String, Object> lazyInitializingMap = new LazyInitializingMap<>(initializer); Object value = lazyInitializingMap.getIfPresent("string"); assertNull(value); }
@CheckForNull public V getIfPresent(K key) { return internalMap.get(key); }
LazyInitializingMap { @CheckForNull public V getIfPresent(K key) { return internalMap.get(key); } }
LazyInitializingMap { @CheckForNull public V getIfPresent(K key) { return internalMap.get(key); } LazyInitializingMap(Function<K, V> initializer); }
LazyInitializingMap { @CheckForNull public V getIfPresent(K key) { return internalMap.get(key); } LazyInitializingMap(Function<K, V> initializer); V get(K key); @CheckForNull V getIfPresent(K key); void clear(); @CheckForNull V remove(K key); }
LazyInitializingMap { @CheckForNull public V getIfPresent(K key) { return internalMap.get(key); } LazyInitializingMap(Function<K, V> initializer); V get(K key); @CheckForNull V getIfPresent(K key); void clear(); @CheckForNull V remove(K key); }
@Test public void testNewOkDialog_noPmo() { OkCancelDialog dialog = new PmoBasedDialogFactory().newOkDialog("title"); assertThat(getAllFields(dialog), hasSize(0)); }
public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); }
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } }
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior...
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior...
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior...
@Test public void testNewOkDialog_MultiplePmos() { OkCancelDialog dialog = new PmoBasedDialogFactory().newOkDialog("title", new TestPmo(), new TestPmo()); List<AbstractField<?>> fields = getAllFields(dialog); assertThat(fields, hasSize(2)); fields.forEach(f -> assertThat(f, is(instanceOf(TextField.class)))); assertThat...
public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); }
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } }
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior...
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior...
PmoBasedDialogFactory { public OkCancelDialog newOkDialog(String title, Object... pmos) { return newOkCancelDialog(title, Handler.NOP_HANDLER, Handler.NOP_HANDLER, ButtonOption.OK_ONLY, pmos); } PmoBasedDialogFactory(); PmoBasedDialogFactory(ValidationService validationService); PmoBasedDialogFactory(PropertyBehavior...
@Test public void testNewDateField_BelowRange() { DateField dateField = ComponentFactory.newDateField(); dateField.setDateOutOfRangeMessage(MESSAGE); assertThrows(IllegalArgumentException.class, () -> dateField.setValue(LocalDate.of(-1, 1, 1))); }
public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); @Deprecated static Label addHorizontalSpacer(AbstractLayout...
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); @Deprecated static Label addHorizontalSpacer(AbstractLayout...
@Test public void testNewDateField_InRangeLowerBound() { DateField dateField = ComponentFactory.newDateField(); dateField.setDateOutOfRangeMessage(MESSAGE); dateField.setValue(LocalDate.of(1, 1, 1)); assertThat(dateField.getErrorMessage(), is(nullValue())); }
public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); @Deprecated static Label addHorizontalSpacer(AbstractLayout...
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); @Deprecated static Label addHorizontalSpacer(AbstractLayout...
@Test public void testNewDateField_InRangeUpperBound() { DateField dateField = ComponentFactory.newDateField(); dateField.setDateOutOfRangeMessage(MESSAGE); dateField.setValue(LocalDate.of(9999, 12, 31)); assertThat(dateField.getErrorMessage(), is(nullValue())); }
public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); @Deprecated static Label addHorizontalSpacer(AbstractLayout...
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); @Deprecated static Label addHorizontalSpacer(AbstractLayout...
@Test public void testNewDateField_AboveRange() { DateField dateField = ComponentFactory.newDateField(); dateField.setDateOutOfRangeMessage(MESSAGE); assertThrows(IllegalArgumentException.class, () -> dateField.setValue(LocalDate.of(10000, 1, 1))); }
public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); }
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); @Deprecated static Label addHorizontalSpacer(AbstractLayout...
ComponentFactory { public static DateField newDateField() { MultiformatDateField field = new MultiformatDateField(); field.setRangeStart(LocalDate.ofYearDay(1, 1)); field.setRangeEnd(LocalDate.ofYearDay(9999, 365)); return field; } private ComponentFactory(); @Deprecated static Label addHorizontalSpacer(AbstractLayout...
@Test public void testHeader_AddHeaderButton() { TestSection section = new TestSection("", false); HorizontalLayout header = section.getHeader(); Label captionLabel = (Label)header.getComponent(0); assertThat(header.isVisible(), is(false)); assertThat(captionLabel.isVisible(), is(false)); Button button = ComponentFacto...
public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); }
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } }
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
@Test public void testSetCaption() { TestSection section = new TestSection("CAP", false); HorizontalLayout header = section.getHeader(); Label captionLabel = (Label)header.getComponent(0); assertThat(header.isVisible(), is(true)); assertThat(captionLabel.isVisible(), is(true)); assertThat(captionLabel.getValue(), is("C...
@Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); }
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } }
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
@Test public void testSetCaption_Null() { TestSection section = new TestSection("CAP", false); HorizontalLayout header = section.getHeader(); Label captionLabel = (Label)header.getComponent(0); assertThat(header.isVisible(), is(true)); assertThat(captionLabel.isVisible(), is(true)); assertThat(captionLabel.getValue(), ...
@Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); }
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } }
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
@Test public void testSetCaption_Empty() { TestSection section = new TestSection("CAP", false); HorizontalLayout header = section.getHeader(); Label captionLabel = (Label)header.getComponent(0); assertThat(header.isVisible(), is(true)); assertThat(captionLabel.isVisible(), is(true)); assertThat(captionLabel.getValue(),...
@Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); }
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } }
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { @Override public void setCaption(@CheckForNull String caption) { captionLabel.setValue(caption); captionLabel.setVisible(!StringUtils.isEmpty(caption)); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
@Test public void testGet_null() { LazyInitializingMap<String, Object> lazyInitializingMap = new LazyInitializingMap<>(initializer); Assertions.assertThrows(NullPointerException.class, () -> { lazyInitializingMap.get(null); }); }
public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); V get(K key); @CheckForNull V getIfPresen...
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); V get(K key); @CheckForNull V getIfPresen...
@Test public void testAddHeaderButton() { TestSection section = new TestSection("CAP", true); HorizontalLayout header = section.getHeader(); assertThat(header.getComponentCount(), is(3)); assertThat(header.isVisible(), is(true)); Button button1 = new Button(); section.addHeaderButton(button1); assertThat(header.getComp...
public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); }
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } }
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
@Test public void testHeaderButton_Style() { TestSection section = new TestSection("CAP", true); Button button1 = new Button(); section.addHeaderButton(button1); assertThat(button1.getStyleName(), containsString(LinkkiTheme.BUTTON_TEXT)); }
public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); }
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } }
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
AbstractSection extends VerticalLayout { public void addHeaderButton(Button button) { button.addStyleName(LinkkiTheme.BUTTON_TEXT); headerComponents.add(button); header.addComponent(button, 1); updateHeader(); } AbstractSection(@CheckForNull String caption); AbstractSection(@CheckForNull String caption, boolean closea...
@Test public void testAddTab_RefreshesFirstTabPage() { TabSheetArea tabSheetArea = new TestArea(); Page tabPage1 = mock(Page.class); Page tabPage2 = mock(Page.class); verify(tabPage1, times(0)).reloadBindings(); verify(tabPage2, times(0)).reloadBindings(); tabSheetArea.addTab(tabPage1, "1"); tabSheetArea.addTab(tabPage...
@Override public void reloadBindings() { Component selectedTab = getSelectedTab(); if (selectedTab != null && selectedTab instanceof Page) { ((Page)selectedTab).reloadBindings(); } }
TabSheetArea extends TabSheet implements Area { @Override public void reloadBindings() { Component selectedTab = getSelectedTab(); if (selectedTab != null && selectedTab instanceof Page) { ((Page)selectedTab).reloadBindings(); } } }
TabSheetArea extends TabSheet implements Area { @Override public void reloadBindings() { Component selectedTab = getSelectedTab(); if (selectedTab != null && selectedTab instanceof Page) { ((Page)selectedTab).reloadBindings(); } } TabSheetArea(); TabSheetArea(boolean preserveHeader); }
TabSheetArea extends TabSheet implements Area { @Override public void reloadBindings() { Component selectedTab = getSelectedTab(); if (selectedTab != null && selectedTab instanceof Page) { ((Page)selectedTab).reloadBindings(); } } TabSheetArea(); TabSheetArea(boolean preserveHeader); @PostConstruct final void init(); ...
TabSheetArea extends TabSheet implements Area { @Override public void reloadBindings() { Component selectedTab = getSelectedTab(); if (selectedTab != null && selectedTab instanceof Page) { ((Page)selectedTab).reloadBindings(); } } TabSheetArea(); TabSheetArea(boolean preserveHeader); @PostConstruct final void init(); ...
@Test public void testTabSelectionRefreshesPage() { TabSheetArea tabSheetArea = new TestArea(); Page tabPage1 = mock(Page.class); Page tabPage2 = mock(Page.class); tabSheetArea.addTab(tabPage1, "1"); tabSheetArea.addTab(tabPage2, "2"); verify(tabPage2, times(0)).reloadBindings(); tabSheetArea.setSelectedTab(1); verify(...
@Override public void reloadBindings() { Component selectedTab = getSelectedTab(); if (selectedTab != null && selectedTab instanceof Page) { ((Page)selectedTab).reloadBindings(); } }
TabSheetArea extends TabSheet implements Area { @Override public void reloadBindings() { Component selectedTab = getSelectedTab(); if (selectedTab != null && selectedTab instanceof Page) { ((Page)selectedTab).reloadBindings(); } } }
TabSheetArea extends TabSheet implements Area { @Override public void reloadBindings() { Component selectedTab = getSelectedTab(); if (selectedTab != null && selectedTab instanceof Page) { ((Page)selectedTab).reloadBindings(); } } TabSheetArea(); TabSheetArea(boolean preserveHeader); }
TabSheetArea extends TabSheet implements Area { @Override public void reloadBindings() { Component selectedTab = getSelectedTab(); if (selectedTab != null && selectedTab instanceof Page) { ((Page)selectedTab).reloadBindings(); } } TabSheetArea(); TabSheetArea(boolean preserveHeader); @PostConstruct final void init(); ...
TabSheetArea extends TabSheet implements Area { @Override public void reloadBindings() { Component selectedTab = getSelectedTab(); if (selectedTab != null && selectedTab instanceof Page) { ((Page)selectedTab).reloadBindings(); } } TabSheetArea(); TabSheetArea(boolean preserveHeader); @PostConstruct final void init(); ...
@Test public void testGetTabs() { Page tabPage1 = mock(Page.class); Page tabPage2 = mock(Page.class); TabSheetArea tabSheetArea = new TestArea(); assertThat(tabSheetArea.getTabs(), is(empty())); tabSheetArea.addTab(tabPage1, "1"); tabSheetArea.addTab(tabPage2, "2"); assertThat(tabSheetArea.getTabs(), contains(tabPage1,...
protected List<Page> getTabs() { return StreamUtil.stream(this) .filter(c -> c instanceof Page) .map(c -> (Page)c) .collect(Collectors.toList()); }
TabSheetArea extends TabSheet implements Area { protected List<Page> getTabs() { return StreamUtil.stream(this) .filter(c -> c instanceof Page) .map(c -> (Page)c) .collect(Collectors.toList()); } }
TabSheetArea extends TabSheet implements Area { protected List<Page> getTabs() { return StreamUtil.stream(this) .filter(c -> c instanceof Page) .map(c -> (Page)c) .collect(Collectors.toList()); } TabSheetArea(); TabSheetArea(boolean preserveHeader); }
TabSheetArea extends TabSheet implements Area { protected List<Page> getTabs() { return StreamUtil.stream(this) .filter(c -> c instanceof Page) .map(c -> (Page)c) .collect(Collectors.toList()); } TabSheetArea(); TabSheetArea(boolean preserveHeader); @PostConstruct final void init(); @Deprecated TabSheet getTabSheet();...
TabSheetArea extends TabSheet implements Area { protected List<Page> getTabs() { return StreamUtil.stream(this) .filter(c -> c instanceof Page) .map(c -> (Page)c) .collect(Collectors.toList()); } TabSheetArea(); TabSheetArea(boolean preserveHeader); @PostConstruct final void init(); @Deprecated TabSheet getTabSheet();...
@Test public void testFindConverter_Default() { LinkkiConverterRegistry linkkiConverterRegistry = new LinkkiConverterRegistry(); assertThat(linkkiConverterRegistry.findConverter(String.class, Date.class), is(instanceOf(StringToDateConverter.class))); }
@SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, rawModelType)) { return (Converter<P, M>)Converter....
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
@Test public void testFindConverter_NotFound() { Assertions.assertThrows(IllegalArgumentException.class, () -> { new LinkkiConverterRegistry().findConverter(String.class, java.time.LocalDate.class); }); }
@SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, rawModelType)) { return (Converter<P, M>)Converter....
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
@Test public void testFindConverter_overrideDefault() { LinkkiConverterRegistry linkkiConverterRegistry = new LinkkiConverterRegistry(new MyStringToDateConverter()); assertThat(linkkiConverterRegistry.findConverter(String.class, Date.class), is(instanceOf(MyStringToDateConverter.class))); }
@SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, rawModelType)) { return (Converter<P, M>)Converter....
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
LinkkiConverterRegistry implements Serializable { @SuppressWarnings("unchecked") public <P, M> Converter<P, M> findConverter(Type presentationType, Type modelType) { Class<?> rawPresentationType = getRawType(presentationType); Class<?> rawModelType = getRawType(modelType); if (isIdentityNecessary(rawPresentationType, r...
@Test public void testConvertToModel() { FormattedDoubleToStringConverter converter = new FormattedDoubleToStringConverter("0.00"); ValueContext context = new ValueContext(Locale.GERMAN); assertThat(converter.convertToModel("1,23", context).getOrThrow(s -> new AssertionError(s)), is(1.23)); }
@Override protected Double convertToModel(Number value) { return value.doubleValue(); }
FormattedDoubleToStringConverter extends FormattedNumberToStringConverter<Double> { @Override protected Double convertToModel(Number value) { return value.doubleValue(); } }
FormattedDoubleToStringConverter extends FormattedNumberToStringConverter<Double> { @Override protected Double convertToModel(Number value) { return value.doubleValue(); } FormattedDoubleToStringConverter(String format); }
FormattedDoubleToStringConverter extends FormattedNumberToStringConverter<Double> { @Override protected Double convertToModel(Number value) { return value.doubleValue(); } FormattedDoubleToStringConverter(String format); }
FormattedDoubleToStringConverter extends FormattedNumberToStringConverter<Double> { @Override protected Double convertToModel(Number value) { return value.doubleValue(); } FormattedDoubleToStringConverter(String format); }
@Test public void testConvertToModel_Null() { FormattedDoubleToStringConverter converter = new FormattedDoubleToStringConverter("0.00"); ValueContext context = new ValueContext(Locale.GERMAN); assertThat(converter.convertToModel("", context).getOrThrow(s -> new AssertionError(s)), is(nullValue())); }
@Override protected Double convertToModel(Number value) { return value.doubleValue(); }
FormattedDoubleToStringConverter extends FormattedNumberToStringConverter<Double> { @Override protected Double convertToModel(Number value) { return value.doubleValue(); } }
FormattedDoubleToStringConverter extends FormattedNumberToStringConverter<Double> { @Override protected Double convertToModel(Number value) { return value.doubleValue(); } FormattedDoubleToStringConverter(String format); }
FormattedDoubleToStringConverter extends FormattedNumberToStringConverter<Double> { @Override protected Double convertToModel(Number value) { return value.doubleValue(); } FormattedDoubleToStringConverter(String format); }
FormattedDoubleToStringConverter extends FormattedNumberToStringConverter<Double> { @Override protected Double convertToModel(Number value) { return value.doubleValue(); } FormattedDoubleToStringConverter(String format); }
@Test public void testGet_initializerFunctionReturnsNull() { LazyInitializingMap<String, Object> lazyInitializingMap = new LazyInitializingMap<>( (String key) -> null); Assertions.assertThrows(NullPointerException.class, () -> { lazyInitializingMap.get("string"); }); }
public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); V get(K key); @CheckForNull V getIfPresen...
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); V get(K key); @CheckForNull V getIfPresen...
@Test public void testConvertToModel_FourDigitYear_NoConversion() { assertThat((converter.convertToModel(LocalDate.of(2039, 12, 31), context)) .getOrThrow(s -> new AssertionError(s)), is(LocalDate.of(2039, 12, 31))); }
@CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } @CheckForNull @...
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } @CheckForNull @...
@Test public void testConvertToModel_NullValue() { assertNull((converter.convertToModel(null, context)) .getOrThrow(s -> new AssertionError(s))); }
@CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } @CheckForNull @...
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } @CheckForNull @...
@Test public void testConvertToModel_MaxTwoDigitYear() { LocalDate date = LocalDate.of(39, 12, 31); assertThat((converter.convertToModel(date, context)) .getOrThrow(s -> new AssertionError(s)), is(TwoDigitYearUtil.convert(date))); }
@CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } @CheckForNull @...
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @CheckForNull @Override public Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context) { if (value == null) { return Result.ok(null); } else { return Result.ok(TwoDigitYearUtil.convert(value)); } } @CheckForNull @...
@Test public void testConvertToPresentation_FourDigitYear_NoConversion() { assertThat((converter.convertToPresentation(LocalDate.of(2011, 9, 5), context)), is(LocalDate.of(2011, 9, 5))); }
@Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } @CheckForNull @Override Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context); @Override LocalDate conver...
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } @CheckForNull @Override Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context); @Override LocalDate conver...
@Test public void testConvertToPresentation_NullValue() { assertNull(converter.convertToPresentation(null, context)); }
@Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } @CheckForNull @Override Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context); @Override LocalDate conver...
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } @CheckForNull @Override Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context); @Override LocalDate conver...
@Test public void testConvertToPresentation_ThreeDigitYear_NoConversion() { assertThat((converter.convertToPresentation(LocalDate.of(312, 5, 1), context)), is(LocalDate.of(312, 5, 1))); }
@Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } @CheckForNull @Override Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context); @Override LocalDate conver...
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } @CheckForNull @Override Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context); @Override LocalDate conver...
@Test public void testConvertToPresentation_TwoDigitYear_NoConversion() { assertThat((converter.convertToPresentation(LocalDate.of(10, 3, 21), context)), is(LocalDate.of(10, 3, 21))); }
@Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } }
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } @CheckForNull @Override Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context); @Override LocalDate conver...
TwoDigitYearLocalDateConverter implements Converter<LocalDate, LocalDate> { @Override public LocalDate convertToPresentation(LocalDate value, ValueContext context) { return value; } @CheckForNull @Override Result<LocalDate> convertToModel(@CheckForNull LocalDate value, ValueContext context); @Override LocalDate conver...
@Test public void testConvertToModel() { FormattedIntegerToStringConverter converter = new FormattedIntegerToStringConverter("#,##0"); ValueContext context = new ValueContext(Locale.GERMAN); assertThat(converter.convertToModel("1.234", context).getOrThrow(s -> new AssertionError(s)), is(1234)); }
@Override protected Integer convertToModel(Number value) { return value.intValue(); }
FormattedIntegerToStringConverter extends FormattedNumberToStringConverter<Integer> { @Override protected Integer convertToModel(Number value) { return value.intValue(); } }
FormattedIntegerToStringConverter extends FormattedNumberToStringConverter<Integer> { @Override protected Integer convertToModel(Number value) { return value.intValue(); } FormattedIntegerToStringConverter(String format); }
FormattedIntegerToStringConverter extends FormattedNumberToStringConverter<Integer> { @Override protected Integer convertToModel(Number value) { return value.intValue(); } FormattedIntegerToStringConverter(String format); }
FormattedIntegerToStringConverter extends FormattedNumberToStringConverter<Integer> { @Override protected Integer convertToModel(Number value) { return value.intValue(); } FormattedIntegerToStringConverter(String format); }
@Test public void testConvertToModel_Null() { FormattedIntegerToStringConverter converter = new FormattedIntegerToStringConverter("#,##0"); ValueContext context = new ValueContext(Locale.GERMAN); assertThat(converter.convertToModel("", context).getOrThrow(s -> new AssertionError(s)), is(nullValue())); }
@Override protected Integer convertToModel(Number value) { return value.intValue(); }
FormattedIntegerToStringConverter extends FormattedNumberToStringConverter<Integer> { @Override protected Integer convertToModel(Number value) { return value.intValue(); } }
FormattedIntegerToStringConverter extends FormattedNumberToStringConverter<Integer> { @Override protected Integer convertToModel(Number value) { return value.intValue(); } FormattedIntegerToStringConverter(String format); }
FormattedIntegerToStringConverter extends FormattedNumberToStringConverter<Integer> { @Override protected Integer convertToModel(Number value) { return value.intValue(); } FormattedIntegerToStringConverter(String format); }
FormattedIntegerToStringConverter extends FormattedNumberToStringConverter<Integer> { @Override protected Integer convertToModel(Number value) { return value.intValue(); } FormattedIntegerToStringConverter(String format); }
@Test public void testSetDataProvider_HasDataProvider() { HasItemsAvailableValuesAspectDefinition hasItemsAvailableValuesAspectDefinition = new HasItemsAvailableValuesAspectDefinition( AvailableValuesType.DYNAMIC); @SuppressWarnings("unchecked") ListDataProvider<Object> dataProvider = mock(ListDataProvider.class); @Sup...
@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>)compon...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
@Test public void testGet() { LazyInitializingMap<String, Object> lazyInitializingMap = new LazyInitializingMap<>(initializer); assertNull(lazyInitializingMap.getIfPresent("string")); lazyInitializingMap.get("string"); assertNotNull(lazyInitializingMap.getIfPresent("string")); }
public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); V get(K key); @CheckForNull V getIfPresen...
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); V get(K key); @CheckForNull V getIfPresen...
@Test public void testSetDataProvider_HasFilterableDataProvider() { HasItemsAvailableValuesAspectDefinition hasItemsAvailableValuesAspectDefinition = new HasItemsAvailableValuesAspectDefinition( AvailableValuesType.DYNAMIC); @SuppressWarnings("unchecked") ListDataProvider<Object> dataProvider = mock(ListDataProvider.cl...
@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>)compon...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
@Test public void testSetDataProvider_Other() { HasItemsAvailableValuesAspectDefinition hasItemsAvailableValuesAspectDefinition = new HasItemsAvailableValuesAspectDefinition( AvailableValuesType.DYNAMIC); @SuppressWarnings("unchecked") ListDataProvider<Object> dataProvider = mock(ListDataProvider.class); Component comp...
@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>)compon...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") private static void setDataProvider(HasItems<?> component, ListDataProvider<Object> listDataProvider) { if (component instanceof HasDataProvider) { ((HasDataProvider<Object>)component).setDataPr...
@Test public void testHandleNullItems_ComboBox() { HasItemsAvailableValuesAspectDefinition hasItemsAvailableValuesAspectDefinition = new HasItemsAvailableValuesAspectDefinition( AvailableValuesType.DYNAMIC); ComboBox<TestEnum> comboBox = new ComboBox<>(); hasItemsAvailableValuesAspectDefinition.handleNullItems(new Labe...
@SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean hasNullItem = items.removeIf(i -> i == null); ((ComboBox<Object>)component).setEmptySelectionAll...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
@Test public void testHandleNullItems_NativeSelect() { HasItemsAvailableValuesAspectDefinition hasItemsAvailableValuesAspectDefinition = new HasItemsAvailableValuesAspectDefinition( AvailableValuesType.DYNAMIC); NativeSelect<TestEnum> nativeSelect = new NativeSelect<>(); hasItemsAvailableValuesAspectDefinition.handleNu...
@SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean hasNullItem = items.removeIf(i -> i == null); ((ComboBox<Object>)component).setEmptySelectionAll...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
@Test public void testHandleNullItems_Other() { HasItemsAvailableValuesAspectDefinition hasItemsAvailableValuesAspectDefinition = new HasItemsAvailableValuesAspectDefinition( AvailableValuesType.DYNAMIC); Component component = mock(HasItems.class, withSettings().extraInterfaces(Component.class)); hasItemsAvailableValue...
@SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean hasNullItem = items.removeIf(i -> i == null); ((ComboBox<Object>)component).setEmptySelectionAll...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
HasItemsAvailableValuesAspectDefinition extends AvailableValuesAspectDefinition<HasItems<?>> { @SuppressWarnings("unchecked") @Override protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { Object component = componentWrapper.getComponent(); if (component instanceof ComboBox<?>) { boolean h...
@Test public void testCreateAspect_Static() { CaptionAspectDefinition captionAspectDefinition = new CaptionAspectDefinition(CaptionType.STATIC, "foo"); Aspect<String> aspect = captionAspectDefinition.createAspect(); assertThat(aspect.getName(), is(CaptionAspectDefinition.NAME)); assertThat(aspect.getValue(), is("foo"))...
@Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, staticCaption); case NONE: return Aspect.of(NAME, null); default: thr...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
@Test public void testCreateAspect_Auto_WithValue() { CaptionAspectDefinition captionAspectDefinition = new CaptionAspectDefinition(CaptionType.AUTO, "foo"); Aspect<String> aspect = captionAspectDefinition.createAspect(); assertThat(aspect.getName(), is(CaptionAspectDefinition.NAME)); assertThat(aspect.getValue(), is("...
@Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, staticCaption); case NONE: return Aspect.of(NAME, null); default: thr...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
@Test public void testCreateAspect_Auto_WithoutValue() { CaptionAspectDefinition captionAspectDefinition = new CaptionAspectDefinition(CaptionType.AUTO, ""); Aspect<String> aspect = captionAspectDefinition.createAspect(); assertThat(aspect.getName(), is(CaptionAspectDefinition.NAME)); assertThat(aspect.isValuePresent()...
@Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, staticCaption); case NONE: return Aspect.of(NAME, null); default: thr...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
@Test public void testCreateAspect_Dynamic() { CaptionAspectDefinition captionAspectDefinition = new CaptionAspectDefinition(CaptionType.DYNAMIC, "foo"); Aspect<String> aspect = captionAspectDefinition.createAspect(); assertThat(aspect.getName(), is(CaptionAspectDefinition.NAME)); assertThat(aspect.isValuePresent(), is...
@Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, staticCaption); case NONE: return Aspect.of(NAME, null); default: thr...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
@Test public void testCreateAspect_None() { CaptionAspectDefinition captionAspectDefinition = new CaptionAspectDefinition(CaptionType.NONE, "foo"); Aspect<String> aspect = captionAspectDefinition.createAspect(); assertThat(aspect.getName(), is(CaptionAspectDefinition.NAME)); assertThat(aspect.getValue(), is(nullValue()...
@Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, staticCaption); case NONE: return Aspect.of(NAME, null); default: thr...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Aspect<String> createAspect() { switch (captionType) { case AUTO: return StringUtils.isEmpty(staticCaption) ? Aspect.of(NAME) : Aspect.of(NAME, staticCaption); case DYNAMIC: return Aspect.of(NAME); case STATIC: return Aspect.of(NAME, s...
@Test public void testGet2() { LazyInitializingMap<String, Object> lazyInitializingMap = new LazyInitializingMap<>(initializer); Object value = lazyInitializingMap.get("string"); assertEquals("stringx", value); Object value2 = lazyInitializingMap.get("string"); assertSame(value, value2); }
public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); }
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); V get(K key); @CheckForNull V getIfPresen...
LazyInitializingMap { public V get(K key) { @CheckForNull V value = internalMap.computeIfAbsent(key, initializer); if (value == null) { throw new NullPointerException("Initializer must not create a null value"); } return value; } LazyInitializingMap(Function<K, V> initializer); V get(K key); @CheckForNull V getIfPresen...
@Test public void testCreateComponentValueSetter() { CaptionAspectDefinition captionAspectDefinition = new CaptionAspectDefinition(CaptionType.DYNAMIC, "foo"); Component component = new Label(); ComponentWrapper componentWrapper = new LabelComponentWrapper(component); Consumer<String> componentValueSetter = captionAspe...
@Override public Consumer<String> createComponentValueSetter(ComponentWrapper componentWrapper) { return caption -> ((Component)componentWrapper.getComponent()).setCaption(caption); }
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Consumer<String> createComponentValueSetter(ComponentWrapper componentWrapper) { return caption -> ((Component)componentWrapper.getComponent()).setCaption(caption); } }
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Consumer<String> createComponentValueSetter(ComponentWrapper componentWrapper) { return caption -> ((Component)componentWrapper.getComponent()).setCaption(caption); } CaptionAspectDefinition(CaptionType captionType, String staticCaptio...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Consumer<String> createComponentValueSetter(ComponentWrapper componentWrapper) { return caption -> ((Component)componentWrapper.getComponent()).setCaption(caption); } CaptionAspectDefinition(CaptionType captionType, String staticCaptio...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public Consumer<String> createComponentValueSetter(ComponentWrapper componentWrapper) { return caption -> ((Component)componentWrapper.getComponent()).setCaption(caption); } CaptionAspectDefinition(CaptionType captionType, String staticCaptio...
@Test public void testCreateComponentValueSetter_NOPonTable() { CaptionAspectDefinition captionAspectDefinition = new CaptionAspectDefinition(CaptionType.DYNAMIC, "foo"); @SuppressWarnings("deprecation") com.vaadin.v7.ui.Table table = new com.vaadin.v7.ui.Table(); ComponentWrapper componentWrapper = new TableComponentW...
@Override public boolean supports(WrapperType type) { return super.supports(type) && !ColumnBasedComponentWrapper.COLUMN_BASED_TYPE.isAssignableFrom(type); }
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public boolean supports(WrapperType type) { return super.supports(type) && !ColumnBasedComponentWrapper.COLUMN_BASED_TYPE.isAssignableFrom(type); } }
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public boolean supports(WrapperType type) { return super.supports(type) && !ColumnBasedComponentWrapper.COLUMN_BASED_TYPE.isAssignableFrom(type); } CaptionAspectDefinition(CaptionType captionType, String staticCaption); }
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public boolean supports(WrapperType type) { return super.supports(type) && !ColumnBasedComponentWrapper.COLUMN_BASED_TYPE.isAssignableFrom(type); } CaptionAspectDefinition(CaptionType captionType, String staticCaption); @Override Aspect<Strin...
CaptionAspectDefinition extends ModelToUiAspectDefinition<String> { @Override public boolean supports(WrapperType type) { return super.supports(type) && !ColumnBasedComponentWrapper.COLUMN_BASED_TYPE.isAssignableFrom(type); } CaptionAspectDefinition(CaptionType captionType, String staticCaption); @Override Aspect<Strin...
@Test public void testCreateComponentValueSetter_SetsString() { Label label = new Label(); Consumer<Object> valueSetter = new LabelValueAspectDefinition() .createComponentValueSetter(new LabelComponentWrapper(label)); valueSetter.accept("foo"); assertThat(label.getValue(), is("foo")); }
@Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } @Override Aspect<Object> createAspect(); @Ov...
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } @Override Aspect<Object> createAspect(); @Ov...
@Test public void testCreateComponentValueSetter_UsesToString() { Label label = new Label(); Consumer<Object> valueSetter = new LabelValueAspectDefinition() .createComponentValueSetter(new LabelComponentWrapper(label)); valueSetter.accept(new Object() { @Override public String toString() { return "bar"; } }); assertTha...
@Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } @Override Aspect<Object> createAspect(); @Ov...
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } @Override Aspect<Object> createAspect(); @Ov...
@Test public void testCreateComponentValueSetter_UsesStandardConverter() { Label label = new Label(); Consumer<Object> valueSetter = new LabelValueAspectDefinition() .createComponentValueSetter(new LabelComponentWrapper(label)); valueSetter.accept(Integer.valueOf(123456)); assertThat(label.getValue(), is("123.456")); }
@Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } @Override Aspect<Object> createAspect(); @Ov...
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } @Override Aspect<Object> createAspect(); @Ov...
@Test public void testCreateComponentValueSetter_UsesStandardConverter_DependingOnUiLocale() { Label label = new Label(); Consumer<Object> valueSetter = new LabelValueAspectDefinition() .createComponentValueSetter(new LabelComponentWrapper(label)); UI ui = MockUi.mockUi(); when(ui.getLocale()).thenReturn(Locale.US); va...
@Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } @Override Aspect<Object> createAspect(); @Ov...
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } @Override Aspect<Object> createAspect(); @Ov...
@Test public void testCreateComponentValueSetter_UsesCustomConverter() { Label label = new Label(); Consumer<Object> valueSetter = new LabelValueAspectDefinition() .createComponentValueSetter(new LabelComponentWrapper(label)); LinkkiConverterRegistry converterRegistry = LinkkiConverterRegistry.DEFAULT .with(new Convert...
@Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } }
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } @Override Aspect<Object> createAspect(); @Ov...
LabelValueAspectDefinition extends ModelToUiAspectDefinition<Object> { @Override public Consumer<Object> createComponentValueSetter(ComponentWrapper componentWrapper) { return v -> ((Label)componentWrapper.getComponent()) .setValue(LabelValueAspectDefinition.toString(v)); } @Override Aspect<Object> createAspect(); @Ov...
@Test public void testGetAvailableValuesType() { for (AvailableValuesType type : AvailableValuesType.values()) { assertThat(new AvailableValuesAspectDefinition<>(type, NOP).getAvailableValuesType(), is(type)); } }
protected AvailableValuesType getAvailableValuesType() { return availableValuesType; }
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected AvailableValuesType getAvailableValuesType() { return availableValuesType; } }
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected AvailableValuesType getAvailableValuesType() { return availableValuesType; } AvailableValuesAspectDefinition(AvailableValuesType availableValuesType, BiConsumer<C, ListDataProvider<Object>> dataProviderSetter); }
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected AvailableValuesType getAvailableValuesType() { return availableValuesType; } AvailableValuesAspectDefinition(AvailableValuesType availableValuesType, BiConsumer<C, ListDataProvider<Object>> dataProviderSetter); @Override Handler c...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected AvailableValuesType getAvailableValuesType() { return availableValuesType; } AvailableValuesAspectDefinition(AvailableValuesType availableValuesType, BiConsumer<C, ListDataProvider<Object>> dataProviderSetter); @Override Handler c...
@Test public void testGetValuesDerivedFromDatatype_NonEnumDatatype() { Assertions.assertThrows(IllegalStateException.class, () -> { new AvailableValuesAspectDefinition<>(AvailableValuesType.DYNAMIC, NOP) .getValuesDerivedFromDatatype("foo", String.class); }); }
protected <T extends Enum<T>> List<?> getValuesDerivedFromDatatype(String propertyName, Class<?> valueClass) { if (valueClass.isEnum()) { @SuppressWarnings("unchecked") Class<T> enumType = (Class<T>)valueClass; return AvailableValuesProvider.enumToValues(enumType, getAvailableValuesType() == AvailableValuesType.ENUM_VA...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected <T extends Enum<T>> List<?> getValuesDerivedFromDatatype(String propertyName, Class<?> valueClass) { if (valueClass.isEnum()) { @SuppressWarnings("unchecked") Class<T> enumType = (Class<T>)valueClass; return AvailableValuesProvider.enumToValu...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected <T extends Enum<T>> List<?> getValuesDerivedFromDatatype(String propertyName, Class<?> valueClass) { if (valueClass.isEnum()) { @SuppressWarnings("unchecked") Class<T> enumType = (Class<T>)valueClass; return AvailableValuesProvider.enumToValu...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected <T extends Enum<T>> List<?> getValuesDerivedFromDatatype(String propertyName, Class<?> valueClass) { if (valueClass.isEnum()) { @SuppressWarnings("unchecked") Class<T> enumType = (Class<T>)valueClass; return AvailableValuesProvider.enumToValu...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected <T extends Enum<T>> List<?> getValuesDerivedFromDatatype(String propertyName, Class<?> valueClass) { if (valueClass.isEnum()) { @SuppressWarnings("unchecked") Class<T> enumType = (Class<T>)valueClass; return AvailableValuesProvider.enumToValu...
@Test public void testGetValuesDerivedFromDatatype() { AvailableValuesAspectDefinition<HasItems<?>> availableValuesAspectDefinition = new AvailableValuesAspectDefinition<>( AvailableValuesType.DYNAMIC, NOP); assertThat(availableValuesAspectDefinition.getValuesDerivedFromDatatype("foo", TestEnum.class), contains(TestEnu...
protected <T extends Enum<T>> List<?> getValuesDerivedFromDatatype(String propertyName, Class<?> valueClass) { if (valueClass.isEnum()) { @SuppressWarnings("unchecked") Class<T> enumType = (Class<T>)valueClass; return AvailableValuesProvider.enumToValues(enumType, getAvailableValuesType() == AvailableValuesType.ENUM_VA...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected <T extends Enum<T>> List<?> getValuesDerivedFromDatatype(String propertyName, Class<?> valueClass) { if (valueClass.isEnum()) { @SuppressWarnings("unchecked") Class<T> enumType = (Class<T>)valueClass; return AvailableValuesProvider.enumToValu...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected <T extends Enum<T>> List<?> getValuesDerivedFromDatatype(String propertyName, Class<?> valueClass) { if (valueClass.isEnum()) { @SuppressWarnings("unchecked") Class<T> enumType = (Class<T>)valueClass; return AvailableValuesProvider.enumToValu...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected <T extends Enum<T>> List<?> getValuesDerivedFromDatatype(String propertyName, Class<?> valueClass) { if (valueClass.isEnum()) { @SuppressWarnings("unchecked") Class<T> enumType = (Class<T>)valueClass; return AvailableValuesProvider.enumToValu...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected <T extends Enum<T>> List<?> getValuesDerivedFromDatatype(String propertyName, Class<?> valueClass) { if (valueClass.isEnum()) { @SuppressWarnings("unchecked") Class<T> enumType = (Class<T>)valueClass; return AvailableValuesProvider.enumToValu...
@SuppressWarnings("deprecation") @Test public void testGetPattern() { DateFormatRegistry registry = new DateFormatRegistry(); assertThat(registry.getPattern(GERMAN), is(DateFormatRegistry.PATTERN_DE)); assertThat(registry.getPattern(GERMANY), is(DateFormatRegistry.PATTERN_DE)); assertThat(registry.getPattern(AUSTRIA), ...
@Deprecated public String getPattern(Locale locale) { requireNonNull(locale, "locale must not be null"); String registeredPattern = languagePatterns.get(locale.getLanguage()); if (registeredPattern != null) { return registeredPattern; } else { return defaultLocalePattern(locale); } }
DateFormatRegistry { @Deprecated public String getPattern(Locale locale) { requireNonNull(locale, "locale must not be null"); String registeredPattern = languagePatterns.get(locale.getLanguage()); if (registeredPattern != null) { return registeredPattern; } else { return defaultLocalePattern(locale); } } }
DateFormatRegistry { @Deprecated public String getPattern(Locale locale) { requireNonNull(locale, "locale must not be null"); String registeredPattern = languagePatterns.get(locale.getLanguage()); if (registeredPattern != null) { return registeredPattern; } else { return defaultLocalePattern(locale); } } }
DateFormatRegistry { @Deprecated public String getPattern(Locale locale) { requireNonNull(locale, "locale must not be null"); String registeredPattern = languagePatterns.get(locale.getLanguage()); if (registeredPattern != null) { return registeredPattern; } else { return defaultLocalePattern(locale); } } @Deprecated S...
DateFormatRegistry { @Deprecated public String getPattern(Locale locale) { requireNonNull(locale, "locale must not be null"); String registeredPattern = languagePatterns.get(locale.getLanguage()); if (registeredPattern != null) { return registeredPattern; } else { return defaultLocalePattern(locale); } } @Deprecated S...
@Test public void testSetDataProvider() { @SuppressWarnings("unchecked") BiConsumer<HasItems<?>, ListDataProvider<Object>> dataProviderSetter = mock(BiConsumer.class); AvailableValuesAspectDefinition<HasItems<?>> availableValuesAspectDefinition = new AvailableValuesAspectDefinition<>( AvailableValuesType.DYNAMIC, dataP...
@SuppressWarnings("unchecked") protected void setDataProvider(ComponentWrapper componentWrapper, ListDataProvider<Object> dataProvider) { dataProviderSetter.accept((C)componentWrapper.getComponent(), dataProvider); }
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @SuppressWarnings("unchecked") protected void setDataProvider(ComponentWrapper componentWrapper, ListDataProvider<Object> dataProvider) { dataProviderSetter.accept((C)componentWrapper.getComponent(), dataProvider); } }
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @SuppressWarnings("unchecked") protected void setDataProvider(ComponentWrapper componentWrapper, ListDataProvider<Object> dataProvider) { dataProviderSetter.accept((C)componentWrapper.getComponent(), dataProvider); } AvailableValuesAspectDefinition(Ava...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @SuppressWarnings("unchecked") protected void setDataProvider(ComponentWrapper componentWrapper, ListDataProvider<Object> dataProvider) { dataProviderSetter.accept((C)componentWrapper.getComponent(), dataProvider); } AvailableValuesAspectDefinition(Ava...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @SuppressWarnings("unchecked") protected void setDataProvider(ComponentWrapper componentWrapper, ListDataProvider<Object> dataProvider) { dataProviderSetter.accept((C)componentWrapper.getComponent(), dataProvider); } AvailableValuesAspectDefinition(Ava...
@Test public void testHandleNullItems() { AvailableValuesAspectDefinition<HasItems<?>> availableValuesAspectDefinition = new AvailableValuesAspectDefinition<>( AvailableValuesType.DYNAMIC, NOP); @SuppressWarnings("unchecked") List<Object> items = mock(List.class); @SuppressWarnings("unchecked") ComboBox<Object> compone...
protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { }
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { } }
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { } AvailableValuesAspectDefinition(AvailableValuesType availableValuesType, BiConsumer<C, ListDataProvider<Object>> dataProviderSetter); }
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { } AvailableValuesAspectDefinition(AvailableValuesType availableValuesType, BiConsumer<C, ListDataProvider<Object>> dataProviderSetter); @Override Handler cre...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { protected void handleNullItems(ComponentWrapper componentWrapper, List<?> items) { } AvailableValuesAspectDefinition(AvailableValuesType availableValuesType, BiConsumer<C, ListDataProvider<Object>> dataProviderSetter); @Override Handler cre...
@Test public void testCreateAspect_Dynamic() { AvailableValuesAspectDefinition<HasItems<?>> availableValuesAspectDefinition = new AvailableValuesAspectDefinition<>( AvailableValuesType.DYNAMIC, NOP); Aspect<Collection<?>> aspect = availableValuesAspectDefinition.createAspect("foo", TestEnum.class); assertThat(aspect.ge...
public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALUES) { return Aspect.of(NAME, new ArrayList<>()); } else { return Asp...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
@Test public void testCreateAspect_NoValues() { AvailableValuesAspectDefinition<HasItems<?>> availableValuesAspectDefinition = new AvailableValuesAspectDefinition<>( AvailableValuesType.NO_VALUES, NOP); Aspect<Collection<?>> aspect = availableValuesAspectDefinition.createAspect("foo", TestEnum.class); assertThat(aspect...
public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALUES) { return Aspect.of(NAME, new ArrayList<>()); } else { return Asp...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
@Test public void testCreateAspect_EnumValuesExclNull() { AvailableValuesAspectDefinition<HasItems<?>> availableValuesAspectDefinition = new AvailableValuesAspectDefinition<>( AvailableValuesType.ENUM_VALUES_EXCL_NULL, NOP); Aspect<Collection<?>> aspect = availableValuesAspectDefinition.createAspect("foo", TestEnum.cla...
public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALUES) { return Aspect.of(NAME, new ArrayList<>()); } else { return Asp...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
@Test public void testCreateAspect_EnumValuesInclNull() { AvailableValuesAspectDefinition<HasItems<?>> availableValuesAspectDefinition = new AvailableValuesAspectDefinition<>( AvailableValuesType.ENUM_VALUES_INCL_NULL, NOP); Aspect<Collection<?>> aspect = availableValuesAspectDefinition.createAspect("foo", TestEnum.cla...
public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALUES) { return Aspect.of(NAME, new ArrayList<>()); } else { return Asp...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { public Aspect<Collection<?>> createAspect(String propertyName, Class<?> valueClass) { AvailableValuesType type = getAvailableValuesType(); if (type == AvailableValuesType.DYNAMIC) { return Aspect.of(NAME); } else if (type == AvailableValuesType.NO_VALU...
@SuppressWarnings("unchecked") @Test public void testCreateUiUpdater() { BiConsumer<HasItems<?>, ListDataProvider<Object>> dataProviderSetter = mock(BiConsumer.class); AvailableValuesAspectDefinition<HasItems<?>> availableValuesAspectDefinition = new AvailableValuesAspectDefinition<>( AvailableValuesType.DYNAMIC, dataP...
@Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { Aspect<Collection<?>> aspect = createAspect(propertyDispatcher.getProperty(), propertyDispatcher.getValueClass()); List<Object> items = new ArrayList<>(); ListDataProvider<Object> listDataProvider = new ...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { Aspect<Collection<?>> aspect = createAspect(propertyDispatcher.getProperty(), propertyDispatcher.getValueClass()); List<Object> items =...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { Aspect<Collection<?>> aspect = createAspect(propertyDispatcher.getProperty(), propertyDispatcher.getValueClass()); List<Object> items =...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { Aspect<Collection<?>> aspect = createAspect(propertyDispatcher.getProperty(), propertyDispatcher.getValueClass()); List<Object> items =...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { Aspect<Collection<?>> aspect = createAspect(propertyDispatcher.getProperty(), propertyDispatcher.getValueClass()); List<Object> items =...
@SuppressWarnings("unchecked") @Test public void testRefresh() { BiConsumer<HasItems<?>, ListDataProvider<Object>> dataProviderSetter = mock(BiConsumer.class); AvailableValuesAspectDefinition<HasItems<?>> availableValuesAspectDefinition = new AvailableValuesAspectDefinition<>( AvailableValuesType.DYNAMIC, dataProviderS...
@Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { Aspect<Collection<?>> aspect = createAspect(propertyDispatcher.getProperty(), propertyDispatcher.getValueClass()); List<Object> items = new ArrayList<>(); ListDataProvider<Object> listDataProvider = new ...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { Aspect<Collection<?>> aspect = createAspect(propertyDispatcher.getProperty(), propertyDispatcher.getValueClass()); List<Object> items =...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { Aspect<Collection<?>> aspect = createAspect(propertyDispatcher.getProperty(), propertyDispatcher.getValueClass()); List<Object> items =...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { Aspect<Collection<?>> aspect = createAspect(propertyDispatcher.getProperty(), propertyDispatcher.getValueClass()); List<Object> items =...
AvailableValuesAspectDefinition implements LinkkiAspectDefinition { @Override public Handler createUiUpdater(PropertyDispatcher propertyDispatcher, ComponentWrapper componentWrapper) { Aspect<Collection<?>> aspect = createAspect(propertyDispatcher.getProperty(), propertyDispatcher.getValueClass()); List<Object> items =...
@Test public void testCreateComponent_PmoClassIsUsedAsId() { TableCreator creator = new TableCreator(); com.vaadin.v7.ui.Table table = (com.vaadin.v7.ui.Table)creator.createComponent(new TestTablePmo()) .getComponent(); assertThat(table.getId(), is("TestTablePmo")); }
@SuppressWarnings("deprecation") @Override public ComponentWrapper createComponent(ContainerPmo<?> containerPmo) { com.vaadin.v7.ui.Table table = containerPmo.isHierarchical() ? new com.vaadin.v7.ui.TreeTable() : new com.vaadin.v7.ui.Table(); table.addStyleName(LinkkiTheme.TABLE); table.setHeightUndefined(); table.setW...
TableCreator implements ColumnBasedComponentCreator { @SuppressWarnings("deprecation") @Override public ComponentWrapper createComponent(ContainerPmo<?> containerPmo) { com.vaadin.v7.ui.Table table = containerPmo.isHierarchical() ? new com.vaadin.v7.ui.TreeTable() : new com.vaadin.v7.ui.Table(); table.addStyleName(Link...
TableCreator implements ColumnBasedComponentCreator { @SuppressWarnings("deprecation") @Override public ComponentWrapper createComponent(ContainerPmo<?> containerPmo) { com.vaadin.v7.ui.Table table = containerPmo.isHierarchical() ? new com.vaadin.v7.ui.TreeTable() : new com.vaadin.v7.ui.Table(); table.addStyleName(Link...
TableCreator implements ColumnBasedComponentCreator { @SuppressWarnings("deprecation") @Override public ComponentWrapper createComponent(ContainerPmo<?> containerPmo) { com.vaadin.v7.ui.Table table = containerPmo.isHierarchical() ? new com.vaadin.v7.ui.TreeTable() : new com.vaadin.v7.ui.Table(); table.addStyleName(Link...
TableCreator implements ColumnBasedComponentCreator { @SuppressWarnings("deprecation") @Override public ComponentWrapper createComponent(ContainerPmo<?> containerPmo) { com.vaadin.v7.ui.Table table = containerPmo.isHierarchical() ? new com.vaadin.v7.ui.TreeTable() : new com.vaadin.v7.ui.Table(); table.addStyleName(Link...
@SuppressWarnings("deprecation") @Test public void testCreateSection_TableIsAddedAndBound() { TestTablePmo containerPmo = new TestTablePmo(); BindingContext bindingContext = new BindingContext(); PmoBasedSectionFactory factory = new PmoBasedSectionFactory(); AbstractSection tableSection = factory.createSection(containe...
@Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); }
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); @Deprecated TableSection createSection...
PmoBasedTableSectionFactory { @Deprecated public TableSection createSection() { return (TableSection)new PmoBasedSectionFactory().createSection(containerPmo, bindingContext); } @Deprecated PmoBasedTableSectionFactory(ContainerPmo<ROW> containerPmo, BindingContext bindingContext); @Deprecated TableSection createSection...
@Test public void testSanitize() { assertThat(HtmlSanitizer.sanitize(null), is(nullValue())); assertThat(HtmlSanitizer.sanitize("<p>"), is("<p>")); assertThat(HtmlSanitizer.sanitize("</p>"), is("</p>")); assertThat(HtmlSanitizer.sanitize("<div>"), is("<div>")); assertThat(HtmlSanitizer.sanitize("</div>"), is("</div>"))...
public static @CheckForNull String sanitize(@CheckForNull String text) { if (StringUtils.isEmpty(text)) { return text; } else { return text.replaceAll("<(?!\\/?" + ALLOWED_TAGS + ">)", "&lt;") .replaceAll("(?<!<\\/?" + ALLOWED_TAGS + ")>", "&gt;"); } }
HtmlSanitizer { public static @CheckForNull String sanitize(@CheckForNull String text) { if (StringUtils.isEmpty(text)) { return text; } else { return text.replaceAll("<(?!\\/?" + ALLOWED_TAGS + ">)", "&lt;") .replaceAll("(?<!<\\/?" + ALLOWED_TAGS + ")>", "&gt;"); } } }
HtmlSanitizer { public static @CheckForNull String sanitize(@CheckForNull String text) { if (StringUtils.isEmpty(text)) { return text; } else { return text.replaceAll("<(?!\\/?" + ALLOWED_TAGS + ">)", "&lt;") .replaceAll("(?<!<\\/?" + ALLOWED_TAGS + ")>", "&gt;"); } } private HtmlSanitizer(); }
HtmlSanitizer { public static @CheckForNull String sanitize(@CheckForNull String text) { if (StringUtils.isEmpty(text)) { return text; } else { return text.replaceAll("<(?!\\/?" + ALLOWED_TAGS + ">)", "&lt;") .replaceAll("(?<!<\\/?" + ALLOWED_TAGS + ")>", "&gt;"); } } private HtmlSanitizer(); static @CheckForNull Stri...
HtmlSanitizer { public static @CheckForNull String sanitize(@CheckForNull String text) { if (StringUtils.isEmpty(text)) { return text; } else { return text.replaceAll("<(?!\\/?" + ALLOWED_TAGS + ">)", "&lt;") .replaceAll("(?<!<\\/?" + ALLOWED_TAGS + ")>", "&gt;"); } } private HtmlSanitizer(); static @CheckForNull Stri...