/** * The default behavior of this method is to call * <code>setWindowState(windowState)</code> on the wrapped response object. */ public void setWindowState(WindowState windowState) throws WindowStateException { response.setWindowState(windowState); }
public void setWindowState(WindowState windowState) throws WindowStateException { if (response instanceof ActionResponse) ((ActionResponse)response).setWindowState(windowState); }
public static void setWindowState(WindowState arg0) throws WindowStateException { ActionResponse actionResponse = getActionResponse(); if (actionResponse == null) { throw new IllegalStateException( "The response is not ActionResponse."); } actionResponse.setWindowState(arg0); }
public void setWindowState(WindowState windowState) { ActionResponse response = getActionResponse(); try { response.setWindowState(windowState); } catch (WindowStateException e) { throw new UnsupportedOperationException("Invalid window state", e); } }
public void setWindowState(WindowState windowState) { ActionResponse response = getActionResponse(); try { response.setWindowState(windowState); } catch (WindowStateException e) { throw new UnsupportedOperationException("Invalid window state", e); } }
public void setWindowState(ExternalContext externalContext, String windowState) { final ActionResponse actionResponse; try { actionResponse = (ActionResponse) externalContext.getNativeResponse(); } catch (ClassCastException e) { throw new IllegalArgumentException( "setWindowState can only be called during an action request", e); } try { actionResponse.setWindowState(PortletUtils.getWindowState(windowState)); } catch (WindowStateException e) { throw new IllegalArgumentException( "The specified WindowState '" + windowState + "' is not valid", e); } }
@ActionMapping(params = "action=cancel") public void cancelUpdate(ActionResponse response) throws IOException, ReadOnlyException, ValidatorException, PortletModeException, WindowStateException { response.setPortletMode(PortletMode.VIEW); // When the config is displayed in a lightbox, need // to make sure we break out of exclusive mode. Normally, // this is handled via the lightbox JS code. The lightbox // JS doesn't support rewriting URLs set via JS though. So, // instead just do it here. response.setWindowState(WindowState.NORMAL); }
@ActionMapping public void submitSearch( ActionRequest request, ActionResponse response, @RequestParam(value = "query", required = false) String query) { // Should we request to maximize? PortletPreferences prefs = request.getPreferences(); boolean maximize = Boolean.parseBoolean( prefs.getValue(MAXIMIZE_ON_SEARCH_PREFERENCE, "true")); // default is true if (maximize) { try { response.setWindowState(WindowState.MAXIMIZED); } catch (WindowStateException e) { log.warn("Failed to set the window state to MAXIMIZED", e); } } // Forward the query parameter... if (query != null) { response.setRenderParameter("query", query); } }
@Override public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { response.setRenderParameter("foo", "foo_value"); response.setPortletMode(PortletMode.EDIT); response.setWindowState(WindowState.MAXIMIZED); }