Package com.sun.jsftemplating.layout.descriptors

Examples of com.sun.jsftemplating.layout.descriptors.LayoutElement


      @HandlerInput(name="parent", type=UIComponent.class, required=false)},
  output={
      @HandlerOutput(name="result", type=UIComponent.class)}
  )
    public static void buildUIComponentTree(HandlerContext context) {
  LayoutElement desc = (LayoutElement) context.getInputValue("layoutElement");
  UIComponent parent = (UIComponent) context.getInputValue("parent");

  // If they didn't give us a parent, make one one up...
  if (parent == null) {
      parent = new UIViewRoot();
      ((UIViewRoot) parent).setViewId("fake");
  }

  // Build it...
  FacesContext facesCtx = context.getFacesContext();
  if (desc instanceof LayoutComponent) {
      // Special case if LayoutComponent is the root node element
      // The LayoutViewHandler assumes that the root node is not used
      // because it was written assuming that the LayoutDefinition was
      // always going to be passed in.  The result is that it ignores
      // the LayoutElement that is passed in and goes striaight to the
      // children.  This isn't what we want.  Process the child here,
      // then continue as normal.
      UIComponent tmpParent =
    ((LayoutComponent) desc).getChild(facesCtx, parent);
      LayoutViewHandler.buildUIComponentTree(facesCtx, tmpParent, desc);
  } else {
      // Process normally (which in this path is probably not normal)
      LayoutViewHandler.buildUIComponentTree(facesCtx, parent, desc);
  }

  // Get the result to return...
  String id = desc.getId(facesCtx, parent);
  UIComponent result = parent.findComponent(id);
  if (result == null) {
      // First see if we can find it in the facet Map
      if (desc instanceof LayoutComponent) {
    result = parent.getFacets().get(id);
View Full Code Here


  output={
      @HandlerOutput(name="value", type=String.class)})
    public static void dumpLayoutElementTree(HandlerContext context) {
// FIXME: Add flag to dump attributes also, perhaps facets should be optional as well?
  // Find the root UIComponent to use...
  LayoutElement elt = (LayoutElement) context.getInputValue("layoutElement");
  if (elt == null) {
      elt = context.getLayoutElement();
      if (elt == null) {
    throw new IllegalArgumentException(
      "Unable to determine LayoutElement to dump!");
View Full Code Here

  List<com.sun.jsftemplating.layout.descriptors.handler.Handler> handlers =
      handlerCtx.getHandler().getChildHandlers();
  if (handlers.size() > 0) {
      // We have child handlers in the loop... execute while we iterate
      LayoutElement elt = handlerCtx.getLayoutElement();
      Map<String, Object> requestMap = handlerCtx.getFacesContext().
        getExternalContext().getRequestMap();
      for (int idx=start; idx < end; idx++) {
    requestMap.put(var, idx);
    // Ignore whats returned by the handler... we need to return
    // false anyway to prevent children from being executed again
    elt.dispatchHandlers(handlerCtx, handlers);
      }
  }

  // This will prevent the child handlers from executing again
  return false;
View Full Code Here

TOP

Related Classes of com.sun.jsftemplating.layout.descriptors.LayoutElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.