public static WindowState getWindowState( String name, int portletMajorVersion) { if (Validator.isNull(name)) { if (portletMajorVersion < 3) { return WindowState.NORMAL; } return WindowState.UNDEFINED; } WindowState windowState = _windowStates.get(name); if (windowState == null) { windowState = new WindowState(name); } return windowState; }
public WindowState getCustomState() { if (customState == null) { customState = new WindowState(customName); } return customState; }
public WindowState getWindowState() { if ( windowState == null && stateName != null ) { windowState = new WindowState(stateName); } return windowState; }
/** Convert a String into a {@link WindowState} */ public static WindowState getWindowState(String state) { if (state == null) { return null; } final WindowState windowState = WINDOW_STATES.get(state); if (windowState != null) { return windowState; } return new WindowState(state); }
private WindowState _getWindowState(String name) { WindowState windowState = _windowStates.get(name); if (windowState == null) { windowState = new WindowState(name); } return windowState; }
/** Convert a String into a {@link WindowState} */ public static WindowState getWindowState(String state) { if (state == null) { return null; } final WindowState windowState = WINDOW_STATES.get(state); if (windowState != null) { return windowState; } return new WindowState(state); }
public RenderMappingPredicate(String windowState, String[] params) { super(params); this.windowState = ("".equals(windowState) ? null : new WindowState(windowState)); }
public RenderMappingPredicate(String windowState, String[] params) { super(params); this.windowState = ("".equals(windowState) ? null : new WindowState(windowState)); }
@PostConstruct private void initAddedPortletWindowState() { if (addedPortletWindowState != null && !"null".equalsIgnoreCase(addedPortletWindowState) && !addedPortletWindowState.isEmpty()) { addedWindowState = new WindowState(addedPortletWindowState); } }
/** * Sets the list of supported WindowStates. * * @param states A List of WindowState names (String) to create WindowState objects from. * @throws IllegalArgumentException If states is null. */ public void setSupportedWindowStateNames(Set<String> states) { if (states == null) throw new IllegalArgumentException("states cannot be null"); final Set<WindowState> windowStates = new HashSet<WindowState>(states.size()); for (final String stateName : states) { windowStates.add(new WindowState(stateName.toLowerCase())); } this.supportedWindowStates = Collections.unmodifiableSet(windowStates); }
/** * @see org.jasig.portal.portlet.common.ICustomWindowState#getWindowState() */ public WindowState getWindowState() { final String windowStateStr = this.customWindowStateDD.getWindowState(); return new WindowState(windowStateStr); }
public WindowState getMappedState() { if (mappedState == null) { if (mappedName != null) { mappedState = new WindowState(mappedName); } else { mappedState = getCustomState(); } } return mappedState; }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { id = in.readObject().toString(); action = in.readBoolean(); secure = in.readBoolean(); parameters = (Map) in.readObject(); portletMode = new PortletMode(in.readObject().toString()); windowState = new WindowState(in.readObject().toString()); if (LOG.isDebugEnabled()) { LOG.debug("Deserializing PortletState [action=" + action + "]"); } } }
/** * Get an enumeration of all <code>WindowState</code>s supported by this * portal. * @return an enumeration of all supported window states. */ public Enumeration<WindowState> getSupportedWindowStates() { if (windowStates == null) { windowStates = new Vector<WindowState>(); @SuppressWarnings({ "unchecked", "rawtypes" }) Enumeration enumeration = new Vector(config.getSupportedWindowStates()).elements(); while (enumeration.hasMoreElements()) { windowStates.add( new WindowState(enumeration.nextElement().toString())); } } return windowStates.elements(); }
/** * Construct a WindowState object given a state string. */ private WindowState createWindowState(String state) { if (WindowState.MINIMIZED.toString().equalsIgnoreCase(state)) { return WindowState.MINIMIZED; } else if (WindowState.NORMAL.toString().equalsIgnoreCase(state)) { return WindowState.NORMAL; } else if (WindowState.MAXIMIZED.toString().equalsIgnoreCase(state)) { return WindowState.MAXIMIZED; } else { return new WindowState(state); } } }
/** * Set the window state for the URL to be what was given in the tag. If not given, default to what was there * previously * * @param portletURL * @throws WindowStateException */ protected void setWindowState(PortletURL portletURL) throws WindowStateException { if (getWindowState() != null && getWindowState().trim().length() > 0) { portletURL.setWindowState(new WindowState(getWindowState().trim())); } }
/** * Creates a <code>WindowState</code> object based on the specified name. * * @param windowStateName the name of the window state * @return one of the standard WindowStates if the specified name matches one of them or a new WindowState. * @see javax.portlet.WindowState */ public static WindowState decodeWindowState(String windowStateName) { if (WindowState.NORMAL.toString().equalsIgnoreCase(windowStateName)) { return WindowState.NORMAL; } else if (WindowState.MINIMIZED.toString().equalsIgnoreCase(windowStateName)) { return WindowState.MINIMIZED; } else if (WindowState.MAXIMIZED.toString().equalsIgnoreCase(windowStateName)) { return WindowState.MAXIMIZED; } else { return new WindowState(windowStateName); } }
protected void setWindowStateParameter(String windowState, PortletURL portletURL) { if (windowState != null) { try { WindowState candidateWindowState = new WindowState(windowState); if (bridgeContext.getPortletRequest().isWindowStateAllowed(candidateWindowState)) { portletURL.setWindowState(candidateWindowState); } else { // TestPage120: encodeActionURLWithInvalidWindowStateRenderTest } } catch (WindowStateException e) { logger.error(e); } } }
protected void setWindowStateParameter(String windowState, PortletURL portletURL) { if (windowState != null) { try { WindowState candidateWindowState = new WindowState(windowState); if (bridgeContext.getPortletRequest().isWindowStateAllowed(candidateWindowState)) { portletURL.setWindowState(candidateWindowState); } else { // TestPage120: encodeActionURLWithInvalidWindowStateRenderTest } } catch (WindowStateException e) { logger.error(e); } } }
/** * A command element to set window state. * <windowState state="normal"/> - set window state of the current window to normal * <windowState windowId="anotherWindow" state="minimized"/> - set window state of another window to minimized * * @param context * @param elem * @throws TransformerException * @throws WindowStateException */ public void windowState(XSLProcessorContext context, ElemExtensionCall elem) throws TransformerException, WindowStateException { TransformerImpl transformerImpl=context.getTransformer(); Node contextNode=context.getContextNode(); String str_state=elem.getAttribute("state",contextNode,transformerImpl); WindowState state=new WindowState(str_state); IPortletUrl portletUrl = getPortletUrl(transformerImpl); String str_windowId=elem.getAttribute("windowId",contextNode,transformerImpl); if(str_windowId!=null && str_windowId!="") { // use portlet url constructor directly to specify a different window id PortletWindowId windowId=new PortletWindowId(str_windowId); IPortletUrlConstructor portletUrlConstructor = (IPortletUrlConstructor) portletUrl.getUrlConstructor(IPortletUrlConstructor.CONSTRUCTOR_NAME); portletUrlConstructor.setWindowState(windowId,state); } else { // set state on the current window portletUrl.setWindowState(state); } }