Package com.sun.jsftemplating.layout.descriptors

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


  Map<String, String> attributes = getAttributes(node);
  String id = attributes.get(ID_ATTRIBUTE);

  // Create the LayoutComponent
  ComponentType type = ensureEditAreaType(parent);
  LayoutComponent component =
      new LayoutComponent(parent, EDITABLE + id, type);
  parent.addChildLayoutElement(component);

  // Configure it...
  component.setNested(
      LayoutElementUtil.isNestedLayoutComponent(component));
  component.addOption(EDITABLE, Boolean.TRUE); // Flag

  // Add children... (different for component LayoutElements)
  addChildLayoutComponentChildren(component, node);

  return parent;
View Full Code Here


  Map<String, String> attributes = getAttributes(node);
  String id = attributes.get(ID_ATTRIBUTE);

  // Create the LayoutComponent
  ComponentType type = ensurePopupMenuType(parent);
  LayoutComponent popupMenu =
      new LayoutComponent(parent, EDIT_MENU + id, type);

  // Configure it...
  popupMenu.setNested(
      LayoutElementUtil.isNestedLayoutComponent(popupMenu));

  // Could add "menu" facet here, however, I decided to do it in the xml

  // Return the result
View Full Code Here

  // Create the LayoutComponent
  if (id == null) {
      id = LayoutElementUtil.getGeneratedId(type, getNextIdNumber());
  }
  LayoutComponent component =
      new LayoutComponent(parent, id, componentType);

  // Set Overwrite flag if needed
  if (overwrite != null) {
      nvps.remove(overwrite);
      component.setOverwrite(Boolean.valueOf(overwrite.getValue().toString()).booleanValue());
  }

  // Set options...
  for (NameValuePair np : nvps) {
      component.addOption(np.getName(), np.getValue());
  }

  // Set flag to indicate if this LayoutComponent is nested in another
  // LayoutComponent.  This is significant b/c during rendering, events
  // will need to be fired differently (the TemplateRenderer /
  // LayoutElements will not have any control).  The strategy used will
  // rely on "instance" handlers, this flag indicates that "instance"
  // handlers should be used.
  // NOTE: While this could be implemented on the LayoutComponent
  //   itself, I decided not to for performance reasons and to
  //   allow this value to be overruled if desired.
  component.setNested(nested);

  // Let calling method see if this is a single tag, or if there should
  // be a closing tag as well
  parser.unread('>');
  if (single) {
View Full Code Here

     @param  facetName  The facet name (null means don't store it)
     *
     *  @return  The child <code>UIComponent</code> that was found or created.
     */
    private UIComponent getChild(UIComponent parent, String id, ComponentType type, Properties properties, String facetName) {
  LayoutComponent desc = new LayoutComponent(null, id, type);
  if (properties != null) {
    //Remove Generics for now. Check with Ken to change thisinto HashMap.
      desc.setOptions((Map) properties);
  }
  if (facetName != null) {
      // Add the facetName to use
// FIXME: Decide if this should have its own method
      desc.addOption(LayoutComponent.FACET_NAME, facetName);
  }

  return getChild(parent, desc);
    }
View Full Code Here

  // Create the LC's for the columns
  List<LayoutComponent> columns = new ArrayList<LayoutComponent>(size);
  ComponentType colType =
      LayoutDefinitionManager.getGlobalComponentType(ctx, COLUMN_TYPE);
  for (int idx = 0; idx < size; idx++) {
      LayoutComponent column = new LayoutComponent(
    desc, id + COLUMN_SEPERATOR + idx, colType);
      columns.add(column);
  }

  // Loop through the properties to set on the columns
View Full Code Here

  // First get the clientId that we are going to attempt to walk.
  String viewId = (String) ctx.getInputValue("viewId");
  String clientId = (String) ctx.getInputValue("clientId");

  // Next, find it
  LayoutComponent result = LayoutDefinitionManager.getLayoutComponent(
    ctx.getFacesContext(), viewId, clientId);

  // Set the result
  ctx.setOutputValue("component", result);
    }
View Full Code Here

      // We found a LayoutInsert, this includes content from a previous
      // file... we need to go back there and look now.
  }

  // First search the direct child LayoutElement
  LayoutComponent comp = null;
  for (LayoutElement child : elt.getChildLayoutElements()) {
      // I am *NOT* providing the parent UIComponent as it may not be
      // available, this function is *not* guaranteed to work for
      // dynamic ids
      if (child.getId(ctx, null).equals(id)
View Full Code Here

      id = LayoutElementUtil.getGeneratedId(type);
  }

  // Create a LayoutComponent...
  FacesContext ctx = context.getFacesContext();
  LayoutComponent desc = new LayoutComponent((LayoutComponent) null, id,
    LayoutDefinitionManager.getGlobalComponentType(ctx, type));

  // Create the component...
  UIComponent component = ComponentUtil.getInstance(ctx).createChildComponent(
    ctx, desc, parent);
View Full Code Here

TOP

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

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.