All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.myfaces.trinidad.component.UIXNavigationPath Maven / Gradle / Ivy

// WARNING: This file was automatically generated. Do not edit it directly,
//          or you will lose your changes.

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
*/
package org.apache.myfaces.trinidad.component;

import java.util.ArrayList;
import java.util.List;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
import javax.faces.component.visit.VisitCallback;
import javax.faces.component.visit.VisitContext;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseId;
import org.apache.myfaces.trinidad.bean.FacesBean;
import org.apache.myfaces.trinidad.bean.PropertyKey;
import org.apache.myfaces.trinidad.util.ComponentUtils;

/**
 *
 * A navigationPath component is used in hierarchical
 *           site layouts to indicate the path back to the root page of the
 *           hierarchy with links.
 *
 * 

Events:

* * * * * * * * * * * *
TypePhasesDescription
org.apache.myfaces.trinidad.event.AttributeChangeEventInvoke
Application
Apply
Request
Values
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing.
*/ public class UIXNavigationPath extends UIXNavigationHierarchy implements NamingContainer { static public final FacesBean.Type TYPE = new FacesBean.Type( UIXNavigationHierarchy.TYPE); static public final PropertyKey VALUE_KEY = TYPE.registerKey("value", Object.class, null, 0, PropertyKey.Mutable.SOMETIMES); static public final PropertyKey VAR_STATUS_KEY = TYPE.registerKey("varStatus", String.class, PropertyKey.CAP_NOT_BOUND); static public final String NODE_STAMP_FACET = "nodeStamp"; static public final String COMPONENT_FAMILY = "org.apache.myfaces.trinidad.NavigationPath"; static public final String COMPONENT_TYPE = "org.apache.myfaces.trinidad.NavigationPath"; /** * Construct an instance of the UIXNavigationPath. */ public UIXNavigationPath() { super("org.apache.myfaces.trinidad.Path"); } @Override protected void processFacetsAndChildren( FacesContext context, PhaseId phaseId) { Object oldPath = getRowKey(); Object focusPath = getFocusRowKey(); if (focusPath != null ) { List paths = new ArrayList(getAllAncestorContainerRowKeys(focusPath)); paths.add(focusPath); int focusPathSize = paths.size(); UIComponent nodeStamp = getFacet("nodeStamp"); if (nodeStamp != null) { for (int i = 0; i < focusPathSize; i++) { setRowKey(paths.get(i)); processComponent(context, nodeStamp, phaseId); } } } setRowKey(oldPath); // process the children TableUtils.__processChildren(context, this, phaseId); } @Override protected boolean visitChildren( VisitContext visitContext, VisitCallback callback) { if (ComponentUtils.isSkipIterationVisit(visitContext)) { return visitChildrenWithoutIterating(visitContext, callback); } else { return _visitChildrenIterating(visitContext, callback); } } private boolean _visitChildrenIterating( VisitContext visitContext, VisitCallback callback) { boolean done = visitData(visitContext, callback); if (!done) { // process the children int childCount = getChildCount(); if (childCount > 0) { for (UIComponent child : getChildren()) { done = UIXComponent.visitTree(visitContext, child, callback); if (done) break; } } } return done; } @Override protected boolean visitData( VisitContext visitContext, VisitCallback callback) { Object focusPath = getFocusRowKey(); Object oldRowKey = null; boolean done = false; // start from the focused area if (focusPath != null) { List stamps = getStamps(); if (!stamps.isEmpty()) { List paths = new ArrayList(getAllAncestorContainerRowKeys(focusPath)); paths.add(focusPath); int focusPathSize = paths.size(); try { for (int i = 0; i < focusPathSize && !done; i++) { setRowKey(paths.get(i)); for (UIComponent stamp : stamps) { done = UIXComponent.visitTree(visitContext, stamp, callback); if (done) break; } } } finally { setRowKey(oldRowKey); } } } return done; } /** * the component to use to stamp each element in the * navigation. A CommandNavigationItem is expected. */ final public UIComponent getNodeStamp() { return getFacet(NODE_STAMP_FACET); } /** * the component to use to stamp each element in the * navigation. A CommandNavigationItem is expected. */ @SuppressWarnings("unchecked") final public void setNodeStamp(UIComponent nodeStampFacet) { getFacets().put(NODE_STAMP_FACET, nodeStampFacet); } /** * Gets the hierarchy of navigation data - must be of type * org.apache.myfaces.trinidad.model.MenuModel * * @return the new value value */ final public Object getValue() { return getProperty(VALUE_KEY); } /** * Sets the hierarchy of navigation data - must be of type * org.apache.myfaces.trinidad.model.MenuModel * * @param value the new value value */ final public void setValue(Object value) { setProperty(VALUE_KEY, (value)); } /** * Gets * Name of the EL variable used to reference the varStatus information. * Once this component has completed rendering, this variable is * removed (or reverted back to its previous value). * The VarStatus provides contextual information about the state of the * component to EL expressions. For components that iterate, varStatus * also provides loop counter information. Please see the this * component's documentation for the specific properties on the varStatus. * The common properties on varStatus include:
  • "model" - returns the CollectionModel for this component
  • "index" - returns the zero based row index
* * @return the new varStatus value */ final public String getVarStatus() { return ComponentUtils.resolveString(getProperty(VAR_STATUS_KEY)); } /** * Sets * Name of the EL variable used to reference the varStatus information. * Once this component has completed rendering, this variable is * removed (or reverted back to its previous value). * The VarStatus provides contextual information about the state of the * component to EL expressions. For components that iterate, varStatus * also provides loop counter information. Please see the this * component's documentation for the specific properties on the varStatus. * The common properties on varStatus include:
  • "model" - returns the CollectionModel for this component
  • "index" - returns the zero based row index
* * @param varStatus the new varStatus value */ final public void setVarStatus(String varStatus) { setProperty(VAR_STATUS_KEY, (varStatus)); } @Override public String getFamily() { return COMPONENT_FAMILY; } @Override protected FacesBean.Type getBeanType() { return TYPE; } /** * Construct an instance of the UIXNavigationPath. */ protected UIXNavigationPath( String rendererType ) { super(rendererType); } static { TYPE.lockAndRegister("org.apache.myfaces.trinidad.NavigationPath","org.apache.myfaces.trinidad.Path"); } }