/**
* This method is used to set the next portlet window state if this one needs to be modified because of the incoming request
*/
public static void setNextState(UIPortlet uiPortlet, WindowState state) {
if (state != null) {
UIPage uiPage = uiPortlet.getAncestorOfType(UIPage.class);
if (WindowState.MAXIMIZED.equals(state)) {
uiPortlet.setCurrentWindowState(WindowState.MAXIMIZED);
if (uiPage != null) {
uiPage.setMaximizedUIPortlet(uiPortlet);
}
} else if (WindowState.MINIMIZED.equals(state)) {
uiPortlet.setCurrentWindowState(WindowState.MINIMIZED);
if (uiPage != null) {
uiPage.setMaximizedUIPortlet(null);
}
} else {
uiPortlet.setCurrentWindowState(WindowState.NORMAL);
if (uiPage != null) {
uiPage.setMaximizedUIPortlet(null);
}
}
}
}