/** * @param targeted true if targeted */ protected void setTargeted(final boolean targeted) { if (targeted != isTargeted()) { getOrCreateComponentModel().targeted = targeted; } }
/** * When the window is targetted, we need to run the "laters". If we don't do this, they will not run because a * targetted request bypasses the root component that would normally have run them. */ @Override protected void invokeLaters() { if (getState() == ACTIVE_STATE && isTargeted()) { UIContextHolder.getCurrent().doInvokeLaters(); } else { super.invokeLaters(); } }
/** * Override paintComponent in order to paint the window or its content, depending on the window state. * * @param renderContext the RenderContext to send the output to. */ @Override protected void paintComponent(final RenderContext renderContext) { if (getState() == DISPLAY_STATE) { setState(ACTIVE_STATE); showWindow(renderContext); } else if (getState() == ACTIVE_STATE && isTargeted()) { getComponentModel().wrappedContent.paint(renderContext); } }
/** * Override handleRequest in order to perform processing specific to this component. * * @param request the request being responded to. */ @Override public void handleRequest(final Request request) { super.handleRequest(request); // Check if window in request boolean targeted = isPresent(request); setTargeted(targeted); if (getState() == ACTIVE_STATE && isTargeted()) { getComponentModel().wrappedContent.serviceRequest(request); } }
/** * Override preparePaintComponent to clear the scratch map before the window content is being painted. * * @param request the request being responded to. */ @Override protected void preparePaintComponent(final Request request) { super.preparePaintComponent(request); // Check if window in request (might not have gone through handle request, eg Step error) boolean targeted = isPresent(request); setTargeted(targeted); if (getState() == ACTIVE_STATE && isTargeted()) { getComponentModel().wrappedContent.preparePaint(request); } }