/** * Display the specified message to the user, in a non-intrusive fashion. */ protected void informUser(final String message) { getContainer().informUser(message); }
/** * Display the specified message to the user, in a non-intrusive fashion. * * <p> * The method simply delegates to the {@link DomainObjectContainer}. * </p> * * @see DomainObjectContainer#informUser(String) * * @deprecated - use {@link org.apache.isis.applib.services.message.MessageService#informUser(String)} */ @Deprecated protected void informUser(final String message) { getContainer().informUser(message); }
/** * Display the specified i18n message to the user, in a non-intrusive fashion. * * <p> * The method simply delegates to the {@link DomainObjectContainer}. * </p> * * @see DomainObjectContainer#informUser(TranslatableString, Class, String) * * @deprecated - use {@link org.apache.isis.applib.services.message.MessageService#informUser(TranslatableString, Class, String)} */ @Deprecated protected void informUser(TranslatableString message, final Class<?> contextClass, final String contextMethod) { getContainer().informUser(message, contextClass, contextMethod); }
@ActionLayout( cssClassFa = "fa fa-thumbs-up" ) @Action(semantics = SemanticsOf.SAFE) @MemberOrder(sequence = "20") public List<ToDoItem> complete() { final List<ToDoItem> items = completeNoUi(); if(items.isEmpty()) { container.informUser(TranslatableString.tr("No to-do items have yet been completed :-("), this.getClass(), "complete"); } return items; }
@Action(semantics = SemanticsOf.SAFE) @ActionLayout( cssClassFa = "fa fa-thumbs-down", bookmarking = BookmarkPolicy.AS_ROOT ) @MemberOrder(sequence = "10") public List<ToDoItem> notYetComplete() { final List<ToDoItem> items = notYetCompleteNoUi(); if(items.isEmpty()) { container.informUser( TranslatableString.tr("All to-do items have been completed :-)"), this.getClass(), "notYetComplete"); } return items; }
/** * To demo/test what occurs if a subscriber that might veto an event. */ @Action( semantics = SemanticsOf.IDEMPOTENT, restrictTo = RestrictTo.PROTOTYPING ) @ActionLayout( named="Set subscriber behaviour", cssClassFa="phone" ) @MemberOrder(sequence = "500.20.1") public void subscriberBehaviour( final DemoBehaviour behaviour) { applicationSettingsService.set(DemoBehaviour.class, behaviour); container.informUser("Subscriber behaviour set to: " + behaviour); } public DemoBehaviour default0SubscriberBehaviour() {
@Test public void testInformUser() throws Exception { context.checking(new Expectations() { { oneOf(container).informUser("message"); } }); object.informUser("message"); }
@Test public void testInformUser() throws Exception { context.checking(new Expectations() { { one(container).informUser("message"); } }); object.informUser("message"); context.assertIsSatisfied(); }