Package org.apache.myfaces.trinidadinternal.ui

Examples of org.apache.myfaces.trinidadinternal.ui.MutableUINode


        boolean immediate = Boolean.TRUE.equals(
                          stamp.getAttributes().get(UIXCommand.IMMEDIATE_KEY));
        Object destination = stamp.getAttributes().get("destination");
        component.setRowIndex(currentIndex);

        MutableUINode mutableNextButton =
        createSingleItemSubmitButton(false,
                                     buttonTextBV,
                                     buttonAccessKeyBV,
                                     destination,
                                     ProcessUtils.getSubmitScriptCall(
                                        context,
                                        formName,
                                        eventKey,
                                        sourceKey,
                                        nameString,
                                        valueKey,
                                        selectedIndex + 1,
                                        sizeKey,
                                        1,
                                        !immediate, null, null));
        if (buttonID != null)
        {
          mutableNextButton.setID(buttonID);
        }
        nextButton = mutableNextButton;
      }
      else
      {
View Full Code Here


  private static UINode  _createCompositeUINode()
  {
    // add the tabs
    MarlinBean pageLayout = new MarlinBean(UIConstants.PAGE_LAYOUT_NAME);
    MutableUINode navigationGlobal =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_MENU_BUTTONS_NAME);
    pageLayout.setNamedChild(UIConstants.NAVIGATION_GLOBAL_CHILD, navigationGlobal);

    // add the bar
    MutableUINode menuTabs =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_MENU_TABS_NAME);
    menuTabs.setAttributeValue(UIConstants.LEVEL_ATTR,
                               1);
    pageLayout.setNamedChild(UIConstants.NAVIGATION1_CHILD, menuTabs);
    MutableUINode menuBar =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_MENU_BAR_NAME);
    menuBar.setAttributeValue(UIConstants.LEVEL_ATTR,
                              2);
    pageLayout.setNamedChild(UIConstants.NAVIGATION2_CHILD, menuBar);

    // add the tree

    MutableUINode navigationTree =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_NAVIGATION_TREE_NAME);
    navigationTree.setAttributeValue(UIConstants.START_LEVEL_ATTR,
                              3);

    BoundValue treeRenderedBV = new HasDataBoundValue(
                                  RootBoundValue.getBoundValue(), 3, true);
    navigationTree.setAttributeValue(UIConstants.RENDERED_ATTR, treeRenderedBV);
    // for PPR, an ID is required:
    navigationTree.setAttributeValue(UIConstants.ID_ATTR, new BoundValue()
    {
      public Object getValue(UIXRenderingContext context)
      {
        UINode pageNode = context.getParentContext().getAncestorNode(0);
        UIComponent component = pageNode.getUIComponent();
        return component.getClientId(context.getFacesContext()) +
               org.apache.myfaces.trinidadinternal.renderkit.uix.PageRenderer.TREE_SUFFIX;
      }
    }
                              );


    // add the list
    MutableUINode menuList =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_MENU_LIST_NAME);
    menuList.setAttributeValue(UIConstants.LEVEL_ATTR,
                              3);
    BoundValue listRenderedBV = new HasDataBoundValue(
                                  RootBoundValue.getBoundValue(), 3, false);
    menuList.setAttributeValue(UIConstants.RENDERED_ATTR, listRenderedBV);


    MarlinBean navigation3Flow = new MarlinBean(UIConstants.FLOW_LAYOUT_NAME);
    navigation3Flow.addIndexedChild(menuList);
    navigation3Flow.addIndexedChild(navigationTree);
    navigation3Flow.setAttributeValue(UIConstants.RENDERED_ATTR,
                           new OrBoundValue(treeRenderedBV,listRenderedBV));
    pageLayout.setNamedChild(UIConstants.NAVIGATION3_CHILD, navigation3Flow);



    // add the path
    MutableUINode navigationPath =
                  new BaseMutableUINode(UIConstants.MARLIN_NAMESPACE,
                                        UIConstants.PAGE_NAVIGATION_PATH_NAME);

    BoundValue hasLocation =
          XhtmlLafUtils.createIsRenderedBoundValue(UIConstants.LOCATION_CHILD);
    navigationPath.setAttributeValue(UIConstants.RENDERED_ATTR,
                               new NotBoundValue(hasLocation));


    UINode location = ContextPoppingUINode.getUINode(UIConstants.LOCATION_CHILD);
    MarlinBean locationFlow = new MarlinBean(UIConstants.FLOW_LAYOUT_NAME);
View Full Code Here

  public UINode setUINode(
    int    index,
    UINode node
    )
  {
    MutableUINode mutableNode = getMutableUINode();
   
    if (mutableNode != null)
    {
      UINode returnNode = mutableNode.getIndexedChild(null, index);
      mutableNode.replaceIndexedChild(index, node);
      return returnNode;
    }
    else
    {
      throw new UnsupportedOperationException(
View Full Code Here

  public void addUINode(
    int    index,
    UINode node
    )
  {
    MutableUINode mutableNode = getMutableUINode();
   
    if (mutableNode != null)
    {
      mutableNode.addIndexedChild(index, node);
    }
    else
    {
      throw new UnsupportedOperationException(
       "It is illegal to add children to a " + _getClassName());
View Full Code Here

  
  public void addUINode(
    UINode node
    )
  {
    MutableUINode mutableNode = getMutableUINode();
   
    if (mutableNode != null)
    {
      mutableNode.addIndexedChild(node);
    }
    else
    {
      throw new UnsupportedOperationException(
       "It is illegal to add children to a " + _getClassName());
View Full Code Here

 
  public UINode removeUINode(
    int index
    )
  {
    MutableUINode mutableNode = getMutableUINode();
   
    if (mutableNode != null)
    {
      return mutableNode.removeIndexedChild(index);
    }
    else
    {
      throw new UnsupportedOperationException(
       "It is illegal to remove children from a " + _getClassName());
View Full Code Here

    }
  }
 
  public void clearUINodes()
  {
    MutableUINode mutableNode = getMutableUINode();
   
    if (mutableNode != null)
    {
      mutableNode.clearIndexedChildren();
    }
    else
    {
      throw new UnsupportedOperationException(
       "It is illegal to remove all children from a " + _getClassName());
View Full Code Here


    // only render the top spacer if the Locator is rendered
    topSpacer.setAttributeValue(RENDERED_ATTR, isLocatorRendered);

    MutableUINode locatorUserInfoLayout = _sCreateLocatorUserInfoLayout(
                                        isEndRendered,
                                        isLocatorRendered,
                                        isUserInfoRendered);

    // the train separator is only rendered if the train is rendered
    MarlinBean trainSeparator = new MarlinBean(SEPARATOR_NAME);
    trainSeparator.setAttributeValue(RENDERED_ATTR, isTrainRendered);

    locatorLayout.addIndexedChild(topSpacer);
    locatorLayout.addIndexedChild(qsStartStack);
    locatorLayout.addIndexedChild(locatorUserInfoLayout);
    locatorLayout.addIndexedChild(trainSeparator);
    locatorLayout.addIndexedChild(
                             ContextPoppingUINode.getUINode( MESSAGES_CHILD ));

    //
    // Create the content footer
    //

    // if content footer child has returnNavigation child and/or
    // pageButtons child use these, otherwise
    // if the content footer child is a MarlinBean or
    // has a contentMarlinBean as a descendent
    // add it directly, otherwise create a MarlinBean and add the
    // content footer child as its indexed child

    MarlinBean contentFooterSwitcher = new MarlinBean(SWITCHER_NAME);

    BoundValue contentFooterBoundValue =
                       RootChildBoundValue.getBoundValue(CONTENT_FOOTER_CHILD);

    // Is there a MarlinBean inside of the CONTENT_FOOTER_CHILD
    BoundValue hasContentMarlinBean =
                       new PageLayoutRenderer.TreeWalkerBoundValue( contentFooterBoundValue,
                                                 CONTENT_FOOTER_NAME );

    // Create MarlinBean using what's in ACTIONS_CHILD
    // and INFO_RETURN_CHILD
    MarlinBean pageNavContentFooter = new MarlinBean(CONTENT_FOOTER_NAME);


    pageNavContentFooter.addIndexedChild(
                       ContextPoppingUINode.getUINode(ACTIONS_CHILD));
    pageNavContentFooter.setNamedChild(START_CHILD,
                       ContextPoppingUINode.getUINode(INFO_RETURN_CHILD));

    // Create MarlinBean using what's in CONTENT_FOOTER_CHILD
    MarlinBean contentMarlinBean = new MarlinBean(CONTENT_FOOTER_NAME);
    contentMarlinBean.addIndexedChild(
                       ContextPoppingUINode.getUINode(CONTENT_FOOTER_CHILD));

    // Use content footer created with
    // ACTIONS_CHILD and INFO_RETURN_CHILD
    contentFooterSwitcher.setNamedChild( _HAS_PAGE_NAV, pageNavContentFooter);

    // Use content footer already in CONTENT_FOOTER_CHILD
    contentFooterSwitcher.setNamedChild(
                         _HAS_CONTENT_FOOTER,
                         ContextPoppingUINode.getUINode(CONTENT_FOOTER_CHILD));

    // Use content footer created with what's in CONTENT_FOOTER_CHILD
    contentFooterSwitcher.setNamedChild( _NO_CONTENT_FOOTER, contentMarlinBean);

    // figure out which one to use:
    //     First Choice: Use the one created with ACTIONS_CHILD
    //                   and INFO_RETURN_CHILD if these children exist.
    //    Second Choice: Use one already in CONTENT_FOOTER_CHILD.
    //     Third Choice: Use one created with what's in CONTENT_FOOTER_CHILD
    BoundValue pageButtonsExistBV =
                      BaseDesktopUtils.createIsRenderedBoundValue(ACTIONS_CHILD);
    BoundValue returnNavExistsBV =
                  BaseDesktopUtils.createIsRenderedBoundValue(INFO_RETURN_CHILD);

    OrBoundValue newChildrenExist = new OrBoundValue( pageButtonsExistBV,
                                                      returnNavExistsBV);

    IfBoundValue hasContentFooterBV = new IfBoundValue( hasContentMarlinBean,
                                                        _HAS_CONTENT_FOOTER,
                                                        _NO_CONTENT_FOOTER );

    IfBoundValue childNameBV = new IfBoundValue( newChildrenExist,
                                                 _HAS_PAGE_NAV,
                                                 hasContentFooterBV);
    contentFooterSwitcher.setAttributeValue(CHILD_NAME_ATTR, childNameBV);

    // create footnote region above contentFooterSwitcher in StackLayout
    MarlinBean contentFooterStackLayout = new MarlinBean(STACK_LAYOUT_NAME);
    contentFooterStackLayout.addIndexedChild(
                  ContextPoppingUINode.getUINode(INFO_FOOTNOTE_CHILD));
    contentFooterStackLayout.addIndexedChild(contentFooterSwitcher);

    //
    // Create the footer area
    //


    MarlinBean footer = _sCreateFooterBean();

    //
    // Build up the root node
    //
    MarlinBean endChildSeparator = new MarlinBean(SPACER_NAME);
    endChildSeparator.setAttributeValue(WIDTH_ATTR, "5");
    endChildSeparator.setAttributeValue(HEIGHT_ATTR, "1");

    // the end child separator is only rendered if the end child is rendered
    endChildSeparator.setAttributeValue(RENDERED_ATTR,
                                        isEndRendered);

    // the userInfo is rendered in the end area if the end child is rendered
    // otherwise it is rendered in the locator area
    MutableUINode endRegionLayout = _sCreateEndLayout(isEndRendered,
                                                      isUserInfoRendered);

    UINodeList rootNodeList = RootUINodeList.getNodeList();

    //
    // Create content of PageLayout to use when we have no page title
    //
    MutableUINode noTitleContentLayout = new MarlinBean(STACK_LAYOUT_NAME);
    noTitleContentLayout.addIndexedChild(_sCreateContentTop(true));
    noTitleContentLayout.addIndexedChild(_createContentLayout(rootNodeList));


    // this is the name of the anchor used to skip the navigational area of a
    // pageLayout and jump to the content area.
    final String skipNavigationAnchor = "TheContent";
View Full Code Here

    boolean          isBack,
    Object           buttonText,
    String           onClickJS
    )
  {
    MutableUINode submitButton = createSingleItemURLButton(
                                                    context,
                                                    isBack,
                                                    buttonText,
                                                    null);
                                                   
    submitButton.setAttributeValue(ON_CLICK_ATTR, onClickJS);
   
    return submitButton;                                  
  }
View Full Code Here

      String buttonID = _getIDForFocus(context, navBar);

      if (formName == null)
      {

        MutableUINode mutableNextButton =
            createSingleItemURLButton(
                                     context,
                                     false,
                                     buttonTextBV,
                                     buttonAccessKeyBV,
                                     getSingleDestinationURL(context,
                                                             navBar,
                                                             eventKey,
                                                             sourceKey,
                                                             nameString,
                                                             valueKey,
                                                             currentValue+1));
        if (buttonID != null)
        {
          mutableNextButton.setID(buttonID);
        }
        nextButton = mutableNextButton;
      }
      else
      {

        // set the destination
        if (supportsScripting)
        {
          MutableUINode mutableNextButton =
          createSingleItemSubmitButton(
                                       context,
                                       false,
                                       buttonTextBV,
                                       buttonAccessKeyBV,
                                       getSingleDestinationSubmit(
                                                  context,
                                                  navBar,
                                                  formName,
                                                  nameString,
                                                  currentValue + 1,
                                                  true));
          if (buttonID != null)
          {
            mutableNextButton.setID(buttonID);
          }
          nextButton = mutableNextButton;
        }
        else
        {
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidadinternal.ui.MutableUINode

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.