public static List<String> getAutoUpdateComponentClientIds(FacesContext context) { return (List<String>) context.getViewRoot().getAttributes().get(COMPONENT_CLIENT_IDS); }
public static List<String> getOrCreateAutoUpdateComponentClientIds(FacesContext context) { List<String> clientIds = getAutoUpdateComponentClientIds(context); if (clientIds == null) { clientIds = new ArrayList<>(); context.getViewRoot().getAttributes().put(COMPONENT_CLIENT_IDS, clientIds); } return clientIds; }
/** * <p> This method sets the {@link LayoutDefinition} key on the given * <code>UIViewRoot</code>.</p> */ public static void setLayoutDefinitionKey(UIViewRoot root, String key) { root.getAttributes().put(LAYOUT_DEFINITION_KEY, key); }
static List<String> getClientIdsAdded(UIViewRoot root) { return (List<String>) root.getAttributes().get(CLIENTIDS_ADDED); }
static List<String> getClientIdsRemoved(UIViewRoot root) { return (List<String>) root.getAttributes().get(CLIENTIDS_REMOVED); }
/** * Marks context of {@link UIViewRoot} with information that view focus is present */ public static void markViewWithFocus(UIViewRoot viewRoot) { viewRoot.getAttributes().put(VIEW_FOCUS, VIEW_FOCUS); }
public static boolean isDynamicComponentRefreshTransientBuildActive(FacesContext facesContext, UIViewRoot view) { return Boolean.TRUE.equals(view.getAttributes().get( DYNAMIC_COMPONENT_REFRESH_TRANSIENT_BUILD)); }
/** * Determines whether view focus is present based on context attribute */ public static boolean hasViewFocus(UIViewRoot viewRoot) { return VIEW_FOCUS.equals(viewRoot.getAttributes().get(VIEW_FOCUS)); }
/** * Determines whether view focus is present based on context attribute */ public static boolean hasViewFocus(UIViewRoot viewRoot) { return VIEW_FOCUS.equals(viewRoot.getAttributes().get(VIEW_FOCUS)); }
/** * Determines whether view focus is present based on context attribute */ public static boolean hasViewFocus(UIViewRoot viewRoot) { return VIEW_FOCUS.equals(viewRoot.getAttributes().get(VIEW_FOCUS)); }
/** * Returns true if given view indeed contains {@link EnableRestorableView}. * @param view The involved view. * @return true if given view indeed contains {@link EnableRestorableView}. */ public static boolean isRestorableView(UIViewRoot view) { return TRUE.equals(view.getAttributes().get(EnableRestorableView.class.getName())); }
/** * @return key */ public String getKey() { FacesContext context = FacesContext.getCurrentInstance(); Map<String, Object> attributes = context.getViewRoot().getAttributes(); return (String) attributes.get("propertyKey"); }
/** * @return dirty */ public boolean isDirty() { FacesContext context = FacesContext.getCurrentInstance(); Map<String, Object> attributes = context.getViewRoot().getAttributes(); Object attribute = attributes.get("propertyChanged"); return attribute != null && (Boolean) attribute; }
/** * @param dirty */ public void setDirty(boolean dirty) { FacesContext context = FacesContext.getCurrentInstance(); Map<String, Object> attributes = context.getViewRoot().getAttributes(); attributes.put("propertyChanged", dirty); }
public static boolean isDynamicComponentRefreshTransientBuildActive(FacesContext facesContext) { if (facesContext.getViewRoot() == null) { return false; } return Boolean.TRUE.equals(facesContext.getViewRoot().getAttributes().get( DYNAMIC_COMPONENT_REFRESH_TRANSIENT_BUILD)); }
public static FaceletState getFaceletState(FaceletContext ctx, UIComponent parent, boolean create) { UIViewRoot root = getViewRoot(ctx, parent); FaceletState map = (FaceletState) root.getAttributes().get(FACELET_STATE_INSTANCE); if (map == null && create) { map = new FaceletState(); root.getAttributes().put(FACELET_STATE_INSTANCE, map); } return map; }
@Override public void setBeanStorage(UUID beanStorageId, BeanStorage beanStorage) { UIViewRoot viewRoot = getViewRoot(); if (!viewRoot.initialStateMarked()) { viewRoot.markInitialState(); // Forces JSF to start recording changes in view state. } Map<String, Object> viewState = viewRoot.getAttributes(); viewState.put(getClass().getName(), beanStorageId); viewState.put(beanStorageId.toString(), beanStorage); }
@Override public void begin(String name) { Scope scope = createConversationScope(name); if (scope._extendedId != null) throw new IllegalStateException(L.l("Conversation begin() must only be called when a long-running conversation does not exist.")); FacesContext facesContext = FacesContext.getCurrentInstance(); if (facesContext != null && name != null) facesContext.getViewRoot().getAttributes().put("caucho.cid", name); scope._extendedId = name; scope.put(name, scope._transientConversation); }
/** * @see Faces#getMetadataAttributes(String) */ public static Map<String, Object> getMetadataAttributes(FacesContext context, String viewId) { ViewHandler viewHandler = context.getApplication().getViewHandler(); ViewDeclarationLanguage vdl = viewHandler.getViewDeclarationLanguage(context, viewId); ViewMetadata metadata = vdl.getViewMetadata(context, viewId); return (metadata != null) ? metadata.createMetadataView(context).getAttributes() : Collections.<String, Object>emptyMap(); }
/** * @see Faces#getMetadataAttributes(String) */ public static Map<String, Object> getMetadataAttributes(FacesContext context, String viewId) { ViewHandler viewHandler = context.getApplication().getViewHandler(); ViewDeclarationLanguage vdl = viewHandler.getViewDeclarationLanguage(context, viewId); ViewMetadata metadata = vdl.getViewMetadata(context, viewId); return (metadata != null) ? metadata.createMetadataView(context).getAttributes() : Collections.<String, Object>emptyMap(); }