@Override public void detach(IRequestCycle requestCycle) { component.getPage().detach(); }
@Override public void detach(IRequestCycle requestCycle) { component.getPage().detach(); }
@Override public boolean isActive(final Component button) { return getPageClass().equals(button.getPage().getClass()); } }
public static ActionPromptProvider getFrom(Component component) { final Page page = component.getPage(); if(page == null) { throw new IllegalArgumentException("Programming error: component must be added to a page in order to locate the ActionPromptProvider"); } return getFrom(page); } public static ActionPromptProvider getFrom(Page page) {
/** * Called to indicate that a component has been rendered. This method should only very rarely be * called at all. One usage is in ImageMap, which renders its link children its own special way * (without calling render() on them). If ImageMap did not call rendered() to indicate that its * child components were actually rendered, the framework would think they had never been * rendered, and in development mode this would result in a runtime exception. */ public final void rendered() { // Tell the page that the component rendered getPage().componentRendered(this); }
private String getMarkupType(Component component) { return component.getPage().getMarkupType(); } }
/** * Locates a component implementing the required class on the same page as the supplied component. */ public static <T> T getFrom(Component component, final Class<T> cls) { return getFrom(component.getPage(), cls); }
@Override public boolean isActive(final Component button) { Args.notNull(button, "button"); return button.getPage().getClass().equals(getPageClass()); } }
/** * Collects feedback messages * * @param pageResolvingComponent * @param filter * @return list of feedback messages */ protected List<FeedbackMessage> collectMessages(Component pageResolvingComponent, IFeedbackMessageFilter filter) { return new FeedbackCollector(pageResolvingComponent.getPage(), includeSession).collect(filter); }
public WebSocketRequestHandler(final Component component, final IWebSocketConnection connection) { this.page = Args.notNull(component, "component").getPage(); this.connection = Args.notNull(connection, "connection"); }
/** * Collects feedback messages * * @param pageResolvingComponent * @param filter * @return list of feedback messages */ protected List<FeedbackMessage> collectMessages(Component pageResolvingComponent, IFeedbackMessageFilter filter) { return new FeedbackCollector(pageResolvingComponent.getPage(), includeSession).collect(filter); }
/** * Redirects to any intercept page previously specified by a call to redirectToInterceptPage. * * @return True if an original destination was redirected to * @see Component#redirectToInterceptPage(Page) */ public final boolean continueToOriginalDestination() { return getPage().getPageMap().continueToOriginalDestination(); }
@Override public void onNoResults(final Component context) { reset(); context.setResponsePage(context.getPage()); } });
public static void clearMessagesForComponent(Component component) { new FeedbackCollector(component.getPage()) .collect(message -> Objects.equals(message.getReporter(), component)).stream() .forEach(it -> it.markRendered()); }
public static void clearMessagesForComponent(Component component) { new FeedbackCollector(component.getPage()) .collect(message -> Objects.equals(message.getReporter(), component)).stream() .forEach(it -> it.markRendered()); }
private void internalInvoke(final Component component, final Object target) { // save a reference to the page because the component can be removed // during the invocation of the listener and thus lose its parent Page page = component.getPage(); // initialization is required for stateless pages if (!page.isInitialized()) { page.internalInitialize(); } ((IRequestListener)target).onRequest(); }
private void subscribeComponent(Component component, Behavior behavior, Method method) { EventSubscription subscription = new EventSubscription(component, behavior, method); Page page = component.getPage(); eventBus.register(page, subscription); if (page.getBehaviors(AtmosphereBehavior.class).isEmpty()) page.add(new AtmosphereBehavior()); } }
@Override protected void respond(AjaxRequestTarget target) { getComponent().getPage().visitChildren((component, visit) -> { if (SINGULAR_JS_BEAHAVIOR_UPDATE_REGION.equals(component.getId())) { target.add(component); visit.stop(); } }); }
@Override public final void onRequest() { WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage()); RequestCycle requestCycle = RequestCycle.get(); requestCycle.scheduleRequestHandlerAfterCurrent(target); respond(target); }
@Override public final void onRequest() { WebApplication app = (WebApplication)getComponent().getApplication(); AjaxRequestTarget target = app.newAjaxRequestTarget(getComponent().getPage()); RequestCycle requestCycle = RequestCycle.get(); requestCycle.scheduleRequestHandlerAfterCurrent(target); respond(target); }