/** * Display the specified message as a warning to the user, in a more visible * fashion, but without requiring explicit acknowledgement. */ protected void warnUser(final String message) { getContainer().warnUser(message); }
@Deprecated public static Object lookupBookmark(Bookmark bookmark, final BookmarkService bookmarkService, DomainObjectContainer container) { try { return bookmarkService != null ? bookmarkService.lookup(bookmark) : null; } catch(RuntimeException ex) { if(ex.getClass().getName().contains("ObjectNotFoundException")) { container.warnUser("Object not found - has it since been deleted?"); return null; } throw ex; } }
/** * Display the specified message as a warning to the user, in a more visible * fashion, but without requiring explicit acknowledgement. * * <p> * The method simply delegates to the {@link DomainObjectContainer}. * </p> * * @see DomainObjectContainer#warnUser(String) * * @deprecated - use {@link org.apache.isis.applib.services.message.MessageService#warnUser(String)} */ @Deprecated protected void warnUser(final String message) { getContainer().warnUser(message); }
/** * Display the specified i18n message as a warning to the user, in a more visible * fashion, but without requiring explicit acknowledgement. * * <p> * The method simply delegates to the {@link DomainObjectContainer}. * </p> * * @see DomainObjectContainer#warnUser(TranslatableString, Class, String) * * @deprecated - use {@link org.apache.isis.applib.services.message.MessageService#warnUser(TranslatableString, Class, String)} */ @Deprecated protected void warnUser(TranslatableString message, final Class<?> contextClass, final String contextMethod) { getContainer().warnUser(message, contextClass, contextMethod); }
@Test public void testWarnUser() throws Exception { context.checking(new Expectations() { { oneOf(container).warnUser("message"); } }); object.warnUser("message"); }
@Test public void testWarnUser() throws Exception { context.checking(new Expectations() { { one(container).warnUser("message"); } }); object.warnUser("message"); context.assertIsSatisfied(); }